Jump to: navigation, search

Difference between revisions of "Designate/Blueprints/ReverseFixedIP"

(Implementation Notes)
(Implementation Notes)
Line 98: Line 98:
 
== Implementation Notes ==
 
== Implementation Notes ==
  
The VM instance will be looked up via the IP address using the Nova API.  If the VM instance is found, the IP address is owned by the user's tenant making the call, so the PTR record can be managed.  If the VM instance is not found, an error will be thrown.  For deletion, the look up will be done using an elevated context.  In that case, no VM should be found for the deletion to occur.
+
For fixed IP PTR record get or creation, the VM instance will be looked up via the IP address in an elevated context using the Nova API.  If the VM instance is found, the tenant is compared to the calling user's tenant to authorize the operation.  If the 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.
  
 
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 in, iterate over the domains in Designate until an appropriate match is found.

Revision as of 23:01, 4 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/{IP address} Return the PTR record for the given IP address.
PATCH /reverse/fixedips/{IP address} Create or delete the PTR record for the given IP address.

Get the PTR Record (GET)

Return the PTR record for the given IP address.

There is no request message body.

Response

   {
       “fixedip”: {
           "id": "<uuid>",
           "ptrdname": "server.mydomain.com.",
           "address": "<ipv4 or ipv6 compliant address>",
           "ttl": 3600,
           "created_at": "2014-03-04T11:00:01.000000",
           "update_at": null,
           "description": null,
           "links": {
               "self": "http://endpoint/v2/reverse/fixedips/<ip 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”: {
           "id": "<uuid>",
           "ptrdname": "server.mydomain.com.",
           "address": "<ipv4 or ipv6 compliant address>",
           "ttl": 3600,
           "created_at": "2014-03-04T11:00:01.000000",
           "update_at": null,
           "description": null,
           "links": {
               "self": "http://endpoint/v2/reverse/fixedips/<ip 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

For fixed IP PTR record get or creation, the VM instance will be looked up via the IP address in an elevated context using the Nova API. If the VM instance is found, the tenant is compared to the calling user's tenant to authorize the operation. If the 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.

To determine which reverse domain the IP address is in, iterate over the domains in Designate until an appropriate match is found.