UpdateVmNetworkConfig
API Request
URLs
PUT zstack/v1/vm-instances/{vmInstanceUuid}/update-nic-configHeaders
Authorization: OAuth the-session-uuidBody
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.
{
"updateVmNetworkConfig": {
"vmNicUuids": [
"afb48d4bfd193c6b9d46b866cb29a767"
]
},
"systemTags": [],
"userTags": []
}
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.Curl
Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \-X PUT -d '{"updateVmNetworkConfig":{"vmNicUuids":["afb48d4bfd193c6b9d46b866cb29a767"]}}' \
http://localhost:8080/zstack/v1/vm-instances/1c8470e916873fe6ae0251c3f592a6c4/update-nic-configRequired Parameters
| Name | Type | Location | Description | Valid Values | Starting Version |
|---|---|---|---|---|---|
| vmInstanceUuid | String | url | The VM instance UUID. | 4.6.21 | |
| vmNicUuids | List | body (contained in the updateVmNetworkConfig srtucture). | 4.6.21 | ||
| systemTags | List | body | Optional. The system tags. | 4.6.21 | |
| userTags | List | body | Optional. The user tags. | 4.6.21 |
API Response
When the API succeeded, an empty JSON structure {} is returned. When the API
failed, the returned JSON structure includes an error field. For
example,
{
"error": {
"code": "SYS.1001",
"description": "A message or a operation timeout",
"details": "Create VM on KVM timeout after 300s"
}
}SDK Sample
Java
SDK
UpdateVmNetworkConfigAction action = new UpdateVmNetworkConfigAction();
action.vmInstanceUuid = "1c8470e916873fe6ae0251c3f592a6c4";
action.vmNicUuids = asList("afb48d4bfd193c6b9d46b866cb29a767");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateVmNetworkConfigAction.Result res = action.call();Python
SDK
UpdateVmNetworkConfigAction action = UpdateVmNetworkConfigAction()
action.vmInstanceUuid = "1c8470e916873fe6ae0251c3f592a6c4"
action.vmNicUuids = [afb48d4bfd193c6b9d46b866cb29a767]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateVmNetworkConfigAction.Result res = action.call()