The policies API provides functionality that allows a administrator to add, delete or update policies
Lists all the policies configured in the Aspire, this endpoint need the at least the OPERATOR role to be executed.
GET /aspire/_api/policies
Pagination query string parameters
Lists policies configured in the Aspire, filtered by a specified criteria, this endpoint need the at least the OPERATOR role to be executed.
Response
{ "policy": [{ "id": "AAABcID5GBc=", "type": "throttle", "description": "Europe Net Appliance throttle", "period": "minute", "value": "100" }, { "id": "AAABcIueWUc=", "type": "route", "description": "All servers", "routeTo": "US" }] }
Status: 200
Gets information about a single policy configured in Aspire, this endpoint need the at least the OPERATOR role to be executed.
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", "description": "Europe Net Appliance throttle", "period": "minute", "value": "100" } }
Status: 200, 404
Adds policies to Aspire, this endpoint need the at least the ADMINISTRATOR role to be executed.
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 |
---|---|---|---|
period | string | Required | Time unit of the throttling policy - second, minute, hour, day |
value | int | Required | Number of documents per time unit for the throttling policy |
Route type:
Name | Type | Required | Description |
---|---|---|---|
routeTo | string | Required | A route to tag |
Example
POST /aspire_api/policies [{ "type": "throttle", "description": "Europe Net Appliance throttle", "period": "minute", "value": "100" }, { "type": "route", "description": "German servers", "routeTo": "US" }]
Response
{ "policy": [{ "id": "AAABcID5GBc=", "type": "throttle" "description": "Europe Net Appliance throttle", "period": "minute", "value": "100" }, { "id": "AAABcID5GBd=", "type": "route" "description": "All servers", "routeTo": "US" }] }
See Response Body for details regarding the response body returned where multiple items are affected with some (or all) returning errors
Status: 201, 406
Update policies in Aspire, this endpoint need the at least the ADMINISTRATOR role to be executed.
PUT /aspire/_api/policies/:id
PUT /aspire/_api/policies
Body Parameters
Name | Type | Required | Description |
---|---|---|---|
id | string | Required | The identifier of the policy to update |
... |
+ fields from "Add" section...
Example
PUT /aspire_api/policies { "AAABcID5GBc=": { "id": "AAABcID5GBc=", "type": "throttle" "description": "Europe Net Appliance", "period": "minute", "value": "100" }, "AAABcID5GBd=": { "id": "AAABcID5GBd=", "type": "route" "description": "German server", "routeTo": "US" } }
Response
{ "policy": [{ "id": "AAABcID5GBc=", "type": "throttle" "description": "Europe Net Appliance", "period": "minute", "value": "100" }, { "id": "AAABcID5GBd=", "type": "route" "description": "German server", "routeTo": "US" }] }
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
Update policies configured in the Aspire, filtered by a specified criteria, this endpoint need the at least the ADMINISTRATOR role to be executed.
PUT /aspire/_api/policies/updateAll
Response
{ "message": "update result response message" }
Status: 200, 406
Delete multiple policies from Aspire, filtered by a specified criteria, this endpoint need the at least the ADMINISTRATOR role to be executed.
POST /aspire/_api/policies/deleteAll
Response
{ "message": "delete result response message" }
Status: 200
Delete one or more policies from Aspire, this endpoint need the at least the ADMINISTRATOR role to be executed.
DELETE /aspire/_api/policies/:id
DELETE /aspire/_api/policies
POST /aspire/_api/policies/delete
Path Parameters and Query parameters
Name | Type | Required | Description |
---|---|---|---|
id | string | Required | The identifier(s) of the policy (s) to delete |
Body Parameter
Name | Type | Required | Description |
---|---|---|---|
ids | string | Required | The identifier(s) of the policy(s) to delete |
Examples
DELETE /aspire/_api/policies/AAABcID5GBc DELETE /aspire/_api/policies?id=AAABcID5GBc&id=AAABcID5GBd POST /aspire/_api/policies/delete { "ids":["AAABcID5GBc","AAABcID5GBd"] }
Response
{ "message": "delete result response message" }
Status: 200, 404, 406