Dynamic DNS

(Difference between revisions)
Jump to: navigation, search
Line 5: Line 5:
 
* HTTP Basic Auth with DDNS username and password as described in [http://www.ietf.org/rfc/rfc2617.txt RFC 2617]
 
* HTTP Basic Auth with DDNS username and password as described in [http://www.ietf.org/rfc/rfc2617.txt RFC 2617]
  
= Dynamic DNS API endpoints =
 
 
=='''GET''' /ddns/clients/{client_key} ==
 
=='''GET''' /ddns/clients/{client_key} ==
 
Returns client details
 
Returns client details

Revision as of 15:41, 14 December 2012

Contents

Production API Environment

The production hostname for the DDNS service is https://cprest-vip.hostway.com

Authentication

  • HTTP Basic Auth with DDNS username and password as described in RFC 2617

GET /ddns/clients/{client_key}

Returns client details

Request body

No body

Response

  • 200 - OK
{ 
  "offline": true
  "hosts": {
    "rel": "related",
    "href": "http://{api_server}/ddns/clients/{client_key}/hosts"
  }
}
  • 401 - Unauthorized
  • 404 - Not Found

PUT /ddns/clients/{client_key}

Registers new client if the specified client key is not yet registered. When the offline status is set to True all associated hosts are set with the "offline" IP address. When the offline status is changed from True to False all associated hosts are set with the current IP address of the client as seen by the server.

Request body

{ 
  "offline": false
}

Response

  • 200 - Existing client status was successfully updated
    • Response body:
{ 
  "offline": false, 
  "hosts": {
    "href": "http://{api_server}/ddns/clients/{client_key}/hosts", 
    "rel": "related"
  }
}

DELETE /ddns/clients/{client_key}

Deletes a client registration

Request body

No body

Response

  • 204 - Client was successfully processed
  • 401 - Unauthorized
  • 404 - Not Found

GET /ddns/clients/{client_key}/hosts

Returns list of all hosts associated with the client

Request body

No body

Response

  • 200 - OK
    • Response body:
{ 
  "hosts": [
    "hostname": "{hostname}"
    "ipAddress": "{ipaddr}"
    "links": [
      {
        "rel": "self",
        "href": "http://{api_server}/ddns/clients/{client_key}/hosts/{hostname}"
      }
    ]
  ]
}
  • 401 - Unauthorized
  • 404 - Not Found

PUT /ddns/clients/{client_key}/hosts/{hostname}

Attach a host (it's actually "connecting a host to client", the host should exist before)

Request body

{ 
}

Response

DELETE /ddns/clients/{client_key}/hosts/{hostname}

Detach a host

Request body

No body

Response

  • 204 - Successfully detached
  • 401 - Unauthorized
  • 404 - Not Found

POST /ddns/clients/{client_key}/action

Perform an action

Request body

{ 
  "{action_name}": "{action_value}" 
}

Actions

  • "updateIP" action
    • "default" value - Update the IP address of all registered hosts with the current IP address of the client as seen by the server.

Response

  • 204 - Success
  • 401 - Unauthorized
  • 404 - Not Found

POST /ddns/clients/{client}/hosts/{hostname}/action

Actions performed when processing the call:

  • if {client} does not exists, register it
  • if {client}.offline = 1, set it to 0
  • if {hostname} is not found, return error
  • if {hostname} isn't attached to the client, attach it ({hostname} should be enabled in the user portal for DDNS)
  • update {hostname} DNS with the remote IP
  • update {client} current_ip with the remote IP

Request body

{
  "updateIP": "default"
}

Response

  • 204 - Success
  • 401 - Unauthorized
  • 404 - Not Found


blog comments powered by Disqus


Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox