Dynamic DNS

From Hostway API Documentation
(Difference between revisions)
Jump to: navigation, search
m (1 revision: Release 90)
 
(7 intermediate revisions by one user not shown)
Line 1: Line 1:
== Production API Environment ==
+
= Authentication =
'''The production hostname for the DDNS service is https://cprest-vip.hostway.com'''
+
* HTTP Basic Auth with DDNS user and passwd
  
== Authentication ==
 
* HTTP Basic Auth with DDNS username and password as described in [http://www.ietf.org/rfc/rfc2617.txt RFC 2617]
 
  
= DDNS API endpoints =
+
= API list =
 +
=='''PUT''' /ddns/clients/{client_key} ==
 +
Create a client
 +
 
 +
=== Request body ===
 +
<nowiki>
 +
{
 +
  "offline": false
 +
}</nowiki>
 +
 
 +
=== Response ===
 +
* 201(+Location)
 +
** Locaiton: http://{api_server}/ddns/clients/{client_key}
 +
* 401
 +
 
 
=='''GET''' /ddns/clients/{client_key} ==
 
=='''GET''' /ddns/clients/{client_key} ==
Returns client details
+
Get a client
  
 
=== Request body ===
 
=== Request body ===
No body
 
  
 
=== Response ===
 
=== Response ===
* 200 - OK
+
* 200
 
  <nowiki>
 
  <nowiki>
 
{  
 
{  
Line 22: Line 33:
 
   }
 
   }
 
}</nowiki>
 
}</nowiki>
* 401 - Unauthorized
+
* 404
* 404 - Not Found
+
* 403
 +
* 401
 +
 
  
 
=='''PUT''' /ddns/clients/{client_key} ==
 
=='''PUT''' /ddns/clients/{client_key} ==
Registers new client if the specified client key is not yet registered.
+
Update a client
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 ===
 
=== Request body ===
 
  <nowiki>
 
  <nowiki>
 
{  
 
{  
   "offline": false
+
   "offline": true
 
}</nowiki>
 
}</nowiki>
  
 
=== Response ===
 
=== Response ===
* 200 - Existing client status was successfully updated
+
* 200
** Response body:
+
 
  <nowiki>
 
  <nowiki>
 
{  
 
{  
Line 47: Line 57:
 
   }
 
   }
 
}</nowiki>
 
}</nowiki>
* 201 - New client was successfully registered
+
* 404
** Response Headers:
+
* 403
*** Location: http://{api_server}/ddns/clients/{client_key}
+
* 401
* 400 - Bad Request
+
* 401 - Unauthorized
+
  
=='''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 ==
 
=='''GET''' /ddns/clients/{client_key}/hosts ==
Returns list of all hosts associated with the client
+
Get all hosts
  
 
=== Request body ===
 
=== Request body ===
No body
 
 
 
=== Response ===
 
=== Response ===
* 200 - OK
+
* 200
** Response body:
+
 
  <nowiki>
 
  <nowiki>
 
{  
 
{  
Line 86: Line 81:
 
   ]
 
   ]
 
}</nowiki>
 
}</nowiki>
* 401 - Unauthorized
+
* 404
* 404 - Not Found
+
* 403
 +
* 401
  
=='''PUT''' /ddns/clients/{client_key}/hosts/{hostname} ==
+
 
Attach a host (it's actually "connecting a host to client", the host should exist before)
+
=='''POST''' /ddns/clients/{client_key}/action ==
 +
Do an action
  
 
=== Request body ===
 
=== Request body ===
 
  <nowiki>
 
  <nowiki>
 
{  
 
{  
 +
  "{action_name}": "{action_value}"
 
}</nowiki>
 
}</nowiki>
 +
==== Actions ====
 +
* "updateIP" action
 +
** "default" value - update ALL hosts ipaddr at once
  
 +
===  Response ===
 +
* 204
 +
* 404
 +
* 403
 +
* 401
 +
 +
 +
=='''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 ===
 
