创建地址组
功能介绍
创建地址组。
接口约束
当前每租户的地址组配额默认值为50。
URI
POST /v3/{project_id}/vpc/address-groups
| 参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
| project_id | 是 | String | 项目ID。 获取方式请参见获取项目ID。 |
请求参数
| 参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
| dry_run | 否 | Boolean |
|
| address_group | 是 | CreateAddressGroupOption object | 创建地址组的请求体。 |
| 参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
| name | 是 | String |
|
| description | 否 | String |
|
| ip_version | 是 | Integer |
|
| max_capacity | 否 | Integer |
|
| ip_set | 否 | Array of strings |
|
| ip_extra_set | 否 | Array of IpExtraSetOption objects |
|
响应参数
状态码:201
| 参数 | 参数类型 | 描述 |
|---|---|---|
| request_id | String | 请求ID。 |
| address_group | AddressGroup object | 创建地址组的响应体。 |
| 参数 | 参数类型 | 描述 |
|---|---|---|
| id | String |
|
| name | String |
|
| description | String |
|
| max_capacity | Integer |
|
| ip_set | Array of strings |
|
| ip_version | Integer |
|
| created_at | String |
|
| updated_at | String |
|
| tenant_id | String |
|
| enterprise_project_id | String |
最大长度:36 |
| tags | Array of ResourceTag objects |
|
| status | String |
|
| status_message | String |
|
| ip_extra_set | Array of IpExtraSetRespOption objects |
|
请求示例
-
创建地址组,命名为AutoTester746010.580123789,指定ip类型为IPv4,地址集包含:192.168.3.2、192.168.3.40、192.168.3.20-192.168.3.100、192.168.5.0/24。
POST https://{{endpoint}}/v3/b2782e6708b8475c993e6064bc456bf8/vpc/address-groups { "address_group" : { "ip_version" : 4, "name" : "AutoTester746010.580123789", "ip_set" : [ "192.168.3.2", "192.168.3.40", "192.168.3.20-192.168.3.100", "192.168.5.0/24" ], "description" : "test", "enterprise_project_id" : "0aad99bc-f5f6-4f78-8404-c598d76b0ed2", "max_capacity" : 20 } }
响应示例
状态码:201
POST操作正常返回,更多状态码请参见状态码。
{
"address_group" : {
"id" : "dd18a501-fcd5-4adc-acfe-b0e2384baf08",
"name" : "AutoTester746010.580123789",
"tenant_id" : "b2782e6708b8475c993e6064bc456bf8",
"ip_version" : 4,
"max_capacity" : 20,
"ip_set" : [ "192.168.5.0/24", "192.168.3.20-192.168.3.100", "192.168.3.40", "192.168.3.2" ],
"ip_extra_set" : [ {
"ip" : "192.168.5.0/24",
"remarks" : null
}, {
"ip" : "192.168.3.20-192.168.3.100",
"remarks" : null
}, {
"ip" : "192.168.3.40",
"remarks" : null
}, {
"ip" : "192.168.3.2",
"remarks" : null
} ],
"enterprise_project_id" : "0aad99bc-f5f6-4f78-8404-c598d76b0ed2",
"created_at" : "2019-06-28T02:06:38.000+00:00",
"updated_at" : "2019-06-28T02:06:38.000+00:00",
"description" : "test",
"status" : "NORMAL",
"status_message" : ""
},
"request_id" : "f568db7a-2675-4271-8747-3e3f1c6381ba"
} 状态码
| 状态码 | 描述 |
|---|---|
| 201 | POST操作正常返回,更多状态码请参见状态码。 |
错误码
请参见错误码。