POST /files/compliancePolicies?action=import

Use this POST method to import a zip file containing firmware-compliance policies into Lenovo XClarity Administrator.

Note: This API requires Lenovo XClarity Administrator v2.3.0 or later.

Authentication

Authentication with user name and password is required.

Request URL

POST https://<management_server_IP>/files/compliancePolicies?action=import

Query parameters

Parameters Required / Optional Description
action=import Required Imports firmware-compliance policies

Request body

Use the "multipart/form-data" media type to import the update package. Use the attributes in the following table as the multipart name in the body. For more information about the multipart/form-data media type, see Returning Values from Forms: multipart/form-data webpage.

Request example

HTTP Header
   Content-Type: multipart/form-data; boundary=AaB03x
Request body
   --AaB03x
      Content-Disposition: form-data; name="uploadedfiles[]"; filename="policies2018103122275762.zip"
      Content-Type: application/x-zip-compressed

    --AaB03x
     Content-Disposition: form-data; name="uploadedfiles[]"; filename="policies2018102523335745.zip"
      Content-Type: application/x-zip-compressed

   --AaB03x--

Response codes

Code Description
200 OK
400 Bad request
403 Forbidden
404 Resource not found
409 Conflict
413 Request entity too large. Clients might impose limitations on the length of the request URL, and the request URL is too long to be handled.
500 Internal server error

Response body

Attributes Type Description
status String Import status. This can be one of the following values.
  • success. The request completed successfully.
  • error. The request failed. A descriptive error message is returned.
errorMsg Object Information about firmware-compliance policy files that are not valid
  result String Results of the request. This can be one of the following values.
  • success. The request completed successfully.
  • failed. The request failed. A descriptive error message was returned.
  messages Array of objects Information about one or more messages
    id String Message identifier of a returned message
    text String Message text associated with the message identifier
    explanation String Additional information to clarify the reason for the message
    recovery Array of objects Recovery information
      text String User actions that can be taken to recover from the event
popMsg Object Information about firmware-compliance policy files that exist on the management server
  result String Results of the request. This can be one of the following values.
  • success. The request completed successfully.
  • failed. The request failed. A descriptive error message was returned.
  messages Array of objects Information about one or more messages
    id String Message identifier of a returned message
    text String Message text associated with the message identifier
    explanation String Additional information to clarify the reason for the message
    recovery Array of objects Recovery information
      text String User actions that can be taken to recover from the event

Response example

{
   "status": "success",
   "errorMsg": {
      "result": "major",
      "messages": [{
         "id": "FQXHMUP3033L",
         "text": "Some files failed to import and are discarded.",
         "explanation": "The following files are invalid and have been discarded: TestB.xml.",
         "recovery": {
            "text": "Please check the contents of files. Ensure that the uploaded files include
                     the correct .xml file."
         }
      }]
   },
   "popMsg": {
      "result": "warning",
      "messages": [{
         "id": "FQXHMUP3032F",
         "text": "Some files failed to import and are discarded.",
         "explanation": "The following policy files already exist on system and have been 
                         discarded: DEFAULT-2015-04-25.xml.",
         "recovery": {
            "text": "Rename or delete the existing compliance policy in the Compliance Policy
                     page, and retry the import."
         }
      }]
   },
   "successMsg": {
      "result": "informational",
      "messages": [{
         "id": "FQXHMUP3030I",
         "text": "Policy import completed successfully."
      }]
   }
}