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, this endpoint need the at least the OPERATOR role to be executed.

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

Pagination query string parameters

Section

Get all policies, filtered

Lists policies configured in the Aspire, filtered by a specified criteria, this endpoint need the at least the OPERATOR role to be executed.

Panel
borderColorblack
bgColor#fafafb

POST /aspire/_api/policies/getAll

Pagination query string parameters

Common filter

Response

Code Block
languagejs
{
    "count": {
        "totalItems": 3
    },
    "policy": [
        {
            "id": "10653921-1b27-40b5-9d7a-f54ef1e3ad01",
            "type": "throttle",
            "description": "throttleDesc",
            "period": "minute",
            "value": 5
        },
        {
            "id": "14822610-a387-44cf-a5ed-3e05618efb57",
            "type": "throttle",
            "description": "throttleDesc",
            "period": "day",
            "value": 333
        },
        {
            "id": "e10af522-5830-4105-9886-3385499202ba",
            "type": "route",
            "description": "routim to cz",
            "routeTo": "CZZZ"
        }
    ]
}

Status: 200



Section

Get single policy

Gets information about a single policy configured in Aspire, this endpoint need the at least the OPERATOR role to be executed.

Panel
borderColorblack
bgColor#fafafb

GET /aspire/_api/policies/:id


Path Parameters

NameTypeRequiredDescription
idstringRequiredThe id of the policy to return


Response

Code Block
languagejs
{
  "id": "10653921-1b27-40b5-9d7a-f54ef1e3ad01",
  "type": "throttle",
  "description": "throttleDesc",
  "period": "minute",
  "value": 5
}

Status: 200, 404




Section

Add policy(ies)

Adds policies to Aspire, this endpoint need the at least the ADMINISTRATOR role to be executed.

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


Body Parameters

NameTypeRequiredDescription
typestringRequired

The type of policy to add

  • "throttle"
  • "route"
descriptionstringRequiredAn optional description of the policy


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


Throttle type:

NameTypeRequiredDescription
periodstringRequiredTime unit of the throttling policy - second, minute, hour, day
valueintRequiredNumber of documents per time unit for the throttling policy


Route type:

NameTypeRequiredDescription
routeTostringRequiredA route to tag


Example

Code Block
languagejs
POST /aspire_api/policies
[{
  "type": "throttle",
  "description": "Europe Net Appliance throttle",
  "period": "minute",
  "value": "100"
},
{
  "type": "route",
  "description": "German servers",
  "routeTo": "US"
}]


Response

Code Block
languagejs
{
  "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




Section

Update policy(ies)

Update policies in Aspire, this endpoint need the at least the ADMINISTRATOR role to be executed.

Panel
borderColorblack
bgColor#fafafb

PUT /aspire/_api/policies/:id

PUT /aspire/_api/policies

Body Parameters

NameTypeRequiredDescription
idstringRequiredThe identifier of the policy to update
descriptionstringxA description
periodstringxTime unit of the throttling policy - second, minute, hour, day
valueintxNumber of documents per time unit for the throttling policy
routeTostringxA route to tag

x - at least one field must be present

Example

Code Block
languagejs
PUT /aspire_api/policies
{
  "AAABcID5GBc=": {
    "id": "AAABcID5GBc=",
    "description": "Europe Net Appliance",
    "period": "minute",
    "value": "100"
  },
  "AAABcID5GBd=": {
    "id": "AAABcID5GBd=",
    "description": "German server",
    "routeTo": "US"
  }
}


Response

Code Block
languagejs
{"policy":[{"updated":true,"id":"AAABcID5GBc="},{"updated":true,"id":"AAABcID5GBd="}]}


Status
: 200, 404, 406



Section

Update policies, filtered

Update policies configured in the Aspire, filtered by a specified criteria, this endpoint need the at least the ADMINISTRATOR role to be executed.

Panel
borderColorblack
bgColor#fafafb

PUT /aspire/_api/policies/updateAll

Common filter

Update body parameter

Code Block
{
  "update" : {
    "description" : "DESCRIPTION"
    "period" : "PERIOD"
    "value" : "VALUE"
    "routeTo" : "ROUTE_TO"
  }
}

Response

Code Block
languagejs
{
  "message": "update result response message"
}

Status: 200, 406



Section

Delete multiple policies, filtered

Delete multiple policies from Aspire, filtered by a specified criteria, this endpoint need the at least the ADMINISTRATOR role to be executed.

Panel
borderColorblack
bgColor#fafafb

POST /aspire/_api/policies/deleteAll

Common filter


Response

Code Block
languagejs
{
  "message": "delete result response message"
}

Status: 200



Section

Delete policy(ies)

Delete one or more policies from Aspire, this endpoint need the at least the ADMINISTRATOR role to be executed.

Panel
borderColorblack
bgColor#fafafb

DELETE /aspire/_api/policies/:id

DELETE /aspire/_api/policies

POST /aspire/_api/policies/delete


Path Parameters and Query parameters

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


Body Parameter

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


Examples

Code Block
languagejs
DELETE /aspire/_api/policies/AAABcID5GBc

DELETE /aspire/_api/policies?id=AAABcID5GBc&id=AAABcID5GBd

POST /aspire/_api/policies/delete
{
  "ids":["AAABcID5GBc","AAABcID5GBd"]
}


Response

Code Block
languagejs
{
  "message": "delete result response message"
}

Status: 200, 404, 406