Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions internal/fluidstack/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
generate-fluidstack-client:
docker run --rm -v "${PWD}:/local" openapitools/openapi-generator-cli:v7.8.0 generate \
--additional-properties disallowAdditionalPropertiesIfNotPresent=false \
-i https://docs.atlas.fluidstack.io/redocusaurus/infrastructure-api.yaml \
-g go \
--git-user-id brevdev \
--git-repo-id cloud \
-o /local/gen/fluidstack
sudo chown -R $(shell id -u):$(shell id -g) gen/fluidstack
gofmt -s -w gen/fluidstack
rm -rf gen/fluidstack/go.mod gen/fluidstack/go.sum
24 changes: 24 additions & 0 deletions internal/fluidstack/gen/fluidstack/.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
23 changes: 23 additions & 0 deletions internal/fluidstack/gen/fluidstack/.openapi-generator-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator

# 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
88 changes: 88 additions & 0 deletions internal/fluidstack/gen/fluidstack/.openapi-generator/FILES
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
.gitignore
.openapi-generator-ignore
.travis.yml
README.md
api/openapi.yaml
api_capabilities.go
api_capacity.go
api_filesystems.go
api_instance_types.go
api_instances.go
api_kubernetes.go
api_projects.go
api_slurm.go
client.go
configuration.go
docs/Accelerator.md
docs/CapabilitiesAPI.md
docs/Capability.md
docs/CapacityAPI.md
docs/Error.md
docs/Filesystem.md
docs/FilesystemsAPI.md
docs/FilesystemsPostRequest.md
docs/Instance.md
docs/InstanceState.md
docs/InstanceType.md
docs/InstanceTypesAPI.md
docs/InstancesAPI.md
docs/InstancesPostRequest.md
docs/KubernetesAPI.md
docs/KubernetesCluster.md
docs/KubernetesClustersPostRequest.md
docs/KubernetesNode.md
docs/KubernetesNodeConditionsInner.md
docs/KubernetesNodePool.md
docs/KubernetesNodePoolPostRequest.md
docs/KubernetesNodeTaintsInner.md
docs/ListCapacity200ResponseInner.md
docs/Project.md
docs/ProjectState.md
docs/ProjectsAPI.md
docs/ProjectsPostRequest.md
docs/SlurmAPI.md
docs/SlurmCluster.md
docs/SlurmClustersPostRequest.md
docs/SlurmLoginNode.md
docs/SlurmNode.md
docs/SlurmNodePool.md
docs/SlurmNodePoolPostRequest.md
git_push.sh
go.mod
go.sum
model_accelerator.go
model_capability.go
model_error.go
model_filesystem.go
model_filesystems_post_request.go
model_instance.go
model_instance_state.go
model_instance_type.go
model_instances_post_request.go
model_kubernetes_cluster.go
model_kubernetes_clusters_post_request.go
model_kubernetes_node.go
model_kubernetes_node_conditions_inner.go
model_kubernetes_node_pool.go
model_kubernetes_node_pool_post_request.go
model_kubernetes_node_taints_inner.go
model_list_capacity_200_response_inner.go
model_project.go
model_project_state.go
model_projects_post_request.go
model_slurm_cluster.go
model_slurm_clusters_post_request.go
model_slurm_login_node.go
model_slurm_node.go
model_slurm_node_pool.go
model_slurm_node_pool_post_request.go
response.go
test/api_capabilities_test.go
test/api_capacity_test.go
test/api_filesystems_test.go
test/api_instance_types_test.go
test/api_instances_test.go
test/api_kubernetes_test.go
test/api_projects_test.go
test/api_slurm_test.go
utils.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7.8.0
8 changes: 8 additions & 0 deletions internal/fluidstack/gen/fluidstack/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
language: go

install:
- go get -d -v .

script:
- go build -v ./

182 changes: 182 additions & 0 deletions internal/fluidstack/gen/fluidstack/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
# Go API client for openapi

Fluidstack Infrastructure API

## 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: v1alpha1
- Package version: 1.0.0
- Generator version: 7.8.0
- Build package: org.openapitools.codegen.languages.GoClientCodegen

## Installation

Install the following dependencies:

```sh
go get github.com/stretchr/testify/assert
go get golang.org/x/net/context
```

Put the package under your project folder and add the following in import:

```go
import openapi "github.com/brevdev/cloud"
```

To use a proxy, set the environment variable `HTTP_PROXY`:

```go
os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")
```

## Configuration of Server URL

Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification.

### Select Server Configuration

For using other server than the one defined on index 0 set context value `openapi.ContextServerIndex` of type `int`.

```go
ctx := context.WithValue(context.Background(), openapi.ContextServerIndex, 1)
```

### Templated Server URL

Templated server URL is formatted using default variables from configuration or from context value `openapi.ContextServerVariables` of type `map[string]string`.

