Add policies policy(ies)Adds one or more 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 seedpolicy |
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 |
---|
routeTo | string | Required | A route to tag |
DeleteIncremental type: Name | Type | Requried | Description |
---|
tags | array of strings | Required | Tags for the routing policy |
Examples |
---|
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. |
ExampleAdd a single policy Code Block |
---|
| POST /aspire/_api/policies
[{
"type": "Throttlethrottle",
"description": "Europe Net Appliance throttle",
"period": "minute",
"timeUnitvalue": "100"
},
{
"type": "mroute",
"timeUnitRatedescription": "1German servers",
"numberOfDocumentsrouteTo": "100US"
} |
Add multiple policies Code Block |
---|
| POST /aspire_api/policies
[,
{
"type": "ThrottledeleteIncremental",
"description": "Days before delete",
"deletesPolicy": "AFTER_DAYS",
"value": "Europe Net Appliance throttle"1"
},
{
"type": "deleteIncremental",
"timeUnitdescription": "sIterations before delete",
"timeUnitRatedeletesPolicy": "10AFTER_INCREMENTALS",
"numberOfDocumentsvalue": "102"
},
{
"type": "RoutedeleteIncremental",
"description": "Germandefault immediate serverpolicy",
"tagsdeletesPolicy": ["USIMMEDIATE",
"UKdeleteCheckAfterErrors",: "DEUALWAYS"]
},
] |
Response Code Block |
---|
| {
"policy": [{
"id": "AAABcID5GBc=",
"type": "throttle"
"description": "Europe Net Appliance throttle",
"period": "minute",
"value": "100"
},
{
"id": "AAABcID5GBd=",
"timeUnittype": "route"
"description": "All servers",
"routeTo": "US"
},
{
"id": "AAABcID5GBe=",
"type": "deleteIncremental",
"description": "Days before delete",
"deletesPolicy": "AFTER_DAYS",
"value": "1"
},
{
"id": "AAABcID5GBf=",
"type": "deleteIncremental",
"description": "Iterations before delete",
"deletesPolicy": "AFTER_INCREMENTALS",
"value": "s2"
},
{
"timeUnitRateid": "5AAABcID5GBg=",
"description": "default immediate policy",
"numberOfDocuments "deletesPolicy": "IMMEDIATE",
"deleteCheckAfterErrors": "10ALWAYS"
}
]
} |
Status |