Jump to: navigation, search

Difference between revisions of "Designate/Blueprints/ReverseFixedIP"

(Create the PTR Record (PATCH))
(Implementation Notes)
Line 94: Line 94:
 
== Implementation Notes ==
 
== Implementation Notes ==
  
For fixed IP PTR record get or creation, the host name will be looked up via the fixed IP address in an elevated context using the Nova API (v2/{tenant_id}/os-fixed-ips/{fixed_ip}.)  If the host name is found, the VM instance is looked up via the host name using the Nova API (/v2/{tenant_id}/servers/details?name={host_name}.)  The tenant is compared to the calling user's tenant to authorize the operation.  If the host name or VM instance is not found or the instance's tenant is not the calling user's tenant, an error will be thrown.  For fixed IP PTR record deletion, the look up will be done in an elevated context.  In that case, no VM should be found for the deletion to occur. (Is this a possible race condition?)
+
The Neutron API list ports call will be used.
  
To determine which reverse domain the IP address is in, iterate over the domains in Designate until an appropriate match is found.
+
To determine which reverse domain the IP address is use the same logic as floating IPs.

Revision as of 17:45, 12 March 2014

Overview

Gerrit Patch []
Launchpad Blueprint [1]

Summary

This blueprint proposes to provide an interface for a VM instance's PTR record based on the allocated Fixed IP.

This blueprint is based on the blueprint for floating IP PTR records:

   Designate/Blueprints/Reverse

API Resource - Private / Fixed IPs

Using the general endpoint call "/reverse" add the fixed IP resource called "fixedips".

API Details

Verb Resource Description
GET /reverse/fixedips Return the list of PTR records for all fixed IP addresses.
GET /reverse/fixedips/{region}:{IP address} Return the PTR record for the given fixed IP address.
PATCH /reverse/fixedips/{region}:{IP address} Create or delete the PTR record for the given fixed IP address.

Get the PTR Record (GET)

Return the PTR record for the given IP address.

There is no request message body.

Response

   {
       “fixedip”: {
           "ptrdname": "server.mydomain.com.",
           "address": "<region>:<ipv4 or ipv6 compliant address>",
           "ttl": 3600,
           "description": null,
           "links": {
               "self": "http://endpoint/v2/reverse/fixedips/<region>:<ipv4 or ipv6 compliant address>"
           }
       }
   }

Create the PTR Record (PATCH)

Create the PTR record for the given IP address.

Request

   {
       "fixedip": {
           "ptrdname": "server.mydomain.com.",
           "ttl": 3600
       }
   }

Response

   {
       “fixedip”: {
           "ptrdname": "server.mydomain.com.",
           "address": "<region>:<ipv4 or ipv6 compliant address>",
           "ttl": 3600,
           "description": null,
           "links": {
               "self": "http://endpoint/v2/reverse/fixedips/<region>:<ipv4 or ipv6 compliant address>"
           }
       }
   }

Delete the PTR Record (PATCH)

Delete the PTR record for the given IP address.

Request

   {
       "fixedip": {
           "ptrdname": null
       }
   }

The return body is empty.

Database Changes

There are no changes to the database schema.

Implementation Notes

The Neutron API list ports call will be used.

To determine which reverse domain the IP address is use the same logic as floating IPs.