Add KVM Host from Config File

POST/zstack/v1/hosts/kvm/from-file

Headers

Authorization: OAuth the-session-uuid

Body

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

In the above example, systemTags and userTags fields can be omitted. They are listed to indicate that these two 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":{"hostInfo":"FILE CONTENT ENCODE BY BASE64"}}' http://localhost:8080/zstack/v1/hosts/kvm/from-file

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
hostInfoStringbody (contained in params structure)Host information encoded in base64 3.1.0
resourceUuid (optional)Stringbody (contained in params structure)  3.1.0
systemTags (optional)Listbody  3.1.0
userTags (optional)Listbody  3.1.0

API Response

Response Example

{
  "results": [
    {
      "ip": "127.0.0.1",
      "success": true
    }
  ]
}
NameTypeDescriptionStarting Version
successboolean 3.1.0
errorErrorCodeError code. If not null, the operation failed. If null, the operation succeeded. See details error3.1.0
resultsListSee details results3.1.0

error

NameTypeDescriptionStarting Version
codeStringError code number, globally unique identifier of the error, e.g. SYS.1000, HOST.10013.1.0
descriptionStringBrief description of the error3.1.0
detailsStringDetailed error information3.1.0
elaborationStringReserved field, default is null3.1.0
opaqueLinkedHashMapReserved field, default is null3.1.0
causeErrorCodeRoot cause, the error that caused the current error. If there is no original error, this field is null3.1.0

results

NameTypeDescriptionStarting Version
ipStringHost IP3.1.0
successboolean 3.1.0
errorErrorCodeSee details error3.1.0

error

NameTypeDescriptionStarting Version
codeStringError code number, globally unique identifier of the error, e.g. SYS.1000, HOST.10013.1.0
descriptionStringBrief description of the error3.1.0
detailsStringDetailed error information3.1.0
elaborationStringReserved field, default is null3.1.0
opaqueLinkedHashMapReserved field, default is null3.1.0
causeErrorCodeRoot cause, the error that caused the current error. If there is no original error, this field is null3.1.0

SDK Examples

Java SDK

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

Python SDK

AddKVMHostFromConfigFileAction action = AddKVMHostFromConfigFileAction()
action.hostInfo = "FILE CONTENT ENCODE BY BASE64"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
AddKVMHostFromConfigFileAction.Result res = action.call()