CreatePortForwardingRule
CreatePortForwardingRule
Execution Availability
Try It Out
Submit a mock request using the current auth context and example-driven inputs.
Request Inputs
Body Fields
paramsObjectRequiredRequest body parameter object.
vipUuidStringRequiredThe VIP UUID.
vipPortStartIntegerRequiredThe VIP start port.
vipPortEndIntegerOptional. The VIP end port. If not specified, the value of vipPortStart will be used by default.
privatePortStartIntegerOptional. The start port of the guest IP address (the IP address of the VM NIC). If not specified, the value of vipPortStart will be used by default.
privatePortEndIntegerOptional. The end port of the guest IP address (the IP address of the VM NIC). If not specified, the value of vipPortEnd will be used by default.
protocolTypeStringRequiredThe protocol type of the network traffic.
vmNicUuidStringOptional. The VM NIC UUID.
allowedCidrStringOptional. The source CIDR. The port forwarding rule is only applied to the traffics of the source CIDR. If not specified, 0.0.0.0/0 will be used by default.
nameStringRequiredThe resource name.
descriptionStringOptional. The detailed description of the resource.
resourceUuidStringOptional. The resource UUID. If specified, the system will not allocate randomly a UUID to the resource.
systemTagsListOptional. The system tags.
userTagsListOptional. The user tags.
Responses
Endpoint
POST/zstack/v1/port-forwarding
/zstack/v1/port-forwarding
Request Example
curl -X POST 'http://{host}/zstack/v1/port-forwarding' -H 'Authorization: OAuth {sessionUuid}' -H 'Content-Type: application/json;charset=UTF-8' -d '{"params":{"vipUuid":"<vipUuid>","vipPortStart":1,"vipPortEnd":1,"privatePortStart":1,"privatePortEnd":1,"protocolType":"<protocolType>","vmNicUuid":"<vmNicUuid>","allowedCidr":"<allowedCidr>","name":"<name>","description":"<description>","resourceUuid":"<resourceUuid>"},"systemTags":["<systemTags>"],"userTags":["<userTags>"]}'
Response Example
200{ "inventory": { "uuid": "895a8ce93d274db78e2ef1462f8b8a29", "name": "TestAttachRule", "description": "test atatch rule", "vipIp": "192.168.0.187", "guestIp": "10.0.0.244", "vipUuid": "6151c96fd2ac4d6cbd8f8eedffc06de5", "vipPortStart": 33.0, "vipPortEnd": 33.0, "privatePortStart": 33.0, "privatePortEnd": 33.0, "vmNicUuid": "581ea3b08aef4096ac24e160f1ab0f8e", "protocolType": "TCP", "state": "Enabled", "allowedCidr": "0.0.0.0/0", "createDate": "Jun 7, 2017 9:20:10 PM", "lastOpDate": "Jun 7, 2017 9:20:10 PM" } }Change History
This API has no change history records yet.
