Skip to content

mever-team/slurm-rest-py

Repository files navigation

slurm-rest

API to access and control Slurm

This Python package is automatically generated by the OpenAPI Generator project:

  • API version: Slurm-24.05.2&openapi/slurmdbd&openapi/v0.0.39&openapi/dbv0.0.39&openapi/slurmctld
  • Package version: 0.0.41.0
  • Generator version: 7.8.0
  • Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit https://www.schedmd.com/

Requirements.

Python 3.7+

Installation & Usage

pip install

If the python package is hosted on a repository, you can install directly using:

pip install git+https://github.com/mever-team/slurm-rest-py.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/mever-team/slurm-rest-py.git)

Then import the package:

import slurm_rest

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import slurm_rest

Tests

Execute pytest to run the tests.

Getting Started

Please follow the installation procedure and then run the following:

import slurm_rest
from slurm_rest.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = slurm_rest.Configuration(
    host = "http://localhost"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: user
configuration.api_key['user'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['user'] = 'Bearer'

# Configure Bearer authorization (JWT): bearerAuth
configuration = slurm_rest.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Configure API key authorization: token
configuration.api_key['token'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['token'] = 'Bearer'


# Enter a context with an instance of the API client
with slurm_rest.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = slurm_rest.SlurmApi(api_client)
    job_id = 'job_id_example' # str | Slurm Job ID
    signal = 'signal_example' # str | signal to send to job (optional)

    try:
        # cancel or signal job
        api_response = api_instance.slurm_v0039_cancel_job(job_id, signal=signal)
        print("The response of SlurmApi->slurm_v0039_cancel_job:\n")
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling SlurmApi->slurm_v0039_cancel_job: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to http://localhost

Class Method HTTP request Description
SlurmApi slurm_v0039_cancel_job DELETE /slurm/v0.0.39/job/{job_id} cancel or signal job
SlurmApi slurm_v0039_delete_node DELETE /slurm/v0.0.39/node/{node_name} delete node
SlurmApi slurm_v0039_diag GET /slurm/v0.0.39/diag get diagnostics
SlurmApi slurm_v0039_get_job GET /slurm/v0.0.39/job/{job_id} get job info
SlurmApi slurm_v0039_get_jobs GET /slurm/v0.0.39/jobs get list of jobs
SlurmApi slurm_v0039_get_node GET /slurm/v0.0.39/node/{node_name} get node info
SlurmApi slurm_v0039_get_nodes GET /slurm/v0.0.39/nodes get all node info
SlurmApi slurm_v0039_get_partition GET /slurm/v0.0.39/partition/{partition_name} get partition info
SlurmApi slurm_v0039_get_partitions GET /slurm/v0.0.39/partitions get all partition info
SlurmApi slurm_v0039_get_reservation GET /slurm/v0.0.39/reservation/{reservation_name} get reservation info
SlurmApi slurm_v0039_get_reservations GET /slurm/v0.0.39/reservations get all reservation info
SlurmApi slurm_v0039_ping GET /slurm/v0.0.39/ping ping test
SlurmApi slurm_v0039_slurmctld_get_licenses GET /slurm/v0.0.39/licenses get all Slurm tracked license info
SlurmApi slurm_v0039_submit_job POST /slurm/v0.0.39/job/submit submit new job
SlurmApi slurm_v0039_update_job POST /slurm/v0.0.39/job/{job_id} update job
SlurmApi slurm_v0039_update_node POST /slurm/v0.0.39/node/{node_name} update node properties
SlurmApi slurm_v0040_delete_job DELETE /slurm/v0.0.40/job/{job_id} cancel or signal job
SlurmApi slurm_v0040_delete_jobs DELETE /slurm/v0.0.40/jobs/ send signal to list of jobs
SlurmApi slurm_v0040_delete_node DELETE /slurm/v0.0.40/node/{node_name} delete node
SlurmApi slurm_v0040_get_diag GET /slurm/v0.0.40/diag/ get diagnostics
SlurmApi slurm_v0040_get_job GET /slurm/v0.0.40/job/{job_id} get job info
SlurmApi slurm_v0040_get_jobs GET /slurm/v0.0.40/jobs/ get list of jobs
SlurmApi slurm_v0040_get_jobs_state GET /slurm/v0.0.40/jobs/state/ get list of job states
SlurmApi slurm_v0040_get_licenses GET /slurm/v0.0.40/licenses/ get all Slurm tracked license info
SlurmApi slurm_v0040_get_node GET /slurm/v0.0.40/node/{node_name} get node info
SlurmApi slurm_v0040_get_nodes GET /slurm/v0.0.40/nodes/ get node(s) info
SlurmApi slurm_v0040_get_partition GET /slurm/v0.0.40/partition/{partition_name} get partition info
SlurmApi slurm_v0040_get_partitions GET /slurm/v0.0.40/partitions/ get all partition info
SlurmApi slurm_v0040_get_ping GET /slurm/v0.0.40/ping/ ping test
SlurmApi slurm_v0040_get_reconfigure GET /slurm/v0.0.40/reconfigure/ request slurmctld reconfigure
SlurmApi slurm_v0040_get_reservation GET /slurm/v0.0.40/reservation/{reservation_name} get reservation info
SlurmApi slurm_v0040_get_reservations GET /slurm/v0.0.40/reservations/ get all reservation info
SlurmApi slurm_v0040_get_shares GET /slurm/v0.0.40/shares get fairshare info
SlurmApi slurm_v0040_post_job POST /slurm/v0.0.40/job/{job_id} update job
SlurmApi slurm_v0040_post_job_submit POST /slurm/v0.0.40/job/submit submit new job
SlurmApi slurm_v0040_post_node POST /slurm/v0.0.40/node/{node_name} update node properties
SlurmApi slurm_v0041_delete_job DELETE /slurm/v0.0.41/job/{job_id} cancel or signal job
SlurmApi slurm_v0041_delete_jobs DELETE /slurm/v0.0.41/jobs/ send signal to list of jobs
SlurmApi slurm_v0041_delete_node DELETE /slurm/v0.0.41/node/{node_name} delete node
SlurmApi slurm_v0041_get_diag GET /slurm/v0.0.41/diag/ get diagnostics
SlurmApi slurm_v0041_get_job GET /slurm/v0.0.41/job/{job_id} get job info
SlurmApi slurm_v0041_get_jobs GET /slurm/v0.0.41/jobs/ get list of jobs
SlurmApi slurm_v0041_get_jobs_state GET /slurm/v0.0.41/jobs/state/ get list of job states
SlurmApi slurm_v0041_get_licenses GET /slurm/v0.0.41/licenses/ get all Slurm tracked license info
SlurmApi slurm_v0041_get_node GET /slurm/v0.0.41/node/{node_name} get node info
SlurmApi slurm_v0041_get_nodes GET /slurm/v0.0.41/nodes/ get node(s) info
SlurmApi slurm_v0041_get_partition GET /slurm/v0.0.41/partition/{partition_name} get partition info
SlurmApi slurm_v0041_get_partitions GET /slurm/v0.0.41/partitions/ get all partition info
SlurmApi slurm_v0041_get_ping GET /slurm/v0.0.41/ping/ ping test
SlurmApi slurm_v0041_get_reconfigure GET /slurm/v0.0.41/reconfigure/ request slurmctld reconfigure
SlurmApi slurm_v0041_get_reservation GET /slurm/v0.0.41/reservation/{reservation_name} get reservation info
SlurmApi slurm_v0041_get_reservations GET /slurm/v0.0.41/reservations/ get all reservation info
SlurmApi slurm_v0041_get_shares GET /slurm/v0.0.41/shares get fairshare info
SlurmApi slurm_v0041_post_job POST /slurm/v0.0.41/job/{job_id} update job
SlurmApi slurm_v0041_post_job_allocate POST /slurm/v0.0.41/job/allocate submit new job allocation without any steps that must be signaled to stop
SlurmApi slurm_v0041_post_job_submit POST /slurm/v0.0.41/job/submit submit new job
SlurmApi slurm_v0041_post_node POST /slurm/v0.0.41/node/{node_name} update node properties
SlurmApi slurmdb_v0039_add_clusters POST /slurmdb/v0.0.39/clusters Add clusters
SlurmApi slurmdb_v0039_add_wckeys POST /slurmdb/v0.0.39/wckeys Add wckeys
SlurmApi slurmdb_v0039_delete_account DELETE /slurmdb/v0.0.39/account/{account_name} Delete account
SlurmApi slurmdb_v0039_delete_association DELETE /slurmdb/v0.0.39/association Delete association
SlurmApi slurmdb_v0039_delete_associations DELETE /slurmdb/v0.0.39/associations Delete associations
SlurmApi slurmdb_v0039_delete_cluster DELETE /slurmdb/v0.0.39/cluster/{cluster_name} Delete cluster
SlurmApi slurmdb_v0039_delete_qos DELETE /slurmdb/v0.0.39/qos/{qos_name} Delete QOS
SlurmApi slurmdb_v0039_delete_user DELETE /slurmdb/v0.0.39/user/{user_name} Delete user
SlurmApi slurmdb_v0039_delete_wckey DELETE /slurmdb/v0.0.39/wckey/{wckey} Delete wckey
SlurmApi slurmdb_v0039_diag GET /slurmdb/v0.0.39/diag Get slurmdb diagnostics
SlurmApi slurmdb_v0039_get_account GET /slurmdb/v0.0.39/account/{account_name} Get account info
SlurmApi slurmdb_v0039_get_accounts GET /slurmdb/v0.0.39/accounts Get account list
SlurmApi slurmdb_v0039_get_association GET /slurmdb/v0.0.39/association Get association info
SlurmApi slurmdb_v0039_get_associations GET /slurmdb/v0.0.39/associations Get association list
SlurmApi slurmdb_v0039_get_cluster GET /slurmdb/v0.0.39/cluster/{cluster_name} Get cluster info
SlurmApi slurmdb_v0039_get_clusters GET /slurmdb/v0.0.39/clusters Get cluster list
SlurmApi slurmdb_v0039_get_config GET /slurmdb/v0.0.39/config Dump all configuration information
SlurmApi slurmdb_v0039_get_job GET /slurmdb/v0.0.39/job/{job_id} Get job info
SlurmApi slurmdb_v0039_get_jobs GET /slurmdb/v0.0.39/jobs Get job list
SlurmApi slurmdb_v0039_get_qos GET /slurmdb/v0.0.39/qos Get QOS list
SlurmApi slurmdb_v0039_get_single_qos GET /slurmdb/v0.0.39/qos/{qos_name} Get QOS info
SlurmApi slurmdb_v0039_get_tres GET /slurmdb/v0.0.39/tres Get TRES info
SlurmApi slurmdb_v0039_get_user GET /slurmdb/v0.0.39/user/{user_name} Get user info
SlurmApi slurmdb_v0039_get_users GET /slurmdb/v0.0.39/users Get user list
SlurmApi slurmdb_v0039_get_wckey GET /slurmdb/v0.0.39/wckey/{wckey} Get wckey info
SlurmApi slurmdb_v0039_get_wckeys GET /slurmdb/v0.0.39/wckeys Get wckey list
SlurmApi slurmdb_v0039_set_config POST /slurmdb/v0.0.39/config Load all configuration information
SlurmApi slurmdb_v0039_update_accounts POST /slurmdb/v0.0.39/accounts Update accounts
SlurmApi slurmdb_v0039_update_associations POST /slurmdb/v0.0.39/associations Set associations info
SlurmApi slurmdb_v0039_update_qos POST /slurmdb/v0.0.39/qos Set QOS info
SlurmApi slurmdb_v0039_update_tres POST /slurmdb/v0.0.39/tres Set TRES info
SlurmApi slurmdb_v0039_update_users POST /slurmdb/v0.0.39/users Update user
SlurmdbApi slurmdb_v0040_delete_account DELETE /slurmdb/v0.0.40/account/{account_name} Delete account
SlurmdbApi slurmdb_v0040_delete_association DELETE /slurmdb/v0.0.40/association/ Delete association
SlurmdbApi slurmdb_v0040_delete_associations DELETE /slurmdb/v0.0.40/associations/ Delete associations
SlurmdbApi slurmdb_v0040_delete_cluster DELETE /slurmdb/v0.0.40/cluster/{cluster_name} Delete cluster
SlurmdbApi slurmdb_v0040_delete_single_qos DELETE /slurmdb/v0.0.40/qos/{qos} Delete QOS
SlurmdbApi slurmdb_v0040_delete_user DELETE /slurmdb/v0.0.40/user/{name} Delete user
SlurmdbApi slurmdb_v0040_delete_wckey DELETE /slurmdb/v0.0.40/wckey/{id} Delete wckey
SlurmdbApi slurmdb_v0040_get_account GET /slurmdb/v0.0.40/account/{account_name} Get account info
SlurmdbApi slurmdb_v0040_get_accounts GET /slurmdb/v0.0.40/accounts/ Get account list
SlurmdbApi slurmdb_v0040_get_association GET /slurmdb/v0.0.40/association/ Get association info
SlurmdbApi slurmdb_v0040_get_associations GET /slurmdb/v0.0.40/associations/ Get association list
SlurmdbApi slurmdb_v0040_get_cluster GET /slurmdb/v0.0.40/cluster/{cluster_name} Get cluster info
SlurmdbApi slurmdb_v0040_get_clusters GET /slurmdb/v0.0.40/clusters/ Get cluster list
SlurmdbApi slurmdb_v0040_get_config GET /slurmdb/v0.0.40/config Dump all configuration information
SlurmdbApi slurmdb_v0040_get_diag GET /slurmdb/v0.0.40/diag/ Get slurmdb diagnostics
SlurmdbApi slurmdb_v0040_get_instance GET /slurmdb/v0.0.40/instance/ Get instance info
SlurmdbApi slurmdb_v0040_get_instances GET /slurmdb/v0.0.40/instances/ Get instance list
SlurmdbApi slurmdb_v0040_get_job GET /slurmdb/v0.0.40/job/{job_id} Get job info
SlurmdbApi slurmdb_v0040_get_jobs GET /slurmdb/v0.0.40/jobs/ Get job list
SlurmdbApi slurmdb_v0040_get_qos GET /slurmdb/v0.0.40/qos/ Get QOS list
SlurmdbApi slurmdb_v0040_get_single_qos GET /slurmdb/v0.0.40/qos/{qos} Get QOS info
SlurmdbApi slurmdb_v0040_get_tres GET /slurmdb/v0.0.40/tres/ Get TRES info
SlurmdbApi slurmdb_v0040_get_user GET /slurmdb/v0.0.40/user/{name} Get user info
SlurmdbApi slurmdb_v0040_get_users GET /slurmdb/v0.0.40/users/ Get user list
SlurmdbApi slurmdb_v0040_get_wckey GET /slurmdb/v0.0.40/wckey/{id} Get wckey info
SlurmdbApi slurmdb_v0040_get_wckeys GET /slurmdb/v0.0.40/wckeys/ Get wckey list
SlurmdbApi slurmdb_v0040_post_accounts POST /slurmdb/v0.0.40/accounts/ Add/update list of accounts
SlurmdbApi slurmdb_v0040_post_accounts_association POST /slurmdb/v0.0.40/accounts_association/ Add accounts with conditional association
SlurmdbApi slurmdb_v0040_post_associations POST /slurmdb/v0.0.40/associations/ Set associations info
SlurmdbApi slurmdb_v0040_post_clusters POST /slurmdb/v0.0.40/clusters/ Get cluster list
SlurmdbApi slurmdb_v0040_post_config POST /slurmdb/v0.0.40/config Load all configuration information
SlurmdbApi slurmdb_v0040_post_qos POST /slurmdb/v0.0.40/qos/ Add or update QOSs
SlurmdbApi slurmdb_v0040_post_tres POST /slurmdb/v0.0.40/tres/ Add TRES
SlurmdbApi slurmdb_v0040_post_users POST /slurmdb/v0.0.40/users/ Update users
SlurmdbApi slurmdb_v0040_post_users_association POST /slurmdb/v0.0.40/users_association/ Add users with conditional association
SlurmdbApi slurmdb_v0040_post_wckeys POST /slurmdb/v0.0.40/wckeys/ Add or update wckeys
SlurmdbApi slurmdb_v0041_delete_account DELETE /slurmdb/v0.0.41/account/{account_name} Delete account
SlurmdbApi slurmdb_v0041_delete_association DELETE /slurmdb/v0.0.41/association/ Delete association
SlurmdbApi slurmdb_v0041_delete_associations DELETE /slurmdb/v0.0.41/associations/ Delete associations
SlurmdbApi slurmdb_v0041_delete_cluster DELETE /slurmdb/v0.0.41/cluster/{cluster_name} Delete cluster
SlurmdbApi slurmdb_v0041_delete_single_qos DELETE /slurmdb/v0.0.41/qos/{qos} Delete QOS
SlurmdbApi slurmdb_v0041_delete_user DELETE /slurmdb/v0.0.41/user/{name} Delete user
SlurmdbApi slurmdb_v0041_delete_wckey DELETE /slurmdb/v0.0.41/wckey/{id} Delete wckey
SlurmdbApi slurmdb_v0041_get_account GET /slurmdb/v0.0.41/account/{account_name} Get account info
SlurmdbApi slurmdb_v0041_get_accounts GET /slurmdb/v0.0.41/accounts/ Get account list
SlurmdbApi slurmdb_v0041_get_association GET /slurmdb/v0.0.41/association/ Get association info
SlurmdbApi slurmdb_v0041_get_associations GET /slurmdb/v0.0.41/associations/ Get association list
SlurmdbApi slurmdb_v0041_get_cluster GET /slurmdb/v0.0.41/cluster/{cluster_name} Get cluster info
SlurmdbApi slurmdb_v0041_get_clusters GET /slurmdb/v0.0.41/clusters/ Get cluster list
SlurmdbApi slurmdb_v0041_get_config GET /slurmdb/v0.0.41/config Dump all configuration information
SlurmdbApi slurmdb_v0041_get_diag GET /slurmdb/v0.0.41/diag/ Get slurmdb diagnostics
SlurmdbApi slurmdb_v0041_get_instance GET /slurmdb/v0.0.41/instance/ Get instance info
SlurmdbApi slurmdb_v0041_get_instances GET /slurmdb/v0.0.41/instances/ Get instance list
SlurmdbApi slurmdb_v0041_get_job GET /slurmdb/v0.0.41/job/{job_id} Get job info
SlurmdbApi slurmdb_v0041_get_jobs GET /slurmdb/v0.0.41/jobs/ Get job list
SlurmdbApi slurmdb_v0041_get_qos GET /slurmdb/v0.0.41/qos/ Get QOS list
SlurmdbApi slurmdb_v0041_get_single_qos GET /slurmdb/v0.0.41/qos/{qos} Get QOS info
SlurmdbApi slurmdb_v0041_get_tres GET /slurmdb/v0.0.41/tres/ Get TRES info
SlurmdbApi slurmdb_v0041_get_user GET /slurmdb/v0.0.41/user/{name} Get user info
SlurmdbApi slurmdb_v0041_get_users GET /slurmdb/v0.0.41/users/ Get user list
SlurmdbApi slurmdb_v0041_get_wckey GET /slurmdb/v0.0.41/wckey/{id} Get wckey info
SlurmdbApi slurmdb_v0041_get_wckeys GET /slurmdb/v0.0.41/wckeys/ Get wckey list
SlurmdbApi slurmdb_v0041_post_accounts POST /slurmdb/v0.0.41/accounts/ Add/update list of accounts
SlurmdbApi slurmdb_v0041_post_accounts_association POST /slurmdb/v0.0.41/accounts_association/ Add accounts with conditional association
SlurmdbApi slurmdb_v0041_post_associations POST /slurmdb/v0.0.41/associations/ Set associations info
SlurmdbApi slurmdb_v0041_post_clusters POST /slurmdb/v0.0.41/clusters/ Get cluster list
SlurmdbApi slurmdb_v0041_post_config POST /slurmdb/v0.0.41/config Load all configuration information
SlurmdbApi slurmdb_v0041_post_qos POST /slurmdb/v0.0.41/qos/ Add or update QOSs
SlurmdbApi slurmdb_v0041_post_tres POST /slurmdb/v0.0.41/tres/ Add TRES
SlurmdbApi slurmdb_v0041_post_users POST /slurmdb/v0.0.41/users/ Update users
SlurmdbApi slurmdb_v0041_post_users_association POST /slurmdb/v0.0.41/users_association/ Add users with conditional association
SlurmdbApi slurmdb_v0041_post_wckeys POST /slurmdb/v0.0.41/wckeys/ Add or update wckeys

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

user

  • Type: API key
  • API key parameter name: X-SLURM-USER-NAME
  • Location: HTTP header

token

  • Type: API key
  • API key parameter name: X-SLURM-USER-TOKEN
  • Location: HTTP header

bearerAuth

  • Type: Bearer authentication (JWT)

Author

[email protected]

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages