Difference between revisions of "Designate/Blueprints/Reverse"
< Designate | Blueprints
Line 20: | Line 20: | ||
! 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/{region}:{uuid} || Returns | + | | 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/{uuid} || A PUT | + | | PUT || /reverse/floatingips/{region}:{floating ip uuid} || A PUT on the given Floating IP to set or unset it. |
|- | |- | ||
− | | DELETE || /reverse/floatingips/{uuid} || | + | | DELETE || /reverse/floatingips/{region}:{floating ip uuid} || N/A |
|} | |} | ||
Line 43: | Line 43: | ||
“floatingips”: [ | “floatingips”: [ | ||
{ | { | ||
− | “id”: " | + | “id”: "<uuid>", |
“ptrdname”: “server1.mydomain.com.”, | “ptrdname”: “server1.mydomain.com.”, | ||
"address": "<insert ipv4 or ipv6 compliant address here>" | "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>"} | ||
}, | }, | ||
{ | { | ||
− | “id”: " | + | “id”: "<uuid>", |
“ptrdname”: “server2.mydomain.com.”, | “ptrdname”: “server2.mydomain.com.”, | ||
"address": "<insert ipv4 or ipv6 compliant address here>", | "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>"} | ||
}, | }, | ||
] | ] | ||
Line 76: | Line 80: | ||
{ | { | ||
“floatingip”: { | “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 - PUT ==== |
− | To unset a PTR for a address ID, a user does a | + | To unset a PTR for a address ID, a user does a PUT on the Floating IP url with a null ptrdname like: |
+ | '''Request''' | ||
+ | {"ptrdname": null} | ||
+ | '''Response''' | ||
+ | |||
== Database Schema == | == Database Schema == |
Revision as of 12:47, 19 November 2013
Contents
Overview
Gerrit Patch | [] |
---|---|
Launchpad Blueprint | [1] |
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. We will outline 2 different Sub-URLs.
API Resource - Public / FloatingIPs
API Details: Create / List / Delete Instance
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} | A PUT 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 PTRs for Floating IPs which have a record.
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>"} }, { “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>"} }, ] }
Set a PTR for a FloatingIP (PUT)
When creating a PTR, the caller must supply a name (Typically A or CNAME record).
Request
{ “floatingip”: { “ptrdname”: “server.mydomain.com.” "address": "<insert ipv4 or ipv6 compliant address here>", "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 - PUT
To unset a PTR for a address ID, a user does a PUT on the Floating IP url with a null ptrdname like: Request
{"ptrdname": null}
Response
Database Schema
A new table will be created in the Designate database: blacklist, which will store the blacklisted domain name, along with other data.
Name | Data Type | Length | Nullable | Details |
---|---|---|---|---|
id | VARCHAR | 36 | False | Primary Key, Generated UUID |
name | VARCHAR | 255 | False | Domain name to be blacklisted |
created_at | DATETIME | - | False | UTC time of creation |
description | VARCHAR | 160 | True | UTF-8 text field |