RevokeSecurityGroupRules

RevokeSecurityGroupRules

1. API Description

This API is used to remove security group rules.

Note

  • Status of security group should be Available.

  • You can use DescribeSecurityGroups to query the ID of the security group.

  • Editing is not supported for default security group.

2. Input Parameters

The following request parameter list only provides API request parameters.

Parameter NameRequiredTypeDescription

securityGroupId

Yes

String

Security group ID.

ruleInfos

Yes

Array of RuleInfo

Security group rules.

3. Output Parameters

Parameter NameTypeDescription

requestId

String

The unique request ID, which is returned for each request. RequestId is required for locating a problem.

4. Code Example

Remove security group rules.

POST /api/v2/vm HTTP/1.1
Host: console.zenlayer.com
Content-Type: application/json
X-ZC-Action: RevokeSecurityGroupRules
<Common Request Params>

Request:
{
  "securityGroupId": "your-security-group-id",
  "ruleInfos": [
    {
      "direction": "egress",
      "policy": "accept",
      "priority": 6,
      "ipProtocol": "tcp",
      "portRange": "22/22",
      "cidrIp": "0.0.0.0/0"
    }
  ]
}

Response:
{
  "requestId": "TB63CDCBC-6788-4E65-A1FA-E52B8C6FE349",
  "response": {
    "requestId": "TB63CDCBC-6788-4E65-A1FA-E52B8C6FE349"
  }
}

5. Developer Resources

Zenlayer Cloud API 2.0 integrates SDKs to make it easier for you to call APIs. More programming languages will be supported.

6. Error Codes

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.​

HTTP Status CodeError CodeDescription

404

INVALID_SECURITY_GROUP_NOT_FOUND

Security group does not exist.

403

OPERATION_DENIED_SECURITY_GROUP_STATUS_NOT_AVAILABLE

Status of security group should be Available.

404

INVALID_SECURITY_GROUP_RULE_NOT_FOUND

Security group rule does not exist.

403

OPERATION_DENIED_DEFAULT_SECURITY_GROUP_NOT_SUPPORT

Operations on the default security groups are not supported.

Last updated