diff --git a/scs_api.server_public.md b/scs_api.server_public.md index fdeacb921c41369ce70bb9dbf42b7ddce91ced81..d4913f93923d4bcf6ab954b2f53d13c379af5606 100644 --- a/scs_api.server_public.md +++ b/scs_api.server_public.md @@ -1,3 +1,4 @@ + API Documentation ==================================================================================================================== @@ -6,7 +7,7 @@ Implements API for IT4I SCS Information System. There is a PyPI package which provides simple user-friendly shell interface to call API requests and display their respond. Package is available on -<a href="https://pypi.org/project/it4i.portal.clients" class="uri" class="reference external">https://pypi.org/project/it4i.portal.clients</a> +<a href="https://pypi.org/project/it4i.portal.clients" class="uri reference external">https://pypi.org/project/it4i.portal.clients</a> Limits are placed on the number of requests you may make to IT4I API. Rate limit can be changed without any warning at any time, but the @@ -14,18 +15,18 @@ default is 6 requests per minute. Exceeding the limit will lead to your ip address being temporarily blocked from making further requests. The block will automatically be lifted by waiting an hour. -- api revision: `32b7e093 / 2020-05-05 14:43:27 +0200` -- api version: `0.9-224-g32b7e09` -- apidoc building date: `2020-05-05 12:46:10 +0000` +- api revision: `dfac2aa3 / 2020-05-06 15:39:14 +0200` +- api version: `0.9-225-gdfac2aa` +- apidoc building date: `2020-05-06 14:12:31 +0000` Summary ------------------------------------------------------------------------------------- <table> <colgroup> -<col width="20%" /> -<col width="40%" /> -<col width="40%" /> +<col style="width: 20%" /> +<col style="width: 40%" /> +<col style="width: 40%" /> </colgroup> <thead> <tr class="header"> @@ -92,29 +93,6 @@ Terminal implementation is available at Request JSON Object: -- **login** (*string*) – account id -- **queue** (*string*) – queue id -- **pid** (*string*) – project id, not required if querying - projectless queue - -Status Codes: - -- <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1" class="reference external">200 OK</a> - – no error - -**Example request**: - - curl -i -H "Content-Type:application/json" -X POST \ - --data '{"pid":"DD-13-5","login":"johnsm","queue":"qfat"}' \ - https://scs.it4i.cz/api/v1/check-access - -**Example response**: - - HTTP/1.1 200 OK - Content-Type: application/json - - "OK Access granted for regular queue." - <a name="get--api-v1-dedicated-time-calendar" class="headerlink" title="Permalink to this definition"></a> **GET /api/v1/dedicated-time-calendar** @@ -131,41 +109,6 @@ Terminal implementation is available at Query Parameters: -- **all** – returns all dedicated times for all clusters -- **salomon** – returns all times just for salomon cluster -- **anselm** – returns all times just for anselm cluster -- **barbora** – returns all times just for barbora cluster -- **dgx** – returns all times just for dgx cluster -- **active** – returns dedicated times for all clusters which are now - active -- **planned** – returns dedicated times for all clusters which are now - active or scheduled in the future - -Status Codes: - -- <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1" class="reference external">200 OK</a> - – no error -- <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.6" class="reference external">405 Method Not Allowed</a> - – invalid requested query parameter - -**Example request**: - - curl -i https://scs.it4i.cz/api/v1/dedicated-time/all - -**Example response**: - - HTTP/1.1 200 OK - Content-Type: application/json - - [ - { - "cluster_type": "salomon", - "dateEfficiency": "2017-11-21 09:45:00", - "dateExpiration": "2017-11-21 23:59:00", - "updated_at": "2017-11-21 09:45:00" - } - ] - <a name="post--api-v1-fs-usage" class="headerlink" title="Permalink to this definition"></a> **POST /api/v1/fs-usage** @@ -176,41 +119,6 @@ Terminal implementation is available at Request JSON Object: -- **login** (*string*) – account id -- **it4ifreetoken** (*string*) – token -- **cluster** (*string*) – cluster id or ‘all’ - -Status Codes: - -- <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1" class="reference external">200 OK</a> - – no error -- <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.6" class="reference external">405 Method Not Allowed</a> - – invalid requested query parameter - -**Example request**: - - curl -i -H "Content-Type:application/json" -X POST \ - --data '{"login":"johnsm", "it4ifreetoken": "abc","cluster":"all"}' \ - https://scs.it4i.cz/api/v1/fs-usage - -**Example response**: - - HTTP/1.1 200 OK - Content-Type: application/json - - [ - { - "cluster": "anselm", - "fs": "/home", - "hard_quota_files": 500000, - "hard_quota_space": 250000000, - "ldapuser": "johnsm", - "updated_at": "2019-03-11 13:25:16", - "usage_files": 19, - "usage_space": 2620 - } - ] - <a name="post--api-v1-it4ifree-(login)" class="headerlink" title="Permalink to this definition"></a> **POST /api/v1/it4ifree/**(login) @@ -233,102 +141,6 @@ Terminal implementation is available at Request JSON Object: -- **login** (*string*) – account id -- **it4ifreetoken** (*string*) – token - -Response JSON Object: - -- **login** (*string*) – account id -- **pi\_login** (*string*) – PI account id -- **pid** (*string*) – project id -- **type** (*string*) – project type, S for standard, M-1, M-2, M-3, - M-4 for multiyear project in particular period -- **days\_left** (*string*) – days to the end of project, or inactive, - expired, forthcoming, upcoming, unlimited -- **free** (*int*) – free core-hours which can be still consumed -- **total** (*int*) – total core-hours assigned to the project -- **used** (*int*) – actual consumed core-hours -- **used\_with\_factor** (*int*) – consumed normalized core-hours -- **used\_by\_me** (*int*) – core-hours consumed by the account -- **used\_by\_me\_with\_factor** (*int*) – normalized core-hours - consumed by the account -- **corehours** (*int*) – core-hours consumed by the account -- **core\_hours\_with\_factor** (*int*) – normalized core-hours - consumed by the account - -Status Codes: - -- <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1" class="reference external">200 OK</a> - – no error -- <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.6" class="reference external">405 Method Not Allowed</a> - – token does not match - -**Example request**: - - curl -i -H "Content-Type:application/json" -X POST \ - --data '{"login":"johnsm", "it4ifreetoken": "abc"}' \ - https://scs.it4i.cz/api/v1/it4ifree/johnsm - -**Example response**: - - HTTP/1.1 200 OK - Content-Type: application/json - - { - "me": [ - { - "days_left": "---", - "free": 17124, - "login": "johnsm", - "pid": "DD-13-6", - "total": 100000, - "type": "S" - "used": 82876, - "used_by_me": 0, - "used_by_me_with_factor": 0, - "used_with_factor":82876 - }, - { - "days_left": "---", - "free": 0, - "login": "johnsm", - "pid": "DD-14-12", - "total": 1000, - "used": 8641, - "type": "S" - "used_by_me": 0, - "used_by_me_with_factor": 0, - "used_with_factor": 8641 - } - ], - "me_as_pi": [ - { - "core_hours": 82876, - "core_hours_with_factor": 82876, - "login":"abc", - "pi_login": "johnsm", - "pid": "DD-13-6", - "type": "S" - }, - { - "core_hours": 0, - "core_hours_with_factor": 0, - "login": "johnsm", - "pi_login": "johnsm", - "pid":"DD-13-6", - "type": "S" - }, - { - "core_hours": 0, - "core_hours_with_factor": 0, - "login": "johnsm", - "pi_login": "johnsm", - "pid":"DD-1-1", - "type": "M-1" - } - ] - } - <a name="get--api-v1-motd-(category)" class="headerlink" title="Permalink to this definition"></a> **GET /api/v1/motd/**(category) @@ -339,46 +151,6 @@ Terminal implementation is available at Query Parameters: -- **notice** – returns only notice messages -- **important** – returns only important messages -- **all** – returns all messages - -Status Codes: - -- <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1" class="reference external">200 OK</a> - – no error -- <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.6" class="reference external">405 Method Not Allowed</a> - – invalid requested query parameter - -**Example request**: - - curl -i https://scs.it4i.cz/api/v1/motd/notice - -**Example response**: - - HTTP/1.1 200 OK - Content-Type: application/json - - [ - { - "author": "svi47", - "category": "notice", - "created_at": "2017-10-12 11:44:51", - "dateEfficiency": "2017-10-12 11:41:00", - "dateExpiration": "2017-11-28 14:30:00", - "dateModification": "2017-10-12 13:44:51", - "deleted_at": null, - "id": 169, - "messageBody": "For more information about the course, - please visit its web page: https://goo.gl/cvFsFH", - "state": null, - "title": "Invitation to the Course Productivity Tools - for High Performance Computing (2017-11-27 to 2017-11-28)", - "typeMotd": null, - "updated_at": "2017-10-12 11:44:51" - } - ] - <a name="get--api-v1-ping" class="headerlink" title="Permalink to this definition"></a> **GET /api/v1/ping** @@ -386,53 +158,9 @@ A service for testing connection to API. Response JSON Object: -- **message** (*string*) – reply message ‘pong’ - -Status Codes: - -- <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1" class="reference external">200 OK</a> - – no error - -**Example request**: - - curl -i https://scs.it4i.cz/api/v1/ping - -**Example response**: - - HTTP/1.1 200 OK - Content-Type: application/json - - { - "message": "pong" - } - <a name="get--api-v1-version" class="headerlink" title="Permalink to this definition"></a> **GET /api/v1/version** Returns basic information about API. Response JSON Object: - -- **hostname** (*string*) – system hostname -- **revision** (*string*) – api revision / build time -- **version** (*string*) – api version - -Status Codes: - -- <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1" class="reference external">200 OK</a> - – no error - -**Example request**: - - curl -i https://scs.it4i.cz/api/v1/version - -**Example response**: - - HTTP/1.1 200 OK - Content-Type: application/json - - { - "hostname": "scs.it4i.cz", - "revision": "ceac8aa / 2017-11-01 12:25:27 +0100", - "version": "0.8.2-34-gceac8aa" - }