Versions Compared

Key

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


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

Query String Parameters

NameTypeRequiredDescription
typestringOptionalFilter returned seeds to only those with the given type
descriptionstringOptionalFilter returned seeds to only those whose description matches the given expression

Response

Code Block
languagejs
{
  "policy": [{
    "id": "AAABcID5GBc=",
    "type": "throttle",
    ..."timeUnit": "m",
	"numberOfDocuments": "100"
  },
  {
    "id": "AAABcIueWUc=",
    "type": "executionroute",
     ..."tags": ["US","UK","DEU"]
  }]
}

Status

Response codeDescription
200Success




Section

Get a single policy

Get 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

Response

Code Block
languagejs
{
  "policy": {
    "id": "AAABcID5GBc=",
    "type": "throttle",
    ... "timeUnit": "m",
	"numberOfDocuments": "100"
 }
}

Status

Response codeDescription
200Success




Section

Add policies

Adds one or more policies to Aspire

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

Request Body Parameters

NameTypeRequiredDescription
typestringRequiredThe type of policy to add
descriptionstringOptionalAn optional description of the seed

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


Throttle type:

NameTypeRequiredDescription
timeUnitstringRequiredTime unit of the throttling policy
numberOfDocumentsintRequiredNumber of documents per time unit for the throttling policy


Route type:

NameTypeRequiredDescription
tagsstringRequiredTags for the routing policy


Examples

Add a single policy

Code Block
languagejs
POST /aspire/_api/policies
{
  "type": "Throttle",
  "description": "Europe Net Appliance throttle",
   ..."timeUnit": "m",
  "numberOfDocuments": "100"
}


Add multiple policies


Code Block
languagejs
POST /aspire_api/policies
[{
  "type": "Throttle",
  "description": "Europe Net Appliance throttle",
  "timeUnit": "s",
  ..."numberOfDocuments": "10"
},
{
  "type": "Route",
  "description": "German server",
  ..."tags": ["US","UK","DEU"]
}]

Response

Code Block
languagejs
{
  "policy": [{
    "id": "AAABcID5GBc=",
    "type": "throttle"
    "description": "Europe Net Appliance",
    "timeUnit": "s",
     ..."numberOfDocuments": "10"
   }]
}

Status

Response codeDescription
201Created
406Not acceptable - there was an issue validating the input




Section

Update policies

Update a policy in Aspire.

Panel
borderColorblack
bgColor#fafafb

PUT /aspire_api/policies/:id

PUT /aspire_api/policies

Path and Request Body Parameters

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

Other parameters passed in the request body will depend on the type of policy being created - see Add a Policy above

Examples

Update a single policy

Code Block
languagejs
PUT /aspire_api/policies/AAABcID5GBc%3D
{
  "id": "AAABcID5GBc=",
  "type": "throttle"
  "description": "Europe Net Appliance",
  ..."timeUnit": "s",
  "numberOfDocuments": "10"
}


Update multiple policies


Code Block
languagejs
PUT /aspire_api/policies
{
  "AAABcID5GBc=": {
    "id": "AAABcID5GBc=",
    "type": "throttle"
    "description": "Europe Net Appliance",
	"timeUnit": "s",
   ... "numberOfDocuments": "10"
  },
  "AAABcID5GBd=": {
    "id": "AAABcID5GBd=",
    "type": "route"
    "description": "German server",
    ... "tags": ["DEU"]
  }
}

Response

Code Block
languagejs
{
  "policy": [{
    "id": "AAABcID5GBc=",
    "type": "throttle"
    "description": "Europe Net Appliance",
	"timeUnit": "s",
    ..."numberOfDocuments": "10"
   }]
}

Status

Response codeDescription
200Success
404Not found - a given seed identifier was not found
406Not acceptable - there was an issue validating the input




Section

Delete policies

Delete one or more policies from Aspire.

Panel
borderColorblack
bgColor#fafafb

DELETE /aspire_api/policies/:id

DELETE /aspire_api/policies

Path and Request Body Parameters

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

Examples

Delete a single policy

Code Block
languagejs
DELETE /aspire_api/policies/AAABcID5GBc%3D

Delete multiple seeds

Code Block
languagejs
DELETE /aspire_api/policies?id=AAABcID5GBc%3D&id=AAABcIueWUc%3D

Response

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

Status

Response codeDescription
200Success
404Not found - a given seed identifier was not found
406Not acceptable - there was an issue validating the input