Document navigation

Shared Bandwidth Operations

CreateVpcSharedQos

API Request

URLs
POST zstack/v1/vips/sharedqos
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "name": "sharedQos",
    "description": "sharedQos description",
    "vpcUuid": "65be8c77be7e3e548075ec8384b7784e",
    "l3NetworkUuid": "960b85b1e9933f198e342fd338badcf7",
    "bandwidth": 1048576
  },
  "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 POST -d '{"params":{"name":"sharedQos","description":"sharedQos description","vpcUuid":"65be8c77be7e3e548075ec8384b7784e","l3NetworkUuid":"960b85b1e9933f198e342fd338badcf7","bandwidth":1048576}}' http://localhost:8080/zstack/v1/vips/sharedqos
Request Parameters
Name Type Location Description Optional Value Starting Version
description String body (contained in the params structure) Optional.The description of the resource. 5.1.0
vpcUuid String body (contained in the params structure) 5.1.0
l3NetworkUuid String body (contained in the params structure) The UUID of the L3 network. 5.1.0
bandwidth Long body (contained in the params structure) Optional. 5.1.0
resourceUuid String body (contained in the params structure) Optional.The resource UUID. 5.1.0
tagUuids List body (contained in the params structure) Optional. 5.1.0
systemTags List body Optional.The system tags. 5.1.0
userTags List body Optional. The user tags. 5.1.0

API Response

Sample Response
{
  "inventory": {
    "uuid": "c4e66289d5a03734b38492b4ca2fde64",
    "l3NetworkUuid": "ed1507b673f433cd8d3be4f652d621bd",
    "vpcUuid": "ed008a7099ef3137bf58b85232cbf804"
  }
}
Name Type Description Starting Version
success boolean 5.1.0
inventory VpcSharedQosInventory Seeinventory 5.1.0
error ErrorCode Error code. If it is not null, it means the operation failed. If the operation is successful, this field is null. Seeerror 5.1.0
#inventory
Name Type Description Starting Version
uuid String The UUID of the resource. 5.1.0
name String The name of the resource. 5.1.0
description String The detailed description of the resource. 5.1.0
l3NetworkUuid String The UUID of the L3 network. 5.1.0
vpcUuid String 5.1.0
bandwidth Long 5.1.0
createDate Timestamp The creation time. 5.1.0
lastOpDate Timestamp The last operation date. 5.1.0
vips List Seevips 5.1.0
#vips
Name Type Description Starting Version
id Long 5.1.0
sharedQosUuid String 5.1.0
vipUuid String VIP UUID. 5.1.0
createDate Timestamp The creation time. 5.1.0
lastOpDate Timestamp The last operation date. 5.1.0
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 5.1.0
description String The brief description of the error. 5.1.0
details String The details about the error. 5.1.0
elaboration String The reserved field. Default value: null. 5.1.0
opaque LinkedHashMap The reserved field. Default value: null. 5.1.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 5.1.0

SDK Sample

Java SDK
CreateVpcSharedQosAction action = new CreateVpcSharedQosAction();
action.name = "sharedQos";
action.description = "sharedQos description";
action.vpcUuid = "65be8c77be7e3e548075ec8384b7784e";
action.l3NetworkUuid = "960b85b1e9933f198e342fd338badcf7";
action.bandwidth = 1048576;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateVpcSharedQosAction.Result res = action.call();
Python SDK
CreateVpcSharedQosAction action = CreateVpcSharedQosAction()
action.name = "sharedQos"
action.description = "sharedQos description"
action.vpcUuid = "65be8c77be7e3e548075ec8384b7784e"
action.l3NetworkUuid = "960b85b1e9933f198e342fd338badcf7"
action.bandwidth = 1048576
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CreateVpcSharedQosAction.Result res = action.call()

DeleteVpcSharedQos

API Request

URLs
DELETE zstack/v1/vips/sharedqos/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/vips/sharedqos/ce4a4da17366304baa95bd30dbbee4be
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The resource UUID. 5.1.0
deleteMode String body Optional.
  • Permissive / Enforcing
  • Permissive
