Difference between revisions of "Designate/Blueprints/Reverse"
< Designate | Blueprints
Graham Hayes (talk | contribs) (→Overview) |
|||
(13 intermediate revisions by 3 users not shown) | |||
Line 3: | Line 3: | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
− | ! Gerrit Patch || [] | + | ! Gerrit Patch || [https://review.openstack.org/#/c/58316/] |
|- | |- | ||
− | ! Launchpad Blueprint || [https://blueprints.launchpad.net/designate/+spec/ | + | ! Launchpad Blueprint || [https://blueprints.launchpad.net/designate/+spec/floating-ip-ptrs] |
|} | |} | ||
Line 11: | Line 11: | ||
== API Resource - General == | == API Resource - General == | ||
− | One new general endpoint called "/reverse" will be created for the Designate REST API | + | One new general endpoint called "/reverse" will be created for the Designate REST API. |
== API Resource - Public / FloatingIPs == | == API Resource - Public / FloatingIPs == | ||
− | === API Details: | + | === API Details: Set / Unset / List === |
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
! Verb !! Resource !! Description | ! Verb !! Resource !! Description | ||
|- | |- | ||
− | | GET || /reverse/floatingips || Returns the list of | + | | GET || /reverse/floatingips || Returns the list of Floating IPs which are looked up in the users service catalog upon the request with or without PTR assigned. |
|- | |- | ||
− | | GET || /reverse/floatingips/{ | + | | GET || /reverse/floatingips/{region}:{floating ip uuid} || Returns the record for the given Floating IP. |
|- | |- | ||
− | | POST || /reverse || N/A | + | | POST || /reverse/floatingips || N/A || |
|- | |- | ||
− | | PUT || /reverse/floatingips/{ | + | | PUT || /reverse/floatingips/{region}:{floating ip uuid} || N/A |
|- | |- | ||
− | | | + | | PATCH || /reverse/floatingips/{region}:{floating ip uuid} || A PATCH on the given Floating IP to set or unset it. |
+ | |- | ||
+ | | DELETE || /reverse/floatingips/{region}:{floating ip uuid} || N/A | ||
|} | |} | ||
Line 35: | Line 37: | ||
==== Get PTR Records (GET) ==== | ==== Get PTR Records (GET) ==== | ||
− | + | List all Floating IPs which the user can assign a record to. | |
There is no request message body in either case. | There is no request message body in either case. | ||
Line 41: | Line 43: | ||
'''Response''' | '''Response''' | ||
{ | { | ||
− | + | “floatingips”: [ | |
{ | { | ||
− | “id”: " | + | “id”: "<uuid>", |
− | + | “ptrdname”: “server1.mydomain.com.”, | |
− | " | + | "address": "<insert ipv4 or ipv6 compliant address here>" |
− | + | "ttl": 3600, | |
− | |||
− | |||
"created_at": "2012-11-02T19:56:26.000000", | "created_at": "2012-11-02T19:56:26.000000", | ||
"updated_at": null | "updated_at": null | ||
“description”: 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”: " | + | “id”: "<uuid>", |
− | + | “ptrdname”: “server2.mydomain.com.”, | |
− | " | + | "address": "<insert ipv4 or ipv6 compliant address here>", |
− | + | "ttl": 3600, | |
− | |||
− | |||
"created_at": "2012-11-02T19:56:26.000000", | "created_at": "2012-11-02T19:56:26.000000", | ||
"updated_at": null | "updated_at": null | ||
“description”: 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" | ||
+ | } | ||
}, | }, | ||
] | ] | ||
} | } | ||
− | ==== Set a PTR for a FloatingIP ( | + | ==== Set a PTR for a FloatingIP (PATCH) ==== |
When creating a PTR, the caller must supply a name (Typically A or CNAME record). | When creating a PTR, the caller must supply a name (Typically A or CNAME record). | ||
'''Request''' | '''Request''' | ||
{ | { | ||
− | + | “floatingip”: { | |
− | “ptrdname”: “server.mydomain.com.” | + | “ptrdname”: “server.mydomain.com.”, |
− | |||
"ttl": 3600 | "ttl": 3600 | ||
} | } | ||
Line 81: | Line 88: | ||
'''Response''' | '''Response''' | ||
{ | { | ||
− | + | “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>"} | ||
} | } | ||
} | } | ||
− | ==== | + | ==== Unset a PTR for a address - PATCH ==== |
− | To unset a PTR for a address ID, a user does a | + | To unset a PTR for a address ID, a user does a PATCH on the Floating IP url with a null ptrdname like: |
+ | '''Request''' | ||
+ | {"floatingip": {"ptrdname": null}} | ||
+ | '''Response''' | ||
+ | |||
+ | == '''**Following is cut-and-paste gone bad :-). Should be fixed**''' == | ||
== Database Schema == | == Database Schema == | ||
− | + | We will extend Records with the following information | |
{| class="wikitable" | {| class="wikitable" | ||
Line 101: | Line 115: | ||
! Name!! Data Type !! Length !! Nullable!! Details | ! Name!! Data Type !! Length !! Nullable!! Details | ||
|- | |- | ||
− | | | + | | managed_resource_region || VARCHAR || 100 || True || The region where the resource lives |
|- | |- | ||
− | | | + | | managed_tenant_id || VARCHAR || 36 || True || Tenant ID owning the resource |
− | |||
− | |||
− | |||
− | |||
|} | |} |
Latest revision as of 18:29, 15 January 2014
Contents
Overview
Gerrit Patch | [1] |
---|---|
Launchpad Blueprint | [2] |
Provide a simple interface towards a entities PTR records based on allocated Floating IPs and in future Internal IPs.
API Resource - General
One new general endpoint called "/reverse" will be created for the Designate REST API.
API Resource - Public / FloatingIPs
API Details: Set / Unset / List
Verb | Resource | Description | |
---|---|---|---|
GET | /reverse/floatingips | Returns the list of Floating IPs which are looked up in the users service catalog upon the request with or without PTR assigned. | |
GET | /reverse/floatingips/{region}:{floating ip uuid} | Returns the record for the given Floating IP. | |
POST | /reverse/floatingips | N/A | |
PUT | /reverse/floatingips/{region}:{floating ip uuid} | N/A | |
PATCH | /reverse/floatingips/{region}:{floating ip uuid} | A PATCH on the given Floating IP to set or unset it. | |
DELETE | /reverse/floatingips/{region}:{floating ip uuid} | N/A |
Create a PTR (POST)
N/A
Get PTR Records (GET)
List all Floating IPs which the user can assign a record to.
There is no request message body in either case.
Response
{ “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" } }, ] }
Set a PTR for a FloatingIP (PATCH)
When creating a PTR, the caller must supply a name (Typically A or CNAME record).
Request
{ “floatingip”: { “ptrdname”: “server.mydomain.com.”, "ttl": 3600 } }
Response
{ “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>"} } }
Unset a PTR for a address - PATCH
To unset a PTR for a address ID, a user does a PATCH on the Floating IP url with a null ptrdname like: Request
{"floatingip": {"ptrdname": null}}
Response
**Following is cut-and-paste gone bad :-). Should be fixed**
Database Schema
We will extend Records with the following information
Name | Data Type | Length | Nullable | Details |
---|---|---|---|---|
managed_resource_region | VARCHAR | 100 | True | The region where the resource lives |
managed_tenant_id | VARCHAR | 36 | True | Tenant ID owning the resource |