Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Document SMARTTest system resource

  • Loading branch information...
commit fbcea7358f3b4f07c7c0a7688d994c166c7e8875 1 parent 5745caa
@williambr williambr authored
Showing with 184 additions and 0 deletions.
  1. +184 −0 docs/api/resources/system.rst
View
184 docs/api/resources/system.rst
@@ -793,3 +793,187 @@ Delete resource
Content-Type: application/json
:statuscode 204: no error
+
+
+SMARTTest
+----------
+
+The SMARTTest resource represents schedule of SMART tests using smartd(8).
+
+List resource
++++++++++++++
+
+.. http:get:: /api/v1.0/system/smarttest/
+
+ Returns a list of all smarttests.
+
+ **Example request**:
+
+ .. sourcecode:: http
+
+ GET /api/v1.0/system/smarttest/ HTTP/1.1
+ Content-Type: application/json
+
+ **Example response**:
+
+ .. sourcecode:: http
+
+ HTTP/1.1 200 OK
+ Vary: Accept
+ Content-Type: application/json
+
+ [
+ {
+ "smarttest_dayweek": "*",
+ "smarttest_daymonth": "*",
+ "smarttest_disks": [
+ 2,
+ 3
+ ],
+ "smarttest_month": "*",
+ "smarttest_type": "L",
+ "id": 1,
+ "smarttest_hour": "*",
+ "smarttest_desc": ""
+ }
+ ]
+
+ :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/smarttest/
+
+ Creates a new smarttest and returns the new smarttest object.
+
+ **Example request**:
+
+ .. sourcecode:: http
+
+ POST /api/v1.0/system/smarttest/ HTTP/1.1
+ Content-Type: application/json
+
+ {
+ "smarttest_disks": [2, 3],
+ "smarttest_type": "L",
+ "smarttest_hour": "*",
+ "smarttest_daymonth": "*",
+ "smarttest_month": "*",
+ "smarttest_dayweek": "*",
+ }
+
+ **Example response**:
+
+ .. sourcecode:: http
+
+ HTTP/1.1 201 Created
+ Vary: Accept
+ Content-Type: application/json
+
+ {
+ "smarttest_dayweek": "*",
+ "smarttest_daymonth": "*",
+ "smarttest_disks": [
+ 2,
+ 3
+ ],
+ "smarttest_month": "*",
+ "smarttest_type": "L",
+ "id": 1,
+ "smarttest_hour": "*",
+ "smarttest_desc": ""
+ }
+
+ :json string smarttest_dayweek: days of the week to run
+ :json string smarttest_daymonth: days of the month to run
+ :json string smarttest_hour: hours to run
+ :json string smarttest_month: months to run
+ :json string smarttest_disks: list of ids of "storage/disk" resource
+ :json string smarttest_type: L (Long Self-Test), S (Short Self-Test), C (Conveyance Self-Test (ATA only)), O (Offline Immediate Test (ATA only))
+ :json string smarttest_desc: user description of the test
+ :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/smarttest/(int:id)/
+
+ Update smarttest `id`.
+
+ **Example request**:
+
+ .. sourcecode:: http
+
+ PUT /api/v1.0/system/smarttest/1/ HTTP/1.1
+ Content-Type: application/json
+
+ {
+ "smarttest_type": "S",
+ "smarttest_disks": [2, 3]
+ }
+
+ **Example response**:
+
+ .. sourcecode:: http
+
+ HTTP/1.1 202 Accepted
+ Vary: Accept
+ Content-Type: application/json
+
+ {
+ "smarttest_dayweek": "*",
+ "smarttest_daymonth": "*",
+ "smarttest_disks": [
+ 2,
+ 3
+ ],
+ "smarttest_month": "*",
+ "smarttest_type": "L",
+ "id": 1,
+ "smarttest_hour": "*",
+ "smarttest_desc": ""
+ }
+
+ :json string smarttest_dayweek: days of the week to run
+ :json string smarttest_daymonth: days of the month to run
+ :json string smarttest_hour: hours to run
+ :json string smarttest_month: months to run
+ :json string smarttest_disks: list of ids of "storage/disk" resource
+ :json string smarttest_type: L (Long Self-Test), S (Short Self-Test), C (Conveyance Self-Test (ATA only)), O (Offline Immediate Test (ATA only))
+ :json string smarttest_desc: user description of the test
+ :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/smarttest/(int:id)/
+
+ Delete smarttest `id`.
+
+ **Example request**:
+
+ .. sourcecode:: http
+
+ DELETE /api/v1.0/system/smarttest/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
Please sign in to comment.
Something went wrong with that request. Please try again.