All Products
Search
Document Center

Cloud Firewall:AddAddressBook

Last Updated:Apr 24, 2024

Creates an address book for access control. Supported address book types are IP address books, Elastic Compute Service (ECS) tag-based address books, port address books, and domain address books. An ECS tag-based address book includes the public IP addresses of the ECS instances that have specific tags.

Operation description

You can call the AddAddressBook operation to create an address book for access control. The address book can be an IP address book, an ECS tag-based address book, a port address book, or a domain address book.

Limits

You can call this operation up to 10 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.

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
yundun-cloudfirewall:AddAddressBookWrite
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
SourceIpdeprecatedstringNo

The source IP address of the request.

192.0.XX.XX
LangstringNo

The language of the content within the response. Valid values:

  • zh (default): Chinese
  • en: English
zh
AddressListstringNo

The addresses that you want to add to the address book. Separate multiple addresses with commas (,).

Note If you set GroupType to ip, port, or domain, you must specify the AddressList parameter.
  • If you set GroupType to ip, you must add IP addresses to the address book. Example: 192.0.XX.XX/32, 192.0.XX.XX/24.
  • If you set GroupType to port, you must add port numbers or port ranges to the address book. Example: 80, 100/200.
  • If you set GroupType to domain, you must add domain names to the address book. Example: example.com, aliyundoc.com.
192.0.XX.XX/32, 192.0.XX.XX/24
DescriptionstringYes

The description of the address book.

sz-001
GroupNamestringYes

The name of the address book.

sz-001
GroupTypestringYes

The type of the address book. Valid values:

  • ip: IP address book
  • domain: domain address book
  • port: port address book
  • tag: ECS tag-based address book
ip
AutoAddTagEcsstringNo

Specifies whether to automatically add public IP addresses of ECS instances to the address book if the instances match the specified tags. Valid values:

  • 1: yes
  • 0 (default): no
1
TagRelationstringNo

The logical relation among the ECS tags that you want to match. Valid values:

  • and (default): Only the public IP addresses of ECS instances that match all the specified tags can be added to the address book.
  • or: The public IP addresses of ECS instances that match one of the specified tags can be added to the address book.
and
TagListobject []No

The ECS tags that you want to match.

TagValuestringNo

The value of the ECS tag.

1
TagKeystringNo

The key of the ECS tag.

TXY

All Alibaba Cloud API requests must include common request parameters. For more information about common request parameters, see Common request parameters. For more information about sample requests, see the "Examples" section of this topic.

Response parameters

ParameterTypeDescriptionExample
object
GroupUuidstring

The UUID of the returned address book.

f04ac7ce-628b-4cb7-be61-310222b7****
RequestIdstring

The request ID.

CBF1E9B7-D6A0-4E9E-AD3E-2B47E6C2****

Examples

Sample success responses

JSONformat

{
  "GroupUuid": "f04ac7ce-628b-4cb7-be61-310222b7****",
  "RequestId": "CBF1E9B7-D6A0-4E9E-AD3E-2B47E6C2****"
}

Error codes

HTTP status codeError codeError messageDescription
400ErrorParametersGroupTypeThe group type is invalid.The group type is invalid.
400ErrorParametersUidThe aliUid parameter is invalid.The aliUid parameter is invalid.
400ErrorParametersGroupAddressThe IP address of the address group is invalid.The IP address of the address group is invalid.
400ErrorDBSelectAn error occurred while querying database.An error occurred while querying database.
400ErrorAddressCountExceedThe maximum number of addresses is exceeded.The maximum number of address is exceeded.
400ErrorAddressGroupExistThe address group already exists.The address group already exists.
400ErrorParamDomainThe parameter Domain is invalid.The parameter Domain is invalid.
400ErrorUUIDNewThe UUID is invalid.The UUID is invalid.
400ErrorAddressGroupCountExceedThe maximum number of address group is exceeded.The maximum number of address group is exceeded.
400ErrorDBInsertAn error occurred while performing an insert operation in the database.An error occurred while performing an insert operation in the database.
400ErrorRecordLogAn error occurred while updating the operation log.An error occurred while updating the operation log.

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

Change history

Change timeSummary of changesOperation
No change history