=== Response ===
* 201 - Host was successfully attached
+
* 201(+Location)
** Response headers:
+
** Location: http://{api_server}/ddns/clients/{client_key}/hosts/{hostname}
*** Location: http://{api_server}/ddns/clients/{client_key}/hosts/{hostname}
+
* 404 - if host doesn't exist in DB
* 401 - Unauthorized
+
* 403
* 404 - The host is not registered for DDNS
+
* 401
  
 
=='''DELETE''' /ddns/clients/{client_key}/hosts/{hostname} ==
 
=='''DELETE''' /ddns/clients/{client_key}/hosts/{hostname} ==
Line 108: Line 119:
  
 
=== Request body ===
 
=== Request body ===
No body
 
  
 
=== Response ===
 
=== Response ===
* 204 - Successfully detached
+
* 204
* 401 - Unauthorized
+
* 404
* 404 - Not Found
+
* 403
 +
* 401
  
=='''POST''' /ddns/clients/{client_key}/action ==
 
Perform an action
 
  
=== Request body ===
+
=='''DELETE''' /ddns/clients/{client_key} ==
<nowiki>
+
Delete a client
{
+
  "{action_name}": "{action_value}"
+
}</nowiki>
+
==== 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 ===
 
=== Request body ===
<nowiki>
 
{
 
  "updateIP": "default"
 
}</nowiki>
 
  
 
=== Response ===
 
=== Response ===
* 204 - Success
+
* 204
* 401 - Unauthorized
+
* 404
* 404 - Not Found
+
* 403
 
+
* 401
[[Category:API]]
+
 
+
<!--  THIS CODE ENABLES DISQUS COMMENTS ON THE PAGE - DELETE TO DISABLE COMMENTING-->
+
 
+
{{#widget:DISQUS
+
|id=hostway
+
|uniqid={{PAGENAME}}
+
|url={{fullurl:{{PAGENAME}}}}
+
}}
+
  
<!--  ########################################################################### -->
+
[[Category:Hostway API]]
 +
[[Category:Dynamic DNS API]]

Latest revision as of 13:37, 31 January 2014

Contents

[edit] Authentication

  • HTTP Basic Auth with DDNS user and passwd


[edit] API list

[edit] PUT /ddns/clients/{client_key}

Create a client

[edit] Request body

{ 
  "offline": false 
}

[edit] Response

[edit] GET /ddns/clients/{client_key}

Get a client

[edit] Request body

[edit] Response

  • 200
{ 
  "offline": true
  "hosts": {
    "rel": "related",
    "href": "http://{api_server}/ddns/clients/{client_key}/hosts"
  }
}
  • 404
  • 403
  • 401


[edit] PUT /ddns/clients/{client_key}

Update a client

[edit] Request body

{ 
  "offline": true 
}

[edit] Response

  • 200
{ 
  "offline": false, 
  "hosts": {
    "href": "http://{api_server}/ddns/clients/{client_key}/hosts", 
    "rel": "related"
  }
}
  • 404
  • 403
  • 401


[edit] GET /ddns/clients/{client_key}/hosts

Get all hosts

[edit] Request body

[edit] Response

  • 200
{ 
  "hosts": [
    "hostname": "{hostname}"
    "ipAddress": "{ipaddr}"
    "links": [
      {
        "rel": "self",
        "href": "http://{api_server}/ddns/clients/{client_key}/hosts/{hostname}"
      }
    ]
  ]
}
  • 404
  • 403
  • 401


[edit] POST /ddns/clients/{client_key}/action

Do an action

[edit] Request body

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

[edit] Actions

  • "updateIP" action
    • "default" value - update ALL hosts ipaddr at once

[edit] Response

  • 204
  • 404
  • 403
  • 401


[edit] PUT /ddns/clients/{client_key}/hosts/{hostname}

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

[edit] Request body

[edit] Response

[edit] DELETE /ddns/clients/{client_key}/hosts/{hostname}

Detach a host

[edit] Request body

[edit] Response

  • 204
  • 404
  • 403
  • 401


[edit] DELETE /ddns/clients/{client_key}

Delete a client

[edit] Request body

[edit] Response

  • 204
  • 404
  • 403
  • 401
Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox