DetachPortForwardingRule
API Request
URLs
DELETE/v1/port-forwarding/{uuid}/vm-instances/nics
Headers
Authorization: OAuth the-session-uuid
Curl
Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth a6a2c933ccf449c99bd49481e9636751" \
-X DELETE http://localhost:8080/zstack/v1/port-forwarding/484d4bed50ab4c18a670982952ccfe61/vm-instances/nics?
Request Parameters
Name | Type | Location | Description | Optional Value | Starting Value |
---|---|---|---|---|---|
uuid | String | url | The resource UUID. | 0.6 | |
systemTags | List | body | Optional. The system tags. | 0.6 | |
userTags | List | body | Optional. The user tags. | 0.6 |
API Response
Sample
Response
{
"inventory": {
"uuid": "dc6ec21666fb42e6be62455f8e5a7307",
"name": "TestAttachRule",
"description": "test atatch rule",
"vipIp": "192.168.0.187",
"guestIp": "10.0.0.244",
"vipUuid": "72dfbe63f95147048a98e514ecbd3ee8",
"vipPortStart": 33.0,
"vipPortEnd": 33.0,
"privatePortStart": 33.0,
"privatePortEnd": 33.0,
"vmNicUuid": "f06654fb4bd6485ebfba84398c98966f",
"protocolType": "TCP",
"state": "Enabled",
"allowedCidr": "0.0.0.0/0",
"createDate": "Jun 7, 2017 9:20:02 PM",
"lastOpDate": "Jun 7, 2017 9:20:02 PM"
}
}
Name | Type | Description | Starting Value |
---|---|---|---|
error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 0.6 |
inventory | PortForwardingRuleInventory | See inventory. | 0.6 |
#error
Name | Type | Description | Starting Value |
---|---|---|---|
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 |
#inventory
Name | Type | Description | Starting Value |
---|---|---|---|
uuid | String | The resource UUID. | 0.6 |
name | String | The resource name. | 0.6 |
description | String | The detailed description of the resource. | 0.6 |
vipIp | String | The IP address of the VIP. | 0.6 |
guestIp | String | The IP address of the VM NIC. | 0.6 |
vipUuid | String | The VIP UUID. | 0.6 |
vipPortStart | Integer | The start port of the VIP. | 0.6 |
vipPortEnd | Integer | The end port of the VIP. | 0.6 |
privatePortStart | Integer | The start port of the guest IP address. | 0.6 |
privatePortEnd | Integer | The end port of the guest IP address. | 0.6 |
vmNicUuid | String | The VM NIC UUID. | 0.6 |
protocolType | String | The protocol type of the network traffic. | 0.6 |
state | String | The state of the rule. | 0.6 |
allowedCidr | String | The source CIDR. The port forwarding rule is only applied to the traffics of the source CIDR. | 0.6 |
createDate | Timestamp | The creation date. | 0.6 |
lastOpDate | Timestamp | The last operation date. | 0.6 |
SDK Sample
Java
SDK
DetachPortForwardingRuleAction action = new DetachPortForwardingRuleAction();
action.uuid = "307d4bf5fed34a859ade0af30c6720f9";
action.sessionId = "8c78997bf11344d79b49a2254ab88bb8";
DetachPortForwardingRuleAction.Result res = action.call();
Python
SDK
DetachPortForwardingRuleAction action = DetachPortForwardingRuleAction()
action.uuid = "c284fc4425ea4467b81dad21df147a8e"
action.sessionId = "545a07392cb2409e9888f8737da4ddfc"
DetachPortForwardingRuleAction.Result res = action.call()