Batch Create Bare Metal Chassis

POST/zstack/v1/baremetal/chassis/from-file

Headers

Authorization: OAuth the-session-uuid

Body

{
  "params": {
    "baremetalChassisInfo": "FILE CONTENT ENCODE BY BASE64"
  },
  "systemTags": [],
  "userTags": []
}

In the example above, systemTags and userTags fields can be omitted. They are listed to indicate that these fields can be included in the body.

Curl Example

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"baremetalChassisInfo":"FILE CONTENT ENCODE BY BASE64"}}' \
http://localhost:8080/zstack/v1/baremetal/chassis/from-file

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
baremetalChassisInfoStringbody(included in the params structure)Bare metal chassis information encoded in base64 3.1.1
longJobName (Optional)Stringbody(included in the params structure)Long job name 3.1.1
longJobDescription (Optional)Stringbody(included in the params structure)Long job description 3.1.1
resourceUuid (Optional)Stringbody(included in the params structure)Resource UUID 3.1.1
systemTags (Optional)ListbodySystem Tag 3.1.1
userTags (Optional)ListbodyUser Tag 3.1.1
tagUuids (Optional)Listbody(included in the params structure)Tag UUID list 3.4.0

API Response

Response Example

{
  "inventory": {
    "uuid": "cec9662c5cc534779833c89d8104aa7d",
    "name": "APIBatchCreateBaremetalChassisMsg",
    "apiId": "85ef8b327b0a3c71a53827b30892f327",
    "jobName": "APIBatchCreateBaremetalChassisMsg",
    "jobData": "{\"createMessages\":[]",
    "jobResult": "",
    "state": "Succeeded",
    "managementNodeUuid": "31c1228477b6310b9eb28a75e892b046"
  }
}
NameTypeDescriptionStarting Version
successboolean 0.6
errorErrorCodeError code. If not null, the operation failed. When the operation is successful, this field is null. For details, see error3.1.1
inventoryLongJobInventoryFor details, see inventory3.1.1

error

NameTypeDescriptionStarting Version
codeStringError code number, globally unique identifier of the error, for example SYS.1000, HOST.10010.6
descriptionStringBrief description of the error0.6
detailsStringDetailed error information0.6
elaborationStringReserved field, default is null0.6
opaqueLinkedHashMapReserved field, default is null0.6
causeErrorCodeRoot cause: the source error that triggered the current error. If there is no original error, this field is null0.6

inventory

NameTypeDescriptionStarting Version
uuidStringUUID of the resource, uniquely identifying the resource2.2.4
nameStringResource name2.2.4
descriptionStringDetailed description of the resource2.2.4
apiIdStringAPI ID used to correlate with TaskProgress2.2.4
jobNameStringTask name2.2.4
jobDataStringTask data2.2.4
jobResultStringTask result2.2.4
targetResourceUuidStringTarget resource UUID2.2.4
managementNodeUuidStringManagement Node UUID2.2.4
createDateTimestampCreate time2.2.4
lastOpDateTimestampLast modification time2.2.4
stateLongJobStateFor details, see state2.2.4

state

NameTypeDescriptionStarting Version
nameStringResource name2.2.4
ordinalint 2.2.4

SDK Examples

Java SDK

BatchCreateBaremetalChassisAction action = new BatchCreateBaremetalChassisAction();
action.baremetalChassisInfo = "FILE CONTENT ENCODE BY BASE64";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
BatchCreateBaremetalChassisAction.Result res = action.call();

Python SDK

action = BatchCreateBaremetalChassisAction()
action.baremetalChassisInfo = "FILE CONTENT ENCODE BY BASE64"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()