```go
ctx := context.WithValue(context.Background(), openapi.ContextServerVariables, map[string]string{
"basePath": "v2",
})
```

Note, enum values are always validated and all unused variables are silently ignored.

### URLs Configuration per Operation

Each operation can use different server URL defined using `OperationServers` map in the `Configuration`.
An operation is uniquely identified by `"{classname}Service.{nickname}"` string.
Similar rules for overriding default operation server index and variables applies by using `openapi.ContextOperationServerIndices` and `openapi.ContextOperationServerVariables` context maps.

```go
ctx := context.WithValue(context.Background(), openapi.ContextOperationServerIndices, map[string]int{
"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), openapi.ContextOperationServerVariables, map[string]map[string]string{
"{classname}Service.{nickname}": {
"port": "8443",
},
})
```

## Documentation for API Endpoints

All URIs are relative to *https://<region>.atlas.fluidstack.io/api/v1alpha1*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*CapabilitiesAPI* | [**ListCapabilities**](docs/CapabilitiesAPI.md#listcapabilities) | **Get** /capabilities | List available capabilities
*CapacityAPI* | [**ListCapacity**](docs/CapacityAPI.md#listcapacity) | **Get** /capacity | List available capacity
*FilesystemsAPI* | [**CreateFilesystem**](docs/FilesystemsAPI.md#createfilesystem) | **Post** /filesystems | Create a filesystem
*FilesystemsAPI* | [**DeleteFilesystem**](docs/FilesystemsAPI.md#deletefilesystem) | **Delete** /filesystems/{id} | Delete a filesystem
*FilesystemsAPI* | [**GetFilesystem**](docs/FilesystemsAPI.md#getfilesystem) | **Get** /filesystems/{id} | Get a filesystem
*FilesystemsAPI* | [**ListFilesystems**](docs/FilesystemsAPI.md#listfilesystems) | **Get** /filesystems | List all filesystems
*InstanceTypesAPI* | [**ListInstanceTypes**](docs/InstanceTypesAPI.md#listinstancetypes) | **Get** /instance-types | List all available instance types
*InstancesAPI* | [**CreateInstance**](docs/InstancesAPI.md#createinstance) | **Post** /instances | Create a machine instance
*InstancesAPI* | [**DeleteInstance**](docs/InstancesAPI.md#deleteinstance) | **Delete** /instances/{id} | Delete a machine instance
*InstancesAPI* | [**GetInstance**](docs/InstancesAPI.md#getinstance) | **Get** /instances/{id} | Get a machine instance
*InstancesAPI* | [**ListInstances**](docs/InstancesAPI.md#listinstances) | **Get** /instances | List all machine instances
*InstancesAPI* | [**StartInstance**](docs/InstancesAPI.md#startinstance) | **Post** /instances/{id}/actions/start | Start a machine instance
*InstancesAPI* | [**StopInstance**](docs/InstancesAPI.md#stopinstance) | **Post** /instances/{id}/actions/stop | Stop a machine instance
*KubernetesAPI* | [**CreateKubernetesCluster**](docs/KubernetesAPI.md#createkubernetescluster) | **Post** /kubernetes/clusters | Create a cluster
*KubernetesAPI* | [**CreateKubernetesNodePool**](docs/KubernetesAPI.md#createkubernetesnodepool) | **Post** /kubernetes/clusters/{cluster_id}/node-pools | Create a node pool
*KubernetesAPI* | [**DeleteKubernetesCluster**](docs/KubernetesAPI.md#deletekubernetescluster) | **Delete** /kubernetes/clusters/{id} | Delete a cluster
*KubernetesAPI* | [**DeleteKubernetesNodePool**](docs/KubernetesAPI.md#deletekubernetesnodepool) | **Delete** /kubernetes/clusters/{cluster_id}/node-pools/{node_pool_id} | Delete a node pool
*KubernetesAPI* | [**GetKubernetesCluster**](docs/KubernetesAPI.md#getkubernetescluster) | **Get** /kubernetes/clusters/{id} | Get a cluster
*KubernetesAPI* | [**GetKubernetesClusterCredentials**](docs/KubernetesAPI.md#getkubernetesclustercredentials) | **Get** /kubernetes/clusters/{cluster_id}/credentials | Get kubeconfig credentials for a cluster
*KubernetesAPI* | [**GetKubernetesNodePool**](docs/KubernetesAPI.md#getkubernetesnodepool) | **Get** /kubernetes/clusters/{cluster_id}/node-pools/{node_pool_id} | Get a node pool
*KubernetesAPI* | [**ListKubernetesClusters**](docs/KubernetesAPI.md#listkubernetesclusters) | **Get** /kubernetes/clusters | List all clusters
*KubernetesAPI* | [**ListKubernetesNodePools**](docs/KubernetesAPI.md#listkubernetesnodepools) | **Get** /kubernetes/clusters/{cluster_id}/node-pools | List all node pools for a cluster
*ProjectsAPI* | [**CreateProject**](docs/ProjectsAPI.md#createproject) | **Post** /projects | Create a project
*ProjectsAPI* | [**DeleteProject**](docs/ProjectsAPI.md#deleteproject) | **Delete** /projects/{id} | Delete a project
*ProjectsAPI* | [**GetProject**](docs/ProjectsAPI.md#getproject) | **Get** /projects/{id} | Get a project
*ProjectsAPI* | [**ListProjects**](docs/ProjectsAPI.md#listprojects) | **Get** /projects | List all projects
*SlurmAPI* | [**CreateSlurmCluster**](docs/SlurmAPI.md#createslurmcluster) | **Post** /slurm/clusters | Create a cluster
*SlurmAPI* | [**CreateSlurmNodePool**](docs/SlurmAPI.md#createslurmnodepool) | **Post** /slurm/clusters/{cluster_id}/node-pools | Create a node pool
*SlurmAPI* | [**DeleteSlurmCluster**](docs/SlurmAPI.md#deleteslurmcluster) | **Delete** /slurm/clusters/{id} | Delete a cluster
*SlurmAPI* | [**DeleteSlurmNodePool**](docs/SlurmAPI.md#deleteslurmnodepool) | **Delete** /slurm/clusters/{cluster_id}/node-pools/{node_pool_id} | Delete a node pool
*SlurmAPI* | [**GetSlurmCluster**](docs/SlurmAPI.md#getslurmcluster) | **Get** /slurm/clusters/{id} | Get a cluster
*SlurmAPI* | [**GetSlurmNodePool**](docs/SlurmAPI.md#getslurmnodepool) | **Get** /slurm/clusters/{cluster_id}/node-pools/{node_pool_id} | Get a node pool
*SlurmAPI* | [**ListSlurmClusters**](docs/SlurmAPI.md#listslurmclusters) | **Get** /slurm/clusters | List all clusters
*SlurmAPI* | [**ListSlurmNodePools**](docs/SlurmAPI.md#listslurmnodepools) | **Get** /slurm/clusters/{cluster_id}/node-pools | List all node pools for a cluster


## Documentation For Models

- [Accelerator](docs/Accelerator.md)
- [Capability](docs/Capability.md)
- [Error](docs/Error.md)
- [Filesystem](docs/Filesystem.md)
- [FilesystemsPostRequest](docs/FilesystemsPostRequest.md)
- [Instance](docs/Instance.md)
- [InstanceState](docs/InstanceState.md)
- [InstanceType](docs/InstanceType.md)
- [InstancesPostRequest](docs/InstancesPostRequest.md)
- [KubernetesCluster](docs/KubernetesCluster.md)
- [KubernetesClustersPostRequest](docs/KubernetesClustersPostRequest.md)
- [KubernetesNode](docs/KubernetesNode.md)
- [KubernetesNodeConditionsInner](docs/KubernetesNodeConditionsInner.md)
- [KubernetesNodePool](docs/KubernetesNodePool.md)
- [KubernetesNodePoolPostRequest](docs/KubernetesNodePoolPostRequest.md)
- [KubernetesNodeTaintsInner](docs/KubernetesNodeTaintsInner.md)
- [ListCapacity200ResponseInner](docs/ListCapacity200ResponseInner.md)
- [Project](docs/Project.md)
- [ProjectState](docs/ProjectState.md)
- [ProjectsPostRequest](docs/ProjectsPostRequest.md)
- [SlurmCluster](docs/SlurmCluster.md)
- [SlurmClustersPostRequest](docs/SlurmClustersPostRequest.md)
- [SlurmLoginNode](docs/SlurmLoginNode.md)
- [SlurmNode](docs/SlurmNode.md)
- [SlurmNodePool](docs/SlurmNodePool.md)
- [SlurmNodePoolPostRequest](docs/SlurmNodePoolPostRequest.md)


## Documentation For Authorization


Authentication schemes defined for the API:
### bearerAuth

- **Type**: HTTP Bearer token authentication

Example

```go
auth := context.WithValue(context.Background(), openapi.ContextAccessToken, "BEARER_TOKEN_STRING")
r, err := client.Service.Operation(auth, args)
```


## Documentation for Utility Methods

Due to the fact that model structure members are all pointers, this package contains
a number of utility functions to easily obtain pointers to values of basic types.
Each of these functions takes a value of the given basic type and returns a pointer to it:

* `PtrBool`
* `PtrInt`
* `PtrInt32`
* `PtrInt64`
* `PtrFloat`
* `PtrFloat32`
* `PtrFloat64`
* `PtrString`
* `PtrTime`

## Author



Loading
Loading