更新时间:2025-02-07 GMT+08:00
创建VPC
功能介绍
创建虚拟私有云。
请求参数
| 名称 | 是否必选 | 参数类型 | 说明 |
|---|---|---|---|
| name | 否 | String |
|
| description | 否 | String |
|
| cidr | 否 | String |
|
| enterprise_project_id | 否 | String |
说明: |
| tags | 否 | Array of Strings |
|
请求示例
- 创建一个vpc,命名为vpc,设置cidr为192.168.0.0/16。
POST https://{Endpoint}/v1/{project_id}/vpcs { "vpc": { "name": "vpc", "description": "test", "cidr": "192.168.0.0/16", "enterprise_project_id": "0aad99bc-f5f6-4f78-8404-c598d76b0ed2" } }
响应参数
| 名称 | 参数类型 | 说明 |
|---|---|---|
| id | String | uuid形式的一个资源标识。 |
| name | String |
|
| description | String |
|
| cidr | String |
|
| status | String |
|
| routes | Array of route objects |
|
| enterprise_project_id | String |
说明: |
| tenant_id | String |
|
| created_at | String |
|
| updated_at | String |
|
响应示例
{
"vpc":
{
"id": "99d9d709-8478-4b46-9f3f-2206b1023fd3",
"name": "vpc",
"description": "test",
"cidr": "192.168.0.0/16",
"status": "CREATING",
"enterprise_project_id": "0aad99bc-f5f6-4f78-8404-c598d76b0ed2",
"routes": [],
"tenant_id": "087679f0aa80d32a2f4ec0172f5e902b",
"created_at": "2022-12-15T02:25:11",
"updated_at": "2022-12-15T02:25:11"
}
} 状态码
请参见状态码。
错误码
请参见错误码。
父主题: VPC