GetPortForwardingAttachableVmNics
API Request
URLs
GET zstack/v1/port-forwarding/{ruleUuid}/vm-instances/candidate-nicsHeaders
Authorization: OAuth the-session-uuidCurl
Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b6d8f8edb4aa48f388591c2dc83fabe9" \
-X GET http://localhost:8080/zstack/v1/port-forwarding/039e99f4cf9741adabaf972914fa9a30/vm-instances/candidate-nicsRequest Parameters
| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| ruleUuid | String | url | The UUID of the port forwarding rule. | 0.6 | |
| systemTags | List | query | Optional. The system tags. | 0.6 | |
| userTags | List | query | Optional. The user tags. | 0.6 |
API Response
Sample
Response
{
"inventories": [
{
"uuid": "2eb90e57e12f400ba8349742840eb9f9",
"vmInstanceUuid": "efa24e175ba34c1196f9818ea6f56e5f",
"l3NetworkUuid": "39e4eeeb2b1e4bb885922cb5c6585277",
"ip": "192.168.0.123",
"mac": "fa:ef:34:5c:6c:00",
"netmask": "255.255.255.0",
"gateway": "192.168.0.1",
"internalName": "eth0",
"deviceId": 0.0
}
]
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 0.6 |
| inventories | List | See inventories. | 0.6 |
#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. | 0.6 |
| description | String | The brief description of the error. | 0.6 |
| details | String | The details about the error. | 0.6 |
| elaboration | String | The reserved field. Default value: null. | 0.6 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 0.6 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 0.6 |
#inventories
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 0.6 |
| vmInstanceUuid | String | The VM instance UUID. | 0.6 |
| l3NetworkUuid | String | The L3 network UUID. | 0.6 |
| ip | String | 0.6 | |
| mac | String | 0.6 | |
| netmask | String | 0.6 | |
| gateway | String | 0.6 | |
| metaData | String | 0.6 | |
| deviceId | Integer | 0.6 | |
| createDate | Timestamp | The creation date. | 0.6 |
| lastOpDate | Timestamp | The last operation date. | 0.6 |
SDK Sample
Java
SDK
GetPortForwardingAttachableVmNicsAction action = new GetPortForwardingAttachableVmNicsAction();
action.ruleUuid = "5980282a68024f039ddfe379b43e49b1";
action.sessionId = "e309fcb7cb0545a3b802a21acfa4b397";
GetPortForwardingAttachableVmNicsAction.Result res = action.call();Python
SDK
GetPortForwardingAttachableVmNicsAction action = GetPortForwardingAttachableVmNicsAction()
action.ruleUuid = "530c24831aaf4ff6bda365c774952576"
action.sessionId = "595b1267d25d4c709c081ecb3ea2f00e"
GetPortForwardingAttachableVmNicsAction.Result res = action.call()