Skip to main content

POST /csvRequest

Use this method to manage devices using a bulk-import CSV file.

Note
  • The bulk import file must be in a comma-delimited CSV format.
  • When managing switches using bulk import, HTTPS is enabled on the switch, and NTP clients on the switch are configured to use the NTP settings from the management server. To change these setting, use POST /manageRequest.

For information about downloading a template (Excel or CSV format) and completing the bulk import file, see Managing systems.

Authentication

Authentication with username and password is required.

Request URL

POST https://{management_server_IP}/csvRequest

Query parameters

ParametersRequired / OptionalDescription
validationOnly={Boolean}OptionalIndicates whether to only validate the bulk-import (CSV) file. This can be one of the following values.
  • true. Validates the contents of the bulk-import CSV file, but does not manage the devices.

  • false. (default) Manages devices that are defined in the bulk-import CSV file.

The following example validates the bulk-import CSV file.
POST https://192.0.2.0/csvRequest?validationOnly=true
The following example manages devices that are defined in the bulk-import CSV file.
POST https://192.0.2.0/csvRequest

Request body

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

Request example

HTTP Header
Content-Type: multipart/form-data; boundary=AaB03x
Request body
--AaB03x
Content-Disposition: form-data; name="uploadedfile"; filename="bulk_manage.csv"
Content-Type: application/octet-stream
--AaB03x--

Response codes

CodeDescriptionComments
200OKThe request completed successfully.
201CreatedOne or more new resources were successfully created.
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.
404Not foundA specified resource cannot be found. A descriptive error message is returned in the response body.
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 header

If this POST method results in a job getting started, the response header includes a URI in the form /augusta/discovery/jobs/{job_id} (for example, /augusta/discovery/jobs/12) that represents the job that is monitored by the management server. You can use GET /csvRequest/jobs/{job_id} to determine the status of the job.

If a job was not successfully started, refer to the response code and response body for details.

Note
A successful response indicates that the request was successfully transmitted and accepted by the management server. It does not indicate that the operation that is associated with the job was successful.

Response body

Table 1. Validate in the bulk-import file.

The following is response body is returned when validateOnly=true. A JSON object is returned for each row in the bulk-import file.

AttributesTypeDescription
currentIPStringIP address or hostname for the device
currentUserNameStringUser name for authenticating to the device, if applicable
displayNameStringDevice display name
failedValidationMessagesArray of stringsInput errors for the device
roleGroupsArray of stringsList of role groups that are permitted to view and manage the device. To get a list of available role groups, use GET /roleGroups.

You can specify only role groups to which the current user belongs.

If you do not specify the roleGroups attribute, the default roles groups are assigned. You can obtain the list of default role group using GET /resourceAccessControl.

If you specify roleGroup with an empty or null value, role groups are not assigned.

Note
If you add devices to a managed chassis, the new devices will belong to the same role groups as the chassis.
managedAuthenticationBooleanIndicates whether to use local authentication instead of XClarity Administrator managed authentication. For more information about managed and local authentication, see Managing the authentication server.

This can be one of the following values.

  • true. Use XClarity Administrator managed authentication.

  • false. Use local authentication.

rowNumberIntegerRow in the CSV file in which the device input is specified
serialNumberStringDevice serial number
storedCredentialsIDStringStored credential ID that is associated with the device, if applicable. To find the stored credential ID, use GET /storedCredentials.
typeStringDevice type. This can be one of the following values.
  • Chassis.

  • Filler

  • Rack

  • Server

  • Storage

  • Switch

The following example is returned when validateOnly=true.
[{
"currentIP": "10.243.3.37",
"currentUsername": "USERID",
"displayName": null,
"failedValidationMessages": [],
"roleGroups": ["LXC-SUPERVISOR","LXC-HW-ADMIN",]
"rowNumber": 2,
"serialNumber": null,
"storedCredentialsId": null,
"type": "flexchassis",
"managedAuthEnabled": null
},
...,
{
"currentIP": "",
"currentUserName": "JOHN",
"displayName": "Server1"
"failedValidationMessages": ["Missing IP address or hostname","Invalid device type"],
"roleGroups": "",
"managedAuthentication": false,
"rowNumber": 1,
"serialNumber": "",
"storedCredentialsID": null,
"type": "Server"
}]
Table 2. Manage devices in the bulk-import file.

The following is response body is returned when validateOnly=false.

AttributesTypeDescription
resultStringResults of this operation. This can be one of the following values.
  • success

  • warning

  • failure

statusCodeStringResponse code
statusDescriptionStringResponse description
messagesArray of objectsInformation about zero or more messages
 idStringMessage identifier of a returned message
 explanationStringAdditional information to clarify the reason for the message
 recoveryStringUser actions that can be taken to recover from the event
 recoveryUrlStringLink to the help system for more information, if available
 textStringMessage text associated with the message identifier

The following example is returned when validateOnly=false.

{
"result": "failure"
"statusCode": 400,
"statusDescription": "There was an error parsing the input to the bulk import request.",
"messages": [{
"id": "FQXDM0558G",
"explanation": "Field \"ManagedAuthEnabled\" is not allowed when field \"Type\" has
value \"flexchassis\".",
"recovery": "Correct the default values that are specified in the bulk import dialog and
the data on line 5 of the CSV file, and try again.",
"recoveryUrl": "",
"text": "A field was specified that is not compatible with the value of another field."
},
{
"id": "FQXDM0557G",
"explanation": "Field \"StoredCredentialsId\" is not allowed when field \"NewPassword\"
is specified.",
"recovery": "Correct the default values entered in the bulk import dialog and/or the data
on line 6 of the CSV file and try again.",
"recoveryUrl": "",
"text": "Incompatible fields were specified."
}]
}