Versions Compared

Key

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


Warning
titlePage in development

This page is in development and as such, its contents may be incorrect

The policies API provides functionality that allows a administrator to add, delete or update policies

Table of Contents

Section

Get all policies

Lists all the policies configured in the Aspire

Panel
borderColorblack
bgColor#fafafb
GET /aspire/_api/policies

Pagination query string parameters

Section

Get all policies, filtered

Lists policies configured in the Aspire, filtered by a specified criteria

Panel
borderColorblack
bgColor#fafafb

POST /aspire/_api/policies/getAll

Pagination query string parameters

Common filter

Response

Code Block
languagejs
{
  "policy": [{
    "id": "AAABcID5GBc=",
    "type": "throttle",
	"description": "Europe Net Appliance throttle",
    "timeUnitperiod": "mminute",
	"timeUnitRate": "1",
	"numberOfDocuments"value": "100"
  },
  {
    "id": "AAABcIueWUc=",
    "type": "route",
	"description": "All servers",
    "tagsrouteTo": ["US","UK","DEU"]
  }]
}

Status

Response codeDescription
200Success
Section

Get all policies, filtered

Lists policies configured in the Aspire, filtered by a specified criteria

Panel
borderColorblack
bgColor#fafafb

POST /aspire/_api/policies/getAll

Pagination query string parameters

Common filter

: 200





: 200, 404

Section

Get single policy

Gets information about a single policy configured in Aspire

Panel
borderColorblack
bgColor#fafafb

GET /aspire/_api/policies/:id


Path Parameters

NameTypeRequiredDescription
idstringRequiredThe id of the policy to return

Query String Parameters

Name
TypeRequiredDescription
expandstringOptionalList of fields to expand, * will expand everything


Response

Code Block
languagejs
{
  "policy": {
    "id": "AAABcID5GBc=",
    "type": "throttle",
	"description": "Europe Net Appliance throttle",
    "timeUnitperiod": "mminute",
	"timeUnitRate": "1",
	"numberOfDocumentsvalue": "100"
 }
}

Status

Response codeDescription
200Success




Not acceptable - there was an issue validating the input

See Response Body for details regarding the response body returned where multiple items are affected with some (or all) returning errors

Status: 201, 406

Section

Add

policies

policy(ies)

Adds policies to Aspire

Panel
borderColorblack
bgColor#fafafb
POST /aspire/_api/policies


Body Parameters

NameTypeRequiredDescription
typestringRequired

The type of policy to add

  • "throttle"
  • "route"
descriptionstringRequiredAn optional description of the policy


Other parameters passed in the request body will depend on the type of policy being created:


Throttle type:

NameTypeRequiredDescription
timeUnitperiodstringRequiredTime unit of the throttling policy - second, minute, hour, day
valuetimeUnitRateintRequiredThe rate at which each time unit is throttlednumberOfDocumentsintRequiredNumber of documents per time unit for the throttling policy


Route type:

NameTypeRequiredDescription
tagsrouteToarray of stringsstringRequiredTags for the routing policyTODO


Example

Code Block
languagejs
POST /aspire_api/policies
[{
  "type": "throttle",
  "description": "Europe Net Appliance throttle",
  "timeUnitperiod": "sminute",
  "timeUnitRatevalue": "10",
  "numberOfDocuments": "10"100"
},
{
  "type": "route",
  "description": "German servers",
  "tagsrouteTo": ["US","UK","DEU"]
}]


Response

Code Block
languagejs
{
  "policy": [{
    "id": "AAABcID5GBc=",
    "type": "throttle"
    "description": "Europe Net Appliance throttle",
    "timeUnitperiod": "sminute",
    "timeUnitRatevalue": "10",
    "numberOfDocuments": "10"100"
   },
   {
    "id": "AAABcID5GBd=",
    "type": "route"
    "description": "All servers",
    "tagsrouteTo": ["US","UK","DEU"]
   }]
}