5.1.0
systemTags List body Optional.The system tags. 5.1.0
userTags List body Optional. The user tags. 5.1.0

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
DeleteVpcSharedQosAction action = new DeleteVpcSharedQosAction();
action.uuid = "ce4a4da17366304baa95bd30dbbee4be";
action.deleteMode = "Permissive";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DeleteVpcSharedQosAction.Result res = action.call();
Python SDK
DeleteVpcSharedQosAction action = DeleteVpcSharedQosAction()
action.uuid = "ce4a4da17366304baa95bd30dbbee4be"
action.deleteMode = "Permissive"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
DeleteVpcSharedQosAction.Result res = action.call()

QueryVpcSharedQos

API Request

URLs
GET zstack/v1/vips/sharedqos
GET zstack/v1/vips/sharedqos/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/vips/sharedqos?q=uuid=b15a3578c3933804bece500f809ebdcc
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/vips/sharedqos/862a52a400c23d5cbccef438c957a5f8

Queryable Fields

You can check all queryable fields and resource names that can be queried across tables by using zstack-cli, entering QueryVpcSharedQos, and pressing the Tab key.

API Response

Sample Response
{
  "inventories": [
    {
      "uuid": "f7f905bb22ca3c7fbb3f683737718289",
      "name": "shared-qos-name",
      "description": "description",
      "l3NetworkUuid": "06ce8adcb1ff3f05803aeaa47765b088",
      "vpcUuid": "f3de6c11b69038f194708d0e70ed7774",
      "bandwidth": 1000,
      "createDate": "Apr 16, 2024 6:06:18 PM",
      "lastOpDate": "Apr 16, 2024 6:06:18 PM"
    }
  ]
}
Name Type Description Starting Version
success boolean 5.1.0
inventory VpcSharedQosInventory Seeinventories. 5.1.0
error ErrorCode Error code. If it is not null, it means the operation failed. If the operation is successful, this field is null. For more information, see error. 5.1.0
#inventories
Name Type Description Starting Version
uuid String The resource UUID. 5.1.0
name String The resource name. 5.1.0
description String The detailed description of the resource. 5.1.0
l3NetworkUuid String UUID of L3 Network. 5.1.0
vpcUuid String The VPC vRouter UUID. 5.1.0
bandwidth Long The bandwidth size. 5.1.0
createDate Timestamp The creation time. 5.1.0
lastOpDate Timestamp The last operation date. 5.1.0
vips List See vips. 5.1.0
#vips
Name Type Description Starting Version
id Long 5.1.0
sharedQosUuid String 5.1.0
vipUuid String VIP UUID 5.1.0
createDate Timestamp The creation time. 5.1.0
lastOpDate Timestamp The last operation date. 5.1.0
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 5.1.0
description String The brief description of the error. 5.1.0
details String The details about the error. 5.1.0
elaboration String The reserved field. Default value: null. 5.1.0
opaque LinkedHashMap The reserved field. Default value: null. 5.1.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 5.1.0

SDK Sample

