Skip to main content
Resource Center/Network Service/Network Service Operations/Security Group Operations
PUTSecurity Group OperationsSince 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 security group UUID.

Body Fields

  • paramsObjectRequired

    Request body parameter object.

    • descriptionString

      Optional. The detailed description of the rule.

    • remoteSecurityGroupUuidString

      Optional. The remote security group UUID.

    • actionString

      Optional. The default action of the rule.

    • stateString

      Optional. The rule status.

    • priorityInteger

      Optional. The rule priority.

    • protocolString

      Optional. The protocol type.

    • srcIpRangeString

      Optional. The range of the source IP of the rule.

    • dstIpRangeString

      Optional. The range of the target IP of the rule.

    • dstPortRangeString

      Optional. The range of the target port of the rule.

  • systemTagsList

    Optional. The system tags.

  • userTagsList

    Optional. The user tags.

Responses

200 OK

On success, this API returns the following response structure.

  • successbooleanRequired

    操作是否成功。

  • 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.

  • inventorySecurityGroupInventoryRequired

    See inventory.

    • uuidStringRequired

      The resource UUID.

    • securityGroupUuidStringRequired

      The security group UUID.

    • typeStringRequired

      The traffic type.

    • ipVersionIntegerRequired

      The IP version.

    • protocolStringRequired

      The traffic protocol type.

    • stateStringRequired

      The rule state.

    • priorityIntegerRequired

      The rule priority.

    • descriptionStringRequired

      The description of the rule.

    • srcIpRangeStringRequired

      The range of the source IP of the rule.

    • dstIpRangeStringRequired

      The range of the target IP of the rule.

    • srcPortRangeStringRequired

      The range of the source port of the rule, which is not implemented in the current version.

    • dstPortRangeStringRequired

      The range of the target port of the rule.

    • actionStringRequired

      The default action of the rule.

    • remoteSecurityGroupUuidStringRequired

      远程安全组UUID。

    • allowedCidrStringRequired

      The allowed CIDR, which has different meanings according to different traffic types. If the traffic type is Ingress, the allowed CIDR is a source CIDR that is allowed to access VM NICs. If the traffic type is Egress, the allowed CIDR is a destination CIDR that is allowed to leave from VM NICs.

    • startPortIntegerRequired

      If the protocol is TCP or UDP, this parameter is the start port of the port range. If the protocol is ICMP, this parameter is the ICMP type.

    • endPortIntegerRequired

      If the protocol is TCP or UDP, this parameter is the end port of the port range. If the protocol is ICMP, this parameter is the ICMP type.

    • createDateTimestampRequired

      The creation date.

    • lastOpDateTimestampRequired

      The last operation date.

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 '{"params":{"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