designate/doc/source/rest.rst
TimSimmons 50d1b1553e Asynchronous Zone Export
Do the needful to move Zone Exports to an asynchronous resource in the
v2 API, as discussed at the Austin 2015 summe mid-cycle

* Make designate-zone-manager an RPC service, with a read-only connection
  to the database
* Add a 'location' column to the zone_tasks table that stores a location
  (swift, URI) that is used to determine where the export will be made
  available to the user
* Add all the infrastucture to make zone export resources live (objects,
  central, storage methods)
* Add a quota on the size of allowed synchronous exports
* Tests, docs

THIS DOES NOT IMPLEMENT
* Zone exports to Swift
* Debateable: See the note in zone_manager/service.py about how the configuration
  and determination of future swift exports will work.

ApiImpact
Blueprint: async-export
Change-Id: I1c168b10358164c3ca5be986b4d615df71062851
2015-08-28 16:45:10 -05:00

2.3 KiB

REST API Documentation

Intro

In the REST API examples, HTTP requests are defined as raw HTTP. For example:

POST /v2/pools HTTP/1.1          # The HTTP Method, Path and HTTP Version
Accept: application/json         # Headers
Content-Type: application/json

{                                # The rest is the body of request
     "name": "Example Pool",
     "ns_records": [
         {
           "hostname": "ns1.example.org.",
           "priority": 1
         }
     ]
}

With this info we can make this request using the cURL tool. We'll assume we are running Designate on localhost.

curl -X POST -i \
     -H 'Accept: application/json' \
     -H 'Content-Type: application/json' \
     -d '{"name": "ns1.example.org."}' \
     http://localhost:9001/v1/servers

The -i flag is used to dump the response headers as well as the response body.

The cURL tool is extremely robust. Please take a look at the cURL tutorial for more info.

HTTP Headers

These headers work for all APIs

  • X-Designate-Edit-Managed-Records
    • Allows admins (or users with the right role) to modify managed records (records created by designate-sink / reverse floating ip API)
  • X-Auth-All-Projects
    • Allows admins (or users with the right role) to view and edit zones / recordsets for all tenants
  • X-Auth-Sudo-Tenant-ID / X-Auth-Sudo-Project-ID
    • Allows admins (or users with the right role) to impersonate another tenant specified by this header

API Versions

The API has 2 versions - V1 and V2.

Note

V1 has been deprecated since the Kilo release.

V1 API

rest/v1/servers rest/v1/domains rest/v1/records rest/v1/diagnostics rest/v1/quotas rest/v1/reports rest/v1/sync

V2 API

rest/v2/collections rest/v2/zones rest/v2/recordsets rest/v2/tlds rest/v2/blacklists rest/v2/pools

Admin API

rest/admin/quotas