SetNicQoS
API Request
URLs
PUT zstack/v1/vm-instances/{uuid}/actionsHeaders
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.
{
"setNicQos": {
"outboundBandwidth": 819200.0,
"inboundBandwidth": 819200.0
},
"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 '{"setNicQos":{"outboundBandwidth":819200.0,"inboundBandwidth":819200.0}}' \
http://localhost:8080/zstack/v1/vm-instances/1d86edf8c2e73980b83005e946449c57/actionsRequest Parameters
| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | The VM NIC UUID. | 0.6 | |
| outboundBandwidth | Long | body (contained in the params structure) | Optional. The outbound bandwidth. | 0.6 | |
| inboundBandwidth | Long | body (contained in the params structure) | Optional. The inbound bandwidth. | 0.6 | |
| systemTags | List | body | Optional. The system tags. | 0.6 | |
| userTags | List | body | Optional. The user tags. | 0.6 |
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
SetNicQoSAction action = new SetNicQoSAction();
action.uuid = "00cc6445774649b488f6a03b023d6701";
action.outboundBandwidth = 819200.0;
action.inboundBandwidth = 819200.0;
action.sessionId = "d5a1b6a5424e4b1c8cc23f77e8ba6d58";
SetNicQoSAction.Result res = action.call();Python
SDK
SetNicQoSAction action = SetNicQoSAction()
action.uuid = "71548ce2c00240a3a5b065080d47f399"
action.outboundBandwidth = 819200.0
action.inboundBandwidth = 819200.0
action.sessionId = "a86b3caf907045b9a82e3a0cb0597330"
SetNicQoSAction.Result res = action.call()