All Products
Search
Document Center

API Gateway:AddIpControlPolicyItem

Last Updated:Mar 01, 2024

Adds a policy to an existing ACL.

Operation description

When you call this operation, note that:

  • This operation is intended for API providers.
  • An added policy immediately takes effect on all APIs that are bound to the access control list (ACL).
  • A maximum of 100 policies can be added to an ACL.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
apigateway:AddIpControlPolicyItemWrite
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
IpControlIdstringYes

The ID of the ACL. The ID is unique.

7ea91319a34d48a09b5c9c871d9768b1
AppIdstringNo

The restriction policy on app IDs for a specific policy. You can restrict app IDs only for whitelists. The IpControlType values of whitelists are ALLOW.

  • You can add only one app ID restriction policy at a time.
  • If this parameter is empty, no restriction is imposed on the app IDs.
  • If this parameter is not empty, there is restriction not only on IP addresses, but also on apps.
  • Please note that if this parameter is not empty and the security authentication method of the API is No Authentication, all API calls are restricted.
  • If this parameter is not empty for a blacklist, API Gateway automatically skips this parameter and sets only restriction on IP addresses. The IpControlType value of a blacklist is REFUSE.
1111111
CidrIpstringYes

The IP addresses or CIDR blocks involved in the policy. Separate multiple IP addresses or CIDR blocks with semicolons (;). You can specify a maximum of 10 IP addresses or CIDR blocks.

113.125.1.101;101.11.1.1

Response parameters

ParameterTypeDescriptionExample
object
PolicyItemIdstring

The ID of the policy. The ID is unique.

P151617000829241
RequestIdstring

The ID of the request.

CEF72CEB-54B6-4AE8-B225-F876FF7BZ004

Examples

Sample success responses

JSONformat

{
  "PolicyItemId": "P151617000829241",
  "RequestId": "CEF72CEB-54B6-4AE8-B225-F876FF7BZ004"
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history