Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scs-api-public
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
SCS
scs-api-public
Commits
044cd5fb
Commit
044cd5fb
authored
5 years ago
by
scs-ror
Browse files
Options
Downloads
Patches
Plain Diff
Version Wed 06 May 2020 02:13:34 PM UTC
parent
9a1a5b2e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scs_api.server_public.md
+8
-280
8 additions, 280 deletions
scs_api.server_public.md
with
8 additions
and
280 deletions
scs_api.server_public.md
+
8
−
280
View file @
044cd5fb
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:
`
32b7e09
3 / 2020-05-0
5
1
4:43:27
+0200`
-
api version:
`0.9-22
4
-g
32b7e09
`
-
apidoc building date:
`2020-05-0
5
1
2:46:10
+0000`
-
api revision:
`
dfac2aa
3 / 2020-05-0
6
1
5:39:14
+0200`
-
api version:
`0.9-22
5
-g
dfac2aa
`
-
apidoc building date:
`2020-05-0
6
1
4: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"
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment