Dynamic DNS
(Difference between revisions)
Mike.robski (Talk | contribs) |
Mike.robski (Talk | contribs) |
||
Line 1: | Line 1: | ||
− | = | + | = SP-Staging Environment = |
− | ''' | + | '''FILL ME with spstaging env and how to test by CV''' |
− | + | ||
− | * HTTP Basic Auth with DDNS | + | = 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} == | ||
− | + | Get a client | |
=== Request body === | === Request body === | ||
− | |||
=== Response === | === Response === | ||
− | * 200 | + | * 200 |
<nowiki> | <nowiki> | ||
{ | { | ||
Line 21: | Line 37: | ||
} | } | ||
}</nowiki> | }</nowiki> | ||
− | * | + | * 404 |
− | * | + | * 403 |
+ | * 401 | ||
+ | |||
=='''PUT''' /ddns/clients/{client_key} == | =='''PUT''' /ddns/clients/{client_key} == | ||
− | + | Update a client | |
− | + | ||
− | + | ||
=== Request body === | === Request body === | ||
<nowiki> | <nowiki> | ||
{ | { | ||
− | "offline": | + | "offline": true |
}</nowiki> | }</nowiki> | ||
=== Response === | === Response === | ||
− | * 200 | + | * 200 |
− | + | ||
<nowiki> | <nowiki> | ||
{ | { | ||
Line 46: | Line 61: | ||
} | } | ||
}</nowiki> | }</nowiki> | ||
− | * | + | * 404 |
− | * | + | * 403 |
− | + | * 401 | |
− | + | ||
− | * 401 | + | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
=='''GET''' /ddns/clients/{client_key}/hosts == | =='''GET''' /ddns/clients/{client_key}/hosts == | ||
− | + | Get all hosts | |
=== Request body === | === Request body === | ||
− | |||
− | |||
=== Response === | === Response === | ||
− | * 200 | + | * 200 |
− | + | ||
<nowiki> | <nowiki> | ||
{ | { | ||
Line 85: | Line 85: | ||
] | ] | ||
}</nowiki> | }</nowiki> | ||
− | * | + | * 404 |
− | * | + | * 403 |
+ | * 401 | ||
− | ==''' | + | |
− | + | =='''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 | + | * 201(+Location) |
− | + | ** Location: http://{api_server}/ddns/clients/{client_key}/hosts/{hostname} | |
− | + | * 404 - if host doesn't exist in DB | |
− | * | + | * 403 |
− | * | + | * 401 |
=='''DELETE''' /ddns/clients/{client_key}/hosts/{hostname} == | =='''DELETE''' /ddns/clients/{client_key}/hosts/{hostname} == | ||
Line 107: | Line 123: | ||
=== Request body === | === Request body === | ||
− | |||
=== Response === | === Response === | ||
− | * 204 | + | * 204 |
− | * | + | * 404 |
− | * | + | * 403 |
+ | * 401 | ||
− | |||
− | |||
− | + | =='''DELETE''' /ddns/clients/{client_key} == | |
− | + | Delete a client | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | ==''' | + | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
=== Request body === | === Request body === | ||
− | |||
− | |||
− | |||
− | |||
=== Response === | === Response === | ||
− | * 204 | + | * 204 |
− | * | + | * 404 |
− | * | + | * 403 |
+ | * 401 | ||
[[Category:Hostway API]] | [[Category:Hostway API]] | ||
[[Category:Dynamic DNS API]] | [[Category:Dynamic DNS API]] | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Revision as of 09:53, 26 March 2013
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
- 201(+Location)
- 401
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
- 201(+Location)
- 404 - if host doesn't exist in DB
- 403
- 401
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