POST /compliancePolicies/compareResult
Use the method to assign a compliance policy to one or more devices and to return the job ID and task IDs for monitoring the status of the job and tasks.
Authentication
Authentication with username and password is required.
Request URL
POST https://{management_server_IP}/compliancePolicies/compareResult
Query parameters
None
Request body
Attributes | Required / Optional | Type | Description | |
---|---|---|---|---|
compliance | Required | Array of objects | Information about each compliance policy | |
autoAssign | Optional | Boolean | Indicates whether to automatically assign the specified compliance policy when a new device of the specified type is detected. This can be one of the following values.
| |
keep | Optional | Boolean | Indicates when to return results when monitoring the status of the assignment job or task. This can be one of the following values.
| |
policyname | Required | String | Name of the compliance-policy to be assigned To obtain a list of policy names, use GET /compliancePolicies. | |
type | Required | String | Device type. This can be one of the following values.
| |
uuid | Required | String | UUID of the device to which you want to assign the compliance policy |
The following example assigns a compliance policy to a device.
{
"compliance":[{
"keep":false,
"policyName":"DEFAULT-2015-04-01",
"type":"IOSwitch",
"uuid":"A3F8482B012B32188E68375DD5FF40EE"
}]
}
Response codes
Code | Description | Comments |
---|---|---|
200 | OK | The request completed successfully. |
400 | Bad Request | A query parameter or request attribute is missing or not valid, or the operation is not supported. A descriptive error message is returned in the response body. |
403 | Forbidden | The orchestrator server was prevented from fulfilling the request. A descriptive error message is returned in the response body. Ensure that you have privileges to perform the request. |
409 | Conflict | There is a conflict with the current state of the resource. A descriptive error message is returned in the response body. |
500 | Internal Server Error | An internal error occurred. A descriptive error message is returned in the response body. |
Response body
You can use GET /tasks/{job_list} to monitor the progress of the compliance-policy assignment job and tasks using the taskid and jobid response attributes.
Attributes | Type | Description | ||
---|---|---|---|---|
errorDetail | Array | Error message if an error occurred | ||
errorMessage | String | |||
message | Array | |||
jobid | Integer | Job ID for the policy assignment | ||
tasks | Array | Information about each task in the job | ||
taskid | Integer | Task ID | ||
uuid | String | Task UUID | ||
status | String | Status of the job. This can be one of the following values.
|
The following example is returned if the request is successful.
{
"errorDetail": [],
"errorMessage": "",
"message": [{
"tasks": [{
"taskid": 0,
"uuid": "A3F8482B012B32188E68375DD5FF40EE"
}],
"jobid": 14
}],
"status": "success"
}
Give documentation feedback