Skip to content

ubccr/slurmrest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go client for Slurm REST API

API to access and control Slurm

Overview

This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.

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

Installation

go get github.com/ubccr/slurmrest

Example

package main

import (
	"context"
	"fmt"
	"log"
	"net/http"
	"time"

	"github.com/ubccr/slurmrest"
)

func main() {
	cfg := slurmrest.NewConfiguration()
	cfg.HTTPClient = &http.Client{Timeout: time.Second * 3600}
	cfg.Scheme = "http"
	cfg.Host = "localhost"

	client := slurmrest.NewAPIClient(cfg)

	req := jc.client.SlurmAPI.SlurmV0040GetJobs(context.Background())
	jobs, resp, err := jc.client.SlurmAPI.SlurmV0040GetJobsExecute(req)
	if err != nil {
		log.Fatalf("FAIL: %s", err)
	} else if resp.StatusCode != 200 {
		log.Fatalf("Invalid status code: %d\n", resp.StatusCode)
	}

	for _, job := range jobs.GetJobs() {
        fmt.Printf("Job %s - %s\n", job.GetJobId(), job.GetJobState())
    }
}

Documentation for API Endpoints

All URIs are relative to http://localhost

Class Method HTTP request Description
SlurmAPI SlurmV0039CancelJob Delete /slurm/v0.0.39/job/{job_id} cancel or signal job
SlurmAPI SlurmV0039DeleteNode Delete /slurm/v0.0.39/node/{node_name} delete node
SlurmAPI SlurmV0039Diag Get /slurm/v0.0.39/diag get diagnostics
SlurmAPI SlurmV0039GetJob Get /slurm/v0.0.39/job/{job_id} get job info
SlurmAPI SlurmV0039GetJobs Get /slurm/v0.0.39/jobs get list of jobs
SlurmAPI SlurmV0039GetNode Get /slurm/v0.0.39/node/{node_name} get node info
SlurmAPI SlurmV0039GetNodes Get /slurm/v0.0.39/nodes get all node info
SlurmAPI SlurmV0039GetPartition Get /slurm/v0.0.39/partition/{partition_name} get partition info
SlurmAPI SlurmV0039GetPartitions Get /slurm/v0.0.39/partitions get all partition info
SlurmAPI SlurmV0039GetReservation Get /slurm/v0.0.39/reservation/{reservation_name} get reservation info
SlurmAPI SlurmV0039GetReservations Get /slurm/v0.0.39/reservations get all reservation info
SlurmAPI SlurmV0039Ping Get /slurm/v0.0.39/ping ping test
SlurmAPI SlurmV0039SlurmctldGetLicenses Get /slurm/v0.0.39/licenses get all Slurm tracked license info
SlurmAPI SlurmV0039SubmitJob Post /slurm/v0.0.39/job/submit submit new job
SlurmAPI SlurmV0039UpdateJob Post /slurm/v0.0.39/job/{job_id} update job
SlurmAPI SlurmV0039UpdateNode Post /slurm/v0.0.39/node/{node_name} update node properties
SlurmAPI SlurmV0040DeleteJob Delete /slurm/v0.0.40/job/{job_id} cancel or signal job
SlurmAPI SlurmV0040DeleteJobs Delete /slurm/v0.0.40/jobs/ send signal to list of jobs
SlurmAPI SlurmV0040DeleteNode Delete /slurm/v0.0.40/node/{node_name} delete node
SlurmAPI SlurmV0040GetDiag Get /slurm/v0.0.40/diag/ get diagnostics
SlurmAPI SlurmV0040GetJob Get /slurm/v0.0.40/job/{job_id} get job info
SlurmAPI SlurmV0040GetJobs Get /slurm/v0.0.40/jobs/ get list of jobs
SlurmAPI SlurmV0040GetJobsState Get /slurm/v0.0.40/jobs/state/ get list of job states
SlurmAPI SlurmV0040GetLicenses Get /slurm/v0.0.40/licenses/ get all Slurm tracked license info
SlurmAPI SlurmV0040GetNode Get /slurm/v0.0.40/node/{node_name} get node info
SlurmAPI SlurmV0040GetNodes Get /slurm/v0.0.40/nodes/ get node(s) info
SlurmAPI SlurmV0040GetPartition Get /slurm/v0.0.40/partition/{partition_name} get partition info
SlurmAPI SlurmV0040GetPartitions Get /slurm/v0.0.40/partitions/ get all partition info
SlurmAPI SlurmV0040GetPing Get /slurm/v0.0.40/ping/ ping test
SlurmAPI SlurmV0040GetReconfigure Get /slurm/v0.0.40/reconfigure/ request slurmctld reconfigure
SlurmAPI SlurmV0040GetReservation Get /slurm/v0.0.40/reservation/{reservation_name} get reservation info
SlurmAPI SlurmV0040GetReservations Get /slurm/v0.0.40/reservations/ get all reservation info
SlurmAPI SlurmV0040GetShares Get /slurm/v0.0.40/shares get fairshare info
SlurmAPI SlurmV0040PostJob Post /slurm/v0.0.40/job/{job_id} update job
SlurmAPI SlurmV0040PostJobSubmit Post /slurm/v0.0.40/job/submit submit new job
SlurmAPI SlurmV0040PostNode Post /slurm/v0.0.40/node/{node_name} update node properties
SlurmAPI SlurmV0041DeleteJob Delete /slurm/v0.0.41/job/{job_id} cancel or signal job
SlurmAPI SlurmV0041DeleteJobs Delete /slurm/v0.0.41/jobs/ send signal to list of jobs
SlurmAPI SlurmV0041DeleteNode Delete /slurm/v0.0.41/node/{node_name} delete node
SlurmAPI SlurmV0041GetDiag Get /slurm/v0.0.41/diag/ get diagnostics
SlurmAPI SlurmV0041GetJob Get /slurm/v0.0.41/job/{job_id} get job info
SlurmAPI SlurmV0041GetJobs Get /slurm/v0.0.41/jobs/ get list of jobs
SlurmAPI SlurmV0041GetJobsState Get /slurm/v0.0.41/jobs/state/ get list of job states
SlurmAPI SlurmV0041GetLicenses Get /slurm/v0.0.41/licenses/ get all Slurm tracked license info
SlurmAPI SlurmV0041GetNode Get /slurm/v0.0.41/node/{node_name} get node info
SlurmAPI SlurmV0041GetNodes Get /slurm/v0.0.41/nodes/ get node(s) info
SlurmAPI SlurmV0041GetPartition Get /slurm/v0.0.41/partition/{partition_name} get partition info
SlurmAPI SlurmV0041GetPartitions Get /slurm/v0.0.41/partitions/ get all partition info
SlurmAPI SlurmV0041GetPing Get /slurm/v0.0.41/ping/ ping test
SlurmAPI SlurmV0041GetReconfigure Get /slurm/v0.0.41/reconfigure/ request slurmctld reconfigure
SlurmAPI SlurmV0041GetReservation Get /slurm/v0.0.41/reservation/{reservation_name} get reservation info
SlurmAPI SlurmV0041GetReservations Get /slurm/v0.0.41/reservations/ get all reservation info
SlurmAPI SlurmV0041GetShares Get /slurm/v0.0.41/shares get fairshare info
SlurmAPI SlurmV0041PostJob Post /slurm/v0.0.41/job/{job_id} update job
SlurmAPI SlurmV0041PostJobAllocate Post /slurm/v0.0.41/job/allocate submit new job allocation without any steps that must be signaled to stop
SlurmAPI SlurmV0041PostJobSubmit Post /slurm/v0.0.41/job/submit submit new job
SlurmAPI SlurmV0041PostNode Post /slurm/v0.0.41/node/{node_name} update node properties
SlurmAPI SlurmdbV0039AddClusters Post /slurmdb/v0.0.39/clusters Add clusters
SlurmAPI SlurmdbV0039AddWckeys Post /slurmdb/v0.0.39/wckeys Add wckeys
SlurmAPI SlurmdbV0039DeleteAccount Delete /slurmdb/v0.0.39/account/{account_name} Delete account
SlurmAPI SlurmdbV0039DeleteAssociation Delete /slurmdb/v0.0.39/association Delete association
SlurmAPI SlurmdbV0039DeleteAssociations Delete /slurmdb/v0.0.39/associations Delete associations
SlurmAPI SlurmdbV0039DeleteCluster Delete /slurmdb/v0.0.39/cluster/{cluster_name} Delete cluster
SlurmAPI SlurmdbV0039DeleteQos Delete /slurmdb/v0.0.39/qos/{qos_name} Delete QOS
SlurmAPI SlurmdbV0039DeleteUser Delete /slurmdb/v0.0.39/user/{user_name} Delete user
SlurmAPI SlurmdbV0039DeleteWckey Delete /slurmdb/v0.0.39/wckey/{wckey} Delete wckey
SlurmAPI SlurmdbV0039Diag Get /slurmdb/v0.0.39/diag Get slurmdb diagnostics
SlurmAPI SlurmdbV0039GetAccount Get /slurmdb/v0.0.39/account/{account_name} Get account info
SlurmAPI SlurmdbV0039GetAccounts Get /slurmdb/v0.0.39/accounts Get account list
SlurmAPI SlurmdbV0039GetAssociation Get /slurmdb/v0.0.39/association Get association info
SlurmAPI SlurmdbV0039GetAssociations Get /slurmdb/v0.0.39/associations Get association list
SlurmAPI SlurmdbV0039GetCluster Get /slurmdb/v0.0.39/cluster/{cluster_name} Get cluster info
SlurmAPI SlurmdbV0039GetClusters Get /slurmdb/v0.0.39/clusters Get cluster list
SlurmAPI SlurmdbV0039GetConfig Get /slurmdb/v0.0.39/config Dump all configuration information
SlurmAPI SlurmdbV0039GetJob Get /slurmdb/v0.0.39/job/{job_id} Get job info
SlurmAPI SlurmdbV0039GetJobs Get /slurmdb/v0.0.39/jobs Get job list
SlurmAPI SlurmdbV0039GetQos Get /slurmdb/v0.0.39/qos Get QOS list
SlurmAPI SlurmdbV0039GetSingleQos Get /slurmdb/v0.0.39/qos/{qos_name} Get QOS info
SlurmAPI SlurmdbV0039GetTres Get /slurmdb/v0.0.39/tres Get TRES info
SlurmAPI SlurmdbV0039GetUser Get /slurmdb/v0.0.39/user/{user_name} Get user info
SlurmAPI SlurmdbV0039GetUsers Get /slurmdb/v0.0.39/users Get user list
SlurmAPI SlurmdbV0039GetWckey Get /slurmdb/v0.0.39/wckey/{wckey} Get wckey info
SlurmAPI SlurmdbV0039GetWckeys Get /slurmdb/v0.0.39/wckeys Get wckey list
SlurmAPI SlurmdbV0039SetConfig Post /slurmdb/v0.0.39/config Load all configuration information
SlurmAPI SlurmdbV0039UpdateAccounts Post /slurmdb/v0.0.39/accounts Update accounts
SlurmAPI SlurmdbV0039UpdateAssociations Post /slurmdb/v0.0.39/associations Set associations info
SlurmAPI SlurmdbV0039UpdateQos Post /slurmdb/v0.0.39/qos Set QOS info
SlurmAPI SlurmdbV0039UpdateTres Post /slurmdb/v0.0.39/tres Set TRES info
SlurmAPI SlurmdbV0039UpdateUsers Post /slurmdb/v0.0.39/users Update user
SlurmdbAPI SlurmdbV0040DeleteAccount Delete /slurmdb/v0.0.40/account/{account_name} Delete account
SlurmdbAPI SlurmdbV0040DeleteAssociation Delete /slurmdb/v0.0.40/association/ Delete association
SlurmdbAPI SlurmdbV0040DeleteAssociations Delete /slurmdb/v0.0.40/associations/ Delete associations
SlurmdbAPI SlurmdbV0040DeleteCluster Delete /slurmdb/v0.0.40/cluster/{cluster_name} Delete cluster
SlurmdbAPI SlurmdbV0040DeleteSingleQos Delete /slurmdb/v0.0.40/qos/{qos} Delete QOS
SlurmdbAPI SlurmdbV0040DeleteUser Delete /slurmdb/v0.0.40/user/{name} Delete user
SlurmdbAPI SlurmdbV0040DeleteWckey Delete /slurmdb/v0.0.40/wckey/{id} Delete wckey
SlurmdbAPI SlurmdbV0040GetAccount Get /slurmdb/v0.0.40/account/{account_name} Get account info
SlurmdbAPI SlurmdbV0040GetAccounts Get /slurmdb/v0.0.40/accounts/ Get account list
SlurmdbAPI SlurmdbV0040GetAssociation Get /slurmdb/v0.0.40/association/ Get association info
SlurmdbAPI SlurmdbV0040GetAssociations Get /slurmdb/v0.0.40/associations/ Get association list
SlurmdbAPI SlurmdbV0040GetCluster Get /slurmdb/v0.0.40/cluster/{cluster_name} Get cluster info
SlurmdbAPI SlurmdbV0040GetClusters Get /slurmdb/v0.0.40/clusters/ Get cluster list
SlurmdbAPI SlurmdbV0040GetConfig Get /slurmdb/v0.0.40/config Dump all configuration information
SlurmdbAPI SlurmdbV0040GetDiag Get /slurmdb/v0.0.40/diag/ Get slurmdb diagnostics
SlurmdbAPI SlurmdbV0040GetInstance Get /slurmdb/v0.0.40/instance/ Get instance info
SlurmdbAPI SlurmdbV0040GetInstances Get /slurmdb/v0.0.40/instances/ Get instance list
SlurmdbAPI SlurmdbV0040GetJob Get /slurmdb/v0.0.40/job/{job_id} Get job info
SlurmdbAPI SlurmdbV0040GetJobs Get /slurmdb/v0.0.40/jobs/ Get job list
SlurmdbAPI SlurmdbV0040GetQos Get /slurmdb/v0.0.40/qos/ Get QOS list
SlurmdbAPI SlurmdbV0040GetSingleQos Get /slurmdb/v0.0.40/qos/{qos} Get QOS info
SlurmdbAPI SlurmdbV0040GetTres Get /slurmdb/v0.0.40/tres/ Get TRES info
SlurmdbAPI SlurmdbV0040GetUser Get /slurmdb/v0.0.40/user/{name} Get user info
SlurmdbAPI SlurmdbV0040GetUsers Get /slurmdb/v0.0.40/users/ Get user list
SlurmdbAPI SlurmdbV0040GetWckey Get /slurmdb/v0.0.40/wckey/{id} Get wckey info
SlurmdbAPI SlurmdbV0040GetWckeys Get /slurmdb/v0.0.40/wckeys/ Get wckey list
SlurmdbAPI SlurmdbV0040PostAccounts Post /slurmdb/v0.0.40/accounts/ Add/update list of accounts
SlurmdbAPI SlurmdbV0040PostAccountsAssociation Post /slurmdb/v0.0.40/accounts_association/ Add accounts with conditional association
SlurmdbAPI SlurmdbV0040PostAssociations Post /slurmdb/v0.0.40/associations/ Set associations info
SlurmdbAPI SlurmdbV0040PostClusters Post /slurmdb/v0.0.40/clusters/ Get cluster list
SlurmdbAPI SlurmdbV0040PostConfig Post /slurmdb/v0.0.40/config Load all configuration information
SlurmdbAPI SlurmdbV0040PostQos Post /slurmdb/v0.0.40/qos/ Add or update QOSs
SlurmdbAPI SlurmdbV0040PostTres Post /slurmdb/v0.0.40/tres/ Add TRES
SlurmdbAPI SlurmdbV0040PostUsers Post /slurmdb/v0.0.40/users/ Update users
SlurmdbAPI SlurmdbV0040PostUsersAssociation Post /slurmdb/v0.0.40/users_association/ Add users with conditional association
SlurmdbAPI SlurmdbV0040PostWckeys Post /slurmdb/v0.0.40/wckeys/ Add or update wckeys
SlurmdbAPI SlurmdbV0041DeleteAccount Delete /slurmdb/v0.0.41/account/{account_name} Delete account
SlurmdbAPI SlurmdbV0041DeleteAssociation Delete /slurmdb/v0.0.41/association/ Delete association
SlurmdbAPI SlurmdbV0041DeleteAssociations Delete /slurmdb/v0.0.41/associations/ Delete associations
SlurmdbAPI SlurmdbV0041DeleteCluster Delete /slurmdb/v0.0.41/cluster/{cluster_name} Delete cluster
SlurmdbAPI SlurmdbV0041DeleteSingleQos Delete /slurmdb/v0.0.41/qos/{qos} Delete QOS
SlurmdbAPI SlurmdbV0041DeleteUser Delete /slurmdb/v0.0.41/user/{name} Delete user
SlurmdbAPI SlurmdbV0041DeleteWckey Delete /slurmdb/v0.0.41/wckey/{id} Delete wckey
SlurmdbAPI SlurmdbV0041GetAccount Get /slurmdb/v0.0.41/account/{account_name} Get account info
SlurmdbAPI SlurmdbV0041GetAccounts Get /slurmdb/v0.0.41/accounts/ Get account list
SlurmdbAPI SlurmdbV0041GetAssociation Get /slurmdb/v0.0.41/association/ Get association info
SlurmdbAPI SlurmdbV0041GetAssociations Get /slurmdb/v0.0.41/associations/ Get association list
SlurmdbAPI SlurmdbV0041GetCluster Get /slurmdb/v0.0.41/cluster/{cluster_name} Get cluster info
SlurmdbAPI SlurmdbV0041GetClusters Get /slurmdb/v0.0.41/clusters/ Get cluster list
SlurmdbAPI SlurmdbV0041GetConfig Get /slurmdb/v0.0.41/config Dump all configuration information
SlurmdbAPI SlurmdbV0041GetDiag Get /slurmdb/v0.0.41/diag/ Get slurmdb diagnostics
SlurmdbAPI SlurmdbV0041GetInstance Get /slurmdb/v0.0.41/instance/ Get instance info
SlurmdbAPI SlurmdbV0041GetInstances Get /slurmdb/v0.0.41/instances/ Get instance list
SlurmdbAPI SlurmdbV0041GetJob Get /slurmdb/v0.0.41/job/{job_id} Get job info
SlurmdbAPI SlurmdbV0041GetJobs Get /slurmdb/v0.0.41/jobs/ Get job list
SlurmdbAPI SlurmdbV0041GetQos Get /slurmdb/v0.0.41/qos/ Get QOS list
SlurmdbAPI SlurmdbV0041GetSingleQos Get /slurmdb/v0.0.41/qos/{qos} Get QOS info
SlurmdbAPI SlurmdbV0041GetTres Get /slurmdb/v0.0.41/tres/ Get TRES info
SlurmdbAPI SlurmdbV0041GetUser Get /slurmdb/v0.0.41/user/{name} Get user info
SlurmdbAPI SlurmdbV0041GetUsers Get /slurmdb/v0.0.41/users/ Get user list
SlurmdbAPI SlurmdbV0041GetWckey Get /slurmdb/v0.0.41/wckey/{id} Get wckey info
SlurmdbAPI SlurmdbV0041GetWckeys Get /slurmdb/v0.0.41/wckeys/ Get wckey list
SlurmdbAPI SlurmdbV0041PostAccounts Post /slurmdb/v0.0.41/accounts/ Add/update list of accounts
SlurmdbAPI SlurmdbV0041PostAccountsAssociation Post /slurmdb/v0.0.41/accounts_association/ Add accounts with conditional association
SlurmdbAPI SlurmdbV0041PostAssociations Post /slurmdb/v0.0.41/associations/ Set associations info
SlurmdbAPI SlurmdbV0041PostClusters Post /slurmdb/v0.0.41/clusters/ Get cluster list
SlurmdbAPI SlurmdbV0041PostConfig Post /slurmdb/v0.0.41/config Load all configuration information
SlurmdbAPI SlurmdbV0041PostQos Post /slurmdb/v0.0.41/qos/ Add or update QOSs
SlurmdbAPI SlurmdbV0041PostTres Post /slurmdb/v0.0.41/tres/ Add TRES
SlurmdbAPI SlurmdbV0041PostUsers Post /slurmdb/v0.0.41/users/ Update users
SlurmdbAPI SlurmdbV0041PostUsersAssociation Post /slurmdb/v0.0.41/users_association/ Add users with conditional association
SlurmdbAPI SlurmdbV0041PostWckeys Post /slurmdb/v0.0.41/wckeys/ Add or update wckeys

Documentation For Models

Author

slurmrest Go client is currently maintained by The Center for Computational Research.

The code in this repo was generated from the openapi.json spec files available from Slurm. For more information see https://github.com/SchedMD/slurm/