Skip to main content

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

AttributesRequired / OptionalTypeDescription
complianceRequiredArray of objectsInformation about each compliance policy
 autoAssignOptionalBooleanIndicates 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.
  • true. Automatically assign the specified compliance policy.
  • false. (default) Do not automatically assign the specified compliance policy.
 keepOptionalBooleanIndicates when to return results when monitoring the status of the assignment job or task. This can be one of the following values.
  • true. (default) Wait for the policy assignment to complete before returning the status.
  • false. Return current status immediately even if the assignment is not complete.
 policynameRequiredStringName of the compliance-policy to be assigned

To obtain a list of policy names, use GET /compliancePolicies.

 typeRequiredStringDevice type. This can be one of the following values.
  • CMM
  • IOSwitch. Flex switch
  • SWITCH
  • SERVER
  • STORAGE. Rack storage device
 uuidRequiredStringUUID 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

CodeDescriptionComments
200OKThe request completed successfully.
400Bad RequestA 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.
403ForbiddenThe 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.
409ConflictThere is a conflict with the current state of the resource. A descriptive error message is returned in the response body.
500Internal Server ErrorAn 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.

AttributesTypeDescription
errorDetailArrayError message if an error occurred
errorMessageString 
messageArray 
 jobidIntegerJob ID for the policy assignment
 tasksArrayInformation about each task in the job
  taskidIntegerTask ID
  uuidStringTask UUID
statusStringStatus of the job. This can be one of the following values.
  • success
  • notstarted
  • inprogress
  • failed
  • finished
  • cancel
The following example is returned if the request is successful.
{
"errorDetail": [],
"errorMessage": "",
"message": [{
"tasks": [{
"taskid": 0,
"uuid": "A3F8482B012B32188E68375DD5FF40EE"
}],
"jobid": 14
}],
"status": "success"
}