You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 11 Next »

The configuration and control API provides functionality that allows a administrator to perform actions such as adding a seed to crawl, or beginning or stopping a crawl. This API will provide the functionality required by the Aspire User interface and will be extensively used by it. The API will also be used by any external process (or script) that needs to control Aspire

Common parameters large lists

To allow paging of responses that might return large amounts of data (typically "list" requests), requests will accept paging parameters as shown below

NameTypeDefaultDescription
fromlong0

The offset in to the results list from which results should be returned

sizelong25/unlimited

The (maximum) number of items to be returned in the results list

Note: The results list is only limited if the offset parameter is set (even to 0). If offset is not set, Aspire will assume you are trying to retrieve all items


Where paging parameters are applied, Aspire will add a "count" to the returned object to inform the total number of objects that exists 


Responses

Aspire's API will return both an HTTP response code and a Json body indicating success or failure of all calls. The following status codes are used

Status

Response codeDescription
200

Success

Success with errors (batch mode)*

201Created
400Bad request
404Not found
406Not acceptable

* batch requests (those calls capable of creating, updating, deleting or controlling more than a single item/object at a time - update multiple connectors for example) will return a status of 200 for the call itself and other status inside the Json body.


Response Body

Where an API call causes a single item to be successful created or updated, the body of the response will contain the item itself. The response shown below is an example of the body returned if a single connector was created or updated (response status 200 or 201)

{
  "connector": {
    "id": "1823c41f-ba3e-43e0-aae5-dd38665d021a",
    "type": "filesystem",
    "description": "NetApp",
    "application": {
      "@config": "com.accenture.aspire:aspire-filesystem-source",
      "properties": {
        "property": [{
            "@name": "enableFetcher",
            "$": "true"
          },
          {
            "@name": "enableTextExtract",
            "$": "true"
          },
          {
            "@name": "extractTextConfiguration",
            "$": "false"
          }
        ]
      }
    },
    "source": {
      "multipleStartPoints": "false",
      "url": "c:\\tmp\\ach1",
      "partialScan": "false",
      "subDirUrl": null,
      "indexContainers": "false",
      "scanRecursively": "true",
      "scanExcludedItems": "false",
      "ignoreScanErrors": "false",
      "ignoreSymLinks": "false",
      "useACLs": "false",
      "acls": null,
      "includes": null,
      "excludes": null
    },
    "general": {
      "@active": "true",
      "displayName": "File System",
      "schedules": {
          "schedule": {
	      "@action": "start",
          "@actionProperties": "incremental",
          "@type": "manually"
        }
      },
      "normalizedName": "File_System"
    },
    "checksum": "BB580D32A38A50D6A9D6A3CD59AA01E0"
  }
}


Where multiple items/objects to be affected, an array will be returned in place of an object. The response shown below is an example of the body returned if two connectors were created or updated (response status 200)

{
  "connector": [{
      "id": "1823c41f-ba3e-43e0-aae5-dd38665d021a",
      "type": "filesystem",
      "description": "NetApp",
      "application": {
        "@config": "com.accenture.aspire:aspire-filesystem-source",
        "properties": {
          "property": [{
              "@name": "enableFetcher",
              "$": "true"
            },
            {
              "@name": "enableTextExtract",
              "$": "true"
            },
            {
              "@name": "extractTextConfiguration",
              "$": "false"
            }
          ]
        }
      },
      "source": {
        "multipleStartPoints": "false",
        "url": "c:\\tmp\\ach1",
        "partialScan": "false",
        "subDirUrl": null,
        "indexContainers": "false",
        "scanRecursively": "true",
        "scanExcludedItems": "false",
        "ignoreScanErrors": "false",
        "ignoreSymLinks": "false",
        "useACLs": "false",
        "acls": null,
        "includes": null,
        "excludes": null
      },
      "general": {
        "@active": "true",
        "displayName": "File System",
        "schedules": {
          "schedule": {
            "@action": "start",
            "@actionProperties": "incremental",
            "@type": "manually"
          }
        },
        "normalizedName": "File_System"
      },
      "checksum": "BB580D32A38A50D6A9D6A3CD59AA01E0"
    },
    {
      "id": "26ab9abc-ca81-407b-89e3-21557996cce6",
      "type": "filesystem",
      "description": "NetApp",
      "application": {
        "@config": "com.accenture.aspire:aspire-filesystem-source",
        "properties": {
          "property": [{
              "@name": "enableFetcher",
              "$": "true"
            },
            {
              "@name": "enableTextExtract",
              "$": "true"
            },
            {
              "@name": "extractTextConfiguration",
              "$": "false"
            }
          ]
        }
      },
      "source": {
        "multipleStartPoints": "false",
        "url": "c:\\tmp\\ach1",
        "partialScan": "false",
        "subDirUrl": null,
        "indexContainers": "false",
        "scanRecursively": "true",
        "scanExcludedItems": "false",
        "ignoreScanErrors": "false",
        "ignoreSymLinks": "false",
        "useACLs": "false",
        "acls": null,
        "includes": null,
        "excludes": null
      },
      "general": {
        "@active": "true",
        "displayName": "File System",
        "schedules": {
          "schedule": {
            "@action": "start",
            "@actionProperties": "incremental",
            "@type": "manually"
          }
        },
        "normalizedName": "File_System"
      },
      "checksum": "02422FD1FBE42E197998D9E13CA07166"
    }
  ]
}


