Add 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 |
Body Parameters Name | Type | Required | Description |
---|
type | string | Required | The type of policy to add - "throttle"
- "route"
- "deleteIncremental (5.0.2)"
| description | string | Required | 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 |
---|
period | string | Required | Time unit of the throttling policy - second, minute, hour, day | value | 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 DeleteIncremental type: You need to decide which delete policy to use, as Aspider only allows one at the time. Delete Incremental policy can be created and assigned to Seed or Connection. When is assigned to both, then Delete Incremental Policy in Seed is only used. Days before delete (sends the deletes after an specific number of days has passed since the last time the URLs were accessed). Iterations before delete (sends the deletes after an specific number of incremental crawls since the last time the URLs were accessed). If the policy is not created, then is used a default policy Immediate (which means sending deletes as soon as a URL is not accessed during an incremental crawl). 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_ |
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. |
Example Code Block |
---|
| POST /aspire_api/policies
[{
"type": "throttle",
"description": "Europe Net Appliance throttle",
"period": "minute",
"value": "100"
},
{
"type": "route",
"description": "German servers",
"routeTo": "US"
},
{
"type": "deleteIncremental",
"description": "Days before delete",
"deletesPolicy": "AFTER_DAYS",
"value": "1"
},
{
"type": "deleteIncremental",
"description": "Iterations before delete",
"deletesPolicy": "AFTER_INCREMENTALS",
"value": "2"
},
{
"type": "deleteIncremental",
"description": "default immediate policy",
"deletesPolicy": "IMMEDIATE",
"deleteCheckAfterErrors": "ALWAYS"
},
] |
Response Code Block |
---|
| {
"policy": [{
"id": "AAABcID5GBc=",
"type": "throttle"
"description": "Europe Net Appliance throttle",
"period": "minute",
"value": "100"
},
{
"id": "AAABcID5GBd=",
"type": "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": "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 |