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
473aa7c3
Commit
473aa7c3
authored
6 years ago
by
scs-ror
Browse files
Options
Downloads
Patches
Plain Diff
Version Fri Apr 26 08:16:17 UTC 2019
parents
No related branches found
No related tags found
No related merge requests found
Pipeline
#7647
failed
6 years ago
Stage: build
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scs_api.server_public.md
+407
-0
407 additions, 0 deletions
scs_api.server_public.md
with
407 additions
and
0 deletions
scs_api.server_public.md
0 → 100644
+
407
−
0
View file @
473aa7c3
API Documentation
====================================================================================================================
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>
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
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:
`cbf07b6f / 2019-04-26 10:13:19 +0200`
-
api version:
`0.9-168-gcbf07b6`
-
apidoc building date:
`2019-04-26 08:15:31 +0000`
Summary
-------------------------------------------------------------------------------------
<table>
<colgroup>
<col
width=
"20%"
/>
<col
width=
"40%"
/>
<col
width=
"40%"
/>
</colgroup>
<thead>
<tr
class=
"header"
>
<th>
Resource
</th>
<th>
Operation
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr
class=
"odd"
>
<td>
check-access
</td>
<td><a
href=
"#post--api-v1-check-access"
class=
"reference external"
>
POST /api/v1/check-access
</a></td>
<td>
Access check to queue
</td>
</tr>
<tr
class=
"even"
>
<td>
dedicated-time
</td>
<td><a
href=
"#get--api-v1-dedicated-time-(cluster_type)"
class=
"reference external"
>
GET /api/v1/dedicated-time/(cluster_type)
</a></td>
<td>
HPC dedicated time
</td>
</tr>
<tr
class=
"odd"
>
<td>
dedicated-time-calendar
</td>
<td><a
href=
"#get--api-v1-dedicated-time-calendar"
class=
"reference external"
>
GET /api/v1/dedicated-time-calendar
</a></td>
<td>
dedicated time calendar
</td>
</tr>
<tr
class=
"even"
>
<td>
fs-usage
</td>
<td><a
href=
"#post--api-v1-fs-usage"
class=
"reference external"
>
POST /api/v1/fs-usage
</a></td>
<td>
Show filesystem usage
</td>
</tr>
<tr
class=
"odd"
>
<td>
it4ifree
</td>
<td><a
href=
"#post--api-v1-it4ifree-(login)"
class=
"reference external"
>
POST /api/v1/it4ifree/(login)
</a></td>
<td>
Free account resources
</td>
</tr>
<tr
class=
"even"
>
<td>
motd
</td>
<td><a
href=
"#get--api-v1-motd-(category)"
class=
"reference external"
>
GET /api/v1/motd/(category)
</a></td>
<td>
SCS messages of the day
</td>
</tr>
<tr
class=
"odd"
>
<td>
ping
</td>
<td><a
href=
"#get--api-v1-ping"
class=
"reference external"
>
GET /api/v1/ping
</a></td>
<td>
Connection test
</td>
</tr>
<tr
class=
"even"
>
<td>
version
</td>
<td><a
href=
"#get--api-v1-version"
class=
"reference external"
>
GET /api/v1/version
</a></td>
<td>
API version
</td>
</tr>
</tbody>
</table>
API Details
---------------------------------------------------------------------------------------------
<a
name=
"post--api-v1-check-access"
class=
"headerlink"
title=
"Permalink to this definition"
></a>
**POST /api/v1/check-access**
A service to check if account and/or related project has the access to
specified queue.
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**
A service with public dedicated time calendar.
<a
name=
"get--api-v1-dedicated-time-(cluster_type)"
class=
"headerlink"
title=
"Permalink to this definition"
></a>
**GET /api/v1/dedicated-time/**
(cluster
\_
type)
Returns list of times dedicated for HPC maintainance. It is not possible
to use HPC services during maintainance.
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
-
**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**
A service to show filesystem usage.
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)
A service to check resources of the projects on which the account
participate. If the calculation run on 1 cpu core during 1 hour, it
consumes 1 core-hour from the project resources. However, some
calculations (or their placement) can be cheaper. Actual consumed
core-hours are reduced by a cheaping factor and then deduct from the
project resources. See
<a
href=
"https://docs.it4i.cz/general/resources-allocation-policy/#normalized-core-hours-nch"
class=
"reference external"
>
link
</a>
for more details about so-called normalized core-hours. The json
response contains two parts:
-
`me`
– data from projects, where the account has access
-
`me_as_pi`
– data from projects, where the account is PI (primary
investigator)
Request JSON Object:
-
**login**
(
*string*
) – account id
-
**it4ifreetoken**
(
*string*
) – token
Response JSON Object:
-
**login**
(
*string*
) – account id
-
**pid**
(
*string*
) – project id
-
**pi\_login**
(
*string*
) – account id which is PI
-
**days\_left**
(
*string*
) – days to the end of project,
`---`
if
project is inactive or not yet started
-
**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,
"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,
"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"
},
{
"core_hours": 0,
"core_hours_with_factor": 0,
"login": "johnsm",
"pi_login": "johnsm",
"pid":"DD-13-6"
}
]
}
<a
name=
"get--api-v1-motd-(category)"
class=
"headerlink"
title=
"Permalink to this definition"
></a>
**GET /api/v1/motd/**
(category)
Returns SCS messages of the day.
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**
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