Difference between revisions of "Designate/Blueprints/Reverse"
< Designate | Blueprints
(→Overview) |
|||
Line 12: | Line 12: | ||
== API Resource - General == | == API Resource - General == | ||
One new general endpoint called "/reverse" will be created for the Designate REST API. We will outline 2 different Sub-URLs. | 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 Resource - Public / FloatingIPs == | ||
Line 19: | Line 20: | ||
! Verb !! Resource !! Description | ! Verb !! Resource !! Description | ||
|- | |- | ||
− | | GET || / | + | | GET || /reverse/floatingips || Returns the list of PTR records for Floating IPs |
|- | |- | ||
− | | GET || / | + | | GET || /reverse/floatingips/{id} || Returns a specific PTR for the given Floating IP ID |
|- | |- | ||
− | | POST || / | + | | POST || /reverse || N/A |
|- | |- | ||
− | | PUT || | + | | PUT || /reverse/floatingips/{id || ip address?} || A PUT Create a PTR on the given ID / IP. |
|- | |- | ||
− | | DELETE || / | + | | DELETE || /reverse/floatingips/{id} || Delete (unset) the reverse record. No message body is expected in the request |
+ | |} | ||
+ | |||
+ | ==== Create a PTR (POST) ==== | ||
+ | N/A | ||
+ | |||
+ | ==== Get PTR Records (GET) ==== | ||
+ | When no id is specified all PTRs for allocated Floating IPs are returned. | ||
+ | |||
+ | There is no request message body in either case. | ||
+ | |||
+ | '''Response''' | ||
+ | { | ||
+ | “records”: [ | ||
+ | { | ||
+ | “id”: "2e32e609-3a4f-45ba-bdef-e50eacd345ad", | ||
+ | “ptr”: “server1.mydomain.com.”, | ||
+ | "managed_by": { | ||
+ | "service_id": "<uuid>", | ||
+ | "region": "<region>" | ||
+ | }, | ||
+ | "created_at": "2012-11-02T19:56:26.000000", | ||
+ | "updated_at": null | ||
+ | “description”: null | ||
+ | }, | ||
+ | { | ||
+ | “id”: "2e32e609-3a4f-45ba-bdef-e50eacd345ad", | ||
+ | “ptr”: “server2.mydomain.com.”, | ||
+ | "managed_by": { | ||
+ | "service_id": "<uuid>", | ||
+ | "region": "<region>" | ||
+ | }, | ||
+ | "created_at": "2012-11-02T19:56:26.000000", | ||
+ | "updated_at": null | ||
+ | “description”: null | ||
+ | }, | ||
+ | ] | ||
+ | } | ||
+ | |||
+ | ==== Set a PTR for a FloatingIP (PUT) ==== | ||
+ | When creating a PTR, the caller must supply a name (Typically A or CNAME record). | ||
+ | |||
+ | '''Request''' | ||
+ | { | ||
+ | “ptr”: { | ||
+ | “ptrdname”: “server.mydomain.com.” | ||
+ | "address": "<insert ipv4 or ipv6 compliant address here>", | ||
+ | "ttl": 3600 | ||
+ | } | ||
+ | } | ||
+ | |||
+ | '''Response''' | ||
+ | { | ||
+ | “record”: { | ||
+ | “id”: "<uuid>", | ||
+ | “ptrdname”: “server.mydomain.com.”, | ||
+ | "address" "15.15.15.15", | ||
+ | "ttl": 3600, | ||
+ | "created_at": "2012-11-02T19:56:26.000000", | ||
+ | "updated_at": null, | ||
+ | } | ||
+ | } | ||
+ | |||
+ | ==== Delete (Unset) a PTR for a address (DELETE) ==== | ||
+ | To unset a PTR for a address ID, a user does a request with the Floating IP ID. The request body is empty. The return body is empty. | ||
+ | |||
+ | == Database Schema == | ||
+ | A new table will be created in the Designate database: blacklist, which will store the blacklisted domain name, along with other data. | ||
+ | |||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | ! 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 | ||
|} | |} |
Revision as of 20:51, 18 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 PTR records for Floating IPs | |
GET | /reverse/floatingips/{id} | Returns a specific PTR for the given Floating IP ID | |
POST | /reverse | N/A | |
PUT | /reverse/floatingips/{id | ip address?} | A PUT Create a PTR on the given ID / IP. |
DELETE | /reverse/floatingips/{id} | Delete (unset) the reverse record. No message body is expected in the request |
Create a PTR (POST)
N/A
Get PTR Records (GET)
When no id is specified all PTRs for allocated Floating IPs are returned.
There is no request message body in either case.
Response
{ “records”: [ { “id”: "2e32e609-3a4f-45ba-bdef-e50eacd345ad", “ptr”: “server1.mydomain.com.”, "managed_by": { "service_id": "<uuid>", "region": "<region>" }, "created_at": "2012-11-02T19:56:26.000000", "updated_at": null “description”: null }, { “id”: "2e32e609-3a4f-45ba-bdef-e50eacd345ad", “ptr”: “server2.mydomain.com.”, "managed_by": { "service_id": "<uuid>", "region": "<region>" }, "created_at": "2012-11-02T19:56:26.000000", "updated_at": null “description”: null }, ] }
Set a PTR for a FloatingIP (PUT)
When creating a PTR, the caller must supply a name (Typically A or CNAME record).
Request
{ “ptr”: { “ptrdname”: “server.mydomain.com.” "address": "<insert ipv4 or ipv6 compliant address here>", "ttl": 3600 } }
Response
{ “record”: { “id”: "<uuid>", “ptrdname”: “server.mydomain.com.”, "address" "15.15.15.15", "ttl": 3600, "created_at": "2012-11-02T19:56:26.000000", "updated_at": null, } }
Delete (Unset) a PTR for a address (DELETE)
To unset a PTR for a address ID, a user does a request with the Floating IP ID. The request body is empty. The return body is empty.
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 |