Slurm REST API
Slurm provides a
REST API
daemon named slurmrestd. This daemon is designed to allow clients to
communicate with Slurm via a REST API (in addition to the command line
interface (CLI) or C API).
Slurmは、slurmrestdという名前のREST APIデーモンを提供します。このデーモンは、クライアントがREST API(コマンドラインインターフェース(CLI)またはC APIに加えて)を介してSlurmと通信できるように設計されています。
Prerequisites
slurmrestd requires additional libraries for compilation:
slurmrestdはコンパイルのために追加のライブラリを必要とします:
Run modes
Slurmrestd currently supports two run modes: inet service mode and listening mode.Slurmrestdは現在、inetサービスモードとリスニングモードの2つの実行モードをサポートしています。
Inet Service Mode
The Slurmrestd daemon acts as an
Inet Service
treating STDIN and STDOUT as the client. This mode allows clients to use
inetd, xinetd, or systemd socket activated services and avoid the need to run a
daemon on the host at all times. This mode creates an instance for each client
and does not support reusing the same instance for different clients.
Slurmrestdデーモンは、STDINおよびSTDOUTをクライアントとして扱うInetサービスとして機能します。このモードでは、クライアントがinetd、xinetd、またはsystemdソケットによってアクティブ化されるサービスを使用でき、ホストでデーモンを常に実行する必要がありません。このモードでは、クライアントごとにインスタンスが作成され、異なるクライアントで同じインスタンスを再利用することはできません。
Listening Mode
The Slurmrestd daemon acts as a full UNIX service and continuously listens
for new TCP connections. Each connection is independently authenticated.
Slurmrestdデーモンは完全なUNIXサービスとして機能し、新しいTCP接続を継続的にリッスンします。各接続は個別に認証されます。
Configuration
slurmrestd can be configured either by environment variables or command line arguments. Please see the doc/man/man1/slurmrestd.1 man page for details.slurmrestdは、環境変数またはコマンドライン引数のいずれかで構成できます。詳細については、doc / man / man1 / slurmrestd.1のマニュアルページを参照してください。
IPv6 Support
Slurmrestd supports IPv6 clients. On dual stack systems,
it will likely provide the source IP as an
IPv6 IP for IPv4 clients
. Slurmrestd must still be able to talk to slurmctld and slurmdbd via
IPv4.
SlurmrestdはIPv6クライアントをサポートします。デュアルスタックシステムでは、ソースIPがIPv4クライアントのIPv6 IPとして提供される可能性があります。Slurmrestdは、IPv4を介してslurmctldおよびslurmdbdと通信できる必要があります。
OpenAPI Specification (OAS)
Slurmrestd is compliant with
OpenAPI 3.0.2
.
The OAS can be viewed at the following URLs:
SlurmrestdはOpenAPI 3.0.2に準拠しています。OASは、次のURLで表示できます。
- /openapi.json
- /openapi.yaml
- /openapi/v3
The OAS is designed to be the primary documentation for the request methods.
There are several third party tools that automatically generate documentation
against the OAS output listed by
openapi.tools.
OASは、リクエストメソッドの主要なドキュメントになるように設計されています。openapi.toolsによってリストされたOAS出力に対してドキュメントを自動的に生成するサードパーティツールがいくつかあります。
Security
The Slurm REST API is written to provide the necessary functionality for
clients to control Slurm using REST commands. It is not designed to be
directly internet facing. Only unencrypted and uncompressed HTTP
communications are supported. Slurmrestd also has no protection against man in
the middle or replay attacks. Slurmrestd should only be placed in a trusted
network that will communicate with a trusted client.
Slurm REST APIは、クライアントがRESTコマンドを使用してSlurmを制御するために必要な機能を提供するように作成されています。直接インターネットに接続するようには設計されていません。暗号化および圧縮されていないHTTP通信のみがサポートされます。Slurmrestdは、中間者またはリプレイ攻撃に対する防御もありません。Slurmrestdは、信頼できるクライアントと通信する信頼できるネットワークにのみ配置する必要があります。
JSON Web Token (JWT) Authentication
slurmrestd supports using JWT to authenticate users.
JWT can be used to authenticate user over REST protocol.
slurmrestdは、JWTを使用したユーザー認証をサポートしています。JWTを使用して、RESTプロトコルでユーザーを認証できます。
- User Name Header: X-SLURM-USER-NAME
- JWT Header: X-SLURM-USER-TOKEN
SlurmUserまたはrootは、指定されたユーザーのプロキシとして機能する代替ユーザー名を提供できます。JWT認証を使用している間、slurmrestdは一意の非特権ユーザーおよびグループとして実行する必要があります。ユーザーが独自のJWTトークンを提供できるようにするため、起動時にslurmrestdにSLURM_JWT環境変数を指定しないでください。
Local Authentication
slurmrestd supports using UNIX domain sockets to have the kernel
authenticate local users. slurmrestd must be run as SlurmUser or root to allow
multiple different users at the same time but it is not required if users wish to run
as only themselves.
Slurmrestd must be located in the Munge security domain in order to function
and communicate with Slurm in local authentication mode.
slurmrestdは、カーネルにローカルユーザーを認証させるUNIXドメインソケットの使用をサポートしています。slurmrestdは、複数の異なるユーザーを同時に許可するためにSlurmUserまたはrootとして実行する必要がありますが、ユーザーが自分だけで実行する場合は必要ありません。ローカル認証モードでSlurmを機能させて通信するには、SlurmrestdがMungeセキュリティドメインに配置されている必要があります。
Last modified 7 February 2020