Skip to main content

POST /switches/configurationData

Use this method to import a switch configuration-data file from the local system into Lenovo XClarity Administrator or back up configuration data for one or more RackSwitch or Flex System switches. When backing up configuration data, the switch configuration data is imported into Lenovo XClarity Administrator from the target switch as a configuration-data file.

Authentication

Authentication with username and password is required.

Request URL

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

Query parameters

None

Request body

Table 1. Backup switch configuration data.
AttributesRequired / OptionalTypeDescription
actionRequiredStringThe action to perform. This can be the following value:
  • backup. Back up configuration data from a specific switch.

targetsRequiredArray of objectsInformation about each target to be restored.
 descriptionOptionalStringDescription of the configuration-data file.

If a description is not specified, the following default text is used: <switch_name} configuration at {timestamp>.

 filenameOptionalStringName of the configuration-data file.

For CNOS devices, the file name can contain alphanumeric characters and the following special characters: underscore (_), hyphen (-) and period (.). For ENOS switches, the file name can contain alphanumeric characters and any special characters.

If a file name is not specified, the following default name is used: <switch_name>_<IP_address>_<timestamp>.cfg.

 overwirteOptionalBooleanIndicates whether to overwrite an existing switch-configuration file with the same name. This can be one of the following values.
  • true. Overwrite an existing switch-configuration file with the same name.

  • false. Append appended an existing switch-configuration file with the same name with a unique number (for example, 1).

Note
If you do not specify this attribute and a switch-configuration file with the same name already exists, the backup process fails.
 uuidRequiredStringUUID of the switches to be backed up. To obtain the switch UUIDs, use the GET /switches method.
The following example backs up configuration data for multiple switches.
{
"action": "backup",
"targets" : [{
"description" : " Switch1 configuration"
"filename" : "Switch1.cfg",
"overwirte" : true,
"uuid" : "00000000000010008000A897DCF7FC00"
},
{
"description" : " Switch2 configuration"
"filename" : "Switch2.cfg",
"overwirte" : true,
"uuid" : "A1A9642D7D763A8096A9F1657FB07929",
}]
}
Table 2. Import switch configuration-data file.

Use the multipart/form-data media type to import the configuration-data file. 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.

AttributesRequired / OptionalTypeDescription
fileSizeRequiredStringThe size of the configuration-data file to be imported (in bytes).
uploadedfileRequiredObjectInformation about the configuration-data file being imported.
 fileNameRequiredStringName of the configuration-data file.

For CNOS devices, the file name can contain alphanumeric characters and the following special characters: underscore (_), hyphen (-) and period (.). For ENOS switches, the file name can contain alphanumeric characters and any special characters.

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

AttributesTypeDescription
resultStringThe 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.
messagesArrayInformation about one or more messages.
 explanationStringAdditional information to clarify the reason for the message.
 recoveryArrayRecovery information
  textStringUser actions that can be taken to recover from the event.
  URLStringLink to the help system for more information, if available.
 statusCodeStringThe response code.
 statusDescriptionStringDescription of the response code.
 textStringMessage text associated with the message identifier.
The following example is returned if the request is successful.
{
"result": "success",
"messages": [{
"explanation": "",
"recovery": {
"text": "text here",
"URL": "URL here"
},
"statusCode": 200,
"statusDescription": "File imported successfully",
"text": "".
"uuid": "00000000000010008000A897DCF7FC00"
}]
}
{
"result": "success",
"messages": [{
"explanation": "",
"recovery": {
"text": "text here",
"URL": "URL here"
},
"statusCode": 200,
"statusDescription": "File imported successfully",
"text": "".
"uuid": "A1A9642D7D763A8096A9F1657FB07929"
}]
}
1 MyBackup_33.cfg