Permalink
Browse files

Document InitShutdown resource

  • Loading branch information...
1 parent 1f46951 commit 92fe55c1645730c5bd39795f2ec8353ff170ce24 @william-gr william-gr committed Sep 10, 2013
Showing with 155 additions and 0 deletions.
  1. +155 −0 docs/api/resources/system.rst
@@ -198,3 +198,158 @@ Delete resource
Content-Type: application/json
:statuscode 204: no error
+
+
+InitShutdown
+------------
+
+The InitShutdown resource represents Init and Shutdown scripts.
+
+List resource
++++++++++++++
+
+.. http:get:: /api/v1.0/system/initshutdown/
+
+ Returns a list of all init shutdown scripts.
+
+ **Example request**:
+
+ .. sourcecode:: http
+
+ GET /api/v1.0/system/initshutdown/ HTTP/1.1
+ Content-Type: application/json
+
+ **Example response**:
+
+ .. sourcecode:: http
+
+ HTTP/1.1 200 OK
+ Vary: Accept
+ Content-Type: application/json
+
+ [
+ {
+ "id": 1
+ "ini_type": "command",
+ "ini_command": "rm /mnt/tank/temp*",
+ "ini_when": "postinit"
+ }
+ ]
+
+ :query offset: offset number. default is 0
+ :query limit: limit number. default is 30
+ :resheader Content-Type: content type of the response
+ :statuscode 200: no error
+
+
+Create resource
++++++++++++++++
+
+.. http:post:: /api/v1.0/system/initshutdown/
+
+ Creates a new initshutdown and returns the new initshutdown object.
+
+ **Example request**:
+
+ .. sourcecode:: http
+
+ POST /api/v1.0/system/initshutdown/ HTTP/1.1
+ Content-Type: application/json
+
+ {
+ "ini_type": "command",
+ "ini_command": "rm /mnt/tank/temp*",
+ "ini_when": "postinit"
+ }
+
+ **Example response**:
+
+ .. sourcecode:: http
+
+ HTTP/1.1 201 Created
+ Vary: Accept
+ Content-Type: application/json
+
+ {
+ "id": 1,
+ "ini_command": "rm /mnt/tank/temp*",
+ "ini_script": null,
+ "ini_type": "command",
+ "ini_when": "postinit"
+ }
+
+ :json string ini_command: command to execute
+ :json string ini_script: path to script to execute
+ :json string ini_type: run a command ("command") or a script ("script")
+ :json string ini_when: preinit, postinit, shutdown
+ :reqheader Content-Type: the request content type
+ :resheader Content-Type: the response content type
+ :statuscode 201: no error
+
+
+Update resource
++++++++++++++++
+
+.. http:put:: /api/v1.0/system/initshutdown/(int:id)/
+
+ Update initshutdown `id`.
+
+ **Example request**:
+
+ .. sourcecode:: http
+
+ PUT /api/v1.0/system/initshutdown/1/ HTTP/1.1
+ Content-Type: application/json
+
+ {
+ "ini_when": "preinit"
+ }
+
+ **Example response**:
+
+ .. sourcecode:: http
+
+ HTTP/1.1 202 Accepted
+ Vary: Accept
+ Content-Type: application/json
+
+ {
+ "id": 1,
+ "ini_command": "rm /mnt/tank/temp*",
+ "ini_script": null,
+ "ini_type": "command",
+ "ini_when": "preinit"
+ }
+
+ :json string ini_command: command to execute
+ :json string ini_script: path to script to execute
+ :json string ini_type: run a command ("command") or a script ("script")
+ :json string ini_when: preinit, postinit, shutdown
+ :reqheader Content-Type: the request content type
+ :resheader Content-Type: the response content type
+ :statuscode 202: no error
+
+
+Delete resource
++++++++++++++++
+
+.. http:delete:: /api/v1.0/system/initshutdown/(int:id)/
+
+ Delete initshutdown `id`.
+
+ **Example request**:
+
+ .. sourcecode:: http
+
+ DELETE /api/v1.0/system/initshutdown/1/ HTTP/1.1
+ Content-Type: application/json
+
+ **Example response**:
+
+ .. sourcecode:: http
+
+ HTTP/1.1 204 No Response
+ Vary: Accept
+ Content-Type: application/json
+
+ :statuscode 204: no error

0 comments on commit 92fe55c

Please sign in to comment.