Skip to main content
Network Management/Network Services/Security Group
PUTSecurity GroupSince 4.7.21SynchronousAuth Required

ChangeSecurityGroupRule

ChangeSecurityGroupRule

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 UUID of the security group rule, uniquely identifying the resource

Body Fields

  • descriptionString

    The rule description

  • remoteSecurityGroupUuidString

    The remote security group UUID for inter-group policies

  • actionString

    The default action of the rule

  • stateString

    The state of the rule

  • priorityInteger

    The priority of the rule

Responses

200 OK

On success, this API returns the following response structure.

  • successbooleanRequired

    操作是否成功。

  • errorErrorCodeRequired

    Error code. If not null, the operation failed. If null, the operation succeeded. See error

    • codeStringRequired

      Error code number, a globally unique identifier for the error, for example SYS.1000, HOST.1001

    • descriptionStringRequired

      Brief description of the error

    • detailsStringRequired

      Detailed error information

    • elaborationStringRequired

      Reserved field, defaults to null

    • opaqueLinkedHashMapRequired

      Reserved field, defaults to null

    • causeErrorCodeRequired

      Root error: the source error that caused the current error. If there is no original error, this field is null

  • inventorySecurityGroupInventoryRequired

    See inventory

    • uuidStringRequired

      The UUID of the resource, uniquely identifying the resource

    • securityGroupUuidStringRequired

      The security group UUID

    • typeStringRequired

      The traffic type

    • ipVersionIntegerRequired

      The IP version number

    • protocolStringRequired

      The traffic protocol type

    • stateStringRequired

      The availability state of the rule

    • priorityIntegerRequired

      The rule priority

    • descriptionStringRequired

      The rule description

    • srcIpRangeStringRequired

      The source IP range

    • dstIpRangeStringRequired

      The destination IP range

    • srcPortRangeStringRequired

      The source port range, not implemented in the current version

    • dstPortRangeStringRequired

      The destination port range

    • actionStringRequired

      The default action of the rule

    • remoteSecurityGroupUuidStringRequired

      远程安全组UUID。

    • allowedCidrStringRequired

      The allowed CIDR. The meaning of the allowed CIDR varies depending on the traffic type For Ingress traffic, the allowed CIDR is the source CIDR that is permitted to access the VM NIC For Egress traffic, the allowed CIDR is the destination CIDR that traffic from the VM NIC is permitted to reach

    • startPortIntegerRequired

      For TCP/UDP, it is the start port number of the port range For ICMP, it is the ICMP type

    • endPortIntegerRequired

      For TCP/UDP, it is the end port number of the port range For ICMP, it is the ICMP type

    • createDateTimestampRequired

      The creation time

    • lastOpDateTimestampRequired

      The last modification time

Endpoint

PUT/zstack/v1/security-groups/rules/{uuid}/actions

/zstack/v1/security-groups/rules/{uuid}/actions

Operation ID

ChangeSecurityGroupRule

Permalink

Request Example

curl -X PUT 'http://{host}/zstack/v1/security-groups/rules/{uuid}/actions' -H 'Authorization: OAuth {sessionUuid}' -H 'Content-Type: application/json;charset=UTF-8' -d '{"description":"<description>","remoteSecurityGroupUuid":"<remoteSecurityGroupUuid>","action":"<action>","state":"<state>","priority":1,"protocol":"<protocol>","srcIpRange":"<srcIpRange>","dstIpRange":"<dstIpRange>","dstPortRange":"<dstPortRange>","systemTags":["<systemTags>"],"userTags":["<userTags>"]}'

Response Example

200
{ "inventory": { "uuid": "68e4f4b48b51369c8c2ada5cb6c2c3c3", "securityGroupUuid": "c80ad90499213d3b9989afdbfe498390", "type": "ingress", "protocol": "tcp", "state": "enable", "srcIpRange": "10.10.10.1-10.10.10.10", "dstPortRange": "2001-2023", "action": "RETURN", "createDate": "Sep 15, 2023 9:57:59 AM", "lastOpDate": "Sep 15, 2023 9:57:59 AM" } }

Change History

This API has no change history records yet.

View all change history