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

toc
Easy Heading Free
navigationTitleOn this Page
navigationExpandOptionexpand-all-by-default

Pagination query string parameters

Sorting query string parameters

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

Query String Parameters

NameTypeRequiredDescription
fromintegerOptionalIndicates the initial page to be retrieved
sizeintegerOptionalSpecifies the size of results page
sortBystringOptionalField by which results are sorted
sortModestringOptional

Sort mode

  • "asc" for ascending sort,
  • "desc" for descending sort
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

Sorting query string parameters

Common filter

Response

Code Block
languagejs
themeRDark
{
    "policycount": [{
    "id": "AAABcID5GBc=",
    "typetotalItems": "throttle",
	"description": "Europe Net Appliance throttle"3
    },
    "timeUnitpolicy": "m",
	"timeUnitRate": "1",
	"numberOfDocuments": "100"
  },
[
        {
            "id": "AAABcIueWUc=10653921-1b27-40b5-9d7a-f54ef1e3ad01",
            "type": "routethrottle",
	            "description": "All serversthrottleDesc",
    "tags        "period": ["US","UKminute","DEU"]
  }]
}

Status

Response codeDescription200Success Section

Get all policies, filtered

Lists policies configured in the Aspire, filtered by a specified criteria

Panel
borderColorblack
bgColor#fafafb

POST /aspire/_api/policies/getAll

Query String Parameters

          "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




Body Parameters

Response

NameTypeRequiredDescription
fromintegerOptionalIndicates the initial page to be retrieved
sizeintegerOptionalSpecifies the size of results page
sortBystringOptionalField by which results are sorted
sortModestringOptional

Sort mode

  • "asc" for ascending sort,
  • "desc" for descending sort
NameTypeRequiredDescription
filterJSONRequiredFilters retrieved policies. Check the filter definition here
Code Block
languagejs
{  
  "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 codeDescription200Success 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


Query String Path Parameters

NameTypeRequiredDescription
idstringRequiredThe id of the policy to return


Response

Code Block
languagejs
themeRDark
{
  "policy": {
    "id": "AAABcID5GBc=10653921-1b27-40b5-9d7a-f54ef1e3ad01",
    "type": "throttle",
	  "description": "Europe Net Appliance throttlethrottleDesc",
    "timeUnitperiod": "mminute",
	  "timeUnitRatevalue": "1",
	"numberOfDocuments": "100"
 }
}

Status

Response codeDescription200Success
5
}

Status: 200, 404




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

Throttle type:

Route type:

Examples

Section

Add

multiple policies

policy(ies)

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

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


Request Body Parameters

NameTypeRequiredDescription
typestringRequired

The type of policy to add

  • "throttle"
  • "route"
  • "deleteIncremental (5.0.2)"
descriptionstringOptionalRequiredAn optional description of the policy


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


Throttle type:

NameTypeRequiredDescription
timeUnitperiodstringRequiredTime unit of the throttling policy
timeUnitRateintRequiredThe rate at which each time unit is throttled
- second, minute, hour, day
valuenumberOfDocumentsintRequiredNumber of documents per time unit for the throttling policy


Route type:

NameTypeRequiredDescription
tagsrouteToarray of stringsstringRequiredTags for the routing policy

Example

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

A route to tag


DeleteIncremental type:

Name TypeRequriedDescription
deletesPolicyDeletesPolicyRequired
  • IMMEDIATE  - policy will be processed immediately, also is taken to consideration, if should be done after errors (property deleteCheckAfterError).
  • AFTER_DAYS - policy will be processed after number of days, number of days are stored in property value.
  • AFTER_INCREMENTALS - policy will be processed after number of incrementals, number of incrementals are stored in property value.
deleteCheckAfterErrorsenum DeleteCheckAfterErrorsRequired for a variant IMMEDIATE

Checks if "delete" candidates still exist after an incremental when they are part of scan error.

  • ALWAYS - policy will be processed even if errors are found. 
  • NEVER - policy will be not processed when errors are found.
valueintRequired for a variant AFTER_DAYS, AFTER_INCREMENTALSNumber of days or iterations. Valid value is also -1, that means that sends the deletes immediately since the last time the URLs were accessed.


Example

