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 |
---|---|---|---|
from | integer | Optional | Indicates the initial page to be retrieved |
size | integer | Optional | Specifies the size of results page |
sortBy | string | Optional | Field by which results are sorted |
sortMode | string | Optional | Sort mode
|
expand | string | Optional | List of fields to expand, * will expand everything |
Response
{ "policy": [{ "id": "AAABcID5GBc=", "type": "throttle", "description": "Europe Net Appliance throttle", "timeUnit": "m", "timeUnitRate": "1", "numberOfDocuments": "100" }, { "id": "AAABcIueWUc=", "type": "route", "description": "All servers", "tags": ["US","UK","DEU"] }] }
Status
Response code | Description |
---|---|
200 | Success |
Lists policies configured in the Aspire, filtered by a specified criteria
POST /aspire/_api/policies/getAll
Query String Parameters
Name | Type | Required | Description |
---|---|---|---|
from | integer | Optional | Indicates the initial page to be retrieved |
size | integer | Optional | Specifies the size of results page |
sortBy | string | Optional | Field by which results are sorted |
sortMode | string | Optional | Sort mode
|
expand | string | Optional | List of fields to expand, * will expand everything |
Body Parameters
Name | Type | Required | Description |
---|---|---|---|
filter | JSON | Required | Filters retrieved policies. Check the filter definition here |
Response
{ "policy": [{ "id": "AAABcID5GBc=", "type": "throttle", "description": "Europe Net Appliance throttle", "timeUnit": "m", "timeUnitRate": "1", "numberOfDocuments": "100" }, { "id": "AAABcIueWUc=", "type": "route", "description": "All servers", "tags": ["US","UK","DEU"] }] }
Status
Response code | Description |
---|---|
200 | Success |
Gets information about a single policy configured in Aspire
GET /aspire/_api/policies/:id
Query String Parameters
Name | Type | Required | Description |
---|---|---|---|
id | string | Required | The id of the policy to return |
expand | string | Optional | List of fields to expand, * will expand everything |
Response
{ "policy": { "id": "AAABcID5GBc=", "type": "throttle", "description": "Europe Net Appliance throttle", "timeUnit": "m", "timeUnitRate": "1", "numberOfDocuments": "100" } }
Status
Response code | Description |
---|---|
200 | Success |
Adds policies to Aspire
POST /aspire/_api/policies
Body Parameters
Name | Type | Required | Description |
---|---|---|---|
type | string | Required | The type of policy to add
|
description | string | Required | An optional description of the policy |
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 |
timeUnitRate | int | Required | The rate at which each time unit is throttled |
numberOfDocuments | int | Required | Number of documents per time unit for the throttling policy |
Route type:
Name | Type | Required | Description |
---|---|---|---|
tags | array of strings | Required | Tags for the routing policy |
Example
POST /aspire_api/policies [{ "type": "throttle", "description": "Europe Net Appliance throttle", "timeUnit": "s", "timeUnitRate": "10", "numberOfDocuments": "10" }, { "type": "route", "description": "German servers", "tags": ["US","UK","DEU"] }]
Response
{ "policy": [{ "id": "AAABcID5GBc=", "type": "throttle" "description": "Europe Net Appliance throttle", "timeUnit": "s", "timeUnitRate": "10", "numberOfDocuments": "10" }, { "id": "AAABcID5GBd=", "type": "route" "description": "All servers", "tags": ["US","UK","DEU"] }] }
Status
Response code | Description |
---|---|
201 | Created |
406 | Not acceptable - there was an issue validating the input |
Update policies in Aspire.
PUT /aspire_api/policies
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
Example
PUT /aspire_api/policies { "AAABcID5GBc=": { "id": "AAABcID5GBc=", "type": "throttle" "description": "Europe Net Appliance", "timeUnit": "s", "timeUnitRate": "1", "numberOfDocuments": "10" }, "AAABcID5GBd=": { "id": "AAABcID5GBd=", "type": "route" "description": "German server", "tags": ["DEU"] } }
Response
{ "policy": [{ "id": "AAABcID5GBc=", "type": "throttle" "description": "Europe Net Appliance", "timeUnit": "s", "timeUnitRate": "1", "numberOfDocuments": "10" }, { "id": "AAABcID5GBd=", "type": "route" "description": "German server", "tags": ["DEU"] }] }
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 multiple policies from Aspire, filtered by a specified criteria
POST /aspire/_api/policies/deleteAll
Body Parameters
Name | Type | Required | Description |
---|---|---|---|
filter | JSON | Required | Filters retrieved policies. Check the filter definition here |
Response
{ "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 code | Description |
---|---|
200 | Success |
404 | Not found - a given credential identifier was not found |
406 | Not acceptable - there was an issue validating the input |
Delete a single policy from Aspire.
DELETE /aspire_api/policies/:id
Query String Parameters
Name | Type | Required | Description |
---|---|---|---|
id | string | Required | The identifier of the policy to delete |
Example
DELETE /aspire_api/policies/AAABcID5GBc%3D
Delete multiple policies
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 |
Some endpoint queries require a filter. A filter is basically a JSON object with the following format:
Credentials filter:
"filter" : { "ids" : ["ID1", "ID2", "ID3", ...], "type" : "TYPE", "description" : "DESCRIPTION" }