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.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes AddAddressBook

The operation that you want to perform. Set the value to AddAddressBook.

Description String Yes sz-001

The description of the address book.

GroupName String Yes sz-001

The name of the address book.

GroupType String Yes ip

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
SourceIp String No 1.2.XX.XX

The source IP address of the request.

Lang String No zh

The natural language of the request and response. Valid values:

  • zh: Chinese
  • en: English
AddressList String No 1.2.XX.XX/32, 1.3.XX.XX/24

The addresses 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 this parameter.
  • If you set GroupType to ip, you must add IP addresses to the address book. Example: 1.2.XX.XX/32, 1.2.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: demo1.aliyun.com,demo2.aliyun.com
AutoAddTagEcs String No 1

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

  • 1: yes
  • 0: no
TagRelation String No and

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

  • and: 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 any of the specified tags can be added to the address book.
TagList.N.TagKey String No TXY

The key of ECS tag N that you want to match.

TagList.N.TagValue String No 1

The value of ECS tag N that you want to match.

All Alibaba Cloud API operations must include common request parameters. For more information about common request parameters, see Common parameters.

For more information about sample requests, see the "Examples" section of this topic.

Response parameters

Parameter Type Example Description
GroupUuid String f04ac7ce-628b-4cb7-be61-310222b718e8

The ID of the returned address book

RequestId String CBF1E9B7-D6A0-4E9E-AD3E-2B47E6C2837D

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/?Action=AddAddressBook
&Description=DEMO address book
&GroupName=demo_address_book
&GroupType=ip
&<Common request parameters>

Sample success responses

XML format

<AddAddressBookResponse>
  <RequestId>B2841452-CB8D-4F7D-B247-38E1CF7334F8</RequestId>
  <GroupUuid>0580bbd0-24cd-47ae-9e5a-f5a099251e32</GroupUuid>
</AddAddressBookResponse>

JSON format

{
    "RequestId":"B2841452-CB8D-4F7D-B247-38E1CF7334F8",
    "GroupUuid":"0580bbd0-24cd-47ae-9e5a-f5a099251e32"
}