Code Block
languagejs
themeRDark
POST /aspire_api/policies
[{
  
Code Block
languagejs
{
  "policy": [{
    "id": "AAABcID5GBc=",
    "type": "throttle",
    "description": "Europe Net Appliance throttle",
    "timeUnit"period": "sminute",
    "timeUnitRatevalue": "10100"
},
{
    "numberOfDocumentstype": "10route",
   }"description": "German servers",
   {
    "idrouteTo": "AAABcID5GBd=US"
},
  {
  "type": "routedeleteIncremental",
    "description": "AllDays serversbefore delete",
  "deletesPolicy": "AFTER_DAYS",
  "tagsvalue": ["US1"
},"UK
{
  "type": "deleteIncremental",
  "DEUdescription"]
: "Iterations before }]
}

Status

Response codeDescription
201Created
406Not acceptable - there was an issue validating the input
Section
delete",
  "deletesPolicy": "AFTER_INCREMENTALS",
  "value": "2"
},
{
  "type": "deleteIncremental",
  "description": "default immediate policy",
  "deletesPolicy": "IMMEDIATE",
  "deleteCheckAfterErrors": "ALWAYS"
},

]


Response

Code Block
languagejs
themeRDark
{
  "policy": [{
    "id": "AAABcID5GBc=",
    "type": "throttle"
    "

Add single policy

Adds a single policy to Aspire

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

Request Body Parameters

NameTypeRequiredDescription
typestringRequired

The type of policy to add

  • "throttle"
  • "route"
descriptionstringOptionalAn optional description of the policy
NameTypeRequiredDescription
timeUnitstringRequiredTime unit of the throttling policy
timeUnitRateintRequiredThe rate at which each time unit is throttled
numberOfDocumentsintRequiredNumber of documents per time unit for the throttling policy
NameTypeRequiredDescription
tagsarray of stringsRequiredTags for the routing policy
Code Block
languagejs
POST /aspire/_api/policies
{
  "type": "Throttle",
  "description": "Europe Net Appliance throttle",
    "timeUnitperiod": "mminute",
    "timeUnitRatevalue": "1100",
  "numberOfDocuments": "100"
}

Response

Code Block
languagejs
{},
  "policy": [{
    "id": "AAABcID5GBcAAABcID5GBd=",
    "type": "throttleroute"
    "description": "Europe Net Appliance throttleAll servers",
    "timeUnitrouteTo": "mUS"
   },
	{
    "timeUnitRateid": "1AAABcID5GBe=",
     "numberOfDocuments "type": "deleteIncremental",
  	"description": "Days before delete",
  	"deletesPolicy": "AFTER_DAYS",
  	"value": "1001"
   }]
}

Status

Response codeDescription201Created406Not acceptable - there was an issue validating the input Section
,
	{
    "id": "AAABcID5GBf=",
    "type": "deleteIncremental",
    "description": "Iterations before delete",
    "deletesPolicy": "AFTER_INCREMENTALS",
    "value": "2"
   },
	{
    "id": "AAABcID5GBg=",
    "description": "default immediate policy",
  	"deletesPolicy": "IMMEDIATE",
  	"deleteCheckAfterErrors": "ALWAYS"
   }
]
}

See Response Body for details regarding the response body returned where multiple items are affected with some (or all) returning errors

Status: 201, 406




Other parameters passed in the request body will depend on the type of policy being created - see Add a Policy above

Example

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, number of days or iterations for delete Incremental policy
routeTostringxA route to tag
deleteCheckAfterErrors

enum

DeleteCheckAfterErrors

xChecks if "delete" candidates still exist after an incremental when they are part of scan error.  (ALWAYS/NEVER)

x - at least one field must be present

Example

Code Block
languagejs
themeRDark
PUT /aspire_api/policies
{
  "AAABcID5GBc=": {
    "id": "AAABcID5GBc=",
    "description": "Europe Net Appliance",
    "period": "minute

Update multiple policies

Update multiple policies in Aspire.

Panel
borderColorblack
bgColor#fafafb

PUT /aspire_api/policies

Body Parameters

NameTypeRequiredDescription
idstringRequiredThe identifier of the policy to update
typestringOptionalThe type of policy
descriptionstringOptionalAn optional description of the seed
Code Block
languagejs
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

Code Block
languagejs
{
  "policy": [{
    "id": "AAABcID5GBc=",
    "type": "throttle"
    "description": "Europe Net Appliance",
	"timeUnit": "s",
	"timeUnitRate": "1",
    "numberOfDocumentsvalue": "10100"
   },
  "AAABcID5GBd=": {
    "id": "AAABcID5GBd=",
    "type": "route"
    "description": "German server",
    "tagsrouteTo": ["DEUUS"]
  }]
}

Status

Response codeDescription200Success404Not found - a given seed identifier was not found406Not acceptable - there was an issue validating the input Section
,
"AAABcID5GBe=": {
    "id": "AAABcID5GBe=",
    "description": "default immediate policy",
    "deleteCheckAfterErrors": "NEVER"
  },
"AAABcID5GBf=": {
    "id": "AAABcID5GBf=",
    "description": "Iterations before delete",
    "value": "3"
 }


Response

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


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
themeRDark
{
  "update" : 

Update single policy

Update a single policy in Aspire.

Panel
borderColorblack
bgColor#fafafb

PUT /aspire_api/policies/:id

Query String Parameters

NameTypeRequiredDescriptionidstringRequiredThe identifier of the policy to update

Body Parameters

NameTypeRequiredDescriptionidstringRequiredThe identifier of the policy to updatetypestringOptionalThe type of policydescriptionstringOptionalAn 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

Code Block
languagejs
PUT /aspire_api/policies/AAABcID5GBc%3D
{
  "id": "AAABcID5GBc=",
  "type": "throttle"
  "description": "Europe Net Appliance",
  "timeUnit": "s",
  "timeUnitRate": "1",
  "numberOfDocuments": "10"
}

Response

Code Block
languagejs
{ "policy": [
{
    "
id
description" : "
AAABcID5GBc=
DESCRIPTION"
,

    "
type
period" : "
throttle
PERIOD"
    "
description
value" : "
Europe
VALUE"
   
Net
 
Appliance", "timeUnit": "s", "timeUnitRate"
"routeTo" : "
1
ROUTE_TO"
,

    "
numberOfDocuments
deleteCheckAfterErrors" : "
10
NEVER"
  }
]

}
Status

Response

Response
Code Block
Description
language
200
js
Success
theme
404Not found - a given seed identifier was not found406Not acceptable - there was an issue validating the input Section
RDark
{
  "message": "update result response message"
}

Status: 200, 406




Delete policy

Delete a single policy from Aspire.

Section

Delete policy(ies)

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

Delete multiple policies, filtered

Delete multiple policies from Aspire, filtered by a specified criteria

Panel
borderColorblack
bgColor#fafafb

POST DELETE /aspire/_api/policies/deleteAll:id

DELETE /aspire/_api/policies

POST /aspire/_api/policies/delete


Path Parameters and Query parametersBody Parameters

NameTypeRequiredDescription
filteridJSONstringRequiredFilters retrieved credentials. Check the filter definition here

Response

Code Block
languagejs
{
  "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 codeDescription
200Success
404Not found - a given credential identifier was not found
406Not acceptable - there was an issue validating the input
Section
Panel
borderColorblack
bgColor#fafafb

DELETE /aspire_api/policies/:id

Query String Parameters

NameTypeRequiredDescriptionidstringRequiredThe identifier of the policy to delete

Example

Code Block
languagejs
DELETE /aspire_api/policies/AAABcID5GBc%3D

Delete multiple policies

Response

Code Block
languagejs
{
  "message": "optional response message"
}

Status

Response codeDescription200Success404Not found - a given seed identifier was not found406Not acceptable - there was an issue validating the input
The identifier(s) of the policy(s) to delete


Body Parameter

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


Examples

Code Block
languagejs
themeRDark
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
themeRDark
{
  "message": "delete result response message"
}

Status: 200, 404, 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
themeRDark
{
  "message": "delete result response message"
}

Status: 200




Section

Export policy(ies)

Export one or more policy from Aspire, this endpoint needs at least the OPERATOR role to be executed.

Panel
borderColorblack
bgColor#fafafb

GET /aspire/_api/policies/export

GET /aspire/_api/policies/export/:id

POST /aspire/_api/policies/exportAll

Info

Every configuration item has the option to export from the UI, using the single menu or by the bulk actions:

Image AddedImage Added

Note

Something important that you need to know is that when you export a config item that depends on another, the export will contain also all the dependencies.

Note

Take into consideration that components with resources loaded into elastic, will be exported, but the resource itself will not, so you will need to reupload the resource and go and select your resource in the component again.


Path Parameters and Query parameters

NameTypeRequiredDescription
idstringRequiredThe identifier(s) of the policy(ies) to export


Body Parameter

NameTypeRequiredDescription
idsstringRequiredThe identifier(s) of the policy(ies) to export


Examples

Code Block
languagejs
themeRDark
GET /aspire/_api/policies/export/AAABcID5GBc

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

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


Response

Code Block
languagejs
themeRDark
{
  "export": {
    "policies": {
      "policy": [
        {
          "id": "<policy_id>",
          "type": "deleteIncremental",
          "description": "pD",
          "deletesPolicy": "IMMEDIATE",
          "deleteCheckAfterErrors": "ALWAYS"
        },
        ...
      ]
    }
  }
}

Status: 200, 404, 406


Section

Export multiple policies, filtered

Export multiple policies from Aspire, filtered by a specified criteria, this endpoint needs at least the OPERATOR role to be executed.

Panel
borderColorblack
bgColor#fafafb

POST /aspire/_api/policies/exportAll

Filters: The connection filter definition here

Response

Code Block
languagejs
themeRDark
{
  "export": {
    "policies": {
      "policy": [
        {
          "id": "<policy_id>",
          "type": "deleteIncremental",
          "description": "pD",
          "deletesPolicy": "IMMEDIATE",
          "deleteCheckAfterErrors": "ALWAYS"
        },
        ...
      ]
    }
  }
}

Status: 200




Section

Import

The import usage can be found here





 Some endpoint queries require a filter. A filter is basically a JSON object with the following format:

Credentials filter:

Section

Filters
Anchor
FiltersAnchor
FiltersAnchor

Connector filter:

Code Block
languagejs
themeRDark
{  
Section
Filters
Anchor
FiltersAnchorFiltersAnchor
Code Block
languagejs
  "filter" : {
    "ids" : ["id1ID1", "id2ID2", "id3ID3", ...],
    "type" : "TYPE",
    "description" : "DESCRIPTION",
	"artifact" : }
Note
When using delete endpoints, ids in the filter are mandatory.
"ARTIFACT"
  }
}