Skip to main content
Resource Center/Network Service/Network Service Operations/Port Forwarding Operations
PUTPort Forwarding OperationsSince 0.6SynchronousAuth Required

ChangePortForwardingRuleState

ChangePortForwardingRuleState

Execution Availability

Try It Out

Submit a mock request using the current auth context and example-driven inputs.

Path Parameters

Request Inputs

Path Parameters

  • uuidStringRequired

    The resource UUID.

Body Fields

  • changeportforwardingrulestateObjectRequired

    changeportforwardingrulestate request body object.

    • stateEventStringRequired

      The state of the port forwarding rule.

  • systemTagsList

    Optional. The system tags.

  • userTagsList

    Optional. The user tags.

Responses

200 OK

On success, this API returns the following response structure.

  • errorErrorCodeRequired

    The error code. If not null, the operation fails, or vice versa. For more information, see error.

    • codeStringRequired

      The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001.

    • descriptionStringRequired

      The brief description of the error.

    • detailsStringRequired

      The details about the error.

    • elaborationStringRequired

      The reserved field. Default value: null.

    • opaqueLinkedHashMapRequired

      The reserved field. Default value: null.

    • causeErrorCodeRequired

      The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null.

  • inventoryPortForwardingRuleInventoryRequired

    See inventory.

    • uuidStringRequired

      The resource UUID.

    • nameStringRequired

      The resource name.

    • descriptionStringRequired

      The detailed description of the resource.

    • vipIpStringRequired

      The IP address of the VIP.

    • guestIpStringRequired

      The IP address of the VM NIC.

    • vipUuidStringRequired

      The VIP UUID.

    • vipPortStartIntegerRequired

      The start port of the VIP.

    • vipPortEndIntegerRequired

      The end port of the VIP.

    • privatePortStartIntegerRequired

      The start port of the guest IP address.

    • privatePortEndIntegerRequired

      The end port of the guest IP address.

    • vmNicUuidStringRequired

      The VM NIC UUID.

    • protocolTypeStringRequired

      The protocol type of the network traffic.

    • stateStringRequired

      The state of the rule.

    • allowedCidrStringRequired

      The source CIDR. The port forwarding rule is only applied to the traffics of the source CIDR.

    • createDateTimestampRequired

      The creation date.

    • lastOpDateTimestampRequired

      The last operation date.

Endpoint

PUT/zstack/v1/port-forwarding/{uuid}/actions

/zstack/v1/port-forwarding/{uuid}/actions

Operation ID

ChangePortForwardingRuleState

Permalink

Request Example

curl -X PUT 'http://{host}/zstack/v1/port-forwarding/{uuid}/actions' -H 'Authorization: OAuth {sessionUuid}' -H 'Content-Type: application/json;charset=UTF-8' -d '{"changeportforwardingrulestate":{"stateEvent":"<stateEvent>"},"systemTags":["<systemTags>"],"userTags":["<userTags>"]}'

Response Example

200
{ "inventory": { "uuid": "59d724e1f8e8417693fbc14d124ce801", "name": "TestAttachRule", "description": "test atatch rule", "vipIp": "192.168.0.187", "guestIp": "10.0.0.244", "vipUuid": "f9c5cbc8662d43408dc704003d4f70ad", "vipPortStart": 33.0, "vipPortEnd": 33.0, "privatePortStart": 33.0, "privatePortEnd": 33.0, "vmNicUuid": "1b41288698ac45149f352ab6c8de2531", "protocolType": "TCP", "state": "Enabled", "allowedCidr": "0.0.0.0/0", "createDate": "Jun 7, 2017 9:20:26 PM", "lastOpDate": "Jun 7, 2017 9:20:26 PM" } }

Change History

This API has no change history records yet.

View all change history