PUT /switches/configurationData

Use this method to restore configuration data for one or more RackSwitch or Flex System switches. The switch configuration-data file is downloaded from Lenovo XClarity Administrator to the target switch, and the configuration takes effect automatically.

Note: This API requires Lenovo XClarity Administrator v1.4.0 or later.

Authentication

Authentication with user name and password is required.

Request URL

PUT https://{management_server_IP}/switches/configurationData

Query parameters

None

Request body

Attributes Required / Optional Type Description
action Required String Action to perform. This can be the following value.
  • restore. Restore configuration data to a specific switch.

restart Optional Boolean (Switches running CNOS only) Indicates whether to restart the switch after configuration data is restored.
  • true. Restarts the switch after the restore operation completes.

  • false. (default). Do not restart the switch.

    If you choose not to restart the switch, you must manually restart the switch to activate the restored configuration data.

targets Required Array of objects Information about each target to be restored
  filename Required String Name of the configuration-data file to restore on the specified switch
  uuid Required String UUID of the switches to be restored. To obtain the switch UUIDs, use the GET /switches method.
The following example restores configuration data for multiple switches and restarts the switches to activate the restored data.
{
   "action": "restore",
   "restart": true,
   "targets" : [{
      "filename" : "Switch1.cfg",
      "uuid" : "00000000000010008000A897DCF7FC00"
   }, 
   {
      "filename" : "Switch2.cfg",
      "uuid" : "A1A9642D7D763A8096A9F1657FB07929"
   }]
}

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.

For XClarity Administrator advanced functions, ensure that you have active licenses for each managed server that supports the advanced functions. If the management server is not license compliant, the compliance response code is set to 0.

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

Attributes Type Description
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 Information about one or more messages
  explanation String Additional information to clarify the reason for the message
  recovery Array Recovery information
    text String User actions that can be taken to recover from the event
    URL String Link to the help system for more information, if available
  statusCode String Response code
  statusDescription String Description of the response code
  text String Message text associated with the message identifier
  uuid String Switch UUID
The following example is returned if the request is successful.
{
   "result": "success",
   "messages": [{
      "explanation": "",
      "recovery": {
         "text": "text here",
         "URL": "URL here"
      },
      "statusCode": 200,
      "statusDescription": "Configuration data was restored successfully.",
      "text": "",
      "uuid": "00000000000010008000A897DCF7FC00"
   },
   {
      "explanation": "",
      "recovery": {
         "text": "text here",
         "URL": "URL here"
      },
      "statusCode": 200,
      "statusDescription": "Configuration data was restored successfully.",
      "text": "",
      "uuid": "A1A9642D7D763A8096A9F1657FB07929"
   }]
}