You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Next »

Page 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

Get all policies

Lists all the policies configured in the Aspire

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

{
  "policy": [{
    "id": "AAABcID5GBc=",
    "type": "throttle",
    ...
  },
  {
    "id": "AAABcIueWUc=",
    "type": "execution",
    ...
  }],
  "message": "optional response message"
}

Status

Response codeDescription
200Success




Get a single policy

Get information about a single policy configured in Aspire

GET /aspire/_api/policies/:id

Path Parameters

NameTypeRequiredDescription
idstringRequiredThe id of the policy to return

Response

{
  "policy": {
    "id": "AAABcID5GBc=",
    "type": "throttle",
    ...
 },

  "message": "optional response message"
}

Status

Response codeDescription
200Success
404The given seed id was not found




Add policies

Adds one or more policies to Aspire

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

Examples

Add a single policy

POST /aspire/_api/policies
{
  "type": "Throttle",
  "description": "Europe Net Appliance throttle"
  ...
}


Add multiple policies


POST /aspire_api/policies
[{
  "type": "Throttle",
  "description": "Europe Net Appliance throttle"
  ...
},
{
  "type": "Route",
  "description": "German server"
  ...
}]

Response

{
  "policy": [{
    "id": "AAABcID5GBc=",
    "type": "throttle"
    "description": "Europe Net Appliance"
    ...
   }],
  "message": "optional response message"
}

Status

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




Update policies

Update a policy in Aspire. Updates will be treated as partial updates rather than overwrites. If a field is not present in the input, any previous value will remain after the update. If you wish to "delete" a value, pass a value of null

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

PUT /aspire_api/policies/AAABcID5GBc%3D
{
  "id": "AAABcID5GBc=",
  "type": "throttle"
  "description": "Europe Net Appliance"
  ...
}


Update multiple policies


PUT /aspire_api/policies
{
  "AAABcID5GBc=": {
    "id": "AAABcID5GBc=",
    "type": "throttle"
    "description": "Europe Net Appliance"
    ...
  },
  "AAABcID5GBd=": {
    "id": "AAABcID5GBd=",
    "type": "route"
    "description": "German server"
    ...
  }
}

Response

{
  "policy": [{
    "id": "AAABcID5GBc=",
    "type": "throttle"
    "description": "Europe Net Appliance"
    ...
   }],
  "message": "optional response message"
}

Status

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




Delete policies

Delete one or more policies from Aspire.

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

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 codeDescription
200Success
404Not found - a given seed identifier was not found
406Not acceptable - there was an issue validating the input
  • No labels