Status

Response codeDescription
201Created
406




Section

Update

policies

policy(ies)

Update policies in Aspire.

Panel
borderColorblack
bgColor#fafafb

PUT /aspire_api/policies/:id

PUT /aspire_api/policies

Note
The existing document will be replaced by the new one provided in the body


Body Parameters

NameTypeRequiredDescription
idstringRequiredThe identifier of the policy to update
typestringOptionalThe type of policy
descriptionstringOptionalAn optional description of the seed
...


+ fields from "Add" section...Other parameters passed in the request body will depend on the type of policy being created - see Add a Policy above

Example

Code Block
languagejs
PUT /aspire_api/policies
{
  "AAABcID5GBc=": {
    "id": "AAABcID5GBc=",
    "type": "throttle"
    "description": "Europe Net Appliance",
	"timeUnit": "s",
    "timeUnitRateperiod": "1minute",
    "numberOfDocumentsvalue": "10100"
  },
  "AAABcID5GBd=": {
    "id": "AAABcID5GBd=",
    "type": "route"
    "description": "German server",
    "tagsrouteTo": ["DEUUS"]
  }
}


Response

Code Block
languagejs
{
  "policy": [{
    "id": "AAABcID5GBc=",
    "type": "throttle"
    "description": "Europe Net Appliance",
	"timeUnit": "s",
	"timeUnitRate    "period": "1minute",
    "numberOfDocumentsvalue": "10100"
   },
   {
    "id": "AAABcID5GBd=",
    "type": "route"
    "description": "German server",
    "tagsrouteTo": ["DEUUS"]
  }]
}

See Response Body for details regarding the response body returned where multiple items are affected with some (or all) returning errors

Status: 200, 404, 406



Not acceptable - there was an issue validating the input
Section

Update policies, filtered

Update policies configured in the Aspire, filtered by a specified criteria

Panel
borderColorblack
bgColor#fafafb

POST /aspire/_api/policies/updateAll

Common filter

Update body parameter


Response

Code Block
Description
language
200Success
404Not found - a given seed identifier was not found
406
js
{
  "message": "update result response message"
}

Status: 200, 406



Filters retrieved policies. Check the filter definition here

Common filter


Response

Section

Delete multiple policies, filtered

Delete multiple policies from Aspire, filtered by a specified criteria

Panel
borderColorblack
bgColor#fafafb

POST /aspire/_api/policies/deleteAll

Body Parameters

NameTypeRequiredDescription
filterJSONRequired
Code Block
languagejs
{
  "message": "optional response message"
}

See Response Body for details regrading the response body returned where multiple items are affected with some (or all) returning errors

Status

Response codeDescription200Success404Not found - a given credential identifier was not found406Not acceptable - there was an issue validating the input

Status: 200



Not acceptable - there was an issue validating the input

: 200, 404, 406

Section

Delete policy(ies)

Delete a single policy one or more policies from Aspire.

Panel
borderColorblack
bgColor#fafafb

DELETE /aspire/_api/policies/:id

DELETE /aspire/_api/policies

POST /aspire/_api/policies/delete


Path Parameters and Query parameters

NameTypeRequiredDescription
idstringRequiredThe identifier(s) of the policy(s) to delete


Body Parameter

NameTypeRequiredDescription
idsstringRequiredThe identifier(s) of the policy(s) to delete


ExamplesExample

Code Block
languagejs
DELETE /aspire/_api/policies/AAABcID5GBc

DELETE /aspire/_api/policies/AAABcID5GBc%3D
Delete multiple policies
?id=AAABcID5GBc&id=AAABcID5GBd

POST /aspire/_api/policies/delete
{
  "ids":["AAABcID5GBc","AAABcID5GBd"]
}


Response

Code Block
languagejs
{
  "message": "optionaldelete result response message"
}

Status

Response codeDescription
200Success
404Not found - a given seed identifier was not found
406