The policies API provides functionality that allows a administrator to add, delete or update policies
Lists all the policies configured in the Aspire
GET /aspire/_api/policies
Query String Parameters
Name | Type | Required | Description |
---|---|---|---|
type | string | Optional | Filter returned seeds to only those with the given type |
description | string | Optional | Filter returned seeds to only those whose description matches the given expression |
Response
{ "policy": [{ "id": "AAABcID5GBc=", "type": "throttle", "timeUnit": "m", "numberOfDocuments": "100" }, { "id": "AAABcIueWUc=", "type": "route", "tags": ["US","UK","DEU"] }] }
Status
Response code | Description |
---|---|
200 | Success |
Get information about a single policy configured in Aspire
GET /aspire/_api/policies/:id
Path Parameters
Name | Type | Required | Description |
---|---|---|---|
id | string | Required | The id of the policy to return |
Response
{ "policy": { "id": "AAABcID5GBc=", "type": "throttle", "timeUnit": "m", "numberOfDocuments": "100" } }
Status
Response code | Description |
---|---|
200 | Success |
Adds one or more policies to Aspire
POST /aspire/_api/policies
Request Body Parameters
Name | Type | Required | Description |
---|---|---|---|
type | string | Required | The type of policy to add |
description | string | Optional | An optional description of the seed |
Other parameters passed in the request body will depend on the type of policy being created:
Throttle type:
Name | Type | Required | Description |
---|---|---|---|
timeUnit | string | Required | Time unit of the throttling policy |
numberOfDocuments | int | Required | Number of documents per time unit for the throttling policy |
Route type:
Name | Type | Required | Description |
---|---|---|---|
tags | string | Required | Tags for the routing policy |
Examples
Add a single policy
POST /aspire/_api/policies { "type": "Throttle", "description": "Europe Net Appliance throttle", "timeUnit": "m", "numberOfDocuments": "100" }
Add multiple policies
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
{ "policy": [{ "id": "AAABcID5GBc=", "type": "throttle" "description": "Europe Net Appliance", "timeUnit": "s", "numberOfDocuments": "10" }] }
Status
Response code | Description |
---|---|
201 | Created |
406 | Not acceptable - there was an issue validating the input |
Update a policy in Aspire.
PUT /aspire_api/policies/:id
PUT /aspire_api/policies
Path and Request Body Parameters
Name | Type | Required | Description |
---|---|---|---|
id | string | Required | The identifier of the policy to update |
type | string | Optional | The type of policy |
description | string | Optional | An 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
PUT /aspire_api/policies/AAABcID5GBc%3D { "id": "AAABcID5GBc=", "type": "throttle" "description": "Europe Net Appliance", "timeUnit": "s", "numberOfDocuments": "10" }
Update multiple policies
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
{ "policy": [{ "id": "AAABcID5GBc=", "type": "throttle" "description": "Europe Net Appliance", "timeUnit": "s", "numberOfDocuments": "10" }] }
Status
Response code | Description |
---|---|
200 | Success |
404 | Not found - a given seed identifier was not found |
406 | Not acceptable - there was an issue validating the input |
Delete one or more policies from Aspire.
DELETE /aspire_api/policies/:id
DELETE /aspire_api/policies
Path and Request Body Parameters
Name | Type | Required | Description |
---|---|---|---|
id | string | Required | The identifier(s) of the policy(s) to delete |
Examples
Delete a single policy
DELETE /aspire_api/policies/AAABcID5GBc%3D
Delete multiple seeds
DELETE /aspire_api/policies?id=AAABcID5GBc%3D&id=AAABcIueWUc%3D
Response
{ "message": "optional response message" }
Status
Response code | Description |
---|---|
200 | Success |
404 | Not found - a given seed identifier was not found |
406 | Not acceptable - there was an issue validating the input |