SR-IOV Operations
IsVfNicAvailableInL3Network
API Request
URLs
GET zstack/v1/l3-networks/{l3NetworkUuid}/hosts/{hostUuid}/vfnicavailableHeaders
Authorization: OAuth the-session-uuidCurl
Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/l3-networks/443e156ec6883356974f97f803187310/hosts/037404d26b033e9d9fe0d3e7e4bbaa8b/vfnicavailableRequest Parameters
| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| l3NetworkUuid | String | url | The L3 network UUID. | 3.9.0 | |
| hostUuid | String | url | The host UUID. | 3.9.0 | |
| systemTags | List | query | Optional. The system tags. | 3.9.0 | |
| userTags | List | query | Optional. The user tags. | 3.9.0 |
API Response
Sample Response
{
"vfNicAvailable": true
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| vfNicAvailable | boolean | Whether a virtual function (VF) NIC is available. | 3.9.0 |
| error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 3.9.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. | 3.9.0 |
| description | String | The brief description of the error. | 3.9.0 |
| details | String | The details about the error. | 3.9.0 |
| elaboration | String | The reserved field. Default value: null. | 3.9.0 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 3.9.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. | 3.9.0 |
SDK Sample
Java
SDK
IsVfNicAvailableInL3NetworkAction action = new IsVfNicAvailableInL3NetworkAction();
action.l3NetworkUuid = "443e156ec6883356974f97f803187310";
action.hostUuid = "037404d26b033e9d9fe0d3e7e4bbaa8b";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
IsVfNicAvailableInL3NetworkAction.Result res = action.call();Python
SDK
IsVfNicAvailableInL3NetworkAction action = IsVfNicAvailableInL3NetworkAction()
action.l3NetworkUuid = "443e156ec6883356974f97f803187310"
action.hostUuid = "037404d26b033e9d9fe0d3e7e4bbaa8b"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
IsVfNicAvailableInL3NetworkAction.Result res = action.call()ChangeVmNicType
API Request
URLs
PUT zstack/v1/vm-instances/nics/{vmNicUuid}/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.
{
"changeVmNicType": {
"vmNicType": "VNIC"
},
"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 '{"changeVmNicType":{"vmNicType":"VNIC"}}' http://localhost:8080/zstack/v1/vm-instances/nics/ba83aa15bafd33e792267c428465b1e5/actionsRequest Parameters
| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| vmNicUuid | String | url | The VM NIC UUID. | 3.9.0 | |
| vmNicType | String | body (contained in the changeVmNicType structure) | The VM NIC type. |
|
3.9.0 |
| systemTags | List | body | Optional. The system tags. | 3.9.0 | |
| userTags | List | body | Optional. The user tags. | 3.9.0 |
API Response
Sample
Response
{
"inventory": {
"uuid": "bd44ea50e2573d5d9249c938dba0dad6",
"vmInstanceUuid": "1311eba1f7e53c3aa816a140fd783068",
"usedIpUuid": "464575b453d53e60941c7eeee08f3149",
"l3NetworkUuid": "b62214c53fde3f6eb825bf2ce59e3d2e",
"ip": "192.168.1.10",
"mac": "00:0c:29:bd:99:fc",
"hypervisorType": "KVM",
"netmask": "255.255.255.0",
"gateway": "192.168.1.1",
"deviceId": 0.0,
"type": "VF"
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 3.9.0 |
| inventory | VmNicInventory | See inventory. | 3.9.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. | 3.9.0 |
| description | String | The brief description of the error. | 3.9.0 |
| details | String | The details about the error. | 3.9.0 |
| elaboration | String | The reserved field. Default value: null. | 3.9.0 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 3.9.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. | 3.9.0 |
#inventory
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 3.9.0 |
| vmInstanceUuid | String | The VM instance UUID. | 3.9.0 |
| l3NetworkUuid | String | The L3 network UUID. | 3.9.0 |
| ip | String | The IP address. | 3.9.0 |
| mac | String | The MAC address. | 3.9.0 |
| hypervisorType | String | The hypervisor type. | 3.9.0 |
| netmask | String | The netmask. | 3.9.0 |
| gateway | String | The gateway. | 3.9.0 |
| metaData | String | 3.9.0 | |
| ipVersion | Integer | The IP version. | 3.9.0 |
| deviceId | Integer | The device ID. | 3.9.0 |
| type | String | The NIC type. | 3.9.0 |
| createDate | Timestamp | The creation date. | 3.9.0 |
| lastOpDate | Timestamp | The last operation date. | 3.9.0 |
| usedIps | List | See usedIps. | 3.9.0 |
#usedIps
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 3.9.0 |
| ipRangeUuid | String | The IP range UUID. | 3.9.0 |
| l3NetworkUuid | String | The L3 network UUID. | 3.9.0 |
| ipVersion | Integer | The IP version. | 3.9.0 |
| ip | String | The IP address. | 3.9.0 |
| netmask | String | The netmask. | 3.9.0 |
| gateway | String | The gateway. | 3.9.0 |
| usedFor | String | 3.9.0 | |
| ipInLong | long | 3.9.0 | |
| vmNicUuid | String | The VM NIC UUID. | 3.9.0 |
| createDate | Timestamp | The creation date. | 3.9.0 |
| lastOpDate | Timestamp | The last operation date. | 3.9.0 |
SDK Sample
Java
SDK
ChangeVmNicTypeAction action = new ChangeVmNicTypeAction();
action.vmNicUuid = "ba83aa15bafd33e792267c428465b1e5";
action.vmNicType = "VNIC";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
ChangeVmNicTypeAction.Result res = action.call();Python
SDK
ChangeVmNicTypeAction action = ChangeVmNicTypeAction()
action.vmNicUuid = "ba83aa15bafd33e792267c428465b1e5"
action.vmNicType = "VNIC"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
ChangeVmNicTypeAction.Result res = action.call()