Skip to content

Commit

Permalink
Initial commit for v0.0.36
Browse files Browse the repository at this point in the history
  • Loading branch information
aebruno committed Jun 21, 2021
0 parents commit fce19ff
Show file tree
Hide file tree
Showing 53 changed files with 30,760 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Compiled Object files, Static and Dynamic libs (Shared Objects)
*.o
*.a
*.so

# Folders
_obj
_test

# Architecture specific extensions/prefixes
*.[568vq]
[568vq].out

*.cgo1.go
*.cgo2.c
_cgo_defun.c
_cgo_gotypes.go
_cgo_export.*

_testmain.go

*.exe
*.test
*.prof
27 changes: 27 additions & 0 deletions .openapi-generator-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator

scripts/*
go.mod
go.sum

# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.

# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs

# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux

# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux

# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md
49 changes: 49 additions & 0 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
.gitignore
.travis.yml
README.md
api/openapi.yaml
api_openapi.go
api_slurm.go
client.go
configuration.go
docs/OpenapiApi.md
docs/SlurmApi.md
docs/V0036Diag.md
docs/V0036DiagStatistics.md
docs/V0036Error.md
docs/V0036JobProperties.md
docs/V0036JobResources.md
docs/V0036JobResponseProperties.md
docs/V0036JobSubmission.md
docs/V0036JobSubmissionResponse.md
docs/V0036JobsResponse.md
docs/V0036Node.md
docs/V0036NodeAllocation.md
docs/V0036NodesResponse.md
docs/V0036Partition.md
docs/V0036PartitionsResponse.md
docs/V0036Ping.md
docs/V0036Pings.md
docs/V0036Signal.md
git_push.sh
go.mod
go.sum
model_v0_0_36_diag.go
model_v0_0_36_diag_statistics.go
model_v0_0_36_error.go
model_v0_0_36_job_properties.go
model_v0_0_36_job_resources.go
model_v0_0_36_job_response_properties.go
model_v0_0_36_job_submission.go
model_v0_0_36_job_submission_response.go
model_v0_0_36_jobs_response.go
model_v0_0_36_node.go
model_v0_0_36_node_allocation.go
model_v0_0_36_nodes_response.go
model_v0_0_36_partition.go
model_v0_0_36_partitions_response.go
model_v0_0_36_ping.go
model_v0_0_36_pings.go
model_v0_0_36_signal.go
response.go
utils.go
1 change: 1 addition & 0 deletions .openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5.1.0
105 changes: 105 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# Go client for Slurm REST API

API to access and control Slurm.

## Overview
This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client.

- API version: 0.0.36
- Package version: 1.0.0
- Build package: org.openapitools.codegen.languages.GoClientCodegen
For more information, please visit [https://www.schedmd.com/](https://www.schedmd.com/)

## Installation

```shell
go get github.com/ubccr/slurmrest
```

## Example

```golang
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)

jreq := client.SlurmApi.SlurmctldGetJobs(context.Background())
jobs, resp, err := client.SlurmApi.SlurmctldGetJobsExecute(jreq)
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/slurm/v0.0.36*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*OpenapiApi* | [**OpenapiGet**](docs/OpenapiApi.md#openapiget) | **Get** /openapi | Retrieve OpenAPI Specification
*OpenapiApi* | [**OpenapiJsonGet**](docs/OpenapiApi.md#openapijsonget) | **Get** /openapi.json | Retrieve OpenAPI Specification
*OpenapiApi* | [**OpenapiV3Get**](docs/OpenapiApi.md#openapiv3get) | **Get** /openapi/v3 | Retrieve OpenAPI Specification
*OpenapiApi* | [**OpenapiYamlGet**](docs/OpenapiApi.md#openapiyamlget) | **Get** /openapi.yaml | Retrieve OpenAPI Specification
*SlurmApi* | [**SlurmctldCancelJob**](docs/SlurmApi.md#slurmctldcanceljob) | **Delete** /job/{job_id} | cancel or signal job
*SlurmApi* | [**SlurmctldDiag**](docs/SlurmApi.md#slurmctlddiag) | **Get** /diag/ | get diagnostics
*SlurmApi* | [**SlurmctldGetJob**](docs/SlurmApi.md#slurmctldgetjob) | **Get** /job/{job_id} | get job info
*SlurmApi* | [**SlurmctldGetJobs**](docs/SlurmApi.md#slurmctldgetjobs) | **Get** /jobs/ | get list of jobs
*SlurmApi* | [**SlurmctldGetNode**](docs/SlurmApi.md#slurmctldgetnode) | **Get** /node/{node_name} | get node info
*SlurmApi* | [**SlurmctldGetNodes**](docs/SlurmApi.md#slurmctldgetnodes) | **Get** /nodes/ | get all node info
*SlurmApi* | [**SlurmctldGetPartition**](docs/SlurmApi.md#slurmctldgetpartition) | **Get** /partition/{partition_name} | get partition info
*SlurmApi* | [**SlurmctldGetPartitions**](docs/SlurmApi.md#slurmctldgetpartitions) | **Get** /partitions/ | get all partition info
*SlurmApi* | [**SlurmctldPing**](docs/SlurmApi.md#slurmctldping) | **Get** /ping/ | ping test
*SlurmApi* | [**SlurmctldSubmitJob**](docs/SlurmApi.md#slurmctldsubmitjob) | **Post** /job/submit | submit new job
*SlurmApi* | [**SlurmctldUpdateJob**](docs/SlurmApi.md#slurmctldupdatejob) | **Post** /job/{job_id} | update job


## Documentation For Models

- [V0036Diag](docs/V0036Diag.md)
- [V0036DiagStatistics](docs/V0036DiagStatistics.md)
- [V0036Error](docs/V0036Error.md)
- [V0036JobProperties](docs/V0036JobProperties.md)
- [V0036JobResources](docs/V0036JobResources.md)
- [V0036JobResponseProperties](docs/V0036JobResponseProperties.md)
- [V0036JobSubmission](docs/V0036JobSubmission.md)
- [V0036JobSubmissionResponse](docs/V0036JobSubmissionResponse.md)
- [V0036JobsResponse](docs/V0036JobsResponse.md)
- [V0036Node](docs/V0036Node.md)
- [V0036NodeAllocation](docs/V0036NodeAllocation.md)
- [V0036NodesResponse](docs/V0036NodesResponse.md)
- [V0036Partition](docs/V0036Partition.md)
- [V0036PartitionsResponse](docs/V0036PartitionsResponse.md)
- [V0036Ping](docs/V0036Ping.md)
- [V0036Pings](docs/V0036Pings.md)
- [V0036Signal](docs/V0036Signal.md)


## Author

slurmrest Go client is currently maintained by [The Center for Computational Research](https://buffalo.edu/ccr).

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/
Loading

0 comments on commit fce19ff

Please sign in to comment.