Adding an Address Group Member¶
Function¶
This API is used to add a member to an address group.
URI¶
POST /v1/{project_id}/address-items
Parameter | Mandatory | Type | Description |
---|---|---|---|
project_id | Yes | String | Project ID, which can be obtained by calling an API or from the console. For details, see Obtaining a Project ID. |
Parameter | Mandatory | Type | Description |
---|---|---|---|
enterprise_project_id | No | String | Enterprise project ID, which is the ID of a project planned based on organizations. You can obtain the enterprise project ID by referring to Obtaining an Enterprise Project ID. If the enterprise project function is not enabled, the value is 0. |
fw_instance_id | No | String | Firewall ID, which can be obtained by referring to Obtaining a Firewall ID. |
Request Parameters¶
Parameter | Mandatory | Type | Description |
---|---|---|---|
X-Auth-Token | Yes | String | User token. You can obtain the token by referring to Obtaining a User Token. |
Content-Type | Yes | String | Content type. It can only be set to application/json. |
Parameter | Mandatory | Type | Description |
---|---|---|---|
set_id | No | String | Address group ID, which can be obtained by calling the API for querying the address group list. Find the value in data.records.set_id (The period [.] is used to separate different levels of objects). |
address_items | No | Array of address_items objects | Address group member list. |
Parameter | Mandatory | Type | Description |
---|---|---|---|
address_type | No | Integer | Address type: 0 (IPv4), 1 (IPv6). |
address | Yes | String | ip |
description | No | String | Address group member description. |
Response Parameters¶
Status code: 200
Parameter | Type | Description |
---|---|---|
data | AddressItems object | Data returned after an address group member is added. |
Parameter | Type | Description |
---|---|---|
items | Array of AddressItemIdWithoutName objects | List of address group member IDs. |
covered_ip | Array of CoveredIPVO objects | List of covered IP addresses. |
Parameter | Type | Description |
---|---|---|
id | String | ID of an address group member. |
Parameter | Type | Description |
---|---|---|
ip | String | IP address |
covered_Ip | String | Cover an IP address. |
Status code: 400
Parameter | Type | Description |
---|---|---|
error_code | String | Error code. |
error_msg | String | Error description. |
Example Requests¶
Add an address group member whose IP address is 2.2.2.2 and name is ceshi to the group whose set_id is 8773c082-2a6c-4529-939a-edc28ef1a67c in project 9d80d070b6d44942af73c9c3d38e0429.
https://{Endpoint}/v1/9d80d070b6d44942af73c9c3d38e0429/address-items
{
"set_id" : "8773c082-2a6c-4529-939a-edc28ef1a67c",
"address_items" : [ {
"description" : "",
"address" : "2.2.2.2"
} ]
}
Example Responses¶
Status code: 200
Return value for adding an address group member.
{
"data" : {
"covered_ip" : [ ],
"items" : [ {
"id" : "65cb47fc-e666-4af4-8c2c-1fbd2f4b1eae"
} ]
}
}
Status code: 400
Bad Request
{
"error_code" : "CFW.00200001",
"error_msg" : "Empty parameter."
}
Status Codes¶
Status Code | Description |
---|---|
200 | Return value for adding an address group member. |
400 | Bad Request |
401 | Unauthorized |
403 | Forbidden |
404 | Not Found |
500 | Internal Server Error |
Error Codes¶
See Error Codes.