Dynamic DNS

(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
== Production API Environment ==
+
= SP-Staging Environment =
'''The production hostname for the DDNS service is https://cprest-vip.hostway.com'''
+
'''FILL ME with spstaging env and how to test by CV'''
  
== Authentication ==
+
 
* HTTP Basic Auth with DDNS username and password as described in [http://www.ietf.org/rfc/rfc2617.txt RFC 2617]
+
= Authentication =
 +
* HTTP Basic Auth with DDNS user and passwd
 +
 
 +
 
 +
= 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 21: Line 37:
 
   }
 
   }
 
}</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 46: Line 61:
 
   }
 
   }
 
}</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 85: Line 85:
 
   ]
 
   ]
 
}</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 107: Line 123:
  
 
=== 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:Hostway API]]
 
[[Category:Hostway API]]
 
[[Category:Dynamic DNS API]]
 
[[Category:Dynamic DNS API]]
 
<!--  THIS CODE ENABLES DISQUS COMMENTS ON THE PAGE - DELETE TO DISABLE COMMENTING-->
 
 
{{#widget:DISQUS
 
|id=hostway
 
|uniqid={{PAGENAME}}
 
|url={{fullurl:{{PAGENAME}}}}
 
}}
 
 
<!--  ########################################################################### -->
 

Revision as of 10:53, 26 March 2013

Contents

SP-Staging Environment

FILL ME with spstaging env and how to test by CV


Authentication

  • HTTP Basic Auth with DDNS user and passwd


API list

PUT /ddns/clients/{client_key}

Create a client

Request body

{ 
  "offline": false 
}

Response

GET /ddns/clients/{client_key}

Get a client

Request body

Response

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


PUT /ddns/clients/{client_key}

Update a client

Request body

{ 
  "offline": true 
}

Response

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


GET /ddns/clients/{client_key}/hosts

Get all hosts

Request body

Response

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


POST /ddns/clients/{client_key}/action

Do an action

Request body

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

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

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

Detach a host

Request body

Response

  • 204
  • 404
  • 403
  • 401


DELETE /ddns/clients/{client_key}

Delete a client

Request body

Response

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