Jump to: navigation, search

Difference between revisions of "Designate/Blueprints/ReverseFixedIP"

(API Details)
(List the Fixed IP PTR Records (GET))
 
(8 intermediate revisions by the same user not shown)
Line 25: Line 25:
 
! Verb !! Resource !! Description
 
! Verb !! Resource !! Description
 
|-
 
|-
| GET || /reverse/fixedips/{region}:{IP address} || Return the PTR record for the given IP address.
+
| GET || /reverse/fixedips || Return the list of PTR records for all fixed IP addresses.
 
|-
 
|-
| PATCH || /reverse/fixedips/{region}:{IP address} || Create or delete the PTR record for the given IP address.
+
| 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) ====
+
==== List the Fixed IP PTR Records (GET) ====
  
Return the PTR record for the given IP address.
+
Return the list of PTR record for all fixed IP addresses.
 +
 
 +
There is no request message body.
 +
 
 +
'''Response'''
 +
    {
 +
        “fixedips”: [
 +
            {
 +
                "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>"
 +
                }
 +
            },
 +
            {
 +
                "ptrdname": "server2.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>"
 +
                }
 +
            }
 +
        ],
 +
        "links": {
 +
            "self": "http://endpoint/v2/reverse/fixedips"
 +
        }
 +
    }
 +
 
 +
==== Get the Fixed IP PTR Record (GET) ====
 +
 
 +
Return the PTR record for the given fixed IP address.
  
 
There is no request message body.
 
There is no request message body.
Line 49: Line 84:
 
     }
 
     }
  
==== Create the PTR Record (PATCH) ====
+
==== Create the Fixed IP PTR Record (PATCH) ====
  
Create the PTR record for the given IP address.
+
Create the PTR record for the given fixed IP address.
  
 
'''Request'''
 
'''Request'''
Line 69: Line 104:
 
             "description": null,
 
             "description": null,
 
             "links": {
 
             "links": {
                 "self": "http://endpoint/v2/reverse/fixedips/<region>:<ip address>"
+
                 "self": "http://endpoint/v2/reverse/fixedips/<region>:<ipv4 or ipv6 compliant address>"
 
             }
 
             }
 
         }
 
         }
 
     }
 
     }
  
==== Delete the PTR Record (PATCH) ====
+
==== Delete the Fixed IP PTR Record (PATCH) ====
  
Delete the PTR record for the given IP address.
+
Delete the PTR record for the given fixed IP address.
  
 
'''Request'''
 
'''Request'''
Line 89: Line 124:
 
== Database Changes ==
 
== Database Changes ==
 
There are no changes to the database schema.
 
There are no changes to the database schema.
 
== 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?)
 
 
To determine which reverse domain the IP address is in, iterate over the domains in Designate until an appropriate match is found.
 

Latest revision as of 15:28, 13 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.

List the Fixed IP PTR Records (GET)

Return the list of PTR record for all fixed IP addresses.

There is no request message body.

Response

   {
       “fixedips”: [
           {
               "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>"
               }
           },
           {
               "ptrdname": "server2.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>"
               }
           }
       ],
       "links": {
           "self": "http://endpoint/v2/reverse/fixedips"
       }
   }

Get the Fixed IP PTR Record (GET)

Return the PTR record for the given fixed 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 Fixed IP PTR Record (PATCH)

Create the PTR record for the given fixed 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 Fixed IP PTR Record (PATCH)

Delete the PTR record for the given fixed IP address.

Request

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

The return body is empty.

Database Changes

There are no changes to the database schema.