Designate/蓝图/反向
目录
概述
| Gerrit补丁 | [1] |
|---|---|
| Launchpad蓝图 | [2] |
为基于分配的浮动 IP,以及未来内部 IP 的 PTR 记录实体提供一个简单的接口。
API 资源 - 通用
将在 Designate REST API 中创建一个名为 "/reverse" 的新的通用端点。
API 资源 - 公共 / 浮动 IP
API 细节:设置 / 取消设置 / 列出
| 动词 | 资源 | 描述 | |
|---|---|---|---|
| GET | /reverse/floatingips | 返回在请求时,无论是否分配了 PTR,都从用户的服务目录中查找的浮动 IP 列表。 | |
| GET | /reverse/floatingips/{region}:{floating ip uuid} | 返回给定浮动 IP 的记录。 | |
| POST | /reverse/floatingips | 不适用 | |
| PUT | /reverse/floatingips/{region}:{floating ip uuid} | 不适用 | |
| PATCH | /reverse/floatingips/{region}:{floating ip uuid} | 对给定的浮动 IP 进行 PATCH 以设置或取消设置它。 | |
| DELETE | /reverse/floatingips/{region}:{floating ip uuid} | 不适用 |
创建 PTR (POST)
不适用
获取 PTR 记录 (GET)
列出用户可以分配记录的所有浮动 IP。
两种情况下都没有请求消息体。
响应
{
“floatingips”: [
{
“id”: "<uuid>",
“ptrdname”: “server1.mydomain.com.”,
"address": "<insert ipv4 or ipv6 compliant address here>"
"ttl": 3600,
"created_at": "2012-11-02T19:56:26.000000",
"updated_at": null
“description”: null
"links": {
"self": "http://endpoint/v2/reverse/floatingips/<region>:<uuid>",
"next": "https://endpoint/v2/reverse/floatingips?marker=<region>:<uuid>&limit=2",
"previous": "https://endpoint/v2/reverse/floatingips?marker=<region>:<uuid>&limit=2"
}
},
{
“id”: "<uuid>",
“ptrdname”: “server2.mydomain.com.”,
"address": "<insert ipv4 or ipv6 compliant address here>",
"ttl": 3600,
"created_at": "2012-11-02T19:56:26.000000",
"updated_at": null
“description”: null
"links": {
"self": "http://endpoint/v2/reverse/floatingips/<region>:<uuid>",
"next": "https://endpoint/v2/reverse/floatingips?marker=<region>:<uuid>&limit=2",
"previous": "https://endpoint/v2/reverse/floatingips?marker=<region>:<uuid>&limit=2"
}
},
]
}
为浮动 IP 设置 PTR (PATCH)
创建 PTR 时,调用者必须提供一个名称(通常是 A 或 CNAME 记录)。
请求
{
“floatingip”: {
“ptrdname”: “server.mydomain.com.”,
"ttl": 3600
}
}
响应
{
“floatingip”: {
“id”: "2e32e609-3a4f-45ba-bdef-e50eacd345ad",
“ptrdname”: “server.mydomain.com.”,
"address": "<insert ipv4 or ipv6 compliant address here>"
"created_at": "2012-11-02T19:56:26.000000",
"ttl": 3600,
"updated_at": null
“description”: null,
"links": {"self": "http://endpoint/v2/reverse/floatingips/<region>:<uuid>"}
}
}
为地址取消设置 PTR - PATCH
要为地址 ID 取消设置 PTR,用户需要使用空 ptrdname 对浮动 IP url 进行 PATCH,例如:请求
{"floatingip": {"ptrdname": null}}
响应
**以下是复制粘贴出错 :-). 应该修复**
数据库模式
我们将使用以下信息扩展 Records
| 姓名 | 数据类型 | 长度 | 可为空 | 详情 |
|---|---|---|---|---|
| managed_resource_region | VARCHAR | 100 | 真 | 资源所在的区域 |
| managed_tenant_id | VARCHAR | 36 | 真 | 拥有该资源的租户 ID |