Should multiple items/objects to be affected and some (or all) result in errors, information about any unsuccessful call will be included in an error section for the response. The response shown below is an example of the body returned if four connectors submitted for update and two encountered and error (response status 200)

{
  "connector": [{
      "id": "1823c41f-ba3e-43e0-aae5-dd38665d021a",
      "type": "filesystem",
      "description": "NetApp",
      "application": {
        "@config": "com.accenture.aspire:aspire-filesystem-source",
        "properties": {
          "property": [{
              "@name": "enableFetcher",
              "$": "true"
            },
            {
              "@name": "enableTextExtract",
              "$": "true"
            },
            {
              "@name": "extractTextConfiguration",
              "$": "false"
            }
          ]
        }
      },
      "source": {
        "multipleStartPoints": "false",
        "url": "c:\\tmp\\ach1",
        "partialScan": "false",
        "subDirUrl": null,
        "indexContainers": "false",
        "scanRecursively": "true",
        "scanExcludedItems": "false",
        "ignoreScanErrors": "false",
        "ignoreSymLinks": "false",
        "useACLs": "false",
        "acls": null,
        "includes": null,
        "excludes": null
      },
      "general": {
        "@active": "true",
        "displayName": "File System",
        "schedules": {
          "schedule": {
            "@action": "start",
            "@actionProperties": "incremental",
            "@type": "manually"
          }
        },
        "normalizedName": "File_System"
      },
      "checksum": "BB580D32A38A50D6A9D6A3CD59AA01E0"
    },
    {
      "id": "26ab9abc-ca81-407b-89e3-21557996cce6",
      "type": "filesystem",
      "description": "NetApp",
      "application": {
        "@config": "com.accenture.aspire:aspire-filesystem-source",
        "properties": {
          "property": [{
              "@name": "enableFetcher",
              "$": "true"
            },
            {
              "@name": "enableTextExtract",
              "$": "true"
            },
            {
              "@name": "extractTextConfiguration",
              "$": "false"
            }
          ]
        }
      },
      "source": {
        "multipleStartPoints": "false",
        "url": "c:\\tmp\\ach1",
        "partialScan": "false",
        "subDirUrl": null,
        "indexContainers": "false",
        "scanRecursively": "true",
        "scanExcludedItems": "false",
        "ignoreScanErrors": "false",
        "ignoreSymLinks": "false",
        "useACLs": "false",
        "acls": null,
        "includes": null,
        "excludes": null
      },
      "general": {
        "@active": "true",
        "displayName": "File System",
        "schedules": {
          "schedule": {
            "@action": "start",
            "@actionProperties": "incremental",
            "@type": "manually"
          }
        },
        "normalizedName": "File_System"
      },
      "checksum": "02422FD1FBE42E197998D9E13CA07166"
    }
  ],
  "error": {
    "connector": [{
        "id": "aaf15f20-c334-4f5f-a34f-f308360c2092",
        "status": 406,
        "message": "java.lang.RuntimeException: testing exception"
      },
      {
        "id": "dde02131-ce63-4639-afee-d72293eef5e0",
        "status": 406,
        "message": "java.lang.RuntimeException: testing exception"
      }
    ]
  }
}



  • No labels