Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Filter body parameter
Anchor
FiltersAnchor
FiltersAnchor

Some endpoint queries supports support a filter. The common filter is basically a JSON object with the following format

Code Block
languagejs
themeRDark
{
  "filter" : {
    "ids" : ["ID1", "ID2", "ID3", ...],
    "type" : "TYPE",
    "description" : "DESCRIPTION"
  }
}

...

Some update endpoint queries supports support an update  object which together with the filtering above allows for "update by query" functionality. The update  is basically a JSON object with the following format

Code Block
languagejs
themeRDark
{
  "update" : {
    "description" : "DESCRIPTION"
  }
}

...

This is an example of the response to this GET request - - /aspire/_api/workflows?sparse=true&from=0&size=2

Code Block
languagejs
themeRDark
{
    "count": {
        "from": 0,
        "size": 2,
        "totalItems": 3
    },
    "workflow": [
        {
            "id": "f5daef4d-fd4b-4e01-bd7b-b00334601b73",
            "type": "connector",
            "description": "Publish to Elastic-1",
            "checksum": "b0bb8b191d7bba8a0c32b8db091937a617e14ad0e768da2c0a75e360aff45430"
        },
        {
            "id": "e33a890a-cea9-48c0-8db9-07533444820f",
            "type": "connector",
            "description": "Publish to Elastic-1",
            "checksum": "1d3e041ca4de48edcee85d46217d928846077277f39d07eac6e4206a2ce8966d"
        }
    ]
}

...

Where an API call causes a single item to be successful created , 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)

Code Block
languagejs
themeRDark
{
  "connector": {
    "id": "AAABcID5GBc=",
    "type": "filesystem",
    "description": "NetApp connector",
    "created": 1596707252548,
    "updated": 1596707252548,
    "properties": { This will be a dynamic JSON object }
  }
}

...

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  (response status 200)

Code Block
languagejs
themeRDark
{
  "connector": [{
    "id": "AAABcID5GBc=",
    "type": "filesystem",
    "description": "NetApp connector",
    "created": 1596707252548,
    "updated": 1596707252548,
    "properties": { This will be a dynamic JSON object }
  },
  {
    "id": "AAABcIueWUc=",
    "type": "sharepoint-online",
    "description": "SharePoint Online",
    "created": 1596707252548,
    "updated": 1596707252548,
    "properties": { This will be a dynamic JSON object } 
  }]
}

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 create and two encountered and error (response status 200)

Code Block
languagejs
themeRDark
{
  "connector": [{
    "id": "AAABcID5GBc=",
    "type": "filesystem",
    "description": "NetApp connector",
    "created": 1596707252548,
    "updated": 1596707252548,
    "properties": { This will be a dynamic JSON object }
  },
  {
    "id": "AAABcIueWUc=",
    "type": "sharepoint-online",
    "description": "SharePoint Online",
    "created": 1596707252548,
    "updated": 1596707252548,
    "properties": { This will be a dynamic JSON object } 
  }],
  "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: another testing exception"
      }
    ]
  }
}

...