Java SDK
QueryVpcSharedQosAction action = new QueryVpcSharedQosAction();
action.conditions = asList("uuid=777d07580d263f95a881ad8523c42806");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryVpcSharedQosAction.Result res = action.call();
Python SDK
QueryVpcSharedQosAction action = QueryVpcSharedQosAction()
action.conditions = ["uuid=0b5a3b10bab03322a30cbbbcff00a17c"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryVpcSharedQosAction.Result res = action.call()

ChangeVpcSharedQos

API Request

URLs
POST zstack/v1/vips/sharedqos/{sharedQosUuid}/bandwidth/actions
Headers
Authorization: OAuth the-session-uuid
body
{
  "params": {
    "bandwidth": 2097152
  },
  "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 POST -d '{"params":{"bandwidth":2097152}}' http://localhost:8080/zstack/v1/vips/sharedqos/221cb152078d30fca39190556ceec683/bandwidth/actions
Request Parameters
Name Type Location Description Optional Value Starting Version
sharedQosUuid String url The shared bandwidth UUID. 5.1.0
bandwidth Long body (contained in the params structure) The bandwidth size. 5.1.0
systemTags List body Optional. The system tags. 5.1.0
userTags List body Optional. The user tags. 5.1.0

API Response

Sample Response
{
  "inventory": {
    "uuid": "2286509f52943894bf33f6aa917ffc29",
    "l3NetworkUuid": "2ceb65d30e7e3deab7db9355e7dee0dd",
    "vpcUuid": "6ab0048c38103fbe9efc8eb8f8ff5bbf"
  }
}
Name Type Description Starting Version
success boolean 5.1.0
inventory VpcSharedQosInventory Seeinventory. 5.1.0
error ErrorCode Error code. If it is not null, it means the operation failed. If the operation is successful, this field is null. For more information, see error. 5.1.0
#inventory
Name Type Description Starting Version
uuid String The resource UUID. 5.1.0
name String The resource name. 5.1.0
description String The detailed description of the resource. 5.1.0
l3NetworkUuid String UUID of L3 Network. 5.1.0
vpcUuid String 5.1.0
bandwidth Long 5.1.0
createDate Timestamp The creation time. 5.1.0
lastOpDate Timestamp The last operation date. 5.1.0
vips List See vips. 5.1.0
#vips
Name Type Description Starting Version
id Long 5.1.0
sharedQosUuid String 5.1.0
vipUuid String VIP UUID 5.1.0
createDate Timestamp The creation time. 5.1.0
lastOpDate Timestamp The last operation date. 5.1.0
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 5.1.0
description String The brief description of the error. 5.1.0
details String The details about the error. 5.1.0
elaboration String The reserved field. Default value: null. 5.1.0
opaque LinkedHashMap The reserved field. Default value: null. 5.1.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 5.1.0

SDK Sample

Java SDK
ChangeVpcSharedQosBandwidthAction action = new ChangeVpcSharedQosBandwidthAction();
action.sharedQosUuid = "221cb152078d30fca39190556ceec683";
action.bandwidth = 2097152;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
ChangeVpcSharedQosBandwidthAction.Result res = action.call();
Python SDK
ChangeVpcSharedQosBandwidthAction action = ChangeVpcSharedQosBandwidthAction()
action.sharedQosUuid = "221cb152078d30fca39190556ceec683"
action.bandwidth = 2097152
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
ChangeVpcSharedQosBandwidthAction.Result res = action.call()

UpdateVpcSharedQos

API Request

URLs
PUT zstack/v1/vips/sharedqos/{uuid}/actions
Headers
Authorization: OAuth the-session-uuid
body
{
  "updateVpcSharedQos": {
    "name": "Updated Shared QoS",
    "description": "This is an updated description for the Shared QoS."
  },
  "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 '{"updateVpcSharedQos":{"name":"Updated Shared QoS","description":"This is an updated description for the Shared QoS."}}' http://localhost:8080 zstack/v1/vips/sharedqos/ab6601fa1df73c05a562fcde20f889ce/actions
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The resource UUID. 5.1.0
name String body (contained in the updateVpcSharedQos structure) The resource name. 5.1.0
description String body (contained in the updateVpcSharedQos structure) Optional. The detailed description of the resource.
systemTags List body Optional.The system tags. 5.1.0
userTags List body Optional. The user tags. 5.1.0

API Response

Sample Response
{
  "inventory": {
    "uuid": "979cefee9f9d334c881c4329756517a5",
    "l3NetworkUuid": "3e8164ec051030dfadfd1046e6042745",
    "vpcUuid": "7895911a13203a00ba5cec0362bc199f"
  }
}
Name Type Description Starting Version
success boolean 5.1.0
inventory VpcSharedQosInventory Seeinventory. 5.1.0
error ErrorCode Error code. If it is not null, it means the operation failed. If the operation is successful, this field is null. For more information, see error. 5.1.0
#inventory
Name Type Description Starting Version
uuid String The resource UUID. 5.1.0
name String The resource name. 5.1.0
description String The detailed description of the resource. 5.1.0
l3NetworkUuid String The UUID of the L3 network. 5.1.0
vpcUuid String 5.1.0
bandwidth Long 5.1.0
createDate Timestamp The creation time. 5.1.0
lastOpDate Timestamp The last operation time. 5.1.0
vips List See vips. 5.1.0
#vips
Name Type Description Starting Version
id Long 5.1.0
sharedQosUuid String 5.1.0
vipUuid String VIP UUID 5.1.0
createDate Timestamp The creation time. 5.1.0
lastOpDate Timestamp The last operation date. 5.1.0
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 5.1.0
description String The brief description of the error. 5.1.0
details String The details about the error. 5.1.0
elaboration String The reserved field. Default value: null. 5.1.0
opaque LinkedHashMap The reserved field. Default value: null. 5.1.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 5.1.0

SDK Sample

Java SDK
UpdateVpcSharedQosAction action = new UpdateVpcSharedQosAction();
action.uuid = "ab6601fa1df73c05a562fcde20f889ce";
action.name = "Updated Shared QoS";
action.description = "This is an updated description for the Shared QoS.";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateVpcSharedQosAction.Result res = action.call();
Python SDK
UpdateVpcSharedQosAction action = UpdateVpcSharedQosAction()
action.uuid = "ab6601fa1df73c05a562fcde20f889ce"
action.name = "Updated Shared QoS"
action.description = "This is an updated description for the Shared QoS."
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateVpcSharedQosAction.Result res = action.call()

AttachVipToVpcSharedQos

API Request

URLs
POST zstack/v1/vips/sharedqos/{sharedQosUuid}/vips
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "vipLists": [
      "175767a19c2d376183863dee3408b1f6"
    ]
  },
  "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
url -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"vipLists":["175767a19c2d376183863dee3408b1f6"]}}' http://localhost:8080/zstack/v1/vips/sharedqos/d4559c8d9f76391b9d8eb30f74698949/vips
Request Parameters
Name Type Location Description Optional Value Starting Version
sharedQosUuid String url 5.1.0
vipLists List body (contained in the params structure) 5.1.0
systemTags List body Optional. The system tags. 5.1.0
userTags List body Optional. The user tags. 5.1.0

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
AttachVipToVpcSharedQosAction action = new AttachVipToVpcSharedQosAction();
action.sharedQosUuid = "d4559c8d9f76391b9d8eb30f74698949";
action.vipLists = asList("175767a19c2d376183863dee3408b1f6");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
AttachVipToVpcSharedQosAction.Result res = action.call();
Python SDK
AttachVipToVpcSharedQosAction action = AttachVipToVpcSharedQosAction()
action.sharedQosUuid = "d4559c8d9f76391b9d8eb30f74698949"
action.vipLists = [175767a19c2d376183863dee3408b1f6]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
AttachVipToVpcSharedQosAction.Result res = action.call()

DetachVipFromVpcSharedQos

API Request

URLs
POST zstack/v1/vips/sharedqos/{sharedQosUuid}/vips
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/vips/sharedqos/85800cac6a5f36c89867c24c73001f10/vips?
Request Parameters
Name Type Location Description Optional Value Starting Version
sharedQosUuid String url 5.1.0
vipLists List body 5.1.0
systemTags List body Optional. The system tags. 5.1.0
userTags List body Optional. The user tags. 5.1.0

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
DetachVipFromVpcSharedQosAction action = new DetachVipFromVpcSharedQosAction();
action.sharedQosUuid = "85800cac6a5f36c89867c24c73001f10";
action.vipLists = asList("3358e3d0355b3b498ed4d80e7e40d6b3");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DetachVipFromVpcSharedQosAction.Result res = action.call();
Python SDK
DetachVipFromVpcSharedQosAction action = DetachVipFromVpcSharedQosAction()
action.sharedQosUuid = "85800cac6a5f36c89867c24c73001f10"
action.vipLists = [3358e3d0355b3b498ed4d80e7e40d6b3]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
DetachVipFromVpcSharedQosAction.Result res = action.call()
API Reference | 5.4.12 | ZStack Cloud · ZCF | ZStack Resource Center