Add policies policy(ies)Adds policies to Aspire, this endpoint need the at least the ADMINISTRATOR role to be executed. Panel |
---|
borderColor | black |
---|
bgColor | #fafafb |
---|
| POST /aspire/_api/policies |
Request Body Parameters Name | Type | Required | Description |
---|
type | string | Required | The type of policy to add - "throttle"
- "route"
- "deleteIncremental (5.0.2)"
| description | string | OptionalRequired | 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 |
---|
timeUnitperiod | string | Required | Time unit of the throttling policy - second, minute, hour, day | valuetimeUnitRate | 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 | |
---|
routeTo | string | Required | A route to tag |
DeleteIncremental type: Name | Type | Requried | Description |
---|
deletesPolicy | DeletesPolicy | Required | - 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.
| deleteCheckAfterErrors | enum DeleteCheckAfterErrors | Required 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.
| value | int | Required for a variant AFTER_DAYS, AFTER_INCREMENTALS | Number of days or iterations. Valid value is also -1, that means that sends the deletes immediately since the last time the URLs were accessed. | Tags for the routing policy |
Example Code Block |
---|
| POST /aspire_api/policies
[{
"type": "throttle",
"description": "Europe Net Appliance throttle",
"timeUnitperiod": "minute",
"value": "100"
},
{
"type": "route",
"description": "German servers",
"routeTo": "US"
},
{
"type": "deleteIncremental",
"description": "sDays before delete",
"timeUnitRatedeletesPolicy": "10AFTER_DAYS",
"numberOfDocumentsvalue": "101"
},
{
"type": "routedeleteIncremental",
"description": "Iterations before delete",
"deletesPolicy": "AFTER_INCREMENTALS",
"value": "2"
},
{
"type"German: servers"deleteIncremental",
"tagsdescription": ["USdefault immediate policy","UK
"deletesPolicy": "IMMEDIATE","DEU"]
}
"deleteCheckAfterErrors": "ALWAYS"
},
] |
Response Code Block |
---|
| {
"policy": [{
"id": "AAABcID5GBc=",
"type": "throttle"
"description": "Europe Net Appliance throttle",
"timeUnitperiod": "minute",
"value": "s100"
},
{
"timeUnitRateid": "10AAABcID5GBd=",
"numberOfDocumentstype": "10route"
}, "description": "All servers",
"routeTo": "US"
},
{
"id": "AAABcID5GBd=AAABcID5GBe=",
"type": "deleteIncremental",
"description": "Days before delete",
"deletesPolicy": "AFTER_DAYS",
"value": "1"
},
{
"id": "AAABcID5GBf=",
"type": "routedeleteIncremental",
"description": "Iterations before delete",
"deletesPolicy": "All servers",AFTER_INCREMENTALS",
"value": "2"
},
{
"tagsid": ["USAAABcID5GBg=","UK","DEU"]
"description": "default immediate policy",
"deletesPolicy": "IMMEDIATE",
"deleteCheckAfterErrors": "ALWAYS"
}
]
} |
Status |