From 56da057549fc1b58825da58fd25b3893ca657f62 Mon Sep 17 00:00:00 2001 From: Drew Malin Date: Tue, 21 Apr 2026 12:04:52 -0700 Subject: [PATCH 1/2] feat(BREV-8931): Bump shadeform API, move from cloud enum to strings --- v1/providers/shadeform/configuration.go | 8 +- .../gen/shadeform/.openapi-generator/FILES | 22 +- .../shadeform/gen/shadeform/README.md | 15 +- .../shadeform/gen/shadeform/api/openapi.yaml | 1022 ++++++++++++++++- .../shadeform/gen/shadeform/api_default.go | 574 +++++++++ .../shadeform/gen/shadeform/docs/Cloud.md | 63 - .../shadeform/gen/shadeform/docs/Cluster.md | 363 ++++++ .../gen/shadeform/docs/ClusterAvailability.md | 93 ++ .../gen/shadeform/docs/ClusterInfoResponse.md | 363 ++++++ .../gen/shadeform/docs/ClusterRegionInfo.md | 72 ++ .../gen/shadeform/docs/ClusterType.md | 114 ++ .../shadeform/docs/ClusterTypesResponse.md | 51 + .../gen/shadeform/docs/ClustersResponse.md | 51 + .../shadeform/docs/CreateClusterRequest.md | 187 +++ .../shadeform/docs/CreateClusterResponse.md | 51 + .../gen/shadeform/docs/CreateRequest.md | 10 +- .../gen/shadeform/docs/CreateVolumeRequest.md | 10 +- .../gen/shadeform/docs/DefaultAPI.md | 335 +++++- .../shadeform/gen/shadeform/docs/Instance.md | 10 +- .../shadeform/docs/InstanceInfoResponse.md | 10 +- .../gen/shadeform/docs/InstanceType.md | 10 +- .../shadeform/gen/shadeform/docs/Volume.md | 10 +- .../gen/shadeform/docs/VolumeTypesInner.md | 10 +- .../shadeform/gen/shadeform/model_cloud.go | 161 --- .../shadeform/gen/shadeform/model_cluster.go | 604 ++++++++++ .../shadeform/model_cluster_availability.go | 228 ++++ .../shadeform/model_cluster_info_response.go | 604 ++++++++++ .../shadeform/model_cluster_region_info.go | 198 ++++ .../gen/shadeform/model_cluster_type.go | 256 +++++ .../shadeform/model_cluster_types_response.go | 167 +++ .../gen/shadeform/model_clusters_response.go | 167 +++ .../shadeform/model_create_cluster_request.go | 364 ++++++ .../model_create_cluster_response.go | 168 +++ .../gen/shadeform/model_create_request.go | 13 +- .../shadeform/model_create_volume_request.go | 13 +- .../shadeform/gen/shadeform/model_instance.go | 15 +- .../shadeform/model_instance_info_response.go | 15 +- .../gen/shadeform/model_instance_type.go | 13 +- .../shadeform/gen/shadeform/model_volume.go | 15 +- .../gen/shadeform/model_volume_types_inner.go | 13 +- .../gen/shadeform/test/api_default_test.go | 116 +- v1/providers/shadeform/instance.go | 7 +- v1/providers/shadeform/instancetype.go | 14 +- v1/providers/shadeform/validation_test.go | 5 +- 44 files changed, 6238 insertions(+), 372 deletions(-) delete mode 100644 v1/providers/shadeform/gen/shadeform/docs/Cloud.md create mode 100644 v1/providers/shadeform/gen/shadeform/docs/Cluster.md create mode 100644 v1/providers/shadeform/gen/shadeform/docs/ClusterAvailability.md create mode 100644 v1/providers/shadeform/gen/shadeform/docs/ClusterInfoResponse.md create mode 100644 v1/providers/shadeform/gen/shadeform/docs/ClusterRegionInfo.md create mode 100644 v1/providers/shadeform/gen/shadeform/docs/ClusterType.md create mode 100644 v1/providers/shadeform/gen/shadeform/docs/ClusterTypesResponse.md create mode 100644 v1/providers/shadeform/gen/shadeform/docs/ClustersResponse.md create mode 100644 v1/providers/shadeform/gen/shadeform/docs/CreateClusterRequest.md create mode 100644 v1/providers/shadeform/gen/shadeform/docs/CreateClusterResponse.md delete mode 100644 v1/providers/shadeform/gen/shadeform/model_cloud.go create mode 100644 v1/providers/shadeform/gen/shadeform/model_cluster.go create mode 100644 v1/providers/shadeform/gen/shadeform/model_cluster_availability.go create mode 100644 v1/providers/shadeform/gen/shadeform/model_cluster_info_response.go create mode 100644 v1/providers/shadeform/gen/shadeform/model_cluster_region_info.go create mode 100644 v1/providers/shadeform/gen/shadeform/model_cluster_type.go create mode 100644 v1/providers/shadeform/gen/shadeform/model_cluster_types_response.go create mode 100644 v1/providers/shadeform/gen/shadeform/model_clusters_response.go create mode 100644 v1/providers/shadeform/gen/shadeform/model_create_cluster_request.go create mode 100644 v1/providers/shadeform/gen/shadeform/model_create_cluster_response.go diff --git a/v1/providers/shadeform/configuration.go b/v1/providers/shadeform/configuration.go index 90b29063..138e8229 100644 --- a/v1/providers/shadeform/configuration.go +++ b/v1/providers/shadeform/configuration.go @@ -1,14 +1,10 @@ package v1 -import ( - openapi "github.com/brevdev/cloud/v1/providers/shadeform/gen/shadeform" -) - type Configuration struct { - AllowedInstanceTypes map[openapi.Cloud]map[string]bool + AllowedInstanceTypes map[string]map[string]bool } -func (c *Configuration) isAllowed(cloud openapi.Cloud, shadeInstanceType string) bool { +func (c *Configuration) isAllowed(cloud string, shadeInstanceType string) bool { allowedClouds, found := c.AllowedInstanceTypes[cloud] if !found { return false diff --git a/v1/providers/shadeform/gen/shadeform/.openapi-generator/FILES b/v1/providers/shadeform/gen/shadeform/.openapi-generator/FILES index 59edec64..e8562f71 100644 --- a/v1/providers/shadeform/gen/shadeform/.openapi-generator/FILES +++ b/v1/providers/shadeform/gen/shadeform/.openapi-generator/FILES @@ -1,4 +1,5 @@ .gitignore +.openapi-generator-ignore .travis.yml README.md api/openapi.yaml @@ -11,7 +12,15 @@ docs/Alert.md docs/AutoDelete.md docs/Availability.md docs/BootTime.md -docs/Cloud.md +docs/Cluster.md +docs/ClusterAvailability.md +docs/ClusterInfoResponse.md +docs/ClusterRegionInfo.md +docs/ClusterType.md +docs/ClusterTypesResponse.md +docs/ClustersResponse.md +docs/CreateClusterRequest.md +docs/CreateClusterResponse.md docs/CreateRequest.md docs/CreateResponse.md docs/CreateVolumeRequest.md @@ -58,7 +67,15 @@ model_alert.go model_auto_delete.go model_availability.go model_boot_time.go -model_cloud.go +model_cluster.go +model_cluster_availability.go +model_cluster_info_response.go +model_cluster_region_info.go +model_cluster_type.go +model_cluster_types_response.go +model_clusters_response.go +model_create_cluster_request.go +model_create_cluster_response.go model_create_request.go model_create_response.go model_create_volume_request.go @@ -96,4 +113,5 @@ model_volume_types_inner.go model_volumes_response.go model_volumes_types_response.go response.go +test/api_default_test.go utils.go diff --git a/v1/providers/shadeform/gen/shadeform/README.md b/v1/providers/shadeform/gen/shadeform/README.md index e0b22510..5ad66ed8 100644 --- a/v1/providers/shadeform/gen/shadeform/README.md +++ b/v1/providers/shadeform/gen/shadeform/README.md @@ -79,6 +79,11 @@ All URIs are relative to *https://api.shadeform.ai/v1* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*DefaultAPI* | [**Clusters**](docs/DefaultAPI.md#clusters) | **Get** /clusters | /clusters +*DefaultAPI* | [**ClustersCreate**](docs/DefaultAPI.md#clusterscreate) | **Post** /clusters/create | /clusters/create +*DefaultAPI* | [**ClustersDelete**](docs/DefaultAPI.md#clustersdelete) | **Post** /clusters/{id}/delete | /clusters/{id}/delete +*DefaultAPI* | [**ClustersInfo**](docs/DefaultAPI.md#clustersinfo) | **Get** /clusters/{id}/info | /clusters/{id}/info +*DefaultAPI* | [**ClustersTypes**](docs/DefaultAPI.md#clusterstypes) | **Get** /clusters/types | /clusters/types *DefaultAPI* | [**Instances**](docs/DefaultAPI.md#instances) | **Get** /instances | /instances *DefaultAPI* | [**InstancesCreate**](docs/DefaultAPI.md#instancescreate) | **Post** /instances/create | /instances/create *DefaultAPI* | [**InstancesDelete**](docs/DefaultAPI.md#instancesdelete) | **Post** /instances/{id}/delete | /instances/{id}/delete @@ -112,7 +117,15 @@ Class | Method | HTTP request | Description - [AutoDelete](docs/AutoDelete.md) - [Availability](docs/Availability.md) - [BootTime](docs/BootTime.md) - - [Cloud](docs/Cloud.md) + - [Cluster](docs/Cluster.md) + - [ClusterAvailability](docs/ClusterAvailability.md) + - [ClusterInfoResponse](docs/ClusterInfoResponse.md) + - [ClusterRegionInfo](docs/ClusterRegionInfo.md) + - [ClusterType](docs/ClusterType.md) + - [ClusterTypesResponse](docs/ClusterTypesResponse.md) + - [ClustersResponse](docs/ClustersResponse.md) + - [CreateClusterRequest](docs/CreateClusterRequest.md) + - [CreateClusterResponse](docs/CreateClusterResponse.md) - [CreateRequest](docs/CreateRequest.md) - [CreateResponse](docs/CreateResponse.md) - [CreateVolumeRequest](docs/CreateVolumeRequest.md) diff --git a/v1/providers/shadeform/gen/shadeform/api/openapi.yaml b/v1/providers/shadeform/gen/shadeform/api/openapi.yaml index 3481590e..5c9aced0 100644 --- a/v1/providers/shadeform/gen/shadeform/api/openapi.yaml +++ b/v1/providers/shadeform/gen/shadeform/api/openapi.yaml @@ -217,6 +217,92 @@ paths: description: Confirms the restart of an instance has been initiated. This does not confirm that the instance restarted successfully. summary: "/instances/{id}/restart" + /clusters: + get: + description: Get all non deleted clusters. + operationId: Clusters + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ClustersResponse' + description: Returns a ClustersResponse object. + summary: /clusters + /clusters/types: + get: + description: Return all the GPU cluster types with their corresponding availability + and specs. + operationId: ClustersTypes + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ClusterTypesResponse' + description: Returns a ClusterTypesResponse object + summary: /clusters/types + /clusters/create: + post: + description: Create a new GPU cluster. + operationId: ClustersCreate + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateClusterRequest' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/CreateClusterResponse' + description: Returns a CreateClusterResponse object + summary: /clusters/create + /clusters/{id}/info: + get: + description: "Get details for the specified, non deleted, cluster in the url." + operationId: ClustersInfo + parameters: + - description: The cluster id + example: 8eda86fe-0f36-41ed-9837-0ccf8f6e0fcb + explode: false + in: path + name: id + required: true + schema: + minimum: 1 + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ClusterInfoResponse' + description: Return a cluster object. + summary: "/clusters/{id}/info" + /clusters/{id}/delete: + post: + description: "This will move the cluster to the 'deleting' status while the\ + \ cluster is being deleted. Once the cluster has entered the 'deleting' status,\ + \ the account will no longer be billed for the cluster." + operationId: ClustersDelete + parameters: + - description: The cluster id + example: b1450ae8-2fa3-4ceb-a4f3-b834805418fc + explode: false + in: path + name: id + required: true + schema: + minimum: 1 + type: string + style: simple + responses: + "200": + description: Confirms the deletion of a cluster. + summary: "/clusters/{id}/delete" /sshkeys: get: description: Get all SSH Keys for the account. @@ -598,7 +684,10 @@ components: shade_instance_type: A6000 properties: cloud: - $ref: '#/components/schemas/Cloud' + description: "Specifies the underlying cloud provider. See this [explanation](/getting-started/concepts#cloud-cloud-provider)\ + \ for more details." + example: hyperstack + type: string shade_instance_type: description: "The Shadeform standardized instance type. See this [explanation](/getting-started/concepts#shade-instance-type-and-cloud-instance-type)\ \ for more details." @@ -862,7 +951,10 @@ components: format: uuid type: string cloud: - $ref: '#/components/schemas/Cloud' + description: "Specifies the underlying cloud provider. See this [explanation](/getting-started/concepts#cloud-cloud-provider)\ + \ for more details." + example: hyperstack + type: string region: description: Specifies the region. example: canada-1 @@ -1065,7 +1157,10 @@ components: format: uuid type: string cloud: - $ref: '#/components/schemas/Cloud' + description: "Specifies the underlying cloud provider. See this [explanation](/getting-started/concepts#cloud-cloud-provider)\ + \ for more details." + example: hyperstack + type: string region: description: Specifies the region. example: canada-1 @@ -1412,7 +1507,10 @@ components: region: canada-1 properties: cloud: - $ref: '#/components/schemas/Cloud' + description: "Specifies the underlying cloud provider. See this [explanation](/getting-started/concepts#cloud-cloud-provider)\ + \ for more details." + example: hyperstack + type: string region: description: Specifies the region. example: canada-1 @@ -1709,37 +1807,882 @@ components: required: - id type: object + ClustersResponse: + example: + clusters: + - instances: + - ssh_port: 22 + configuration: + nvlink: true + os: ubuntu_22_shade_os + num_gpus: 1 + gpu_type: A100 + memory_in_gb: 12 + vram_per_gpu_in_gb: 48 + vcpus: 6 + storage_in_gb: 256 + interconnect: pcie + gpu_manufacturer: nvidia + launch_configuration: + docker_configuration: + args: --model mistralai/Mistral-7B-v0.1 + shared_memory_in_gb: 8 + image: vllm/vllm-openai:latest + port_mappings: + - container_port: 8000 + host_port: 80 + - container_port: 8000 + host_port: 80 + registry_credentials: + password: password + username: username + envs: + - name: HUGGING_FACE_HUB_TOKEN + value: hugging_face_api_token + - name: HUGGING_FACE_HUB_TOKEN + value: hugging_face_api_token + volume_mounts: + - host_path: "~/.cache/huggingface" + container_path: /root/.cache/huggingface + - host_path: "~/.cache/huggingface" + container_path: /root/.cache/huggingface + script_configuration: + base64_script: IyEvYmluL2Jhc2gKCiMgRW5kbGVzcyBsb29wCndoaWxlIHRydWUKZG8KICAgICMgRmV0Y2ggYSBjYXQgZmFjdCB3aXRoIGEgbWF4aW11bSBsZW5ndGggb2YgMTQwIGNoYXJhY3RlcnMKICAgIGN1cmwgLS1uby1wcm9ncmVzcy1tZXRlciBodHRwczovL2NhdGZhY3QubmluamEvZmFjdD9tYXhfbGVuZ3RoPTE0MAoKICAgICMgUHJpbnQgYSBuZXdsaW5lIGZvciByZWFkYWJpbGl0eQogICAgZWNobwoKICAgICMgU2xlZXAgZm9yIDMgc2Vjb25kcyBiZWZvcmUgdGhlIG5leHQgaXRlcmF0aW9uCiAgICBzbGVlcCAzCmRvbmUKCgo= + type: docker + cloud_instance_type: gpu_1x_a6000 + ip: 1.0.0.1 + created_at: 2016-08-29T09:12:33.001Z + cloud_assigned_id: 13b057d7-e266-4869-985f-760fe75a78b3 + deleted_at: 2016-08-29T09:12:33.001Z + shade_cloud: true + shade_instance_type: A6000 + tags: + - tag1 + - tag1 + cloud: hyperstack + hourly_price: 210 + cost_estimate: "103.4" + boot_time: + max_boot_in_sec: 300 + min_boot_in_sec: 180 + port_mappings: + - external_port: 80 + internal_port: 8000 + - external_port: 80 + internal_port: 8000 + name: cool-gpu-server + id: d290f1ee-6c54-4b01-90e6-d701748f0851 + region: canada-1 + active_at: 2016-08-29T09:12:33.001Z + status_details: downloading + ssh_user: shadeform + status: active + - ssh_port: 22 + configuration: + nvlink: true + os: ubuntu_22_shade_os + num_gpus: 1 + gpu_type: A100 + memory_in_gb: 12 + vram_per_gpu_in_gb: 48 + vcpus: 6 + storage_in_gb: 256 + interconnect: pcie + gpu_manufacturer: nvidia + launch_configuration: + docker_configuration: + args: --model mistralai/Mistral-7B-v0.1 + shared_memory_in_gb: 8 + image: vllm/vllm-openai:latest + port_mappings: + - container_port: 8000 + host_port: 80 + - container_port: 8000 + host_port: 80 + registry_credentials: + password: password + username: username + envs: + - name: HUGGING_FACE_HUB_TOKEN + value: hugging_face_api_token + - name: HUGGING_FACE_HUB_TOKEN + value: hugging_face_api_token + volume_mounts: + - host_path: "~/.cache/huggingface" + container_path: /root/.cache/huggingface + - host_path: "~/.cache/huggingface" + container_path: /root/.cache/huggingface + script_configuration: + base64_script: IyEvYmluL2Jhc2gKCiMgRW5kbGVzcyBsb29wCndoaWxlIHRydWUKZG8KICAgICMgRmV0Y2ggYSBjYXQgZmFjdCB3aXRoIGEgbWF4aW11bSBsZW5ndGggb2YgMTQwIGNoYXJhY3RlcnMKICAgIGN1cmwgLS1uby1wcm9ncmVzcy1tZXRlciBodHRwczovL2NhdGZhY3QubmluamEvZmFjdD9tYXhfbGVuZ3RoPTE0MAoKICAgICMgUHJpbnQgYSBuZXdsaW5lIGZvciByZWFkYWJpbGl0eQogICAgZWNobwoKICAgICMgU2xlZXAgZm9yIDMgc2Vjb25kcyBiZWZvcmUgdGhlIG5leHQgaXRlcmF0aW9uCiAgICBzbGVlcCAzCmRvbmUKCgo= + type: docker + cloud_instance_type: gpu_1x_a6000 + ip: 1.0.0.1 + created_at: 2016-08-29T09:12:33.001Z + cloud_assigned_id: 13b057d7-e266-4869-985f-760fe75a78b3 + deleted_at: 2016-08-29T09:12:33.001Z + shade_cloud: true + shade_instance_type: A6000 + tags: + - tag1 + - tag1 + cloud: hyperstack + hourly_price: 210 + cost_estimate: "103.4" + boot_time: + max_boot_in_sec: 300 + min_boot_in_sec: 180 + port_mappings: + - external_port: 80 + internal_port: 8000 + - external_port: 80 + internal_port: 8000 + name: cool-gpu-server + id: d290f1ee-6c54-4b01-90e6-d701748f0851 + region: canada-1 + active_at: 2016-08-29T09:12:33.001Z + status_details: downloading + ssh_user: shadeform + status: active + created_at: 2000-01-23T04:56:07.000+00:00 + cloud: denvr + hourly_price: 1500 + cloud_cluster_id: cluster-abc123 + cost_estimate: $15.00 + region_info: + region: houston-usa-1 + display_name: "US, Houston, TX" + updated_at: 2000-01-23T04:56:07.000+00:00 + name: devnr-cluster1 + id: 8eda86fe-0f36-41ed-9837-0ccf8f6e0fcb + active_at: 2000-01-23T04:56:07.000+00:00 + status_details: Cluster is provisioning + status: active + - instances: + - ssh_port: 22 + configuration: + nvlink: true + os: ubuntu_22_shade_os + num_gpus: 1 + gpu_type: A100 + memory_in_gb: 12 + vram_per_gpu_in_gb: 48 + vcpus: 6 + storage_in_gb: 256 + interconnect: pcie + gpu_manufacturer: nvidia + launch_configuration: + docker_configuration: + args: --model mistralai/Mistral-7B-v0.1 + shared_memory_in_gb: 8 + image: vllm/vllm-openai:latest + port_mappings: + - container_port: 8000 + host_port: 80 + - container_port: 8000 + host_port: 80 + registry_credentials: + password: password + username: username + envs: + - name: HUGGING_FACE_HUB_TOKEN + value: hugging_face_api_token + - name: HUGGING_FACE_HUB_TOKEN + value: hugging_face_api_token + volume_mounts: + - host_path: "~/.cache/huggingface" + container_path: /root/.cache/huggingface + - host_path: "~/.cache/huggingface" + container_path: /root/.cache/huggingface + script_configuration: + base64_script: IyEvYmluL2Jhc2gKCiMgRW5kbGVzcyBsb29wCndoaWxlIHRydWUKZG8KICAgICMgRmV0Y2ggYSBjYXQgZmFjdCB3aXRoIGEgbWF4aW11bSBsZW5ndGggb2YgMTQwIGNoYXJhY3RlcnMKICAgIGN1cmwgLS1uby1wcm9ncmVzcy1tZXRlciBodHRwczovL2NhdGZhY3QubmluamEvZmFjdD9tYXhfbGVuZ3RoPTE0MAoKICAgICMgUHJpbnQgYSBuZXdsaW5lIGZvciByZWFkYWJpbGl0eQogICAgZWNobwoKICAgICMgU2xlZXAgZm9yIDMgc2Vjb25kcyBiZWZvcmUgdGhlIG5leHQgaXRlcmF0aW9uCiAgICBzbGVlcCAzCmRvbmUKCgo= + type: docker + cloud_instance_type: gpu_1x_a6000 + ip: 1.0.0.1 + created_at: 2016-08-29T09:12:33.001Z + cloud_assigned_id: 13b057d7-e266-4869-985f-760fe75a78b3 + deleted_at: 2016-08-29T09:12:33.001Z + shade_cloud: true + shade_instance_type: A6000 + tags: + - tag1 + - tag1 + cloud: hyperstack + hourly_price: 210 + cost_estimate: "103.4" + boot_time: + max_boot_in_sec: 300 + min_boot_in_sec: 180 + port_mappings: + - external_port: 80 + internal_port: 8000 + - external_port: 80 + internal_port: 8000 + name: cool-gpu-server + id: d290f1ee-6c54-4b01-90e6-d701748f0851 + region: canada-1 + active_at: 2016-08-29T09:12:33.001Z + status_details: downloading + ssh_user: shadeform + status: active + - ssh_port: 22 + configuration: + nvlink: true + os: ubuntu_22_shade_os + num_gpus: 1 + gpu_type: A100 + memory_in_gb: 12 + vram_per_gpu_in_gb: 48 + vcpus: 6 + storage_in_gb: 256 + interconnect: pcie + gpu_manufacturer: nvidia + launch_configuration: + docker_configuration: + args: --model mistralai/Mistral-7B-v0.1 + shared_memory_in_gb: 8 + image: vllm/vllm-openai:latest + port_mappings: + - container_port: 8000 + host_port: 80 + - container_port: 8000 + host_port: 80 + registry_credentials: + password: password + username: username + envs: + - name: HUGGING_FACE_HUB_TOKEN + value: hugging_face_api_token + - name: HUGGING_FACE_HUB_TOKEN + value: hugging_face_api_token + volume_mounts: + - host_path: "~/.cache/huggingface" + container_path: /root/.cache/huggingface + - host_path: "~/.cache/huggingface" + container_path: /root/.cache/huggingface + script_configuration: + base64_script: IyEvYmluL2Jhc2gKCiMgRW5kbGVzcyBsb29wCndoaWxlIHRydWUKZG8KICAgICMgRmV0Y2ggYSBjYXQgZmFjdCB3aXRoIGEgbWF4aW11bSBsZW5ndGggb2YgMTQwIGNoYXJhY3RlcnMKICAgIGN1cmwgLS1uby1wcm9ncmVzcy1tZXRlciBodHRwczovL2NhdGZhY3QubmluamEvZmFjdD9tYXhfbGVuZ3RoPTE0MAoKICAgICMgUHJpbnQgYSBuZXdsaW5lIGZvciByZWFkYWJpbGl0eQogICAgZWNobwoKICAgICMgU2xlZXAgZm9yIDMgc2Vjb25kcyBiZWZvcmUgdGhlIG5leHQgaXRlcmF0aW9uCiAgICBzbGVlcCAzCmRvbmUKCgo= + type: docker + cloud_instance_type: gpu_1x_a6000 + ip: 1.0.0.1 + created_at: 2016-08-29T09:12:33.001Z + cloud_assigned_id: 13b057d7-e266-4869-985f-760fe75a78b3 + deleted_at: 2016-08-29T09:12:33.001Z + shade_cloud: true + shade_instance_type: A6000 + tags: + - tag1 + - tag1 + cloud: hyperstack + hourly_price: 210 + cost_estimate: "103.4" + boot_time: + max_boot_in_sec: 300 + min_boot_in_sec: 180 + port_mappings: + - external_port: 80 + internal_port: 8000 + - external_port: 80 + internal_port: 8000 + name: cool-gpu-server + id: d290f1ee-6c54-4b01-90e6-d701748f0851 + region: canada-1 + active_at: 2016-08-29T09:12:33.001Z + status_details: downloading + ssh_user: shadeform + status: active + created_at: 2000-01-23T04:56:07.000+00:00 + cloud: denvr + hourly_price: 1500 + cloud_cluster_id: cluster-abc123 + cost_estimate: $15.00 + region_info: + region: houston-usa-1 + display_name: "US, Houston, TX" + updated_at: 2000-01-23T04:56:07.000+00:00 + name: devnr-cluster1 + id: 8eda86fe-0f36-41ed-9837-0ccf8f6e0fcb + active_at: 2000-01-23T04:56:07.000+00:00 + status_details: Cluster is provisioning + status: active + properties: + clusters: + items: + $ref: '#/components/schemas/Cluster' + type: array + required: + - clusters + type: object + Cluster: + example: + instances: + - ssh_port: 22 + configuration: + nvlink: true + os: ubuntu_22_shade_os + num_gpus: 1 + gpu_type: A100 + memory_in_gb: 12 + vram_per_gpu_in_gb: 48 + vcpus: 6 + storage_in_gb: 256 + interconnect: pcie + gpu_manufacturer: nvidia + launch_configuration: + docker_configuration: + args: --model mistralai/Mistral-7B-v0.1 + shared_memory_in_gb: 8 + image: vllm/vllm-openai:latest + port_mappings: + - container_port: 8000 + host_port: 80 + - container_port: 8000 + host_port: 80 + registry_credentials: + password: password + username: username + envs: + - name: HUGGING_FACE_HUB_TOKEN + value: hugging_face_api_token + - name: HUGGING_FACE_HUB_TOKEN + value: hugging_face_api_token + volume_mounts: + - host_path: "~/.cache/huggingface" + container_path: /root/.cache/huggingface + - host_path: "~/.cache/huggingface" + container_path: /root/.cache/huggingface + script_configuration: + base64_script: IyEvYmluL2Jhc2gKCiMgRW5kbGVzcyBsb29wCndoaWxlIHRydWUKZG8KICAgICMgRmV0Y2ggYSBjYXQgZmFjdCB3aXRoIGEgbWF4aW11bSBsZW5ndGggb2YgMTQwIGNoYXJhY3RlcnMKICAgIGN1cmwgLS1uby1wcm9ncmVzcy1tZXRlciBodHRwczovL2NhdGZhY3QubmluamEvZmFjdD9tYXhfbGVuZ3RoPTE0MAoKICAgICMgUHJpbnQgYSBuZXdsaW5lIGZvciByZWFkYWJpbGl0eQogICAgZWNobwoKICAgICMgU2xlZXAgZm9yIDMgc2Vjb25kcyBiZWZvcmUgdGhlIG5leHQgaXRlcmF0aW9uCiAgICBzbGVlcCAzCmRvbmUKCgo= + type: docker + cloud_instance_type: gpu_1x_a6000 + ip: 1.0.0.1 + created_at: 2016-08-29T09:12:33.001Z + cloud_assigned_id: 13b057d7-e266-4869-985f-760fe75a78b3 + deleted_at: 2016-08-29T09:12:33.001Z + shade_cloud: true + shade_instance_type: A6000 + tags: + - tag1 + - tag1 + cloud: hyperstack + hourly_price: 210 + cost_estimate: "103.4" + boot_time: + max_boot_in_sec: 300 + min_boot_in_sec: 180 + port_mappings: + - external_port: 80 + internal_port: 8000 + - external_port: 80 + internal_port: 8000 + name: cool-gpu-server + id: d290f1ee-6c54-4b01-90e6-d701748f0851 + region: canada-1 + active_at: 2016-08-29T09:12:33.001Z + status_details: downloading + ssh_user: shadeform + status: active + - ssh_port: 22 + configuration: + nvlink: true + os: ubuntu_22_shade_os + num_gpus: 1 + gpu_type: A100 + memory_in_gb: 12 + vram_per_gpu_in_gb: 48 + vcpus: 6 + storage_in_gb: 256 + interconnect: pcie + gpu_manufacturer: nvidia + launch_configuration: + docker_configuration: + args: --model mistralai/Mistral-7B-v0.1 + shared_memory_in_gb: 8 + image: vllm/vllm-openai:latest + port_mappings: + - container_port: 8000 + host_port: 80 + - container_port: 8000 + host_port: 80 + registry_credentials: + password: password + username: username + envs: + - name: HUGGING_FACE_HUB_TOKEN + value: hugging_face_api_token + - name: HUGGING_FACE_HUB_TOKEN + value: hugging_face_api_token + volume_mounts: + - host_path: "~/.cache/huggingface" + container_path: /root/.cache/huggingface + - host_path: "~/.cache/huggingface" + container_path: /root/.cache/huggingface + script_configuration: + base64_script: IyEvYmluL2Jhc2gKCiMgRW5kbGVzcyBsb29wCndoaWxlIHRydWUKZG8KICAgICMgRmV0Y2ggYSBjYXQgZmFjdCB3aXRoIGEgbWF4aW11bSBsZW5ndGggb2YgMTQwIGNoYXJhY3RlcnMKICAgIGN1cmwgLS1uby1wcm9ncmVzcy1tZXRlciBodHRwczovL2NhdGZhY3QubmluamEvZmFjdD9tYXhfbGVuZ3RoPTE0MAoKICAgICMgUHJpbnQgYSBuZXdsaW5lIGZvciByZWFkYWJpbGl0eQogICAgZWNobwoKICAgICMgU2xlZXAgZm9yIDMgc2Vjb25kcyBiZWZvcmUgdGhlIG5leHQgaXRlcmF0aW9uCiAgICBzbGVlcCAzCmRvbmUKCgo= + type: docker + cloud_instance_type: gpu_1x_a6000 + ip: 1.0.0.1 + created_at: 2016-08-29T09:12:33.001Z + cloud_assigned_id: 13b057d7-e266-4869-985f-760fe75a78b3 + deleted_at: 2016-08-29T09:12:33.001Z + shade_cloud: true + shade_instance_type: A6000 + tags: + - tag1 + - tag1 + cloud: hyperstack + hourly_price: 210 + cost_estimate: "103.4" + boot_time: + max_boot_in_sec: 300 + min_boot_in_sec: 180 + port_mappings: + - external_port: 80 + internal_port: 8000 + - external_port: 80 + internal_port: 8000 + name: cool-gpu-server + id: d290f1ee-6c54-4b01-90e6-d701748f0851 + region: canada-1 + active_at: 2016-08-29T09:12:33.001Z + status_details: downloading + ssh_user: shadeform + status: active + created_at: 2000-01-23T04:56:07.000+00:00 + cloud: denvr + hourly_price: 1500 + cloud_cluster_id: cluster-abc123 + cost_estimate: $15.00 + region_info: + region: houston-usa-1 + display_name: "US, Houston, TX" + updated_at: 2000-01-23T04:56:07.000+00:00 + name: devnr-cluster1 + id: 8eda86fe-0f36-41ed-9837-0ccf8f6e0fcb + active_at: 2000-01-23T04:56:07.000+00:00 + status_details: Cluster is provisioning + status: active + properties: + id: + description: The unique identifier for the cluster. + example: 8eda86fe-0f36-41ed-9837-0ccf8f6e0fcb + format: uuid + type: string + cloud: + description: The cloud provider for the cluster. + example: denvr + type: string + name: + description: The name of the cluster. + example: devnr-cluster1 + type: string + cloud_cluster_id: + description: The cloud provider assigned cluster ID. + example: cluster-abc123 + nullable: true + type: string + region_info: + $ref: '#/components/schemas/ClusterRegionInfo' + status: + description: The current status of the cluster. + example: active + type: string + status_details: + description: Additional details about the cluster status. + example: Cluster is provisioning + nullable: true + type: string + created_at: + description: The timestamp when the cluster was created. + format: date-time + type: string + updated_at: + description: The timestamp when the cluster was last updated. + format: date-time + type: string + instances: + description: Array of instances in the cluster. + items: + $ref: '#/components/schemas/Instance' + type: array + hourly_price: + description: The hourly price of the cluster in cents. + example: 1500 + type: integer + cost_estimate: + description: Estimated cost of the cluster. + example: $15.00 + nullable: true + type: string + active_at: + description: The timestamp when the cluster became active. + format: date-time + nullable: true + type: string + required: + - cloud + - created_at + - hourly_price + - id + - instances + - name + - region_info + - status + - updated_at + type: object + ClusterRegionInfo: + example: + region: houston-usa-1 + display_name: "US, Houston, TX" + properties: + region: + description: The region code. + example: houston-usa-1 + type: string + display_name: + description: Human-readable display name for the region. + example: "US, Houston, TX" + type: string + required: + - display_name + - region + type: object + ClusterAvailability: + properties: + region: + description: The region code. + example: houston-usa-1 + type: string + display_name: + description: Human-readable display name for the region. + example: "US, Houston, TX" + type: string + available: + description: Whether the cluster type is available in this region. + example: true + type: boolean + required: + - available + - display_name + - region + type: object + ClusterTypesResponse: + example: + cluster_types: + - cloud: denvr + num_instances: 2 + availability: + region: houston-usa-1 + display_name: "US, Houston, TX" + available: true + cluster_type: + cloud: denvr + shade_instance_type: H100_sxm5x8 + cloud_instance_type: H100_80GB_SXM_8x + configuration: + memory_in_gb: 940 + storage_in_gb: 20000 + vcpus: 208 + num_gpus: 8 + gpu_type: H100 + interconnect: sxm5 + nvlink: true + os_options: + - ubuntu22.04_cuda12.4_shade_os + - ubuntu20.04_cuda12.4_shade_os + - ubuntu20.04 + - ubuntu22.04 + vram_per_gpu_in_gb: 80 + gpu_manufacturer: nvidia + memory_in_gb: 940 + storage_in_gb: 20000 + vcpus: 208 + num_gpus: 8 + gpu_type: H100 + interconnect: sxm5 + nvlink: true + hourly_price: 1400 + boot_time: + min_boot_in_sec: 600 + max_boot_in_sec: 1200 + deployment_type: vm + properties: + cluster_types: + example: + - cloud: denvr + num_instances: 2 + availability: + region: houston-usa-1 + display_name: "US, Houston, TX" + available: true + cluster_type: + cloud: denvr + shade_instance_type: H100_sxm5x8 + cloud_instance_type: H100_80GB_SXM_8x + configuration: + memory_in_gb: 940 + storage_in_gb: 20000 + vcpus: 208 + num_gpus: 8 + gpu_type: H100 + interconnect: sxm5 + nvlink: true + os_options: + - ubuntu22.04_cuda12.4_shade_os + - ubuntu20.04_cuda12.4_shade_os + - ubuntu20.04 + - ubuntu22.04 + vram_per_gpu_in_gb: 80 + gpu_manufacturer: nvidia + memory_in_gb: 940 + storage_in_gb: 20000 + vcpus: 208 + num_gpus: 8 + gpu_type: H100 + interconnect: sxm5 + nvlink: true + hourly_price: 1400 + boot_time: + min_boot_in_sec: 600 + max_boot_in_sec: 1200 + deployment_type: vm + items: + $ref: '#/components/schemas/ClusterType' + type: array + required: + - cluster_types + type: object + ClusterType: + properties: + cloud: + description: The cloud provider. + example: denvr + type: string + num_instances: + description: The number of instances in this cluster type. + example: 2 + type: integer + availability: + $ref: '#/components/schemas/ClusterAvailability' + cluster_type: + $ref: '#/components/schemas/InstanceType' + required: + - availability + - cloud + - cluster_type + - num_instances + type: object + CreateClusterRequest: + example: + cloud: denvr + os: ubuntu20.04 + ssh_key_id: f0c6ac6d-7240-4968-8eb7-a11c4a0a5dc6 + name: protestant-aquamarine-cluster + cluster_type: H100_sxm5x8 + region: houston-usa-1 + num_instances: 2 + properties: + name: + description: The name of the cluster. + example: protestant-aquamarine-cluster + type: string + cloud: + description: The cloud provider for the cluster. + example: denvr + type: string + region: + description: The region where the cluster will be deployed. + example: houston-usa-1 + type: string + cluster_type: + description: The type of GPU cluster to create. + example: H100_sxm5x8 + type: string + num_instances: + description: The number of instances in the cluster. + example: 2 + type: integer + ssh_key_id: + description: The SSH key ID to use for the cluster instances. + example: f0c6ac6d-7240-4968-8eb7-a11c4a0a5dc6 + type: string + os: + description: The operating system for the cluster. + example: ubuntu20.04 + type: string + required: + - cloud + - cluster_type + - name + - num_instances + - region + type: object + CreateClusterResponse: + description: Response of the /clusters/create API call + example: + id: 8eda86fe-0f36-41ed-9837-0ccf8f6e0fcb + properties: + id: + description: The unique identifier for the newly created cluster. + example: 8eda86fe-0f36-41ed-9837-0ccf8f6e0fcb + format: uuid + type: string + required: + - id + type: object + ClusterInfoResponse: + allOf: + - $ref: '#/components/schemas/Cluster' + example: + instances: + - ssh_port: 22 + configuration: + nvlink: true + os: ubuntu_22_shade_os + num_gpus: 1 + gpu_type: A100 + memory_in_gb: 12 + vram_per_gpu_in_gb: 48 + vcpus: 6 + storage_in_gb: 256 + interconnect: pcie + gpu_manufacturer: nvidia + launch_configuration: + docker_configuration: + args: --model mistralai/Mistral-7B-v0.1 + shared_memory_in_gb: 8 + image: vllm/vllm-openai:latest + port_mappings: + - container_port: 8000 + host_port: 80 + - container_port: 8000 + host_port: 80 + registry_credentials: + password: password + username: username + envs: + - name: HUGGING_FACE_HUB_TOKEN + value: hugging_face_api_token + - name: HUGGING_FACE_HUB_TOKEN + value: hugging_face_api_token + volume_mounts: + - host_path: "~/.cache/huggingface" + container_path: /root/.cache/huggingface + - host_path: "~/.cache/huggingface" + container_path: /root/.cache/huggingface + script_configuration: + base64_script: IyEvYmluL2Jhc2gKCiMgRW5kbGVzcyBsb29wCndoaWxlIHRydWUKZG8KICAgICMgRmV0Y2ggYSBjYXQgZmFjdCB3aXRoIGEgbWF4aW11bSBsZW5ndGggb2YgMTQwIGNoYXJhY3RlcnMKICAgIGN1cmwgLS1uby1wcm9ncmVzcy1tZXRlciBodHRwczovL2NhdGZhY3QubmluamEvZmFjdD9tYXhfbGVuZ3RoPTE0MAoKICAgICMgUHJpbnQgYSBuZXdsaW5lIGZvciByZWFkYWJpbGl0eQogICAgZWNobwoKICAgICMgU2xlZXAgZm9yIDMgc2Vjb25kcyBiZWZvcmUgdGhlIG5leHQgaXRlcmF0aW9uCiAgICBzbGVlcCAzCmRvbmUKCgo= + type: docker + cloud_instance_type: gpu_1x_a6000 + ip: 1.0.0.1 + created_at: 2016-08-29T09:12:33.001Z + cloud_assigned_id: 13b057d7-e266-4869-985f-760fe75a78b3 + deleted_at: 2016-08-29T09:12:33.001Z + shade_cloud: true + shade_instance_type: A6000 + tags: + - tag1 + - tag1 + cloud: hyperstack + hourly_price: 210 + cost_estimate: "103.4" + boot_time: + max_boot_in_sec: 300 + min_boot_in_sec: 180 + port_mappings: + - external_port: 80 + internal_port: 8000 + - external_port: 80 + internal_port: 8000 + name: cool-gpu-server + id: d290f1ee-6c54-4b01-90e6-d701748f0851 + region: canada-1 + active_at: 2016-08-29T09:12:33.001Z + status_details: downloading + ssh_user: shadeform + status: active + - ssh_port: 22 + configuration: + nvlink: true + os: ubuntu_22_shade_os + num_gpus: 1 + gpu_type: A100 + memory_in_gb: 12 + vram_per_gpu_in_gb: 48 + vcpus: 6 + storage_in_gb: 256 + interconnect: pcie + gpu_manufacturer: nvidia + launch_configuration: + docker_configuration: + args: --model mistralai/Mistral-7B-v0.1 + shared_memory_in_gb: 8 + image: vllm/vllm-openai:latest + port_mappings: + - container_port: 8000 + host_port: 80 + - container_port: 8000 + host_port: 80 + registry_credentials: + password: password + username: username + envs: + - name: HUGGING_FACE_HUB_TOKEN + value: hugging_face_api_token + - name: HUGGING_FACE_HUB_TOKEN + value: hugging_face_api_token + volume_mounts: + - host_path: "~/.cache/huggingface" + container_path: /root/.cache/huggingface + - host_path: "~/.cache/huggingface" + container_path: /root/.cache/huggingface + script_configuration: + base64_script: IyEvYmluL2Jhc2gKCiMgRW5kbGVzcyBsb29wCndoaWxlIHRydWUKZG8KICAgICMgRmV0Y2ggYSBjYXQgZmFjdCB3aXRoIGEgbWF4aW11bSBsZW5ndGggb2YgMTQwIGNoYXJhY3RlcnMKICAgIGN1cmwgLS1uby1wcm9ncmVzcy1tZXRlciBodHRwczovL2NhdGZhY3QubmluamEvZmFjdD9tYXhfbGVuZ3RoPTE0MAoKICAgICMgUHJpbnQgYSBuZXdsaW5lIGZvciByZWFkYWJpbGl0eQogICAgZWNobwoKICAgICMgU2xlZXAgZm9yIDMgc2Vjb25kcyBiZWZvcmUgdGhlIG5leHQgaXRlcmF0aW9uCiAgICBzbGVlcCAzCmRvbmUKCgo= + type: docker + cloud_instance_type: gpu_1x_a6000 + ip: 1.0.0.1 + created_at: 2016-08-29T09:12:33.001Z + cloud_assigned_id: 13b057d7-e266-4869-985f-760fe75a78b3 + deleted_at: 2016-08-29T09:12:33.001Z + shade_cloud: true + shade_instance_type: A6000 + tags: + - tag1 + - tag1 + cloud: hyperstack + hourly_price: 210 + cost_estimate: "103.4" + boot_time: + max_boot_in_sec: 300 + min_boot_in_sec: 180 + port_mappings: + - external_port: 80 + internal_port: 8000 + - external_port: 80 + internal_port: 8000 + name: cool-gpu-server + id: d290f1ee-6c54-4b01-90e6-d701748f0851 + region: canada-1 + active_at: 2016-08-29T09:12:33.001Z + status_details: downloading + ssh_user: shadeform + status: active + created_at: 2000-01-23T04:56:07.000+00:00 + cloud: denvr + hourly_price: 1500 + cloud_cluster_id: cluster-abc123 + cost_estimate: $15.00 + region_info: + region: houston-usa-1 + display_name: "US, Houston, TX" + updated_at: 2000-01-23T04:56:07.000+00:00 + name: devnr-cluster1 + id: 8eda86fe-0f36-41ed-9837-0ccf8f6e0fcb + active_at: 2000-01-23T04:56:07.000+00:00 + status_details: Cluster is provisioning + status: active Cloud: description: "Specifies the underlying cloud provider. See this [explanation](/getting-started/concepts#cloud-cloud-provider)\ \ for more details." - enum: - - lambdalabs - - paperspace - - vultr - - datacrunch - - latitude - - massedcompute - - imwt - - hyperstack - - nebius - - crusoe - - denvr - - digitalocean - - tcm - - hotaisle - - cudo - - scaleway - - evergreen - - excesssupply - - voltagepark - - boostrun - - ionstream - - whitefiber - - horizon - - fpt - - hydra - - amaya - - verda example: hyperstack type: string Region: @@ -2069,7 +3012,10 @@ components: size_in_gb: 100 properties: cloud: - $ref: '#/components/schemas/Cloud' + description: "Specifies the underlying cloud provider. See this [explanation](/getting-started/concepts#cloud-cloud-provider)\ + \ for more details." + example: hyperstack + type: string region: description: Specifies the region. example: canada-1 @@ -2138,7 +3084,10 @@ components: example: 78a0dd5a-dbb1-4568-b55c-5e7e0a8b0c40 type: string cloud: - $ref: '#/components/schemas/Cloud' + description: "Specifies the underlying cloud provider. See this [explanation](/getting-started/concepts#cloud-cloud-provider)\ + \ for more details." + example: hyperstack + type: string cloud_assigned_id: description: The unique identifier of the storage volume issued by the underlying cloud provider. @@ -2726,7 +3675,10 @@ components: region: canada-1 properties: cloud: - $ref: '#/components/schemas/Cloud' + description: "Specifies the underlying cloud provider. See this [explanation](/getting-started/concepts#cloud-cloud-provider)\ + \ for more details." + example: hyperstack + type: string region: description: Specifies the region. example: canada-1 diff --git a/v1/providers/shadeform/gen/shadeform/api_default.go b/v1/providers/shadeform/gen/shadeform/api_default.go index 3d2b6923..14812e73 100644 --- a/v1/providers/shadeform/gen/shadeform/api_default.go +++ b/v1/providers/shadeform/gen/shadeform/api_default.go @@ -23,6 +23,580 @@ import ( // DefaultAPIService DefaultAPI service type DefaultAPIService service +type ApiClustersRequest struct { + ctx context.Context + ApiService *DefaultAPIService +} + +func (r ApiClustersRequest) Execute() (*ClustersResponse, *http.Response, error) { + return r.ApiService.ClustersExecute(r) +} + +/* +Clusters /clusters + +Get all non deleted clusters. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiClustersRequest +*/ +func (a *DefaultAPIService) Clusters(ctx context.Context) ApiClustersRequest { + return ApiClustersRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return ClustersResponse +func (a *DefaultAPIService) ClustersExecute(r ApiClustersRequest) (*ClustersResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ClustersResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.Clusters") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/clusters" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["ApiKeyAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-API-KEY"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiClustersCreateRequest struct { + ctx context.Context + ApiService *DefaultAPIService + createClusterRequest *CreateClusterRequest +} + +func (r ApiClustersCreateRequest) CreateClusterRequest(createClusterRequest CreateClusterRequest) ApiClustersCreateRequest { + r.createClusterRequest = &createClusterRequest + return r +} + +func (r ApiClustersCreateRequest) Execute() (*CreateClusterResponse, *http.Response, error) { + return r.ApiService.ClustersCreateExecute(r) +} + +/* +ClustersCreate /clusters/create + +Create a new GPU cluster. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiClustersCreateRequest +*/ +func (a *DefaultAPIService) ClustersCreate(ctx context.Context) ApiClustersCreateRequest { + return ApiClustersCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return CreateClusterResponse +func (a *DefaultAPIService) ClustersCreateExecute(r ApiClustersCreateRequest) (*CreateClusterResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CreateClusterResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ClustersCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/clusters/create" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createClusterRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["ApiKeyAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-API-KEY"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiClustersDeleteRequest struct { + ctx context.Context + ApiService *DefaultAPIService + id string +} + +func (r ApiClustersDeleteRequest) Execute() (*http.Response, error) { + return r.ApiService.ClustersDeleteExecute(r) +} + +/* +ClustersDelete /clusters/{id}/delete + +This will move the cluster to the 'deleting' status while the cluster is being deleted. Once the cluster has entered the 'deleting' status, the account will no longer be billed for the cluster. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id The cluster id + @return ApiClustersDeleteRequest +*/ +func (a *DefaultAPIService) ClustersDelete(ctx context.Context, id string) ApiClustersDeleteRequest { + return ApiClustersDeleteRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *DefaultAPIService) ClustersDeleteExecute(r ApiClustersDeleteRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ClustersDelete") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/clusters/{id}/delete" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["ApiKeyAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-API-KEY"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiClustersInfoRequest struct { + ctx context.Context + ApiService *DefaultAPIService + id string +} + +func (r ApiClustersInfoRequest) Execute() (*ClusterInfoResponse, *http.Response, error) { + return r.ApiService.ClustersInfoExecute(r) +} + +/* +ClustersInfo /clusters/{id}/info + +Get details for the specified, non deleted, cluster in the url. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id The cluster id + @return ApiClustersInfoRequest +*/ +func (a *DefaultAPIService) ClustersInfo(ctx context.Context, id string) ApiClustersInfoRequest { + return ApiClustersInfoRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ClusterInfoResponse +func (a *DefaultAPIService) ClustersInfoExecute(r ApiClustersInfoRequest) (*ClusterInfoResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ClusterInfoResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ClustersInfo") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/clusters/{id}/info" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["ApiKeyAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-API-KEY"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiClustersTypesRequest struct { + ctx context.Context + ApiService *DefaultAPIService +} + +func (r ApiClustersTypesRequest) Execute() (*ClusterTypesResponse, *http.Response, error) { + return r.ApiService.ClustersTypesExecute(r) +} + +/* +ClustersTypes /clusters/types + +Return all the GPU cluster types with their corresponding availability and specs. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiClustersTypesRequest +*/ +func (a *DefaultAPIService) ClustersTypes(ctx context.Context) ApiClustersTypesRequest { + return ApiClustersTypesRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return ClusterTypesResponse +func (a *DefaultAPIService) ClustersTypesExecute(r ApiClustersTypesRequest) (*ClusterTypesResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ClusterTypesResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ClustersTypes") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/clusters/types" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["ApiKeyAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-API-KEY"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + type ApiInstancesRequest struct { ctx context.Context ApiService *DefaultAPIService diff --git a/v1/providers/shadeform/gen/shadeform/docs/Cloud.md b/v1/providers/shadeform/gen/shadeform/docs/Cloud.md deleted file mode 100644 index dbee995b..00000000 --- a/v1/providers/shadeform/gen/shadeform/docs/Cloud.md +++ /dev/null @@ -1,63 +0,0 @@ -# Cloud - -## Enum - - -* `LAMBDALABS` (value: `"lambdalabs"`) - -* `PAPERSPACE` (value: `"paperspace"`) - -* `VULTR` (value: `"vultr"`) - -* `DATACRUNCH` (value: `"datacrunch"`) - -* `LATITUDE` (value: `"latitude"`) - -* `MASSEDCOMPUTE` (value: `"massedcompute"`) - -* `IMWT` (value: `"imwt"`) - -* `HYPERSTACK` (value: `"hyperstack"`) - -* `NEBIUS` (value: `"nebius"`) - -* `CRUSOE` (value: `"crusoe"`) - -* `DENVR` (value: `"denvr"`) - -* `DIGITALOCEAN` (value: `"digitalocean"`) - -* `TCM` (value: `"tcm"`) - -* `HOTAISLE` (value: `"hotaisle"`) - -* `CUDO` (value: `"cudo"`) - -* `SCALEWAY` (value: `"scaleway"`) - -* `EVERGREEN` (value: `"evergreen"`) - -* `EXCESSSUPPLY` (value: `"excesssupply"`) - -* `VOLTAGEPARK` (value: `"voltagepark"`) - -* `BOOSTRUN` (value: `"boostrun"`) - -* `IONSTREAM` (value: `"ionstream"`) - -* `WHITEFIBER` (value: `"whitefiber"`) - -* `HORIZON` (value: `"horizon"`) - -* `FPT` (value: `"fpt"`) - -* `HYDRA` (value: `"hydra"`) - -* `AMAYA` (value: `"amaya"`) - -* `VERDA` (value: `"verda"`) - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v1/providers/shadeform/gen/shadeform/docs/Cluster.md b/v1/providers/shadeform/gen/shadeform/docs/Cluster.md new file mode 100644 index 00000000..5560a394 --- /dev/null +++ b/v1/providers/shadeform/gen/shadeform/docs/Cluster.md @@ -0,0 +1,363 @@ +# Cluster + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | The unique identifier for the cluster. | +**Cloud** | **string** | The cloud provider for the cluster. | +**Name** | **string** | The name of the cluster. | +**CloudClusterId** | Pointer to **NullableString** | The cloud provider assigned cluster ID. | [optional] +**RegionInfo** | [**ClusterRegionInfo**](ClusterRegionInfo.md) | | +**Status** | **string** | The current status of the cluster. | +**StatusDetails** | Pointer to **NullableString** | Additional details about the cluster status. | [optional] +**CreatedAt** | **time.Time** | The timestamp when the cluster was created. | +**UpdatedAt** | **time.Time** | The timestamp when the cluster was last updated. | +**Instances** | [**[]Instance**](Instance.md) | Array of instances in the cluster. | +**HourlyPrice** | **int32** | The hourly price of the cluster in cents. | +**CostEstimate** | Pointer to **NullableString** | Estimated cost of the cluster. | [optional] +**ActiveAt** | Pointer to **NullableTime** | The timestamp when the cluster became active. | [optional] + +## Methods + +### NewCluster + +`func NewCluster(id string, cloud string, name string, regionInfo ClusterRegionInfo, status string, createdAt time.Time, updatedAt time.Time, instances []Instance, hourlyPrice int32, ) *Cluster` + +NewCluster instantiates a new Cluster object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewClusterWithDefaults + +`func NewClusterWithDefaults() *Cluster` + +NewClusterWithDefaults instantiates a new Cluster object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *Cluster) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *Cluster) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *Cluster) SetId(v string)` + +SetId sets Id field to given value. + + +### GetCloud + +`func (o *Cluster) GetCloud() string` + +GetCloud returns the Cloud field if non-nil, zero value otherwise. + +### GetCloudOk + +`func (o *Cluster) GetCloudOk() (*string, bool)` + +GetCloudOk returns a tuple with the Cloud field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCloud + +`func (o *Cluster) SetCloud(v string)` + +SetCloud sets Cloud field to given value. + + +### GetName + +`func (o *Cluster) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *Cluster) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *Cluster) SetName(v string)` + +SetName sets Name field to given value. + + +### GetCloudClusterId + +`func (o *Cluster) GetCloudClusterId() string` + +GetCloudClusterId returns the CloudClusterId field if non-nil, zero value otherwise. + +### GetCloudClusterIdOk + +`func (o *Cluster) GetCloudClusterIdOk() (*string, bool)` + +GetCloudClusterIdOk returns a tuple with the CloudClusterId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCloudClusterId + +`func (o *Cluster) SetCloudClusterId(v string)` + +SetCloudClusterId sets CloudClusterId field to given value. + +### HasCloudClusterId + +`func (o *Cluster) HasCloudClusterId() bool` + +HasCloudClusterId returns a boolean if a field has been set. + +### SetCloudClusterIdNil + +`func (o *Cluster) SetCloudClusterIdNil(b bool)` + + SetCloudClusterIdNil sets the value for CloudClusterId to be an explicit nil + +### UnsetCloudClusterId +`func (o *Cluster) UnsetCloudClusterId()` + +UnsetCloudClusterId ensures that no value is present for CloudClusterId, not even an explicit nil +### GetRegionInfo + +`func (o *Cluster) GetRegionInfo() ClusterRegionInfo` + +GetRegionInfo returns the RegionInfo field if non-nil, zero value otherwise. + +### GetRegionInfoOk + +`func (o *Cluster) GetRegionInfoOk() (*ClusterRegionInfo, bool)` + +GetRegionInfoOk returns a tuple with the RegionInfo field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRegionInfo + +`func (o *Cluster) SetRegionInfo(v ClusterRegionInfo)` + +SetRegionInfo sets RegionInfo field to given value. + + +### GetStatus + +`func (o *Cluster) GetStatus() string` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *Cluster) GetStatusOk() (*string, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *Cluster) SetStatus(v string)` + +SetStatus sets Status field to given value. + + +### GetStatusDetails + +`func (o *Cluster) GetStatusDetails() string` + +GetStatusDetails returns the StatusDetails field if non-nil, zero value otherwise. + +### GetStatusDetailsOk + +`func (o *Cluster) GetStatusDetailsOk() (*string, bool)` + +GetStatusDetailsOk returns a tuple with the StatusDetails field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatusDetails + +`func (o *Cluster) SetStatusDetails(v string)` + +SetStatusDetails sets StatusDetails field to given value. + +### HasStatusDetails + +`func (o *Cluster) HasStatusDetails() bool` + +HasStatusDetails returns a boolean if a field has been set. + +### SetStatusDetailsNil + +`func (o *Cluster) SetStatusDetailsNil(b bool)` + + SetStatusDetailsNil sets the value for StatusDetails to be an explicit nil + +### UnsetStatusDetails +`func (o *Cluster) UnsetStatusDetails()` + +UnsetStatusDetails ensures that no value is present for StatusDetails, not even an explicit nil +### GetCreatedAt + +`func (o *Cluster) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *Cluster) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *Cluster) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + + +### GetUpdatedAt + +`func (o *Cluster) GetUpdatedAt() time.Time` + +GetUpdatedAt returns the UpdatedAt field if non-nil, zero value otherwise. + +### GetUpdatedAtOk + +`func (o *Cluster) GetUpdatedAtOk() (*time.Time, bool)` + +GetUpdatedAtOk returns a tuple with the UpdatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdatedAt + +`func (o *Cluster) SetUpdatedAt(v time.Time)` + +SetUpdatedAt sets UpdatedAt field to given value. + + +### GetInstances + +`func (o *Cluster) GetInstances() []Instance` + +GetInstances returns the Instances field if non-nil, zero value otherwise. + +### GetInstancesOk + +`func (o *Cluster) GetInstancesOk() (*[]Instance, bool)` + +GetInstancesOk returns a tuple with the Instances field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInstances + +`func (o *Cluster) SetInstances(v []Instance)` + +SetInstances sets Instances field to given value. + + +### GetHourlyPrice + +`func (o *Cluster) GetHourlyPrice() int32` + +GetHourlyPrice returns the HourlyPrice field if non-nil, zero value otherwise. + +### GetHourlyPriceOk + +`func (o *Cluster) GetHourlyPriceOk() (*int32, bool)` + +GetHourlyPriceOk returns a tuple with the HourlyPrice field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHourlyPrice + +`func (o *Cluster) SetHourlyPrice(v int32)` + +SetHourlyPrice sets HourlyPrice field to given value. + + +### GetCostEstimate + +`func (o *Cluster) GetCostEstimate() string` + +GetCostEstimate returns the CostEstimate field if non-nil, zero value otherwise. + +### GetCostEstimateOk + +`func (o *Cluster) GetCostEstimateOk() (*string, bool)` + +GetCostEstimateOk returns a tuple with the CostEstimate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCostEstimate + +`func (o *Cluster) SetCostEstimate(v string)` + +SetCostEstimate sets CostEstimate field to given value. + +### HasCostEstimate + +`func (o *Cluster) HasCostEstimate() bool` + +HasCostEstimate returns a boolean if a field has been set. + +### SetCostEstimateNil + +`func (o *Cluster) SetCostEstimateNil(b bool)` + + SetCostEstimateNil sets the value for CostEstimate to be an explicit nil + +### UnsetCostEstimate +`func (o *Cluster) UnsetCostEstimate()` + +UnsetCostEstimate ensures that no value is present for CostEstimate, not even an explicit nil +### GetActiveAt + +`func (o *Cluster) GetActiveAt() time.Time` + +GetActiveAt returns the ActiveAt field if non-nil, zero value otherwise. + +### GetActiveAtOk + +`func (o *Cluster) GetActiveAtOk() (*time.Time, bool)` + +GetActiveAtOk returns a tuple with the ActiveAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActiveAt + +`func (o *Cluster) SetActiveAt(v time.Time)` + +SetActiveAt sets ActiveAt field to given value. + +### HasActiveAt + +`func (o *Cluster) HasActiveAt() bool` + +HasActiveAt returns a boolean if a field has been set. + +### SetActiveAtNil + +`func (o *Cluster) SetActiveAtNil(b bool)` + + SetActiveAtNil sets the value for ActiveAt to be an explicit nil + +### UnsetActiveAt +`func (o *Cluster) UnsetActiveAt()` + +UnsetActiveAt ensures that no value is present for ActiveAt, not even an explicit nil + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/v1/providers/shadeform/gen/shadeform/docs/ClusterAvailability.md b/v1/providers/shadeform/gen/shadeform/docs/ClusterAvailability.md new file mode 100644 index 00000000..4b17c8e0 --- /dev/null +++ b/v1/providers/shadeform/gen/shadeform/docs/ClusterAvailability.md @@ -0,0 +1,93 @@ +# ClusterAvailability + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Region** | **string** | The region code. | +**DisplayName** | **string** | Human-readable display name for the region. | +**Available** | **bool** | Whether the cluster type is available in this region. | + +## Methods + +### NewClusterAvailability + +`func NewClusterAvailability(region string, displayName string, available bool, ) *ClusterAvailability` + +NewClusterAvailability instantiates a new ClusterAvailability object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewClusterAvailabilityWithDefaults + +`func NewClusterAvailabilityWithDefaults() *ClusterAvailability` + +NewClusterAvailabilityWithDefaults instantiates a new ClusterAvailability object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetRegion + +`func (o *ClusterAvailability) GetRegion() string` + +GetRegion returns the Region field if non-nil, zero value otherwise. + +### GetRegionOk + +`func (o *ClusterAvailability) GetRegionOk() (*string, bool)` + +GetRegionOk returns a tuple with the Region field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRegion + +`func (o *ClusterAvailability) SetRegion(v string)` + +SetRegion sets Region field to given value. + + +### GetDisplayName + +`func (o *ClusterAvailability) GetDisplayName() string` + +GetDisplayName returns the DisplayName field if non-nil, zero value otherwise. + +### GetDisplayNameOk + +`func (o *ClusterAvailability) GetDisplayNameOk() (*string, bool)` + +GetDisplayNameOk returns a tuple with the DisplayName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDisplayName + +`func (o *ClusterAvailability) SetDisplayName(v string)` + +SetDisplayName sets DisplayName field to given value. + + +### GetAvailable + +`func (o *ClusterAvailability) GetAvailable() bool` + +GetAvailable returns the Available field if non-nil, zero value otherwise. + +### GetAvailableOk + +`func (o *ClusterAvailability) GetAvailableOk() (*bool, bool)` + +GetAvailableOk returns a tuple with the Available field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAvailable + +`func (o *ClusterAvailability) SetAvailable(v bool)` + +SetAvailable sets Available field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/v1/providers/shadeform/gen/shadeform/docs/ClusterInfoResponse.md b/v1/providers/shadeform/gen/shadeform/docs/ClusterInfoResponse.md new file mode 100644 index 00000000..74357197 --- /dev/null +++ b/v1/providers/shadeform/gen/shadeform/docs/ClusterInfoResponse.md @@ -0,0 +1,363 @@ +# ClusterInfoResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | The unique identifier for the cluster. | +**Cloud** | **string** | The cloud provider for the cluster. | +**Name** | **string** | The name of the cluster. | +**CloudClusterId** | Pointer to **NullableString** | The cloud provider assigned cluster ID. | [optional] +**RegionInfo** | [**ClusterRegionInfo**](ClusterRegionInfo.md) | | +**Status** | **string** | The current status of the cluster. | +**StatusDetails** | Pointer to **NullableString** | Additional details about the cluster status. | [optional] +**CreatedAt** | **time.Time** | The timestamp when the cluster was created. | +**UpdatedAt** | **time.Time** | The timestamp when the cluster was last updated. | +**Instances** | [**[]Instance**](Instance.md) | Array of instances in the cluster. | +**HourlyPrice** | **int32** | The hourly price of the cluster in cents. | +**CostEstimate** | Pointer to **NullableString** | Estimated cost of the cluster. | [optional] +**ActiveAt** | Pointer to **NullableTime** | The timestamp when the cluster became active. | [optional] + +## Methods + +### NewClusterInfoResponse + +`func NewClusterInfoResponse(id string, cloud string, name string, regionInfo ClusterRegionInfo, status string, createdAt time.Time, updatedAt time.Time, instances []Instance, hourlyPrice int32, ) *ClusterInfoResponse` + +NewClusterInfoResponse instantiates a new ClusterInfoResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewClusterInfoResponseWithDefaults + +`func NewClusterInfoResponseWithDefaults() *ClusterInfoResponse` + +NewClusterInfoResponseWithDefaults instantiates a new ClusterInfoResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *ClusterInfoResponse) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *ClusterInfoResponse) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *ClusterInfoResponse) SetId(v string)` + +SetId sets Id field to given value. + + +### GetCloud + +`func (o *ClusterInfoResponse) GetCloud() string` + +GetCloud returns the Cloud field if non-nil, zero value otherwise. + +### GetCloudOk + +`func (o *ClusterInfoResponse) GetCloudOk() (*string, bool)` + +GetCloudOk returns a tuple with the Cloud field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCloud + +`func (o *ClusterInfoResponse) SetCloud(v string)` + +SetCloud sets Cloud field to given value. + + +### GetName + +`func (o *ClusterInfoResponse) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *ClusterInfoResponse) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *ClusterInfoResponse) SetName(v string)` + +SetName sets Name field to given value. + + +### GetCloudClusterId + +`func (o *ClusterInfoResponse) GetCloudClusterId() string` + +GetCloudClusterId returns the CloudClusterId field if non-nil, zero value otherwise. + +### GetCloudClusterIdOk + +`func (o *ClusterInfoResponse) GetCloudClusterIdOk() (*string, bool)` + +GetCloudClusterIdOk returns a tuple with the CloudClusterId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCloudClusterId + +`func (o *ClusterInfoResponse) SetCloudClusterId(v string)` + +SetCloudClusterId sets CloudClusterId field to given value. + +### HasCloudClusterId + +`func (o *ClusterInfoResponse) HasCloudClusterId() bool` + +HasCloudClusterId returns a boolean if a field has been set. + +### SetCloudClusterIdNil + +`func (o *ClusterInfoResponse) SetCloudClusterIdNil(b bool)` + + SetCloudClusterIdNil sets the value for CloudClusterId to be an explicit nil + +### UnsetCloudClusterId +`func (o *ClusterInfoResponse) UnsetCloudClusterId()` + +UnsetCloudClusterId ensures that no value is present for CloudClusterId, not even an explicit nil +### GetRegionInfo + +`func (o *ClusterInfoResponse) GetRegionInfo() ClusterRegionInfo` + +GetRegionInfo returns the RegionInfo field if non-nil, zero value otherwise. + +### GetRegionInfoOk + +`func (o *ClusterInfoResponse) GetRegionInfoOk() (*ClusterRegionInfo, bool)` + +GetRegionInfoOk returns a tuple with the RegionInfo field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRegionInfo + +`func (o *ClusterInfoResponse) SetRegionInfo(v ClusterRegionInfo)` + +SetRegionInfo sets RegionInfo field to given value. + + +### GetStatus + +`func (o *ClusterInfoResponse) GetStatus() string` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *ClusterInfoResponse) GetStatusOk() (*string, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *ClusterInfoResponse) SetStatus(v string)` + +SetStatus sets Status field to given value. + + +### GetStatusDetails + +`func (o *ClusterInfoResponse) GetStatusDetails() string` + +GetStatusDetails returns the StatusDetails field if non-nil, zero value otherwise. + +### GetStatusDetailsOk + +`func (o *ClusterInfoResponse) GetStatusDetailsOk() (*string, bool)` + +GetStatusDetailsOk returns a tuple with the StatusDetails field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatusDetails + +`func (o *ClusterInfoResponse) SetStatusDetails(v string)` + +SetStatusDetails sets StatusDetails field to given value. + +### HasStatusDetails + +`func (o *ClusterInfoResponse) HasStatusDetails() bool` + +HasStatusDetails returns a boolean if a field has been set. + +### SetStatusDetailsNil + +`func (o *ClusterInfoResponse) SetStatusDetailsNil(b bool)` + + SetStatusDetailsNil sets the value for StatusDetails to be an explicit nil + +### UnsetStatusDetails +`func (o *ClusterInfoResponse) UnsetStatusDetails()` + +UnsetStatusDetails ensures that no value is present for StatusDetails, not even an explicit nil +### GetCreatedAt + +`func (o *ClusterInfoResponse) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *ClusterInfoResponse) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *ClusterInfoResponse) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + + +### GetUpdatedAt + +`func (o *ClusterInfoResponse) GetUpdatedAt() time.Time` + +GetUpdatedAt returns the UpdatedAt field if non-nil, zero value otherwise. + +### GetUpdatedAtOk + +`func (o *ClusterInfoResponse) GetUpdatedAtOk() (*time.Time, bool)` + +GetUpdatedAtOk returns a tuple with the UpdatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdatedAt + +`func (o *ClusterInfoResponse) SetUpdatedAt(v time.Time)` + +SetUpdatedAt sets UpdatedAt field to given value. + + +### GetInstances + +`func (o *ClusterInfoResponse) GetInstances() []Instance` + +GetInstances returns the Instances field if non-nil, zero value otherwise. + +### GetInstancesOk + +`func (o *ClusterInfoResponse) GetInstancesOk() (*[]Instance, bool)` + +GetInstancesOk returns a tuple with the Instances field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInstances + +`func (o *ClusterInfoResponse) SetInstances(v []Instance)` + +SetInstances sets Instances field to given value. + + +### GetHourlyPrice + +`func (o *ClusterInfoResponse) GetHourlyPrice() int32` + +GetHourlyPrice returns the HourlyPrice field if non-nil, zero value otherwise. + +### GetHourlyPriceOk + +`func (o *ClusterInfoResponse) GetHourlyPriceOk() (*int32, bool)` + +GetHourlyPriceOk returns a tuple with the HourlyPrice field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHourlyPrice + +`func (o *ClusterInfoResponse) SetHourlyPrice(v int32)` + +SetHourlyPrice sets HourlyPrice field to given value. + + +### GetCostEstimate + +`func (o *ClusterInfoResponse) GetCostEstimate() string` + +GetCostEstimate returns the CostEstimate field if non-nil, zero value otherwise. + +### GetCostEstimateOk + +`func (o *ClusterInfoResponse) GetCostEstimateOk() (*string, bool)` + +GetCostEstimateOk returns a tuple with the CostEstimate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCostEstimate + +`func (o *ClusterInfoResponse) SetCostEstimate(v string)` + +SetCostEstimate sets CostEstimate field to given value. + +### HasCostEstimate + +`func (o *ClusterInfoResponse) HasCostEstimate() bool` + +HasCostEstimate returns a boolean if a field has been set. + +### SetCostEstimateNil + +`func (o *ClusterInfoResponse) SetCostEstimateNil(b bool)` + + SetCostEstimateNil sets the value for CostEstimate to be an explicit nil + +### UnsetCostEstimate +`func (o *ClusterInfoResponse) UnsetCostEstimate()` + +UnsetCostEstimate ensures that no value is present for CostEstimate, not even an explicit nil +### GetActiveAt + +`func (o *ClusterInfoResponse) GetActiveAt() time.Time` + +GetActiveAt returns the ActiveAt field if non-nil, zero value otherwise. + +### GetActiveAtOk + +`func (o *ClusterInfoResponse) GetActiveAtOk() (*time.Time, bool)` + +GetActiveAtOk returns a tuple with the ActiveAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActiveAt + +`func (o *ClusterInfoResponse) SetActiveAt(v time.Time)` + +SetActiveAt sets ActiveAt field to given value. + +### HasActiveAt + +`func (o *ClusterInfoResponse) HasActiveAt() bool` + +HasActiveAt returns a boolean if a field has been set. + +### SetActiveAtNil + +`func (o *ClusterInfoResponse) SetActiveAtNil(b bool)` + + SetActiveAtNil sets the value for ActiveAt to be an explicit nil + +### UnsetActiveAt +`func (o *ClusterInfoResponse) UnsetActiveAt()` + +UnsetActiveAt ensures that no value is present for ActiveAt, not even an explicit nil + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/v1/providers/shadeform/gen/shadeform/docs/ClusterRegionInfo.md b/v1/providers/shadeform/gen/shadeform/docs/ClusterRegionInfo.md new file mode 100644 index 00000000..60d0fd29 --- /dev/null +++ b/v1/providers/shadeform/gen/shadeform/docs/ClusterRegionInfo.md @@ -0,0 +1,72 @@ +# ClusterRegionInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Region** | **string** | The region code. | +**DisplayName** | **string** | Human-readable display name for the region. | + +## Methods + +### NewClusterRegionInfo + +`func NewClusterRegionInfo(region string, displayName string, ) *ClusterRegionInfo` + +NewClusterRegionInfo instantiates a new ClusterRegionInfo object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewClusterRegionInfoWithDefaults + +`func NewClusterRegionInfoWithDefaults() *ClusterRegionInfo` + +NewClusterRegionInfoWithDefaults instantiates a new ClusterRegionInfo object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetRegion + +`func (o *ClusterRegionInfo) GetRegion() string` + +GetRegion returns the Region field if non-nil, zero value otherwise. + +### GetRegionOk + +`func (o *ClusterRegionInfo) GetRegionOk() (*string, bool)` + +GetRegionOk returns a tuple with the Region field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRegion + +`func (o *ClusterRegionInfo) SetRegion(v string)` + +SetRegion sets Region field to given value. + + +### GetDisplayName + +`func (o *ClusterRegionInfo) GetDisplayName() string` + +GetDisplayName returns the DisplayName field if non-nil, zero value otherwise. + +### GetDisplayNameOk + +`func (o *ClusterRegionInfo) GetDisplayNameOk() (*string, bool)` + +GetDisplayNameOk returns a tuple with the DisplayName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDisplayName + +`func (o *ClusterRegionInfo) SetDisplayName(v string)` + +SetDisplayName sets DisplayName field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/v1/providers/shadeform/gen/shadeform/docs/ClusterType.md b/v1/providers/shadeform/gen/shadeform/docs/ClusterType.md new file mode 100644 index 00000000..316da72c --- /dev/null +++ b/v1/providers/shadeform/gen/shadeform/docs/ClusterType.md @@ -0,0 +1,114 @@ +# ClusterType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Cloud** | **string** | The cloud provider. | +**NumInstances** | **int32** | The number of instances in this cluster type. | +**Availability** | [**ClusterAvailability**](ClusterAvailability.md) | | +**ClusterType** | [**InstanceType**](InstanceType.md) | | + +## Methods + +### NewClusterType + +`func NewClusterType(cloud string, numInstances int32, availability ClusterAvailability, clusterType InstanceType, ) *ClusterType` + +NewClusterType instantiates a new ClusterType object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewClusterTypeWithDefaults + +`func NewClusterTypeWithDefaults() *ClusterType` + +NewClusterTypeWithDefaults instantiates a new ClusterType object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCloud + +`func (o *ClusterType) GetCloud() string` + +GetCloud returns the Cloud field if non-nil, zero value otherwise. + +### GetCloudOk + +`func (o *ClusterType) GetCloudOk() (*string, bool)` + +GetCloudOk returns a tuple with the Cloud field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCloud + +`func (o *ClusterType) SetCloud(v string)` + +SetCloud sets Cloud field to given value. + + +### GetNumInstances + +`func (o *ClusterType) GetNumInstances() int32` + +GetNumInstances returns the NumInstances field if non-nil, zero value otherwise. + +### GetNumInstancesOk + +`func (o *ClusterType) GetNumInstancesOk() (*int32, bool)` + +GetNumInstancesOk returns a tuple with the NumInstances field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNumInstances + +`func (o *ClusterType) SetNumInstances(v int32)` + +SetNumInstances sets NumInstances field to given value. + + +### GetAvailability + +`func (o *ClusterType) GetAvailability() ClusterAvailability` + +GetAvailability returns the Availability field if non-nil, zero value otherwise. + +### GetAvailabilityOk + +`func (o *ClusterType) GetAvailabilityOk() (*ClusterAvailability, bool)` + +GetAvailabilityOk returns a tuple with the Availability field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAvailability + +`func (o *ClusterType) SetAvailability(v ClusterAvailability)` + +SetAvailability sets Availability field to given value. + + +### GetClusterType + +`func (o *ClusterType) GetClusterType() InstanceType` + +GetClusterType returns the ClusterType field if non-nil, zero value otherwise. + +### GetClusterTypeOk + +`func (o *ClusterType) GetClusterTypeOk() (*InstanceType, bool)` + +GetClusterTypeOk returns a tuple with the ClusterType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetClusterType + +`func (o *ClusterType) SetClusterType(v InstanceType)` + +SetClusterType sets ClusterType field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/v1/providers/shadeform/gen/shadeform/docs/ClusterTypesResponse.md b/v1/providers/shadeform/gen/shadeform/docs/ClusterTypesResponse.md new file mode 100644 index 00000000..78d3a1be --- /dev/null +++ b/v1/providers/shadeform/gen/shadeform/docs/ClusterTypesResponse.md @@ -0,0 +1,51 @@ +# ClusterTypesResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClusterTypes** | [**[]ClusterType**](ClusterType.md) | | + +## Methods + +### NewClusterTypesResponse + +`func NewClusterTypesResponse(clusterTypes []ClusterType, ) *ClusterTypesResponse` + +NewClusterTypesResponse instantiates a new ClusterTypesResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewClusterTypesResponseWithDefaults + +`func NewClusterTypesResponseWithDefaults() *ClusterTypesResponse` + +NewClusterTypesResponseWithDefaults instantiates a new ClusterTypesResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetClusterTypes + +`func (o *ClusterTypesResponse) GetClusterTypes() []ClusterType` + +GetClusterTypes returns the ClusterTypes field if non-nil, zero value otherwise. + +### GetClusterTypesOk + +`func (o *ClusterTypesResponse) GetClusterTypesOk() (*[]ClusterType, bool)` + +GetClusterTypesOk returns a tuple with the ClusterTypes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetClusterTypes + +`func (o *ClusterTypesResponse) SetClusterTypes(v []ClusterType)` + +SetClusterTypes sets ClusterTypes field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/v1/providers/shadeform/gen/shadeform/docs/ClustersResponse.md b/v1/providers/shadeform/gen/shadeform/docs/ClustersResponse.md new file mode 100644 index 00000000..3e6d96e8 --- /dev/null +++ b/v1/providers/shadeform/gen/shadeform/docs/ClustersResponse.md @@ -0,0 +1,51 @@ +# ClustersResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Clusters** | [**[]Cluster**](Cluster.md) | | + +## Methods + +### NewClustersResponse + +`func NewClustersResponse(clusters []Cluster, ) *ClustersResponse` + +NewClustersResponse instantiates a new ClustersResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewClustersResponseWithDefaults + +`func NewClustersResponseWithDefaults() *ClustersResponse` + +NewClustersResponseWithDefaults instantiates a new ClustersResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetClusters + +`func (o *ClustersResponse) GetClusters() []Cluster` + +GetClusters returns the Clusters field if non-nil, zero value otherwise. + +### GetClustersOk + +`func (o *ClustersResponse) GetClustersOk() (*[]Cluster, bool)` + +GetClustersOk returns a tuple with the Clusters field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetClusters + +`func (o *ClustersResponse) SetClusters(v []Cluster)` + +SetClusters sets Clusters field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/v1/providers/shadeform/gen/shadeform/docs/CreateClusterRequest.md b/v1/providers/shadeform/gen/shadeform/docs/CreateClusterRequest.md new file mode 100644 index 00000000..1e42b515 --- /dev/null +++ b/v1/providers/shadeform/gen/shadeform/docs/CreateClusterRequest.md @@ -0,0 +1,187 @@ +# CreateClusterRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | The name of the cluster. | +**Cloud** | **string** | The cloud provider for the cluster. | +**Region** | **string** | The region where the cluster will be deployed. | +**ClusterType** | **string** | The type of GPU cluster to create. | +**NumInstances** | **int32** | The number of instances in the cluster. | +**SshKeyId** | Pointer to **string** | The SSH key ID to use for the cluster instances. | [optional] +**Os** | Pointer to **string** | The operating system for the cluster. | [optional] + +## Methods + +### NewCreateClusterRequest + +`func NewCreateClusterRequest(name string, cloud string, region string, clusterType string, numInstances int32, ) *CreateClusterRequest` + +NewCreateClusterRequest instantiates a new CreateClusterRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCreateClusterRequestWithDefaults + +`func NewCreateClusterRequestWithDefaults() *CreateClusterRequest` + +NewCreateClusterRequestWithDefaults instantiates a new CreateClusterRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *CreateClusterRequest) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *CreateClusterRequest) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *CreateClusterRequest) SetName(v string)` + +SetName sets Name field to given value. + + +### GetCloud + +`func (o *CreateClusterRequest) GetCloud() string` + +GetCloud returns the Cloud field if non-nil, zero value otherwise. + +### GetCloudOk + +`func (o *CreateClusterRequest) GetCloudOk() (*string, bool)` + +GetCloudOk returns a tuple with the Cloud field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCloud + +`func (o *CreateClusterRequest) SetCloud(v string)` + +SetCloud sets Cloud field to given value. + + +### GetRegion + +`func (o *CreateClusterRequest) GetRegion() string` + +GetRegion returns the Region field if non-nil, zero value otherwise. + +### GetRegionOk + +`func (o *CreateClusterRequest) GetRegionOk() (*string, bool)` + +GetRegionOk returns a tuple with the Region field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRegion + +`func (o *CreateClusterRequest) SetRegion(v string)` + +SetRegion sets Region field to given value. + + +### GetClusterType + +`func (o *CreateClusterRequest) GetClusterType() string` + +GetClusterType returns the ClusterType field if non-nil, zero value otherwise. + +### GetClusterTypeOk + +`func (o *CreateClusterRequest) GetClusterTypeOk() (*string, bool)` + +GetClusterTypeOk returns a tuple with the ClusterType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetClusterType + +`func (o *CreateClusterRequest) SetClusterType(v string)` + +SetClusterType sets ClusterType field to given value. + + +### GetNumInstances + +`func (o *CreateClusterRequest) GetNumInstances() int32` + +GetNumInstances returns the NumInstances field if non-nil, zero value otherwise. + +### GetNumInstancesOk + +`func (o *CreateClusterRequest) GetNumInstancesOk() (*int32, bool)` + +GetNumInstancesOk returns a tuple with the NumInstances field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNumInstances + +`func (o *CreateClusterRequest) SetNumInstances(v int32)` + +SetNumInstances sets NumInstances field to given value. + + +### GetSshKeyId + +`func (o *CreateClusterRequest) GetSshKeyId() string` + +GetSshKeyId returns the SshKeyId field if non-nil, zero value otherwise. + +### GetSshKeyIdOk + +`func (o *CreateClusterRequest) GetSshKeyIdOk() (*string, bool)` + +GetSshKeyIdOk returns a tuple with the SshKeyId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSshKeyId + +`func (o *CreateClusterRequest) SetSshKeyId(v string)` + +SetSshKeyId sets SshKeyId field to given value. + +### HasSshKeyId + +`func (o *CreateClusterRequest) HasSshKeyId() bool` + +HasSshKeyId returns a boolean if a field has been set. + +### GetOs + +`func (o *CreateClusterRequest) GetOs() string` + +GetOs returns the Os field if non-nil, zero value otherwise. + +### GetOsOk + +`func (o *CreateClusterRequest) GetOsOk() (*string, bool)` + +GetOsOk returns a tuple with the Os field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOs + +`func (o *CreateClusterRequest) SetOs(v string)` + +SetOs sets Os field to given value. + +### HasOs + +`func (o *CreateClusterRequest) HasOs() bool` + +HasOs returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/v1/providers/shadeform/gen/shadeform/docs/CreateClusterResponse.md b/v1/providers/shadeform/gen/shadeform/docs/CreateClusterResponse.md new file mode 100644 index 00000000..f84cfd11 --- /dev/null +++ b/v1/providers/shadeform/gen/shadeform/docs/CreateClusterResponse.md @@ -0,0 +1,51 @@ +# CreateClusterResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | The unique identifier for the newly created cluster. | + +## Methods + +### NewCreateClusterResponse + +`func NewCreateClusterResponse(id string, ) *CreateClusterResponse` + +NewCreateClusterResponse instantiates a new CreateClusterResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCreateClusterResponseWithDefaults + +`func NewCreateClusterResponseWithDefaults() *CreateClusterResponse` + +NewCreateClusterResponseWithDefaults instantiates a new CreateClusterResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *CreateClusterResponse) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *CreateClusterResponse) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *CreateClusterResponse) SetId(v string)` + +SetId sets Id field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/v1/providers/shadeform/gen/shadeform/docs/CreateRequest.md b/v1/providers/shadeform/gen/shadeform/docs/CreateRequest.md index ae416863..8aa9dd6a 100644 --- a/v1/providers/shadeform/gen/shadeform/docs/CreateRequest.md +++ b/v1/providers/shadeform/gen/shadeform/docs/CreateRequest.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Cloud** | [**Cloud**](Cloud.md) | | +**Cloud** | **string** | Specifies the underlying cloud provider. See this [explanation](/getting-started/concepts#cloud-cloud-provider) for more details. | **Region** | **string** | Specifies the region. | **ShadeInstanceType** | **string** | The Shadeform standardized instance type. See this [explanation](/getting-started/concepts#shade-instance-type-and-cloud-instance-type) for more details. | **ShadeCloud** | **bool** | Specifies if the instance is launched in [Shade Cloud](/getting-started/concepts#shade-cloud) or in a linked cloud account. | @@ -24,7 +24,7 @@ Name | Type | Description | Notes ### NewCreateRequest -`func NewCreateRequest(cloud Cloud, region string, shadeInstanceType string, shadeCloud bool, name string, ) *CreateRequest` +`func NewCreateRequest(cloud string, region string, shadeInstanceType string, shadeCloud bool, name string, ) *CreateRequest` NewCreateRequest instantiates a new CreateRequest object This constructor will assign default values to properties that have it defined, @@ -41,20 +41,20 @@ but it doesn't guarantee that properties required by API are set ### GetCloud -`func (o *CreateRequest) GetCloud() Cloud` +`func (o *CreateRequest) GetCloud() string` GetCloud returns the Cloud field if non-nil, zero value otherwise. ### GetCloudOk -`func (o *CreateRequest) GetCloudOk() (*Cloud, bool)` +`func (o *CreateRequest) GetCloudOk() (*string, bool)` GetCloudOk returns a tuple with the Cloud field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetCloud -`func (o *CreateRequest) SetCloud(v Cloud)` +`func (o *CreateRequest) SetCloud(v string)` SetCloud sets Cloud field to given value. diff --git a/v1/providers/shadeform/gen/shadeform/docs/CreateVolumeRequest.md b/v1/providers/shadeform/gen/shadeform/docs/CreateVolumeRequest.md index 7a4993a3..58b9d493 100644 --- a/v1/providers/shadeform/gen/shadeform/docs/CreateVolumeRequest.md +++ b/v1/providers/shadeform/gen/shadeform/docs/CreateVolumeRequest.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Cloud** | [**Cloud**](Cloud.md) | | +**Cloud** | **string** | Specifies the underlying cloud provider. See this [explanation](/getting-started/concepts#cloud-cloud-provider) for more details. | **Region** | **string** | Specifies the region. | **SizeInGb** | **int32** | Storage volume size in GB | **Name** | **string** | The name of the storage volume. | @@ -13,7 +13,7 @@ Name | Type | Description | Notes ### NewCreateVolumeRequest -`func NewCreateVolumeRequest(cloud Cloud, region string, sizeInGb int32, name string, ) *CreateVolumeRequest` +`func NewCreateVolumeRequest(cloud string, region string, sizeInGb int32, name string, ) *CreateVolumeRequest` NewCreateVolumeRequest instantiates a new CreateVolumeRequest object This constructor will assign default values to properties that have it defined, @@ -30,20 +30,20 @@ but it doesn't guarantee that properties required by API are set ### GetCloud -`func (o *CreateVolumeRequest) GetCloud() Cloud` +`func (o *CreateVolumeRequest) GetCloud() string` GetCloud returns the Cloud field if non-nil, zero value otherwise. ### GetCloudOk -`func (o *CreateVolumeRequest) GetCloudOk() (*Cloud, bool)` +`func (o *CreateVolumeRequest) GetCloudOk() (*string, bool)` GetCloudOk returns a tuple with the Cloud field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetCloud -`func (o *CreateVolumeRequest) SetCloud(v Cloud)` +`func (o *CreateVolumeRequest) SetCloud(v string)` SetCloud sets Cloud field to given value. diff --git a/v1/providers/shadeform/gen/shadeform/docs/DefaultAPI.md b/v1/providers/shadeform/gen/shadeform/docs/DefaultAPI.md index 6c7dd40d..18cd1ee3 100644 --- a/v1/providers/shadeform/gen/shadeform/docs/DefaultAPI.md +++ b/v1/providers/shadeform/gen/shadeform/docs/DefaultAPI.md @@ -4,6 +4,11 @@ All URIs are relative to *https://api.shadeform.ai/v1* Method | HTTP request | Description ------------- | ------------- | ------------- +[**Clusters**](DefaultAPI.md#Clusters) | **Get** /clusters | /clusters +[**ClustersCreate**](DefaultAPI.md#ClustersCreate) | **Post** /clusters/create | /clusters/create +[**ClustersDelete**](DefaultAPI.md#ClustersDelete) | **Post** /clusters/{id}/delete | /clusters/{id}/delete +[**ClustersInfo**](DefaultAPI.md#ClustersInfo) | **Get** /clusters/{id}/info | /clusters/{id}/info +[**ClustersTypes**](DefaultAPI.md#ClustersTypes) | **Get** /clusters/types | /clusters/types [**Instances**](DefaultAPI.md#Instances) | **Get** /instances | /instances [**InstancesCreate**](DefaultAPI.md#InstancesCreate) | **Post** /instances/create | /instances/create [**InstancesDelete**](DefaultAPI.md#InstancesDelete) | **Post** /instances/{id}/delete | /instances/{id}/delete @@ -30,6 +35,332 @@ Method | HTTP request | Description +## Clusters + +> ClustersResponse Clusters(ctx).Execute() + +/clusters + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/brevdev/cloud" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DefaultAPI.Clusters(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.Clusters``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `Clusters`: ClustersResponse + fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.Clusters`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiClustersRequest struct via the builder pattern + + +### Return type + +[**ClustersResponse**](ClustersResponse.md) + +### Authorization + +[ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ClustersCreate + +> CreateClusterResponse ClustersCreate(ctx).CreateClusterRequest(createClusterRequest).Execute() + +/clusters/create + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/brevdev/cloud" +) + +func main() { + createClusterRequest := *openapiclient.NewCreateClusterRequest("protestant-aquamarine-cluster", "denvr", "houston-usa-1", "H100_sxm5x8", int32(2)) // CreateClusterRequest | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DefaultAPI.ClustersCreate(context.Background()).CreateClusterRequest(createClusterRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.ClustersCreate``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ClustersCreate`: CreateClusterResponse + fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.ClustersCreate`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiClustersCreateRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **createClusterRequest** | [**CreateClusterRequest**](CreateClusterRequest.md) | | + +### Return type + +[**CreateClusterResponse**](CreateClusterResponse.md) + +### Authorization + +[ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ClustersDelete + +> ClustersDelete(ctx, id).Execute() + +/clusters/{id}/delete + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/brevdev/cloud" +) + +func main() { + id := "b1450ae8-2fa3-4ceb-a4f3-b834805418fc" // string | The cluster id + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.DefaultAPI.ClustersDelete(context.Background(), id).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.ClustersDelete``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | The cluster id | + +### Other Parameters + +Other parameters are passed through a pointer to a apiClustersDeleteRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + + (empty response body) + +### Authorization + +[ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ClustersInfo + +> ClusterInfoResponse ClustersInfo(ctx, id).Execute() + +/clusters/{id}/info + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/brevdev/cloud" +) + +func main() { + id := "8eda86fe-0f36-41ed-9837-0ccf8f6e0fcb" // string | The cluster id + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DefaultAPI.ClustersInfo(context.Background(), id).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.ClustersInfo``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ClustersInfo`: ClusterInfoResponse + fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.ClustersInfo`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | The cluster id | + +### Other Parameters + +Other parameters are passed through a pointer to a apiClustersInfoRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**ClusterInfoResponse**](ClusterInfoResponse.md) + +### Authorization + +[ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ClustersTypes + +> ClusterTypesResponse ClustersTypes(ctx).Execute() + +/clusters/types + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/brevdev/cloud" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DefaultAPI.ClustersTypes(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.ClustersTypes``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ClustersTypes`: ClusterTypesResponse + fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.ClustersTypes`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiClustersTypesRequest struct via the builder pattern + + +### Return type + +[**ClusterTypesResponse**](ClusterTypesResponse.md) + +### Authorization + +[ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + ## Instances > InstancesResponse Instances(ctx).Execute() @@ -112,7 +443,7 @@ import ( ) func main() { - createRequest := *openapiclient.NewCreateRequest(openapiclient.Cloud("lambdalabs"), "canada-1", "A6000", true, "cool-gpu-server") // CreateRequest | (optional) + createRequest := *openapiclient.NewCreateRequest("hyperstack", "canada-1", "A6000", true, "cool-gpu-server") // CreateRequest | (optional) configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) @@ -1322,7 +1653,7 @@ import ( ) func main() { - createVolumeRequest := *openapiclient.NewCreateVolumeRequest(openapiclient.Cloud("lambdalabs"), "canada-1", int32(100), "My storage volume") // CreateVolumeRequest | (optional) + createVolumeRequest := *openapiclient.NewCreateVolumeRequest("hyperstack", "canada-1", int32(100), "My storage volume") // CreateVolumeRequest | (optional) configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) diff --git a/v1/providers/shadeform/gen/shadeform/docs/Instance.md b/v1/providers/shadeform/gen/shadeform/docs/Instance.md index ec90feda..d8d10955 100644 --- a/v1/providers/shadeform/gen/shadeform/docs/Instance.md +++ b/v1/providers/shadeform/gen/shadeform/docs/Instance.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Id** | **string** | The unique identifier for the instance. Used in the instances for the /instances/{id}/info and /instances/{id}/delete APIs. | -**Cloud** | [**Cloud**](Cloud.md) | | +**Cloud** | **string** | Specifies the underlying cloud provider. See this [explanation](/getting-started/concepts#cloud-cloud-provider) for more details. | **Region** | **string** | Specifies the region. | **ShadeInstanceType** | **string** | The Shadeform standardized instance type. See this [explanation](/getting-started/concepts#shade-instance-type-and-cloud-instance-type) for more details. | **CloudInstanceType** | **string** | The instance type for the underlying cloud provider. See this [explanation](/getting-started/concepts#shade-instance-type-and-cloud-instance-type) for more details. | @@ -32,7 +32,7 @@ Name | Type | Description | Notes ### NewInstance -`func NewInstance(id string, cloud Cloud, region string, shadeInstanceType string, cloudInstanceType string, cloudAssignedId string, shadeCloud bool, name string, configuration InstanceConfiguration, ip string, sshUser string, sshPort int32, status Status, costEstimate string, createdAt time.Time, deletedAt time.Time, ) *Instance` +`func NewInstance(id string, cloud string, region string, shadeInstanceType string, cloudInstanceType string, cloudAssignedId string, shadeCloud bool, name string, configuration InstanceConfiguration, ip string, sshUser string, sshPort int32, status Status, costEstimate string, createdAt time.Time, deletedAt time.Time, ) *Instance` NewInstance instantiates a new Instance object This constructor will assign default values to properties that have it defined, @@ -69,20 +69,20 @@ SetId sets Id field to given value. ### GetCloud -`func (o *Instance) GetCloud() Cloud` +`func (o *Instance) GetCloud() string` GetCloud returns the Cloud field if non-nil, zero value otherwise. ### GetCloudOk -`func (o *Instance) GetCloudOk() (*Cloud, bool)` +`func (o *Instance) GetCloudOk() (*string, bool)` GetCloudOk returns a tuple with the Cloud field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetCloud -`func (o *Instance) SetCloud(v Cloud)` +`func (o *Instance) SetCloud(v string)` SetCloud sets Cloud field to given value. diff --git a/v1/providers/shadeform/gen/shadeform/docs/InstanceInfoResponse.md b/v1/providers/shadeform/gen/shadeform/docs/InstanceInfoResponse.md index d18d9931..2b13d637 100644 --- a/v1/providers/shadeform/gen/shadeform/docs/InstanceInfoResponse.md +++ b/v1/providers/shadeform/gen/shadeform/docs/InstanceInfoResponse.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Id** | **string** | The unique identifier for the instance. Used in the instances for the /instances/{id}/info and /instances/{id}/delete APIs. | -**Cloud** | [**Cloud**](Cloud.md) | | +**Cloud** | **string** | Specifies the underlying cloud provider. See this [explanation](/getting-started/concepts#cloud-cloud-provider) for more details. | **Region** | **string** | Specifies the region. | **ShadeInstanceType** | **string** | The Shadeform standardized instance type. See this [explanation](/getting-started/concepts#shade-instance-type-and-cloud-instance-type) for more details. | **CloudInstanceType** | **string** | The instance type for the underlying cloud provider. See this [explanation](/getting-started/concepts#shade-instance-type-and-cloud-instance-type) for more details. | @@ -38,7 +38,7 @@ Name | Type | Description | Notes ### NewInstanceInfoResponse -`func NewInstanceInfoResponse(id string, cloud Cloud, region string, shadeInstanceType string, cloudInstanceType string, cloudAssignedId string, shadeCloud bool, name string, configuration InstanceConfiguration, ip string, sshUser string, sshPort int32, status Status, costEstimate string, createdAt time.Time, deletedAt time.Time, ) *InstanceInfoResponse` +`func NewInstanceInfoResponse(id string, cloud string, region string, shadeInstanceType string, cloudInstanceType string, cloudAssignedId string, shadeCloud bool, name string, configuration InstanceConfiguration, ip string, sshUser string, sshPort int32, status Status, costEstimate string, createdAt time.Time, deletedAt time.Time, ) *InstanceInfoResponse` NewInstanceInfoResponse instantiates a new InstanceInfoResponse object This constructor will assign default values to properties that have it defined, @@ -75,20 +75,20 @@ SetId sets Id field to given value. ### GetCloud -`func (o *InstanceInfoResponse) GetCloud() Cloud` +`func (o *InstanceInfoResponse) GetCloud() string` GetCloud returns the Cloud field if non-nil, zero value otherwise. ### GetCloudOk -`func (o *InstanceInfoResponse) GetCloudOk() (*Cloud, bool)` +`func (o *InstanceInfoResponse) GetCloudOk() (*string, bool)` GetCloudOk returns a tuple with the Cloud field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetCloud -`func (o *InstanceInfoResponse) SetCloud(v Cloud)` +`func (o *InstanceInfoResponse) SetCloud(v string)` SetCloud sets Cloud field to given value. diff --git a/v1/providers/shadeform/gen/shadeform/docs/InstanceType.md b/v1/providers/shadeform/gen/shadeform/docs/InstanceType.md index 8ff28d3f..f20c4ffd 100644 --- a/v1/providers/shadeform/gen/shadeform/docs/InstanceType.md +++ b/v1/providers/shadeform/gen/shadeform/docs/InstanceType.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Cloud** | [**Cloud**](Cloud.md) | | +**Cloud** | **string** | Specifies the underlying cloud provider. See this [explanation](/getting-started/concepts#cloud-cloud-provider) for more details. | **ShadeInstanceType** | **string** | The Shadeform standardized instance type. See this [explanation](/getting-started/concepts#shade-instance-type-and-cloud-instance-type) for more details. | **CloudInstanceType** | **string** | The instance type for the underlying cloud provider. See this [explanation](/getting-started/concepts#shade-instance-type-and-cloud-instance-type) for more details. | **Configuration** | [**InstanceTypeConfiguration**](InstanceTypeConfiguration.md) | | @@ -17,7 +17,7 @@ Name | Type | Description | Notes ### NewInstanceType -`func NewInstanceType(cloud Cloud, shadeInstanceType string, cloudInstanceType string, configuration InstanceTypeConfiguration, hourlyPrice int32, deploymentType string, availability []Availability, ) *InstanceType` +`func NewInstanceType(cloud string, shadeInstanceType string, cloudInstanceType string, configuration InstanceTypeConfiguration, hourlyPrice int32, deploymentType string, availability []Availability, ) *InstanceType` NewInstanceType instantiates a new InstanceType object This constructor will assign default values to properties that have it defined, @@ -34,20 +34,20 @@ but it doesn't guarantee that properties required by API are set ### GetCloud -`func (o *InstanceType) GetCloud() Cloud` +`func (o *InstanceType) GetCloud() string` GetCloud returns the Cloud field if non-nil, zero value otherwise. ### GetCloudOk -`func (o *InstanceType) GetCloudOk() (*Cloud, bool)` +`func (o *InstanceType) GetCloudOk() (*string, bool)` GetCloudOk returns a tuple with the Cloud field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetCloud -`func (o *InstanceType) SetCloud(v Cloud)` +`func (o *InstanceType) SetCloud(v string)` SetCloud sets Cloud field to given value. diff --git a/v1/providers/shadeform/gen/shadeform/docs/Volume.md b/v1/providers/shadeform/gen/shadeform/docs/Volume.md index 3be73dda..dee0c055 100644 --- a/v1/providers/shadeform/gen/shadeform/docs/Volume.md +++ b/v1/providers/shadeform/gen/shadeform/docs/Volume.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Id** | **string** | The ID of the storage volume. | -**Cloud** | [**Cloud**](Cloud.md) | | +**Cloud** | **string** | Specifies the underlying cloud provider. See this [explanation](/getting-started/concepts#cloud-cloud-provider) for more details. | **CloudAssignedId** | **string** | The unique identifier of the storage volume issued by the underlying cloud provider. | **Region** | **string** | Specifies the region. | **Name** | **string** | The name of the storage volume. | @@ -19,7 +19,7 @@ Name | Type | Description | Notes ### NewVolume -`func NewVolume(id string, cloud Cloud, cloudAssignedId string, region string, name string, fixedSize bool, sizeInGb int32, costEstimate string, supportsMultiMount bool, mountedBy string, ) *Volume` +`func NewVolume(id string, cloud string, cloudAssignedId string, region string, name string, fixedSize bool, sizeInGb int32, costEstimate string, supportsMultiMount bool, mountedBy string, ) *Volume` NewVolume instantiates a new Volume object This constructor will assign default values to properties that have it defined, @@ -56,20 +56,20 @@ SetId sets Id field to given value. ### GetCloud -`func (o *Volume) GetCloud() Cloud` +`func (o *Volume) GetCloud() string` GetCloud returns the Cloud field if non-nil, zero value otherwise. ### GetCloudOk -`func (o *Volume) GetCloudOk() (*Cloud, bool)` +`func (o *Volume) GetCloudOk() (*string, bool)` GetCloudOk returns a tuple with the Cloud field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetCloud -`func (o *Volume) SetCloud(v Cloud)` +`func (o *Volume) SetCloud(v string)` SetCloud sets Cloud field to given value. diff --git a/v1/providers/shadeform/gen/shadeform/docs/VolumeTypesInner.md b/v1/providers/shadeform/gen/shadeform/docs/VolumeTypesInner.md index c96d8aed..9879f5ff 100644 --- a/v1/providers/shadeform/gen/shadeform/docs/VolumeTypesInner.md +++ b/v1/providers/shadeform/gen/shadeform/docs/VolumeTypesInner.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Cloud** | [**Cloud**](Cloud.md) | | +**Cloud** | **string** | Specifies the underlying cloud provider. See this [explanation](/getting-started/concepts#cloud-cloud-provider) for more details. | **Region** | **string** | Specifies the region. | **SupportsMultiMount** | **bool** | Denotes whether the volume supports multiple instances mounting to it at the same time. | **FixedSize** | **bool** | Denotes whether the volume is fixed in size or elastically scaling. | @@ -14,7 +14,7 @@ Name | Type | Description | Notes ### NewVolumeTypesInner -`func NewVolumeTypesInner(cloud Cloud, region string, supportsMultiMount bool, fixedSize bool, pricePerGbPerHour string, ) *VolumeTypesInner` +`func NewVolumeTypesInner(cloud string, region string, supportsMultiMount bool, fixedSize bool, pricePerGbPerHour string, ) *VolumeTypesInner` NewVolumeTypesInner instantiates a new VolumeTypesInner object This constructor will assign default values to properties that have it defined, @@ -31,20 +31,20 @@ but it doesn't guarantee that properties required by API are set ### GetCloud -`func (o *VolumeTypesInner) GetCloud() Cloud` +`func (o *VolumeTypesInner) GetCloud() string` GetCloud returns the Cloud field if non-nil, zero value otherwise. ### GetCloudOk -`func (o *VolumeTypesInner) GetCloudOk() (*Cloud, bool)` +`func (o *VolumeTypesInner) GetCloudOk() (*string, bool)` GetCloudOk returns a tuple with the Cloud field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetCloud -`func (o *VolumeTypesInner) SetCloud(v Cloud)` +`func (o *VolumeTypesInner) SetCloud(v string)` SetCloud sets Cloud field to given value. diff --git a/v1/providers/shadeform/gen/shadeform/model_cloud.go b/v1/providers/shadeform/gen/shadeform/model_cloud.go deleted file mode 100644 index 5302e2b5..00000000 --- a/v1/providers/shadeform/gen/shadeform/model_cloud.go +++ /dev/null @@ -1,161 +0,0 @@ -/* -Shadeform API - -Shadeform is a single API and platform for deploying and managing cloud GPUs. - -API version: 1.0.0 -Contact: support@shadeform.ai -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package openapi - -import ( - "encoding/json" - "fmt" -) - -// Cloud Specifies the underlying cloud provider. See this [explanation](/getting-started/concepts#cloud-cloud-provider) for more details. -type Cloud string - -// List of Cloud -const ( - LAMBDALABS Cloud = "lambdalabs" - PAPERSPACE Cloud = "paperspace" - VULTR Cloud = "vultr" - DATACRUNCH Cloud = "datacrunch" - LATITUDE Cloud = "latitude" - MASSEDCOMPUTE Cloud = "massedcompute" - IMWT Cloud = "imwt" - HYPERSTACK Cloud = "hyperstack" - NEBIUS Cloud = "nebius" - CRUSOE Cloud = "crusoe" - DENVR Cloud = "denvr" - DIGITALOCEAN Cloud = "digitalocean" - TCM Cloud = "tcm" - HOTAISLE Cloud = "hotaisle" - CUDO Cloud = "cudo" - SCALEWAY Cloud = "scaleway" - EVERGREEN Cloud = "evergreen" - EXCESSSUPPLY Cloud = "excesssupply" - VOLTAGEPARK Cloud = "voltagepark" - BOOSTRUN Cloud = "boostrun" - IONSTREAM Cloud = "ionstream" - WHITEFIBER Cloud = "whitefiber" - HORIZON Cloud = "horizon" - FPT Cloud = "fpt" - HYDRA Cloud = "hydra" - AMAYA Cloud = "amaya" - VERDA Cloud = "verda" -) - -// All allowed values of Cloud enum -var AllowedCloudEnumValues = []Cloud{ - "lambdalabs", - "paperspace", - "vultr", - "datacrunch", - "latitude", - "massedcompute", - "imwt", - "hyperstack", - "nebius", - "crusoe", - "denvr", - "digitalocean", - "tcm", - "hotaisle", - "cudo", - "scaleway", - "evergreen", - "excesssupply", - "voltagepark", - "boostrun", - "ionstream", - "whitefiber", - "horizon", - "fpt", - "hydra", - "amaya", - "verda", -} - -func (v *Cloud) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := Cloud(value) - for _, existing := range AllowedCloudEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - return fmt.Errorf("%+v is not a valid Cloud", value) -} - -// NewCloudFromValue returns a pointer to a valid Cloud -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewCloudFromValue(v string) (*Cloud, error) { - ev := Cloud(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for Cloud: valid values are %v", v, AllowedCloudEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v Cloud) IsValid() bool { - for _, existing := range AllowedCloudEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to Cloud value -func (v Cloud) Ptr() *Cloud { - return &v -} - -type NullableCloud struct { - value *Cloud - isSet bool -} - -func (v NullableCloud) Get() *Cloud { - return v.value -} - -func (v *NullableCloud) Set(val *Cloud) { - v.value = val - v.isSet = true -} - -func (v NullableCloud) IsSet() bool { - return v.isSet -} - -func (v *NullableCloud) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCloud(val *Cloud) *NullableCloud { - return &NullableCloud{value: val, isSet: true} -} - -func (v NullableCloud) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCloud) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/v1/providers/shadeform/gen/shadeform/model_cluster.go b/v1/providers/shadeform/gen/shadeform/model_cluster.go new file mode 100644 index 00000000..224a5b54 --- /dev/null +++ b/v1/providers/shadeform/gen/shadeform/model_cluster.go @@ -0,0 +1,604 @@ +/* +Shadeform API + +Shadeform is a single API and platform for deploying and managing cloud GPUs. + +API version: 1.0.0 +Contact: support@shadeform.ai +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the Cluster type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Cluster{} + +// Cluster struct for Cluster +type Cluster struct { + // The unique identifier for the cluster. + Id string `json:"id"` + // The cloud provider for the cluster. + Cloud string `json:"cloud"` + // The name of the cluster. + Name string `json:"name"` + // The cloud provider assigned cluster ID. + CloudClusterId NullableString `json:"cloud_cluster_id,omitempty"` + RegionInfo ClusterRegionInfo `json:"region_info"` + // The current status of the cluster. + Status string `json:"status"` + // Additional details about the cluster status. + StatusDetails NullableString `json:"status_details,omitempty"` + // The timestamp when the cluster was created. + CreatedAt time.Time `json:"created_at"` + // The timestamp when the cluster was last updated. + UpdatedAt time.Time `json:"updated_at"` + // Array of instances in the cluster. + Instances []Instance `json:"instances"` + // The hourly price of the cluster in cents. + HourlyPrice int32 `json:"hourly_price"` + // Estimated cost of the cluster. + CostEstimate NullableString `json:"cost_estimate,omitempty"` + // The timestamp when the cluster became active. + ActiveAt NullableTime `json:"active_at,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Cluster Cluster + +// NewCluster instantiates a new Cluster object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCluster(id string, cloud string, name string, regionInfo ClusterRegionInfo, status string, createdAt time.Time, updatedAt time.Time, instances []Instance, hourlyPrice int32) *Cluster { + this := Cluster{} + this.Id = id + this.Cloud = cloud + this.Name = name + this.RegionInfo = regionInfo + this.Status = status + this.CreatedAt = createdAt + this.UpdatedAt = updatedAt + this.Instances = instances + this.HourlyPrice = hourlyPrice + return &this +} + +// NewClusterWithDefaults instantiates a new Cluster object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewClusterWithDefaults() *Cluster { + this := Cluster{} + return &this +} + +// GetId returns the Id field value +func (o *Cluster) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Cluster) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Cluster) SetId(v string) { + o.Id = v +} + +// GetCloud returns the Cloud field value +func (o *Cluster) GetCloud() string { + if o == nil { + var ret string + return ret + } + + return o.Cloud +} + +// GetCloudOk returns a tuple with the Cloud field value +// and a boolean to check if the value has been set. +func (o *Cluster) GetCloudOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Cloud, true +} + +// SetCloud sets field value +func (o *Cluster) SetCloud(v string) { + o.Cloud = v +} + +// GetName returns the Name field value +func (o *Cluster) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Cluster) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Cluster) SetName(v string) { + o.Name = v +} + +// GetCloudClusterId returns the CloudClusterId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Cluster) GetCloudClusterId() string { + if o == nil || IsNil(o.CloudClusterId.Get()) { + var ret string + return ret + } + return *o.CloudClusterId.Get() +} + +// GetCloudClusterIdOk returns a tuple with the CloudClusterId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Cluster) GetCloudClusterIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.CloudClusterId.Get(), o.CloudClusterId.IsSet() +} + +// HasCloudClusterId returns a boolean if a field has been set. +func (o *Cluster) HasCloudClusterId() bool { + if o != nil && o.CloudClusterId.IsSet() { + return true + } + + return false +} + +// SetCloudClusterId gets a reference to the given NullableString and assigns it to the CloudClusterId field. +func (o *Cluster) SetCloudClusterId(v string) { + o.CloudClusterId.Set(&v) +} + +// SetCloudClusterIdNil sets the value for CloudClusterId to be an explicit nil +func (o *Cluster) SetCloudClusterIdNil() { + o.CloudClusterId.Set(nil) +} + +// UnsetCloudClusterId ensures that no value is present for CloudClusterId, not even an explicit nil +func (o *Cluster) UnsetCloudClusterId() { + o.CloudClusterId.Unset() +} + +// GetRegionInfo returns the RegionInfo field value +func (o *Cluster) GetRegionInfo() ClusterRegionInfo { + if o == nil { + var ret ClusterRegionInfo + return ret + } + + return o.RegionInfo +} + +// GetRegionInfoOk returns a tuple with the RegionInfo field value +// and a boolean to check if the value has been set. +func (o *Cluster) GetRegionInfoOk() (*ClusterRegionInfo, bool) { + if o == nil { + return nil, false + } + return &o.RegionInfo, true +} + +// SetRegionInfo sets field value +func (o *Cluster) SetRegionInfo(v ClusterRegionInfo) { + o.RegionInfo = v +} + +// GetStatus returns the Status field value +func (o *Cluster) GetStatus() string { + if o == nil { + var ret string + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *Cluster) GetStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *Cluster) SetStatus(v string) { + o.Status = v +} + +// GetStatusDetails returns the StatusDetails field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Cluster) GetStatusDetails() string { + if o == nil || IsNil(o.StatusDetails.Get()) { + var ret string + return ret + } + return *o.StatusDetails.Get() +} + +// GetStatusDetailsOk returns a tuple with the StatusDetails field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Cluster) GetStatusDetailsOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.StatusDetails.Get(), o.StatusDetails.IsSet() +} + +// HasStatusDetails returns a boolean if a field has been set. +func (o *Cluster) HasStatusDetails() bool { + if o != nil && o.StatusDetails.IsSet() { + return true + } + + return false +} + +// SetStatusDetails gets a reference to the given NullableString and assigns it to the StatusDetails field. +func (o *Cluster) SetStatusDetails(v string) { + o.StatusDetails.Set(&v) +} + +// SetStatusDetailsNil sets the value for StatusDetails to be an explicit nil +func (o *Cluster) SetStatusDetailsNil() { + o.StatusDetails.Set(nil) +} + +// UnsetStatusDetails ensures that no value is present for StatusDetails, not even an explicit nil +func (o *Cluster) UnsetStatusDetails() { + o.StatusDetails.Unset() +} + +// GetCreatedAt returns the CreatedAt field value +func (o *Cluster) GetCreatedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value +// and a boolean to check if the value has been set. +func (o *Cluster) GetCreatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.CreatedAt, true +} + +// SetCreatedAt sets field value +func (o *Cluster) SetCreatedAt(v time.Time) { + o.CreatedAt = v +} + +// GetUpdatedAt returns the UpdatedAt field value +func (o *Cluster) GetUpdatedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value +// and a boolean to check if the value has been set. +func (o *Cluster) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.UpdatedAt, true +} + +// SetUpdatedAt sets field value +func (o *Cluster) SetUpdatedAt(v time.Time) { + o.UpdatedAt = v +} + +// GetInstances returns the Instances field value +func (o *Cluster) GetInstances() []Instance { + if o == nil { + var ret []Instance + return ret + } + + return o.Instances +} + +// GetInstancesOk returns a tuple with the Instances field value +// and a boolean to check if the value has been set. +func (o *Cluster) GetInstancesOk() ([]Instance, bool) { + if o == nil { + return nil, false + } + return o.Instances, true +} + +// SetInstances sets field value +func (o *Cluster) SetInstances(v []Instance) { + o.Instances = v +} + +// GetHourlyPrice returns the HourlyPrice field value +func (o *Cluster) GetHourlyPrice() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.HourlyPrice +} + +// GetHourlyPriceOk returns a tuple with the HourlyPrice field value +// and a boolean to check if the value has been set. +func (o *Cluster) GetHourlyPriceOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.HourlyPrice, true +} + +// SetHourlyPrice sets field value +func (o *Cluster) SetHourlyPrice(v int32) { + o.HourlyPrice = v +} + +// GetCostEstimate returns the CostEstimate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Cluster) GetCostEstimate() string { + if o == nil || IsNil(o.CostEstimate.Get()) { + var ret string + return ret + } + return *o.CostEstimate.Get() +} + +// GetCostEstimateOk returns a tuple with the CostEstimate field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Cluster) GetCostEstimateOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.CostEstimate.Get(), o.CostEstimate.IsSet() +} + +// HasCostEstimate returns a boolean if a field has been set. +func (o *Cluster) HasCostEstimate() bool { + if o != nil && o.CostEstimate.IsSet() { + return true + } + + return false +} + +// SetCostEstimate gets a reference to the given NullableString and assigns it to the CostEstimate field. +func (o *Cluster) SetCostEstimate(v string) { + o.CostEstimate.Set(&v) +} + +// SetCostEstimateNil sets the value for CostEstimate to be an explicit nil +func (o *Cluster) SetCostEstimateNil() { + o.CostEstimate.Set(nil) +} + +// UnsetCostEstimate ensures that no value is present for CostEstimate, not even an explicit nil +func (o *Cluster) UnsetCostEstimate() { + o.CostEstimate.Unset() +} + +// GetActiveAt returns the ActiveAt field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Cluster) GetActiveAt() time.Time { + if o == nil || IsNil(o.ActiveAt.Get()) { + var ret time.Time + return ret + } + return *o.ActiveAt.Get() +} + +// GetActiveAtOk returns a tuple with the ActiveAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Cluster) GetActiveAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.ActiveAt.Get(), o.ActiveAt.IsSet() +} + +// HasActiveAt returns a boolean if a field has been set. +func (o *Cluster) HasActiveAt() bool { + if o != nil && o.ActiveAt.IsSet() { + return true + } + + return false +} + +// SetActiveAt gets a reference to the given NullableTime and assigns it to the ActiveAt field. +func (o *Cluster) SetActiveAt(v time.Time) { + o.ActiveAt.Set(&v) +} + +// SetActiveAtNil sets the value for ActiveAt to be an explicit nil +func (o *Cluster) SetActiveAtNil() { + o.ActiveAt.Set(nil) +} + +// UnsetActiveAt ensures that no value is present for ActiveAt, not even an explicit nil +func (o *Cluster) UnsetActiveAt() { + o.ActiveAt.Unset() +} + +func (o Cluster) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Cluster) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["cloud"] = o.Cloud + toSerialize["name"] = o.Name + if o.CloudClusterId.IsSet() { + toSerialize["cloud_cluster_id"] = o.CloudClusterId.Get() + } + toSerialize["region_info"] = o.RegionInfo + toSerialize["status"] = o.Status + if o.StatusDetails.IsSet() { + toSerialize["status_details"] = o.StatusDetails.Get() + } + toSerialize["created_at"] = o.CreatedAt + toSerialize["updated_at"] = o.UpdatedAt + toSerialize["instances"] = o.Instances + toSerialize["hourly_price"] = o.HourlyPrice + if o.CostEstimate.IsSet() { + toSerialize["cost_estimate"] = o.CostEstimate.Get() + } + if o.ActiveAt.IsSet() { + toSerialize["active_at"] = o.ActiveAt.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Cluster) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "cloud", + "name", + "region_info", + "status", + "created_at", + "updated_at", + "instances", + "hourly_price", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCluster := _Cluster{} + + err = json.Unmarshal(data, &varCluster) + + if err != nil { + return err + } + + *o = Cluster(varCluster) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "cloud") + delete(additionalProperties, "name") + delete(additionalProperties, "cloud_cluster_id") + delete(additionalProperties, "region_info") + delete(additionalProperties, "status") + delete(additionalProperties, "status_details") + delete(additionalProperties, "created_at") + delete(additionalProperties, "updated_at") + delete(additionalProperties, "instances") + delete(additionalProperties, "hourly_price") + delete(additionalProperties, "cost_estimate") + delete(additionalProperties, "active_at") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCluster struct { + value *Cluster + isSet bool +} + +func (v NullableCluster) Get() *Cluster { + return v.value +} + +func (v *NullableCluster) Set(val *Cluster) { + v.value = val + v.isSet = true +} + +func (v NullableCluster) IsSet() bool { + return v.isSet +} + +func (v *NullableCluster) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCluster(val *Cluster) *NullableCluster { + return &NullableCluster{value: val, isSet: true} +} + +func (v NullableCluster) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCluster) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/v1/providers/shadeform/gen/shadeform/model_cluster_availability.go b/v1/providers/shadeform/gen/shadeform/model_cluster_availability.go new file mode 100644 index 00000000..1106db11 --- /dev/null +++ b/v1/providers/shadeform/gen/shadeform/model_cluster_availability.go @@ -0,0 +1,228 @@ +/* +Shadeform API + +Shadeform is a single API and platform for deploying and managing cloud GPUs. + +API version: 1.0.0 +Contact: support@shadeform.ai +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" + "fmt" +) + +// checks if the ClusterAvailability type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ClusterAvailability{} + +// ClusterAvailability struct for ClusterAvailability +type ClusterAvailability struct { + // The region code. + Region string `json:"region"` + // Human-readable display name for the region. + DisplayName string `json:"display_name"` + // Whether the cluster type is available in this region. + Available bool `json:"available"` + AdditionalProperties map[string]interface{} +} + +type _ClusterAvailability ClusterAvailability + +// NewClusterAvailability instantiates a new ClusterAvailability object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewClusterAvailability(region string, displayName string, available bool) *ClusterAvailability { + this := ClusterAvailability{} + this.Region = region + this.DisplayName = displayName + this.Available = available + return &this +} + +// NewClusterAvailabilityWithDefaults instantiates a new ClusterAvailability object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewClusterAvailabilityWithDefaults() *ClusterAvailability { + this := ClusterAvailability{} + return &this +} + +// GetRegion returns the Region field value +func (o *ClusterAvailability) GetRegion() string { + if o == nil { + var ret string + return ret + } + + return o.Region +} + +// GetRegionOk returns a tuple with the Region field value +// and a boolean to check if the value has been set. +func (o *ClusterAvailability) GetRegionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Region, true +} + +// SetRegion sets field value +func (o *ClusterAvailability) SetRegion(v string) { + o.Region = v +} + +// GetDisplayName returns the DisplayName field value +func (o *ClusterAvailability) GetDisplayName() string { + if o == nil { + var ret string + return ret + } + + return o.DisplayName +} + +// GetDisplayNameOk returns a tuple with the DisplayName field value +// and a boolean to check if the value has been set. +func (o *ClusterAvailability) GetDisplayNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DisplayName, true +} + +// SetDisplayName sets field value +func (o *ClusterAvailability) SetDisplayName(v string) { + o.DisplayName = v +} + +// GetAvailable returns the Available field value +func (o *ClusterAvailability) GetAvailable() bool { + if o == nil { + var ret bool + return ret + } + + return o.Available +} + +// GetAvailableOk returns a tuple with the Available field value +// and a boolean to check if the value has been set. +func (o *ClusterAvailability) GetAvailableOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Available, true +} + +// SetAvailable sets field value +func (o *ClusterAvailability) SetAvailable(v bool) { + o.Available = v +} + +func (o ClusterAvailability) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ClusterAvailability) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["region"] = o.Region + toSerialize["display_name"] = o.DisplayName + toSerialize["available"] = o.Available + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ClusterAvailability) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "region", + "display_name", + "available", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varClusterAvailability := _ClusterAvailability{} + + err = json.Unmarshal(data, &varClusterAvailability) + + if err != nil { + return err + } + + *o = ClusterAvailability(varClusterAvailability) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "region") + delete(additionalProperties, "display_name") + delete(additionalProperties, "available") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableClusterAvailability struct { + value *ClusterAvailability + isSet bool +} + +func (v NullableClusterAvailability) Get() *ClusterAvailability { + return v.value +} + +func (v *NullableClusterAvailability) Set(val *ClusterAvailability) { + v.value = val + v.isSet = true +} + +func (v NullableClusterAvailability) IsSet() bool { + return v.isSet +} + +func (v *NullableClusterAvailability) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableClusterAvailability(val *ClusterAvailability) *NullableClusterAvailability { + return &NullableClusterAvailability{value: val, isSet: true} +} + +func (v NullableClusterAvailability) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableClusterAvailability) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/v1/providers/shadeform/gen/shadeform/model_cluster_info_response.go b/v1/providers/shadeform/gen/shadeform/model_cluster_info_response.go new file mode 100644 index 00000000..51a49e05 --- /dev/null +++ b/v1/providers/shadeform/gen/shadeform/model_cluster_info_response.go @@ -0,0 +1,604 @@ +/* +Shadeform API + +Shadeform is a single API and platform for deploying and managing cloud GPUs. + +API version: 1.0.0 +Contact: support@shadeform.ai +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the ClusterInfoResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ClusterInfoResponse{} + +// ClusterInfoResponse struct for ClusterInfoResponse +type ClusterInfoResponse struct { + // The unique identifier for the cluster. + Id string `json:"id"` + // The cloud provider for the cluster. + Cloud string `json:"cloud"` + // The name of the cluster. + Name string `json:"name"` + // The cloud provider assigned cluster ID. + CloudClusterId NullableString `json:"cloud_cluster_id,omitempty"` + RegionInfo ClusterRegionInfo `json:"region_info"` + // The current status of the cluster. + Status string `json:"status"` + // Additional details about the cluster status. + StatusDetails NullableString `json:"status_details,omitempty"` + // The timestamp when the cluster was created. + CreatedAt time.Time `json:"created_at"` + // The timestamp when the cluster was last updated. + UpdatedAt time.Time `json:"updated_at"` + // Array of instances in the cluster. + Instances []Instance `json:"instances"` + // The hourly price of the cluster in cents. + HourlyPrice int32 `json:"hourly_price"` + // Estimated cost of the cluster. + CostEstimate NullableString `json:"cost_estimate,omitempty"` + // The timestamp when the cluster became active. + ActiveAt NullableTime `json:"active_at,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ClusterInfoResponse ClusterInfoResponse + +// NewClusterInfoResponse instantiates a new ClusterInfoResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewClusterInfoResponse(id string, cloud string, name string, regionInfo ClusterRegionInfo, status string, createdAt time.Time, updatedAt time.Time, instances []Instance, hourlyPrice int32) *ClusterInfoResponse { + this := ClusterInfoResponse{} + this.Id = id + this.Cloud = cloud + this.Name = name + this.RegionInfo = regionInfo + this.Status = status + this.CreatedAt = createdAt + this.UpdatedAt = updatedAt + this.Instances = instances + this.HourlyPrice = hourlyPrice + return &this +} + +// NewClusterInfoResponseWithDefaults instantiates a new ClusterInfoResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewClusterInfoResponseWithDefaults() *ClusterInfoResponse { + this := ClusterInfoResponse{} + return &this +} + +// GetId returns the Id field value +func (o *ClusterInfoResponse) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ClusterInfoResponse) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *ClusterInfoResponse) SetId(v string) { + o.Id = v +} + +// GetCloud returns the Cloud field value +func (o *ClusterInfoResponse) GetCloud() string { + if o == nil { + var ret string + return ret + } + + return o.Cloud +} + +// GetCloudOk returns a tuple with the Cloud field value +// and a boolean to check if the value has been set. +func (o *ClusterInfoResponse) GetCloudOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Cloud, true +} + +// SetCloud sets field value +func (o *ClusterInfoResponse) SetCloud(v string) { + o.Cloud = v +} + +// GetName returns the Name field value +func (o *ClusterInfoResponse) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ClusterInfoResponse) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ClusterInfoResponse) SetName(v string) { + o.Name = v +} + +// GetCloudClusterId returns the CloudClusterId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ClusterInfoResponse) GetCloudClusterId() string { + if o == nil || IsNil(o.CloudClusterId.Get()) { + var ret string + return ret + } + return *o.CloudClusterId.Get() +} + +// GetCloudClusterIdOk returns a tuple with the CloudClusterId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ClusterInfoResponse) GetCloudClusterIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.CloudClusterId.Get(), o.CloudClusterId.IsSet() +} + +// HasCloudClusterId returns a boolean if a field has been set. +func (o *ClusterInfoResponse) HasCloudClusterId() bool { + if o != nil && o.CloudClusterId.IsSet() { + return true + } + + return false +} + +// SetCloudClusterId gets a reference to the given NullableString and assigns it to the CloudClusterId field. +func (o *ClusterInfoResponse) SetCloudClusterId(v string) { + o.CloudClusterId.Set(&v) +} + +// SetCloudClusterIdNil sets the value for CloudClusterId to be an explicit nil +func (o *ClusterInfoResponse) SetCloudClusterIdNil() { + o.CloudClusterId.Set(nil) +} + +// UnsetCloudClusterId ensures that no value is present for CloudClusterId, not even an explicit nil +func (o *ClusterInfoResponse) UnsetCloudClusterId() { + o.CloudClusterId.Unset() +} + +// GetRegionInfo returns the RegionInfo field value +func (o *ClusterInfoResponse) GetRegionInfo() ClusterRegionInfo { + if o == nil { + var ret ClusterRegionInfo + return ret + } + + return o.RegionInfo +} + +// GetRegionInfoOk returns a tuple with the RegionInfo field value +// and a boolean to check if the value has been set. +func (o *ClusterInfoResponse) GetRegionInfoOk() (*ClusterRegionInfo, bool) { + if o == nil { + return nil, false + } + return &o.RegionInfo, true +} + +// SetRegionInfo sets field value +func (o *ClusterInfoResponse) SetRegionInfo(v ClusterRegionInfo) { + o.RegionInfo = v +} + +// GetStatus returns the Status field value +func (o *ClusterInfoResponse) GetStatus() string { + if o == nil { + var ret string + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *ClusterInfoResponse) GetStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *ClusterInfoResponse) SetStatus(v string) { + o.Status = v +} + +// GetStatusDetails returns the StatusDetails field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ClusterInfoResponse) GetStatusDetails() string { + if o == nil || IsNil(o.StatusDetails.Get()) { + var ret string + return ret + } + return *o.StatusDetails.Get() +} + +// GetStatusDetailsOk returns a tuple with the StatusDetails field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ClusterInfoResponse) GetStatusDetailsOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.StatusDetails.Get(), o.StatusDetails.IsSet() +} + +// HasStatusDetails returns a boolean if a field has been set. +func (o *ClusterInfoResponse) HasStatusDetails() bool { + if o != nil && o.StatusDetails.IsSet() { + return true + } + + return false +} + +// SetStatusDetails gets a reference to the given NullableString and assigns it to the StatusDetails field. +func (o *ClusterInfoResponse) SetStatusDetails(v string) { + o.StatusDetails.Set(&v) +} + +// SetStatusDetailsNil sets the value for StatusDetails to be an explicit nil +func (o *ClusterInfoResponse) SetStatusDetailsNil() { + o.StatusDetails.Set(nil) +} + +// UnsetStatusDetails ensures that no value is present for StatusDetails, not even an explicit nil +func (o *ClusterInfoResponse) UnsetStatusDetails() { + o.StatusDetails.Unset() +} + +// GetCreatedAt returns the CreatedAt field value +func (o *ClusterInfoResponse) GetCreatedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value +// and a boolean to check if the value has been set. +func (o *ClusterInfoResponse) GetCreatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.CreatedAt, true +} + +// SetCreatedAt sets field value +func (o *ClusterInfoResponse) SetCreatedAt(v time.Time) { + o.CreatedAt = v +} + +// GetUpdatedAt returns the UpdatedAt field value +func (o *ClusterInfoResponse) GetUpdatedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value +// and a boolean to check if the value has been set. +func (o *ClusterInfoResponse) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.UpdatedAt, true +} + +// SetUpdatedAt sets field value +func (o *ClusterInfoResponse) SetUpdatedAt(v time.Time) { + o.UpdatedAt = v +} + +// GetInstances returns the Instances field value +func (o *ClusterInfoResponse) GetInstances() []Instance { + if o == nil { + var ret []Instance + return ret + } + + return o.Instances +} + +// GetInstancesOk returns a tuple with the Instances field value +// and a boolean to check if the value has been set. +func (o *ClusterInfoResponse) GetInstancesOk() ([]Instance, bool) { + if o == nil { + return nil, false + } + return o.Instances, true +} + +// SetInstances sets field value +func (o *ClusterInfoResponse) SetInstances(v []Instance) { + o.Instances = v +} + +// GetHourlyPrice returns the HourlyPrice field value +func (o *ClusterInfoResponse) GetHourlyPrice() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.HourlyPrice +} + +// GetHourlyPriceOk returns a tuple with the HourlyPrice field value +// and a boolean to check if the value has been set. +func (o *ClusterInfoResponse) GetHourlyPriceOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.HourlyPrice, true +} + +// SetHourlyPrice sets field value +func (o *ClusterInfoResponse) SetHourlyPrice(v int32) { + o.HourlyPrice = v +} + +// GetCostEstimate returns the CostEstimate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ClusterInfoResponse) GetCostEstimate() string { + if o == nil || IsNil(o.CostEstimate.Get()) { + var ret string + return ret + } + return *o.CostEstimate.Get() +} + +// GetCostEstimateOk returns a tuple with the CostEstimate field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ClusterInfoResponse) GetCostEstimateOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.CostEstimate.Get(), o.CostEstimate.IsSet() +} + +// HasCostEstimate returns a boolean if a field has been set. +func (o *ClusterInfoResponse) HasCostEstimate() bool { + if o != nil && o.CostEstimate.IsSet() { + return true + } + + return false +} + +// SetCostEstimate gets a reference to the given NullableString and assigns it to the CostEstimate field. +func (o *ClusterInfoResponse) SetCostEstimate(v string) { + o.CostEstimate.Set(&v) +} + +// SetCostEstimateNil sets the value for CostEstimate to be an explicit nil +func (o *ClusterInfoResponse) SetCostEstimateNil() { + o.CostEstimate.Set(nil) +} + +// UnsetCostEstimate ensures that no value is present for CostEstimate, not even an explicit nil +func (o *ClusterInfoResponse) UnsetCostEstimate() { + o.CostEstimate.Unset() +} + +// GetActiveAt returns the ActiveAt field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ClusterInfoResponse) GetActiveAt() time.Time { + if o == nil || IsNil(o.ActiveAt.Get()) { + var ret time.Time + return ret + } + return *o.ActiveAt.Get() +} + +// GetActiveAtOk returns a tuple with the ActiveAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ClusterInfoResponse) GetActiveAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.ActiveAt.Get(), o.ActiveAt.IsSet() +} + +// HasActiveAt returns a boolean if a field has been set. +func (o *ClusterInfoResponse) HasActiveAt() bool { + if o != nil && o.ActiveAt.IsSet() { + return true + } + + return false +} + +// SetActiveAt gets a reference to the given NullableTime and assigns it to the ActiveAt field. +func (o *ClusterInfoResponse) SetActiveAt(v time.Time) { + o.ActiveAt.Set(&v) +} + +// SetActiveAtNil sets the value for ActiveAt to be an explicit nil +func (o *ClusterInfoResponse) SetActiveAtNil() { + o.ActiveAt.Set(nil) +} + +// UnsetActiveAt ensures that no value is present for ActiveAt, not even an explicit nil +func (o *ClusterInfoResponse) UnsetActiveAt() { + o.ActiveAt.Unset() +} + +func (o ClusterInfoResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ClusterInfoResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["cloud"] = o.Cloud + toSerialize["name"] = o.Name + if o.CloudClusterId.IsSet() { + toSerialize["cloud_cluster_id"] = o.CloudClusterId.Get() + } + toSerialize["region_info"] = o.RegionInfo + toSerialize["status"] = o.Status + if o.StatusDetails.IsSet() { + toSerialize["status_details"] = o.StatusDetails.Get() + } + toSerialize["created_at"] = o.CreatedAt + toSerialize["updated_at"] = o.UpdatedAt + toSerialize["instances"] = o.Instances + toSerialize["hourly_price"] = o.HourlyPrice + if o.CostEstimate.IsSet() { + toSerialize["cost_estimate"] = o.CostEstimate.Get() + } + if o.ActiveAt.IsSet() { + toSerialize["active_at"] = o.ActiveAt.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ClusterInfoResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "cloud", + "name", + "region_info", + "status", + "created_at", + "updated_at", + "instances", + "hourly_price", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varClusterInfoResponse := _ClusterInfoResponse{} + + err = json.Unmarshal(data, &varClusterInfoResponse) + + if err != nil { + return err + } + + *o = ClusterInfoResponse(varClusterInfoResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "cloud") + delete(additionalProperties, "name") + delete(additionalProperties, "cloud_cluster_id") + delete(additionalProperties, "region_info") + delete(additionalProperties, "status") + delete(additionalProperties, "status_details") + delete(additionalProperties, "created_at") + delete(additionalProperties, "updated_at") + delete(additionalProperties, "instances") + delete(additionalProperties, "hourly_price") + delete(additionalProperties, "cost_estimate") + delete(additionalProperties, "active_at") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableClusterInfoResponse struct { + value *ClusterInfoResponse + isSet bool +} + +func (v NullableClusterInfoResponse) Get() *ClusterInfoResponse { + return v.value +} + +func (v *NullableClusterInfoResponse) Set(val *ClusterInfoResponse) { + v.value = val + v.isSet = true +} + +func (v NullableClusterInfoResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableClusterInfoResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableClusterInfoResponse(val *ClusterInfoResponse) *NullableClusterInfoResponse { + return &NullableClusterInfoResponse{value: val, isSet: true} +} + +func (v NullableClusterInfoResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableClusterInfoResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/v1/providers/shadeform/gen/shadeform/model_cluster_region_info.go b/v1/providers/shadeform/gen/shadeform/model_cluster_region_info.go new file mode 100644 index 00000000..13c01c5a --- /dev/null +++ b/v1/providers/shadeform/gen/shadeform/model_cluster_region_info.go @@ -0,0 +1,198 @@ +/* +Shadeform API + +Shadeform is a single API and platform for deploying and managing cloud GPUs. + +API version: 1.0.0 +Contact: support@shadeform.ai +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" + "fmt" +) + +// checks if the ClusterRegionInfo type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ClusterRegionInfo{} + +// ClusterRegionInfo struct for ClusterRegionInfo +type ClusterRegionInfo struct { + // The region code. + Region string `json:"region"` + // Human-readable display name for the region. + DisplayName string `json:"display_name"` + AdditionalProperties map[string]interface{} +} + +type _ClusterRegionInfo ClusterRegionInfo + +// NewClusterRegionInfo instantiates a new ClusterRegionInfo object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewClusterRegionInfo(region string, displayName string) *ClusterRegionInfo { + this := ClusterRegionInfo{} + this.Region = region + this.DisplayName = displayName + return &this +} + +// NewClusterRegionInfoWithDefaults instantiates a new ClusterRegionInfo object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewClusterRegionInfoWithDefaults() *ClusterRegionInfo { + this := ClusterRegionInfo{} + return &this +} + +// GetRegion returns the Region field value +func (o *ClusterRegionInfo) GetRegion() string { + if o == nil { + var ret string + return ret + } + + return o.Region +} + +// GetRegionOk returns a tuple with the Region field value +// and a boolean to check if the value has been set. +func (o *ClusterRegionInfo) GetRegionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Region, true +} + +// SetRegion sets field value +func (o *ClusterRegionInfo) SetRegion(v string) { + o.Region = v +} + +// GetDisplayName returns the DisplayName field value +func (o *ClusterRegionInfo) GetDisplayName() string { + if o == nil { + var ret string + return ret + } + + return o.DisplayName +} + +// GetDisplayNameOk returns a tuple with the DisplayName field value +// and a boolean to check if the value has been set. +func (o *ClusterRegionInfo) GetDisplayNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DisplayName, true +} + +// SetDisplayName sets field value +func (o *ClusterRegionInfo) SetDisplayName(v string) { + o.DisplayName = v +} + +func (o ClusterRegionInfo) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ClusterRegionInfo) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["region"] = o.Region + toSerialize["display_name"] = o.DisplayName + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ClusterRegionInfo) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "region", + "display_name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varClusterRegionInfo := _ClusterRegionInfo{} + + err = json.Unmarshal(data, &varClusterRegionInfo) + + if err != nil { + return err + } + + *o = ClusterRegionInfo(varClusterRegionInfo) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "region") + delete(additionalProperties, "display_name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableClusterRegionInfo struct { + value *ClusterRegionInfo + isSet bool +} + +func (v NullableClusterRegionInfo) Get() *ClusterRegionInfo { + return v.value +} + +func (v *NullableClusterRegionInfo) Set(val *ClusterRegionInfo) { + v.value = val + v.isSet = true +} + +func (v NullableClusterRegionInfo) IsSet() bool { + return v.isSet +} + +func (v *NullableClusterRegionInfo) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableClusterRegionInfo(val *ClusterRegionInfo) *NullableClusterRegionInfo { + return &NullableClusterRegionInfo{value: val, isSet: true} +} + +func (v NullableClusterRegionInfo) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableClusterRegionInfo) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/v1/providers/shadeform/gen/shadeform/model_cluster_type.go b/v1/providers/shadeform/gen/shadeform/model_cluster_type.go new file mode 100644 index 00000000..ad95883a --- /dev/null +++ b/v1/providers/shadeform/gen/shadeform/model_cluster_type.go @@ -0,0 +1,256 @@ +/* +Shadeform API + +Shadeform is a single API and platform for deploying and managing cloud GPUs. + +API version: 1.0.0 +Contact: support@shadeform.ai +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" + "fmt" +) + +// checks if the ClusterType type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ClusterType{} + +// ClusterType struct for ClusterType +type ClusterType struct { + // The cloud provider. + Cloud string `json:"cloud"` + // The number of instances in this cluster type. + NumInstances int32 `json:"num_instances"` + Availability ClusterAvailability `json:"availability"` + ClusterType InstanceType `json:"cluster_type"` + AdditionalProperties map[string]interface{} +} + +type _ClusterType ClusterType + +// NewClusterType instantiates a new ClusterType object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewClusterType(cloud string, numInstances int32, availability ClusterAvailability, clusterType InstanceType) *ClusterType { + this := ClusterType{} + this.Cloud = cloud + this.NumInstances = numInstances + this.Availability = availability + this.ClusterType = clusterType + return &this +} + +// NewClusterTypeWithDefaults instantiates a new ClusterType object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewClusterTypeWithDefaults() *ClusterType { + this := ClusterType{} + return &this +} + +// GetCloud returns the Cloud field value +func (o *ClusterType) GetCloud() string { + if o == nil { + var ret string + return ret + } + + return o.Cloud +} + +// GetCloudOk returns a tuple with the Cloud field value +// and a boolean to check if the value has been set. +func (o *ClusterType) GetCloudOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Cloud, true +} + +// SetCloud sets field value +func (o *ClusterType) SetCloud(v string) { + o.Cloud = v +} + +// GetNumInstances returns the NumInstances field value +func (o *ClusterType) GetNumInstances() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.NumInstances +} + +// GetNumInstancesOk returns a tuple with the NumInstances field value +// and a boolean to check if the value has been set. +func (o *ClusterType) GetNumInstancesOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.NumInstances, true +} + +// SetNumInstances sets field value +func (o *ClusterType) SetNumInstances(v int32) { + o.NumInstances = v +} + +// GetAvailability returns the Availability field value +func (o *ClusterType) GetAvailability() ClusterAvailability { + if o == nil { + var ret ClusterAvailability + return ret + } + + return o.Availability +} + +// GetAvailabilityOk returns a tuple with the Availability field value +// and a boolean to check if the value has been set. +func (o *ClusterType) GetAvailabilityOk() (*ClusterAvailability, bool) { + if o == nil { + return nil, false + } + return &o.Availability, true +} + +// SetAvailability sets field value +func (o *ClusterType) SetAvailability(v ClusterAvailability) { + o.Availability = v +} + +// GetClusterType returns the ClusterType field value +func (o *ClusterType) GetClusterType() InstanceType { + if o == nil { + var ret InstanceType + return ret + } + + return o.ClusterType +} + +// GetClusterTypeOk returns a tuple with the ClusterType field value +// and a boolean to check if the value has been set. +func (o *ClusterType) GetClusterTypeOk() (*InstanceType, bool) { + if o == nil { + return nil, false + } + return &o.ClusterType, true +} + +// SetClusterType sets field value +func (o *ClusterType) SetClusterType(v InstanceType) { + o.ClusterType = v +} + +func (o ClusterType) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ClusterType) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["cloud"] = o.Cloud + toSerialize["num_instances"] = o.NumInstances + toSerialize["availability"] = o.Availability + toSerialize["cluster_type"] = o.ClusterType + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ClusterType) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "cloud", + "num_instances", + "availability", + "cluster_type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varClusterType := _ClusterType{} + + err = json.Unmarshal(data, &varClusterType) + + if err != nil { + return err + } + + *o = ClusterType(varClusterType) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "cloud") + delete(additionalProperties, "num_instances") + delete(additionalProperties, "availability") + delete(additionalProperties, "cluster_type") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableClusterType struct { + value *ClusterType + isSet bool +} + +func (v NullableClusterType) Get() *ClusterType { + return v.value +} + +func (v *NullableClusterType) Set(val *ClusterType) { + v.value = val + v.isSet = true +} + +func (v NullableClusterType) IsSet() bool { + return v.isSet +} + +func (v *NullableClusterType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableClusterType(val *ClusterType) *NullableClusterType { + return &NullableClusterType{value: val, isSet: true} +} + +func (v NullableClusterType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableClusterType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/v1/providers/shadeform/gen/shadeform/model_cluster_types_response.go b/v1/providers/shadeform/gen/shadeform/model_cluster_types_response.go new file mode 100644 index 00000000..ee8ef323 --- /dev/null +++ b/v1/providers/shadeform/gen/shadeform/model_cluster_types_response.go @@ -0,0 +1,167 @@ +/* +Shadeform API + +Shadeform is a single API and platform for deploying and managing cloud GPUs. + +API version: 1.0.0 +Contact: support@shadeform.ai +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" + "fmt" +) + +// checks if the ClusterTypesResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ClusterTypesResponse{} + +// ClusterTypesResponse struct for ClusterTypesResponse +type ClusterTypesResponse struct { + ClusterTypes []ClusterType `json:"cluster_types"` + AdditionalProperties map[string]interface{} +} + +type _ClusterTypesResponse ClusterTypesResponse + +// NewClusterTypesResponse instantiates a new ClusterTypesResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewClusterTypesResponse(clusterTypes []ClusterType) *ClusterTypesResponse { + this := ClusterTypesResponse{} + this.ClusterTypes = clusterTypes + return &this +} + +// NewClusterTypesResponseWithDefaults instantiates a new ClusterTypesResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewClusterTypesResponseWithDefaults() *ClusterTypesResponse { + this := ClusterTypesResponse{} + return &this +} + +// GetClusterTypes returns the ClusterTypes field value +func (o *ClusterTypesResponse) GetClusterTypes() []ClusterType { + if o == nil { + var ret []ClusterType + return ret + } + + return o.ClusterTypes +} + +// GetClusterTypesOk returns a tuple with the ClusterTypes field value +// and a boolean to check if the value has been set. +func (o *ClusterTypesResponse) GetClusterTypesOk() ([]ClusterType, bool) { + if o == nil { + return nil, false + } + return o.ClusterTypes, true +} + +// SetClusterTypes sets field value +func (o *ClusterTypesResponse) SetClusterTypes(v []ClusterType) { + o.ClusterTypes = v +} + +func (o ClusterTypesResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ClusterTypesResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["cluster_types"] = o.ClusterTypes + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ClusterTypesResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "cluster_types", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varClusterTypesResponse := _ClusterTypesResponse{} + + err = json.Unmarshal(data, &varClusterTypesResponse) + + if err != nil { + return err + } + + *o = ClusterTypesResponse(varClusterTypesResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "cluster_types") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableClusterTypesResponse struct { + value *ClusterTypesResponse + isSet bool +} + +func (v NullableClusterTypesResponse) Get() *ClusterTypesResponse { + return v.value +} + +func (v *NullableClusterTypesResponse) Set(val *ClusterTypesResponse) { + v.value = val + v.isSet = true +} + +func (v NullableClusterTypesResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableClusterTypesResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableClusterTypesResponse(val *ClusterTypesResponse) *NullableClusterTypesResponse { + return &NullableClusterTypesResponse{value: val, isSet: true} +} + +func (v NullableClusterTypesResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableClusterTypesResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/v1/providers/shadeform/gen/shadeform/model_clusters_response.go b/v1/providers/shadeform/gen/shadeform/model_clusters_response.go new file mode 100644 index 00000000..b91f6023 --- /dev/null +++ b/v1/providers/shadeform/gen/shadeform/model_clusters_response.go @@ -0,0 +1,167 @@ +/* +Shadeform API + +Shadeform is a single API and platform for deploying and managing cloud GPUs. + +API version: 1.0.0 +Contact: support@shadeform.ai +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" + "fmt" +) + +// checks if the ClustersResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ClustersResponse{} + +// ClustersResponse struct for ClustersResponse +type ClustersResponse struct { + Clusters []Cluster `json:"clusters"` + AdditionalProperties map[string]interface{} +} + +type _ClustersResponse ClustersResponse + +// NewClustersResponse instantiates a new ClustersResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewClustersResponse(clusters []Cluster) *ClustersResponse { + this := ClustersResponse{} + this.Clusters = clusters + return &this +} + +// NewClustersResponseWithDefaults instantiates a new ClustersResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewClustersResponseWithDefaults() *ClustersResponse { + this := ClustersResponse{} + return &this +} + +// GetClusters returns the Clusters field value +func (o *ClustersResponse) GetClusters() []Cluster { + if o == nil { + var ret []Cluster + return ret + } + + return o.Clusters +} + +// GetClustersOk returns a tuple with the Clusters field value +// and a boolean to check if the value has been set. +func (o *ClustersResponse) GetClustersOk() ([]Cluster, bool) { + if o == nil { + return nil, false + } + return o.Clusters, true +} + +// SetClusters sets field value +func (o *ClustersResponse) SetClusters(v []Cluster) { + o.Clusters = v +} + +func (o ClustersResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ClustersResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["clusters"] = o.Clusters + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ClustersResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "clusters", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varClustersResponse := _ClustersResponse{} + + err = json.Unmarshal(data, &varClustersResponse) + + if err != nil { + return err + } + + *o = ClustersResponse(varClustersResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "clusters") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableClustersResponse struct { + value *ClustersResponse + isSet bool +} + +func (v NullableClustersResponse) Get() *ClustersResponse { + return v.value +} + +func (v *NullableClustersResponse) Set(val *ClustersResponse) { + v.value = val + v.isSet = true +} + +func (v NullableClustersResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableClustersResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableClustersResponse(val *ClustersResponse) *NullableClustersResponse { + return &NullableClustersResponse{value: val, isSet: true} +} + +func (v NullableClustersResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableClustersResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/v1/providers/shadeform/gen/shadeform/model_create_cluster_request.go b/v1/providers/shadeform/gen/shadeform/model_create_cluster_request.go new file mode 100644 index 00000000..67a2291c --- /dev/null +++ b/v1/providers/shadeform/gen/shadeform/model_create_cluster_request.go @@ -0,0 +1,364 @@ +/* +Shadeform API + +Shadeform is a single API and platform for deploying and managing cloud GPUs. + +API version: 1.0.0 +Contact: support@shadeform.ai +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" + "fmt" +) + +// checks if the CreateClusterRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateClusterRequest{} + +// CreateClusterRequest struct for CreateClusterRequest +type CreateClusterRequest struct { + // The name of the cluster. + Name string `json:"name"` + // The cloud provider for the cluster. + Cloud string `json:"cloud"` + // The region where the cluster will be deployed. + Region string `json:"region"` + // The type of GPU cluster to create. + ClusterType string `json:"cluster_type"` + // The number of instances in the cluster. + NumInstances int32 `json:"num_instances"` + // The SSH key ID to use for the cluster instances. + SshKeyId *string `json:"ssh_key_id,omitempty"` + // The operating system for the cluster. + Os *string `json:"os,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CreateClusterRequest CreateClusterRequest + +// NewCreateClusterRequest instantiates a new CreateClusterRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateClusterRequest(name string, cloud string, region string, clusterType string, numInstances int32) *CreateClusterRequest { + this := CreateClusterRequest{} + this.Name = name + this.Cloud = cloud + this.Region = region + this.ClusterType = clusterType + this.NumInstances = numInstances + return &this +} + +// NewCreateClusterRequestWithDefaults instantiates a new CreateClusterRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateClusterRequestWithDefaults() *CreateClusterRequest { + this := CreateClusterRequest{} + return &this +} + +// GetName returns the Name field value +func (o *CreateClusterRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *CreateClusterRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *CreateClusterRequest) SetName(v string) { + o.Name = v +} + +// GetCloud returns the Cloud field value +func (o *CreateClusterRequest) GetCloud() string { + if o == nil { + var ret string + return ret + } + + return o.Cloud +} + +// GetCloudOk returns a tuple with the Cloud field value +// and a boolean to check if the value has been set. +func (o *CreateClusterRequest) GetCloudOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Cloud, true +} + +// SetCloud sets field value +func (o *CreateClusterRequest) SetCloud(v string) { + o.Cloud = v +} + +// GetRegion returns the Region field value +func (o *CreateClusterRequest) GetRegion() string { + if o == nil { + var ret string + return ret + } + + return o.Region +} + +// GetRegionOk returns a tuple with the Region field value +// and a boolean to check if the value has been set. +func (o *CreateClusterRequest) GetRegionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Region, true +} + +// SetRegion sets field value +func (o *CreateClusterRequest) SetRegion(v string) { + o.Region = v +} + +// GetClusterType returns the ClusterType field value +func (o *CreateClusterRequest) GetClusterType() string { + if o == nil { + var ret string + return ret + } + + return o.ClusterType +} + +// GetClusterTypeOk returns a tuple with the ClusterType field value +// and a boolean to check if the value has been set. +func (o *CreateClusterRequest) GetClusterTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ClusterType, true +} + +// SetClusterType sets field value +func (o *CreateClusterRequest) SetClusterType(v string) { + o.ClusterType = v +} + +// GetNumInstances returns the NumInstances field value +func (o *CreateClusterRequest) GetNumInstances() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.NumInstances +} + +// GetNumInstancesOk returns a tuple with the NumInstances field value +// and a boolean to check if the value has been set. +func (o *CreateClusterRequest) GetNumInstancesOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.NumInstances, true +} + +// SetNumInstances sets field value +func (o *CreateClusterRequest) SetNumInstances(v int32) { + o.NumInstances = v +} + +// GetSshKeyId returns the SshKeyId field value if set, zero value otherwise. +func (o *CreateClusterRequest) GetSshKeyId() string { + if o == nil || IsNil(o.SshKeyId) { + var ret string + return ret + } + return *o.SshKeyId +} + +// GetSshKeyIdOk returns a tuple with the SshKeyId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateClusterRequest) GetSshKeyIdOk() (*string, bool) { + if o == nil || IsNil(o.SshKeyId) { + return nil, false + } + return o.SshKeyId, true +} + +// HasSshKeyId returns a boolean if a field has been set. +func (o *CreateClusterRequest) HasSshKeyId() bool { + if o != nil && !IsNil(o.SshKeyId) { + return true + } + + return false +} + +// SetSshKeyId gets a reference to the given string and assigns it to the SshKeyId field. +func (o *CreateClusterRequest) SetSshKeyId(v string) { + o.SshKeyId = &v +} + +// GetOs returns the Os field value if set, zero value otherwise. +func (o *CreateClusterRequest) GetOs() string { + if o == nil || IsNil(o.Os) { + var ret string + return ret + } + return *o.Os +} + +// GetOsOk returns a tuple with the Os field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateClusterRequest) GetOsOk() (*string, bool) { + if o == nil || IsNil(o.Os) { + return nil, false + } + return o.Os, true +} + +// HasOs returns a boolean if a field has been set. +func (o *CreateClusterRequest) HasOs() bool { + if o != nil && !IsNil(o.Os) { + return true + } + + return false +} + +// SetOs gets a reference to the given string and assigns it to the Os field. +func (o *CreateClusterRequest) SetOs(v string) { + o.Os = &v +} + +func (o CreateClusterRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateClusterRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["cloud"] = o.Cloud + toSerialize["region"] = o.Region + toSerialize["cluster_type"] = o.ClusterType + toSerialize["num_instances"] = o.NumInstances + if !IsNil(o.SshKeyId) { + toSerialize["ssh_key_id"] = o.SshKeyId + } + if !IsNil(o.Os) { + toSerialize["os"] = o.Os + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CreateClusterRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "cloud", + "region", + "cluster_type", + "num_instances", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateClusterRequest := _CreateClusterRequest{} + + err = json.Unmarshal(data, &varCreateClusterRequest) + + if err != nil { + return err + } + + *o = CreateClusterRequest(varCreateClusterRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "cloud") + delete(additionalProperties, "region") + delete(additionalProperties, "cluster_type") + delete(additionalProperties, "num_instances") + delete(additionalProperties, "ssh_key_id") + delete(additionalProperties, "os") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCreateClusterRequest struct { + value *CreateClusterRequest + isSet bool +} + +func (v NullableCreateClusterRequest) Get() *CreateClusterRequest { + return v.value +} + +func (v *NullableCreateClusterRequest) Set(val *CreateClusterRequest) { + v.value = val + v.isSet = true +} + +func (v NullableCreateClusterRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateClusterRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateClusterRequest(val *CreateClusterRequest) *NullableCreateClusterRequest { + return &NullableCreateClusterRequest{value: val, isSet: true} +} + +func (v NullableCreateClusterRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateClusterRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/v1/providers/shadeform/gen/shadeform/model_create_cluster_response.go b/v1/providers/shadeform/gen/shadeform/model_create_cluster_response.go new file mode 100644 index 00000000..09181303 --- /dev/null +++ b/v1/providers/shadeform/gen/shadeform/model_create_cluster_response.go @@ -0,0 +1,168 @@ +/* +Shadeform API + +Shadeform is a single API and platform for deploying and managing cloud GPUs. + +API version: 1.0.0 +Contact: support@shadeform.ai +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" + "fmt" +) + +// checks if the CreateClusterResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateClusterResponse{} + +// CreateClusterResponse Response of the /clusters/create API call +type CreateClusterResponse struct { + // The unique identifier for the newly created cluster. + Id string `json:"id"` + AdditionalProperties map[string]interface{} +} + +type _CreateClusterResponse CreateClusterResponse + +// NewCreateClusterResponse instantiates a new CreateClusterResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateClusterResponse(id string) *CreateClusterResponse { + this := CreateClusterResponse{} + this.Id = id + return &this +} + +// NewCreateClusterResponseWithDefaults instantiates a new CreateClusterResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateClusterResponseWithDefaults() *CreateClusterResponse { + this := CreateClusterResponse{} + return &this +} + +// GetId returns the Id field value +func (o *CreateClusterResponse) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *CreateClusterResponse) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *CreateClusterResponse) SetId(v string) { + o.Id = v +} + +func (o CreateClusterResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateClusterResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CreateClusterResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateClusterResponse := _CreateClusterResponse{} + + err = json.Unmarshal(data, &varCreateClusterResponse) + + if err != nil { + return err + } + + *o = CreateClusterResponse(varCreateClusterResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCreateClusterResponse struct { + value *CreateClusterResponse + isSet bool +} + +func (v NullableCreateClusterResponse) Get() *CreateClusterResponse { + return v.value +} + +func (v *NullableCreateClusterResponse) Set(val *CreateClusterResponse) { + v.value = val + v.isSet = true +} + +func (v NullableCreateClusterResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateClusterResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateClusterResponse(val *CreateClusterResponse) *NullableCreateClusterResponse { + return &NullableCreateClusterResponse{value: val, isSet: true} +} + +func (v NullableCreateClusterResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateClusterResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/v1/providers/shadeform/gen/shadeform/model_create_request.go b/v1/providers/shadeform/gen/shadeform/model_create_request.go index 106b0ca3..3b738b32 100644 --- a/v1/providers/shadeform/gen/shadeform/model_create_request.go +++ b/v1/providers/shadeform/gen/shadeform/model_create_request.go @@ -21,7 +21,8 @@ var _ MappedNullable = &CreateRequest{} // CreateRequest struct for CreateRequest type CreateRequest struct { - Cloud Cloud `json:"cloud"` + // Specifies the underlying cloud provider. See this [explanation](/getting-started/concepts#cloud-cloud-provider) for more details. + Cloud string `json:"cloud"` // Specifies the region. Region string `json:"region"` // The Shadeform standardized instance type. See this [explanation](/getting-started/concepts#shade-instance-type-and-cloud-instance-type) for more details. @@ -55,7 +56,7 @@ type _CreateRequest CreateRequest // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewCreateRequest(cloud Cloud, region string, shadeInstanceType string, shadeCloud bool, name string) *CreateRequest { +func NewCreateRequest(cloud string, region string, shadeInstanceType string, shadeCloud bool, name string) *CreateRequest { this := CreateRequest{} this.Cloud = cloud this.Region = region @@ -74,9 +75,9 @@ func NewCreateRequestWithDefaults() *CreateRequest { } // GetCloud returns the Cloud field value -func (o *CreateRequest) GetCloud() Cloud { +func (o *CreateRequest) GetCloud() string { if o == nil { - var ret Cloud + var ret string return ret } @@ -85,7 +86,7 @@ func (o *CreateRequest) GetCloud() Cloud { // GetCloudOk returns a tuple with the Cloud field value // and a boolean to check if the value has been set. -func (o *CreateRequest) GetCloudOk() (*Cloud, bool) { +func (o *CreateRequest) GetCloudOk() (*string, bool) { if o == nil { return nil, false } @@ -93,7 +94,7 @@ func (o *CreateRequest) GetCloudOk() (*Cloud, bool) { } // SetCloud sets field value -func (o *CreateRequest) SetCloud(v Cloud) { +func (o *CreateRequest) SetCloud(v string) { o.Cloud = v } diff --git a/v1/providers/shadeform/gen/shadeform/model_create_volume_request.go b/v1/providers/shadeform/gen/shadeform/model_create_volume_request.go index 674d8b2f..f7113ed2 100644 --- a/v1/providers/shadeform/gen/shadeform/model_create_volume_request.go +++ b/v1/providers/shadeform/gen/shadeform/model_create_volume_request.go @@ -21,7 +21,8 @@ var _ MappedNullable = &CreateVolumeRequest{} // CreateVolumeRequest struct for CreateVolumeRequest type CreateVolumeRequest struct { - Cloud Cloud `json:"cloud"` + // Specifies the underlying cloud provider. See this [explanation](/getting-started/concepts#cloud-cloud-provider) for more details. + Cloud string `json:"cloud"` // Specifies the region. Region string `json:"region"` // Storage volume size in GB @@ -37,7 +38,7 @@ type _CreateVolumeRequest CreateVolumeRequest // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewCreateVolumeRequest(cloud Cloud, region string, sizeInGb int32, name string) *CreateVolumeRequest { +func NewCreateVolumeRequest(cloud string, region string, sizeInGb int32, name string) *CreateVolumeRequest { this := CreateVolumeRequest{} this.Cloud = cloud this.Region = region @@ -55,9 +56,9 @@ func NewCreateVolumeRequestWithDefaults() *CreateVolumeRequest { } // GetCloud returns the Cloud field value -func (o *CreateVolumeRequest) GetCloud() Cloud { +func (o *CreateVolumeRequest) GetCloud() string { if o == nil { - var ret Cloud + var ret string return ret } @@ -66,7 +67,7 @@ func (o *CreateVolumeRequest) GetCloud() Cloud { // GetCloudOk returns a tuple with the Cloud field value // and a boolean to check if the value has been set. -func (o *CreateVolumeRequest) GetCloudOk() (*Cloud, bool) { +func (o *CreateVolumeRequest) GetCloudOk() (*string, bool) { if o == nil { return nil, false } @@ -74,7 +75,7 @@ func (o *CreateVolumeRequest) GetCloudOk() (*Cloud, bool) { } // SetCloud sets field value -func (o *CreateVolumeRequest) SetCloud(v Cloud) { +func (o *CreateVolumeRequest) SetCloud(v string) { o.Cloud = v } diff --git a/v1/providers/shadeform/gen/shadeform/model_instance.go b/v1/providers/shadeform/gen/shadeform/model_instance.go index 69284c8c..99c55134 100644 --- a/v1/providers/shadeform/gen/shadeform/model_instance.go +++ b/v1/providers/shadeform/gen/shadeform/model_instance.go @@ -23,8 +23,9 @@ var _ MappedNullable = &Instance{} // Instance struct for Instance type Instance struct { // The unique identifier for the instance. Used in the instances for the /instances/{id}/info and /instances/{id}/delete APIs. - Id string `json:"id"` - Cloud Cloud `json:"cloud"` + Id string `json:"id"` + // Specifies the underlying cloud provider. See this [explanation](/getting-started/concepts#cloud-cloud-provider) for more details. + Cloud string `json:"cloud"` // Specifies the region. Region string `json:"region"` // The Shadeform standardized instance type. See this [explanation](/getting-started/concepts#shade-instance-type-and-cloud-instance-type) for more details. @@ -72,7 +73,7 @@ type _Instance Instance // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewInstance(id string, cloud Cloud, region string, shadeInstanceType string, cloudInstanceType string, cloudAssignedId string, shadeCloud bool, name string, configuration InstanceConfiguration, ip string, sshUser string, sshPort int32, status Status, costEstimate string, createdAt time.Time, deletedAt time.Time) *Instance { +func NewInstance(id string, cloud string, region string, shadeInstanceType string, cloudInstanceType string, cloudAssignedId string, shadeCloud bool, name string, configuration InstanceConfiguration, ip string, sshUser string, sshPort int32, status Status, costEstimate string, createdAt time.Time, deletedAt time.Time) *Instance { this := Instance{} this.Id = id this.Cloud = cloud @@ -126,9 +127,9 @@ func (o *Instance) SetId(v string) { } // GetCloud returns the Cloud field value -func (o *Instance) GetCloud() Cloud { +func (o *Instance) GetCloud() string { if o == nil { - var ret Cloud + var ret string return ret } @@ -137,7 +138,7 @@ func (o *Instance) GetCloud() Cloud { // GetCloudOk returns a tuple with the Cloud field value // and a boolean to check if the value has been set. -func (o *Instance) GetCloudOk() (*Cloud, bool) { +func (o *Instance) GetCloudOk() (*string, bool) { if o == nil { return nil, false } @@ -145,7 +146,7 @@ func (o *Instance) GetCloudOk() (*Cloud, bool) { } // SetCloud sets field value -func (o *Instance) SetCloud(v Cloud) { +func (o *Instance) SetCloud(v string) { o.Cloud = v } diff --git a/v1/providers/shadeform/gen/shadeform/model_instance_info_response.go b/v1/providers/shadeform/gen/shadeform/model_instance_info_response.go index de86f98e..99673585 100644 --- a/v1/providers/shadeform/gen/shadeform/model_instance_info_response.go +++ b/v1/providers/shadeform/gen/shadeform/model_instance_info_response.go @@ -23,8 +23,9 @@ var _ MappedNullable = &InstanceInfoResponse{} // InstanceInfoResponse struct for InstanceInfoResponse type InstanceInfoResponse struct { // The unique identifier for the instance. Used in the instances for the /instances/{id}/info and /instances/{id}/delete APIs. - Id string `json:"id"` - Cloud Cloud `json:"cloud"` + Id string `json:"id"` + // Specifies the underlying cloud provider. See this [explanation](/getting-started/concepts#cloud-cloud-provider) for more details. + Cloud string `json:"cloud"` // Specifies the region. Region string `json:"region"` // The Shadeform standardized instance type. See this [explanation](/getting-started/concepts#shade-instance-type-and-cloud-instance-type) for more details. @@ -81,7 +82,7 @@ type _InstanceInfoResponse InstanceInfoResponse // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewInstanceInfoResponse(id string, cloud Cloud, region string, shadeInstanceType string, cloudInstanceType string, cloudAssignedId string, shadeCloud bool, name string, configuration InstanceConfiguration, ip string, sshUser string, sshPort int32, status Status, costEstimate string, createdAt time.Time, deletedAt time.Time) *InstanceInfoResponse { +func NewInstanceInfoResponse(id string, cloud string, region string, shadeInstanceType string, cloudInstanceType string, cloudAssignedId string, shadeCloud bool, name string, configuration InstanceConfiguration, ip string, sshUser string, sshPort int32, status Status, costEstimate string, createdAt time.Time, deletedAt time.Time) *InstanceInfoResponse { this := InstanceInfoResponse{} this.Id = id this.Cloud = cloud @@ -135,9 +136,9 @@ func (o *InstanceInfoResponse) SetId(v string) { } // GetCloud returns the Cloud field value -func (o *InstanceInfoResponse) GetCloud() Cloud { +func (o *InstanceInfoResponse) GetCloud() string { if o == nil { - var ret Cloud + var ret string return ret } @@ -146,7 +147,7 @@ func (o *InstanceInfoResponse) GetCloud() Cloud { // GetCloudOk returns a tuple with the Cloud field value // and a boolean to check if the value has been set. -func (o *InstanceInfoResponse) GetCloudOk() (*Cloud, bool) { +func (o *InstanceInfoResponse) GetCloudOk() (*string, bool) { if o == nil { return nil, false } @@ -154,7 +155,7 @@ func (o *InstanceInfoResponse) GetCloudOk() (*Cloud, bool) { } // SetCloud sets field value -func (o *InstanceInfoResponse) SetCloud(v Cloud) { +func (o *InstanceInfoResponse) SetCloud(v string) { o.Cloud = v } diff --git a/v1/providers/shadeform/gen/shadeform/model_instance_type.go b/v1/providers/shadeform/gen/shadeform/model_instance_type.go index 7705d3ec..5defc7be 100644 --- a/v1/providers/shadeform/gen/shadeform/model_instance_type.go +++ b/v1/providers/shadeform/gen/shadeform/model_instance_type.go @@ -21,7 +21,8 @@ var _ MappedNullable = &InstanceType{} // InstanceType Information about a specific instance type type InstanceType struct { - Cloud Cloud `json:"cloud"` + // Specifies the underlying cloud provider. See this [explanation](/getting-started/concepts#cloud-cloud-provider) for more details. + Cloud string `json:"cloud"` // The Shadeform standardized instance type. See this [explanation](/getting-started/concepts#shade-instance-type-and-cloud-instance-type) for more details. ShadeInstanceType string `json:"shade_instance_type"` // The instance type for the underlying cloud provider. See this [explanation](/getting-started/concepts#shade-instance-type-and-cloud-instance-type) for more details. @@ -42,7 +43,7 @@ type _InstanceType InstanceType // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewInstanceType(cloud Cloud, shadeInstanceType string, cloudInstanceType string, configuration InstanceTypeConfiguration, hourlyPrice int32, deploymentType string, availability []Availability) *InstanceType { +func NewInstanceType(cloud string, shadeInstanceType string, cloudInstanceType string, configuration InstanceTypeConfiguration, hourlyPrice int32, deploymentType string, availability []Availability) *InstanceType { this := InstanceType{} this.Cloud = cloud this.ShadeInstanceType = shadeInstanceType @@ -63,9 +64,9 @@ func NewInstanceTypeWithDefaults() *InstanceType { } // GetCloud returns the Cloud field value -func (o *InstanceType) GetCloud() Cloud { +func (o *InstanceType) GetCloud() string { if o == nil { - var ret Cloud + var ret string return ret } @@ -74,7 +75,7 @@ func (o *InstanceType) GetCloud() Cloud { // GetCloudOk returns a tuple with the Cloud field value // and a boolean to check if the value has been set. -func (o *InstanceType) GetCloudOk() (*Cloud, bool) { +func (o *InstanceType) GetCloudOk() (*string, bool) { if o == nil { return nil, false } @@ -82,7 +83,7 @@ func (o *InstanceType) GetCloudOk() (*Cloud, bool) { } // SetCloud sets field value -func (o *InstanceType) SetCloud(v Cloud) { +func (o *InstanceType) SetCloud(v string) { o.Cloud = v } diff --git a/v1/providers/shadeform/gen/shadeform/model_volume.go b/v1/providers/shadeform/gen/shadeform/model_volume.go index a76ac09d..0efdd3f5 100644 --- a/v1/providers/shadeform/gen/shadeform/model_volume.go +++ b/v1/providers/shadeform/gen/shadeform/model_volume.go @@ -22,8 +22,9 @@ var _ MappedNullable = &Volume{} // Volume struct for Volume type Volume struct { // The ID of the storage volume. - Id string `json:"id"` - Cloud Cloud `json:"cloud"` + Id string `json:"id"` + // Specifies the underlying cloud provider. See this [explanation](/getting-started/concepts#cloud-cloud-provider) for more details. + Cloud string `json:"cloud"` // The unique identifier of the storage volume issued by the underlying cloud provider. CloudAssignedId string `json:"cloud_assigned_id"` // Specifies the region. @@ -49,7 +50,7 @@ type _Volume Volume // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewVolume(id string, cloud Cloud, cloudAssignedId string, region string, name string, fixedSize bool, sizeInGb int32, costEstimate string, supportsMultiMount bool, mountedBy string) *Volume { +func NewVolume(id string, cloud string, cloudAssignedId string, region string, name string, fixedSize bool, sizeInGb int32, costEstimate string, supportsMultiMount bool, mountedBy string) *Volume { this := Volume{} this.Id = id this.Cloud = cloud @@ -97,9 +98,9 @@ func (o *Volume) SetId(v string) { } // GetCloud returns the Cloud field value -func (o *Volume) GetCloud() Cloud { +func (o *Volume) GetCloud() string { if o == nil { - var ret Cloud + var ret string return ret } @@ -108,7 +109,7 @@ func (o *Volume) GetCloud() Cloud { // GetCloudOk returns a tuple with the Cloud field value // and a boolean to check if the value has been set. -func (o *Volume) GetCloudOk() (*Cloud, bool) { +func (o *Volume) GetCloudOk() (*string, bool) { if o == nil { return nil, false } @@ -116,7 +117,7 @@ func (o *Volume) GetCloudOk() (*Cloud, bool) { } // SetCloud sets field value -func (o *Volume) SetCloud(v Cloud) { +func (o *Volume) SetCloud(v string) { o.Cloud = v } diff --git a/v1/providers/shadeform/gen/shadeform/model_volume_types_inner.go b/v1/providers/shadeform/gen/shadeform/model_volume_types_inner.go index 20ee1625..da5eb446 100644 --- a/v1/providers/shadeform/gen/shadeform/model_volume_types_inner.go +++ b/v1/providers/shadeform/gen/shadeform/model_volume_types_inner.go @@ -21,7 +21,8 @@ var _ MappedNullable = &VolumeTypesInner{} // VolumeTypesInner struct for VolumeTypesInner type VolumeTypesInner struct { - Cloud Cloud `json:"cloud"` + // Specifies the underlying cloud provider. See this [explanation](/getting-started/concepts#cloud-cloud-provider) for more details. + Cloud string `json:"cloud"` // Specifies the region. Region string `json:"region"` // Denotes whether the volume supports multiple instances mounting to it at the same time. @@ -39,7 +40,7 @@ type _VolumeTypesInner VolumeTypesInner // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewVolumeTypesInner(cloud Cloud, region string, supportsMultiMount bool, fixedSize bool, pricePerGbPerHour string) *VolumeTypesInner { +func NewVolumeTypesInner(cloud string, region string, supportsMultiMount bool, fixedSize bool, pricePerGbPerHour string) *VolumeTypesInner { this := VolumeTypesInner{} this.Cloud = cloud this.Region = region @@ -58,9 +59,9 @@ func NewVolumeTypesInnerWithDefaults() *VolumeTypesInner { } // GetCloud returns the Cloud field value -func (o *VolumeTypesInner) GetCloud() Cloud { +func (o *VolumeTypesInner) GetCloud() string { if o == nil { - var ret Cloud + var ret string return ret } @@ -69,7 +70,7 @@ func (o *VolumeTypesInner) GetCloud() Cloud { // GetCloudOk returns a tuple with the Cloud field value // and a boolean to check if the value has been set. -func (o *VolumeTypesInner) GetCloudOk() (*Cloud, bool) { +func (o *VolumeTypesInner) GetCloudOk() (*string, bool) { if o == nil { return nil, false } @@ -77,7 +78,7 @@ func (o *VolumeTypesInner) GetCloudOk() (*Cloud, bool) { } // SetCloud sets field value -func (o *VolumeTypesInner) SetCloud(v Cloud) { +func (o *VolumeTypesInner) SetCloud(v string) { o.Cloud = v } diff --git a/v1/providers/shadeform/gen/shadeform/test/api_default_test.go b/v1/providers/shadeform/gen/shadeform/test/api_default_test.go index 08d02f30..25d38e9b 100644 --- a/v1/providers/shadeform/gen/shadeform/test/api_default_test.go +++ b/v1/providers/shadeform/gen/shadeform/test/api_default_test.go @@ -11,18 +11,82 @@ package openapi import ( "context" - "testing" - - openapiclient "github.com/brevdev/cloud/v1/providers/shadeform/gen/shadeform" + openapiclient "github.com/brevdev/cloud" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "testing" ) func Test_openapi_DefaultAPIService(t *testing.T) { + configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) + t.Run("Test DefaultAPIService Clusters", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultAPI.Clusters(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultAPIService ClustersCreate", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultAPI.ClustersCreate(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultAPIService ClustersDelete", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var id string + + httpRes, err := apiClient.DefaultAPI.ClustersDelete(context.Background(), id).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultAPIService ClustersInfo", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.DefaultAPI.ClustersInfo(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultAPIService ClustersTypes", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultAPI.ClustersTypes(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + t.Run("Test DefaultAPIService Instances", func(t *testing.T) { + t.Skip("skip test") // remove to run test resp, httpRes, err := apiClient.DefaultAPI.Instances(context.Background()).Execute() @@ -30,9 +94,11 @@ func Test_openapi_DefaultAPIService(t *testing.T) { require.Nil(t, err) require.NotNil(t, resp) assert.Equal(t, 200, httpRes.StatusCode) + }) t.Run("Test DefaultAPIService InstancesCreate", func(t *testing.T) { + t.Skip("skip test") // remove to run test resp, httpRes, err := apiClient.DefaultAPI.InstancesCreate(context.Background()).Execute() @@ -40,9 +106,11 @@ func Test_openapi_DefaultAPIService(t *testing.T) { require.Nil(t, err) require.NotNil(t, resp) assert.Equal(t, 200, httpRes.StatusCode) + }) t.Run("Test DefaultAPIService InstancesDelete", func(t *testing.T) { + t.Skip("skip test") // remove to run test var id string @@ -51,9 +119,11 @@ func Test_openapi_DefaultAPIService(t *testing.T) { require.Nil(t, err) assert.Equal(t, 200, httpRes.StatusCode) + }) t.Run("Test DefaultAPIService InstancesInfo", func(t *testing.T) { + t.Skip("skip test") // remove to run test var id string @@ -63,9 +133,11 @@ func Test_openapi_DefaultAPIService(t *testing.T) { require.Nil(t, err) require.NotNil(t, resp) assert.Equal(t, 200, httpRes.StatusCode) + }) t.Run("Test DefaultAPIService InstancesRestart", func(t *testing.T) { + t.Skip("skip test") // remove to run test var id string @@ -74,9 +146,11 @@ func Test_openapi_DefaultAPIService(t *testing.T) { require.Nil(t, err) assert.Equal(t, 200, httpRes.StatusCode) + }) t.Run("Test DefaultAPIService InstancesTypes", func(t *testing.T) { + t.Skip("skip test") // remove to run test resp, httpRes, err := apiClient.DefaultAPI.InstancesTypes(context.Background()).Execute() @@ -84,9 +158,11 @@ func Test_openapi_DefaultAPIService(t *testing.T) { require.Nil(t, err) require.NotNil(t, resp) assert.Equal(t, 200, httpRes.StatusCode) + }) t.Run("Test DefaultAPIService InstancesUpdate", func(t *testing.T) { + t.Skip("skip test") // remove to run test var id string @@ -95,9 +171,11 @@ func Test_openapi_DefaultAPIService(t *testing.T) { require.Nil(t, err) assert.Equal(t, 200, httpRes.StatusCode) + }) t.Run("Test DefaultAPIService SshKeys", func(t *testing.T) { + t.Skip("skip test") // remove to run test resp, httpRes, err := apiClient.DefaultAPI.SshKeys(context.Background()).Execute() @@ -105,9 +183,11 @@ func Test_openapi_DefaultAPIService(t *testing.T) { require.Nil(t, err) require.NotNil(t, resp) assert.Equal(t, 200, httpRes.StatusCode) + }) t.Run("Test DefaultAPIService SshKeysAdd", func(t *testing.T) { + t.Skip("skip test") // remove to run test resp, httpRes, err := apiClient.DefaultAPI.SshKeysAdd(context.Background()).Execute() @@ -115,9 +195,11 @@ func Test_openapi_DefaultAPIService(t *testing.T) { require.Nil(t, err) require.NotNil(t, resp) assert.Equal(t, 200, httpRes.StatusCode) + }) t.Run("Test DefaultAPIService SshKeysDelete", func(t *testing.T) { + t.Skip("skip test") // remove to run test var id string @@ -126,9 +208,11 @@ func Test_openapi_DefaultAPIService(t *testing.T) { require.Nil(t, err) assert.Equal(t, 200, httpRes.StatusCode) + }) t.Run("Test DefaultAPIService SshKeysInfo", func(t *testing.T) { + t.Skip("skip test") // remove to run test var id string @@ -138,9 +222,11 @@ func Test_openapi_DefaultAPIService(t *testing.T) { require.Nil(t, err) require.NotNil(t, resp) assert.Equal(t, 200, httpRes.StatusCode) + }) t.Run("Test DefaultAPIService SshKeysSetDefault", func(t *testing.T) { + t.Skip("skip test") // remove to run test var id string @@ -149,9 +235,11 @@ func Test_openapi_DefaultAPIService(t *testing.T) { require.Nil(t, err) assert.Equal(t, 200, httpRes.StatusCode) + }) t.Run("Test DefaultAPIService Templates", func(t *testing.T) { + t.Skip("skip test") // remove to run test resp, httpRes, err := apiClient.DefaultAPI.Templates(context.Background()).Execute() @@ -159,9 +247,11 @@ func Test_openapi_DefaultAPIService(t *testing.T) { require.Nil(t, err) require.NotNil(t, resp) assert.Equal(t, 200, httpRes.StatusCode) + }) t.Run("Test DefaultAPIService TemplatesDelete", func(t *testing.T) { + t.Skip("skip test") // remove to run test var templateId string @@ -170,9 +260,11 @@ func Test_openapi_DefaultAPIService(t *testing.T) { require.Nil(t, err) assert.Equal(t, 200, httpRes.StatusCode) + }) t.Run("Test DefaultAPIService TemplatesFeatured", func(t *testing.T) { + t.Skip("skip test") // remove to run test resp, httpRes, err := apiClient.DefaultAPI.TemplatesFeatured(context.Background()).Execute() @@ -180,9 +272,11 @@ func Test_openapi_DefaultAPIService(t *testing.T) { require.Nil(t, err) require.NotNil(t, resp) assert.Equal(t, 200, httpRes.StatusCode) + }) t.Run("Test DefaultAPIService TemplatesInfo", func(t *testing.T) { + t.Skip("skip test") // remove to run test var templateId string @@ -192,9 +286,11 @@ func Test_openapi_DefaultAPIService(t *testing.T) { require.Nil(t, err) require.NotNil(t, resp) assert.Equal(t, 200, httpRes.StatusCode) + }) t.Run("Test DefaultAPIService TemplatesSave", func(t *testing.T) { + t.Skip("skip test") // remove to run test resp, httpRes, err := apiClient.DefaultAPI.TemplatesSave(context.Background()).Execute() @@ -202,9 +298,11 @@ func Test_openapi_DefaultAPIService(t *testing.T) { require.Nil(t, err) require.NotNil(t, resp) assert.Equal(t, 200, httpRes.StatusCode) + }) t.Run("Test DefaultAPIService TemplatesUpdate", func(t *testing.T) { + t.Skip("skip test") // remove to run test var templateId string @@ -213,9 +311,11 @@ func Test_openapi_DefaultAPIService(t *testing.T) { require.Nil(t, err) assert.Equal(t, 200, httpRes.StatusCode) + }) t.Run("Test DefaultAPIService Volumes", func(t *testing.T) { + t.Skip("skip test") // remove to run test resp, httpRes, err := apiClient.DefaultAPI.Volumes(context.Background()).Execute() @@ -223,9 +323,11 @@ func Test_openapi_DefaultAPIService(t *testing.T) { require.Nil(t, err) require.NotNil(t, resp) assert.Equal(t, 200, httpRes.StatusCode) + }) t.Run("Test DefaultAPIService VolumesCreate", func(t *testing.T) { + t.Skip("skip test") // remove to run test resp, httpRes, err := apiClient.DefaultAPI.VolumesCreate(context.Background()).Execute() @@ -233,9 +335,11 @@ func Test_openapi_DefaultAPIService(t *testing.T) { require.Nil(t, err) require.NotNil(t, resp) assert.Equal(t, 200, httpRes.StatusCode) + }) t.Run("Test DefaultAPIService VolumesDelete", func(t *testing.T) { + t.Skip("skip test") // remove to run test var id string @@ -244,9 +348,11 @@ func Test_openapi_DefaultAPIService(t *testing.T) { require.Nil(t, err) assert.Equal(t, 200, httpRes.StatusCode) + }) t.Run("Test DefaultAPIService VolumesInfo", func(t *testing.T) { + t.Skip("skip test") // remove to run test var id string @@ -256,9 +362,11 @@ func Test_openapi_DefaultAPIService(t *testing.T) { require.Nil(t, err) require.NotNil(t, resp) assert.Equal(t, 200, httpRes.StatusCode) + }) t.Run("Test DefaultAPIService VolumesTypes", func(t *testing.T) { + t.Skip("skip test") // remove to run test resp, httpRes, err := apiClient.DefaultAPI.VolumesTypes(context.Background()).Execute() @@ -266,5 +374,7 @@ func Test_openapi_DefaultAPIService(t *testing.T) { require.Nil(t, err) require.NotNil(t, resp) assert.Equal(t, 200, httpRes.StatusCode) + }) + } diff --git a/v1/providers/shadeform/instance.go b/v1/providers/shadeform/instance.go index 372a9fb5..2101a2c6 100644 --- a/v1/providers/shadeform/instance.go +++ b/v1/providers/shadeform/instance.go @@ -65,11 +65,6 @@ func (c *ShadeformClient) CreateInstance(ctx context.Context, attrs v1.CreateIns return nil, errors.WrapAndTrace(err) } - cloudEnum, err := openapi.NewCloudFromValue(cloud) - if err != nil { - return nil, errors.WrapAndTrace(err) - } - // Add refID tag refIDTag, err := c.createTag(refIDTagName, attrs.RefID) if err != nil { @@ -98,7 +93,7 @@ func (c *ShadeformClient) CreateInstance(ctx context.Context, attrs v1.CreateIns } req := openapi.CreateRequest{ - Cloud: *cloudEnum, + Cloud: cloud, Region: region, ShadeInstanceType: shadeInstanceType, Name: c.getInstanceNameForShadeform(attrs.RefID, attrs.Name), diff --git a/v1/providers/shadeform/instancetype.go b/v1/providers/shadeform/instancetype.go index 8bd2e2e4..91f6d563 100644 --- a/v1/providers/shadeform/instancetype.go +++ b/v1/providers/shadeform/instancetype.go @@ -153,13 +153,7 @@ func (c *ShadeformClient) isInstanceTypeAllowed(instanceType string) (bool, erro return false, errors.WrapAndTrace(err) } - // Convert to API Cloud Enum - cloudEnum, err := openapi.NewCloudFromValue(cloud) - if err != nil { - return false, errors.WrapAndTrace(err) - } - - return c.config.isAllowed(*cloudEnum, shadeInstanceType), nil + return c.config.isAllowed(cloud, shadeInstanceType), nil } // getInstanceType - gets the Brev instance type from the shadeform cloud and shade instance type @@ -281,15 +275,15 @@ func shadeformGPUTypeToBrevGPUName(gpuType string) string { return gpuType } -func shadeformCloud(cloud openapi.Cloud) string { +func shadeformCloud(cloud string) string { // Shadeform will return the cloud as "excesssupply" if the instance type is retrieved // from cloud partners and not a direct cloud provider. In this case, we should just return // the Shadeform Cloud Provider ID. - if cloud == openapi.EXCESSSUPPLY { + if cloud == "excesssupply" { return CloudProviderID } - return string(cloud) + return cloud } func shadeformArchitecture(gpuName string) v1.Architecture { diff --git a/v1/providers/shadeform/validation_test.go b/v1/providers/shadeform/validation_test.go index 65969ff2..68d38c23 100644 --- a/v1/providers/shadeform/validation_test.go +++ b/v1/providers/shadeform/validation_test.go @@ -11,7 +11,6 @@ import ( "time" "github.com/brevdev/cloud/internal/validation" - openapi "github.com/brevdev/cloud/v1/providers/shadeform/gen/shadeform" "github.com/brevdev/cloud/internal/ssh" v1 "github.com/brevdev/cloud/v1" @@ -53,8 +52,8 @@ func TestInstanceTypeFilter(t *testing.T) { client := NewShadeformClient("validation-test", apiKey) client.WithConfiguration(Configuration{ - AllowedInstanceTypes: map[openapi.Cloud]map[string]bool{ - openapi.HYPERSTACK: { + AllowedInstanceTypes: map[string]map[string]bool{ + "hyperstack": { "A4000": true, }, }, From 8a5a53847bd2a9344ff2176c9da5f1f6ec5c1f96 Mon Sep 17 00:00:00 2001 From: Drew Malin Date: Tue, 21 Apr 2026 12:07:19 -0700 Subject: [PATCH 2/2] fmt --- .../gen/shadeform/test/api_default_test.go | 63 +------------------ v1/providers/shadeform/instance.go | 4 +- v1/providers/shadeform/instancetype.go | 2 +- 3 files changed, 6 insertions(+), 63 deletions(-) diff --git a/v1/providers/shadeform/gen/shadeform/test/api_default_test.go b/v1/providers/shadeform/gen/shadeform/test/api_default_test.go index 25d38e9b..a92f30be 100644 --- a/v1/providers/shadeform/gen/shadeform/test/api_default_test.go +++ b/v1/providers/shadeform/gen/shadeform/test/api_default_test.go @@ -11,19 +11,18 @@ package openapi import ( "context" - openapiclient "github.com/brevdev/cloud" + "testing" + + openapiclient "github.com/brevdev/cloud/v1/providers/shadeform/gen/shadeform" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "testing" ) func Test_openapi_DefaultAPIService(t *testing.T) { - configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) t.Run("Test DefaultAPIService Clusters", func(t *testing.T) { - t.Skip("skip test") // remove to run test resp, httpRes, err := apiClient.DefaultAPI.Clusters(context.Background()).Execute() @@ -31,11 +30,9 @@ func Test_openapi_DefaultAPIService(t *testing.T) { require.Nil(t, err) require.NotNil(t, resp) assert.Equal(t, 200, httpRes.StatusCode) - }) t.Run("Test DefaultAPIService ClustersCreate", func(t *testing.T) { - t.Skip("skip test") // remove to run test resp, httpRes, err := apiClient.DefaultAPI.ClustersCreate(context.Background()).Execute() @@ -43,11 +40,9 @@ func Test_openapi_DefaultAPIService(t *testing.T) { require.Nil(t, err) require.NotNil(t, resp) assert.Equal(t, 200, httpRes.StatusCode) - }) t.Run("Test DefaultAPIService ClustersDelete", func(t *testing.T) { - t.Skip("skip test") // remove to run test var id string @@ -56,11 +51,9 @@ func Test_openapi_DefaultAPIService(t *testing.T) { require.Nil(t, err) assert.Equal(t, 200, httpRes.StatusCode) - }) t.Run("Test DefaultAPIService ClustersInfo", func(t *testing.T) { - t.Skip("skip test") // remove to run test var id string @@ -70,11 +63,9 @@ func Test_openapi_DefaultAPIService(t *testing.T) { require.Nil(t, err) require.NotNil(t, resp) assert.Equal(t, 200, httpRes.StatusCode) - }) t.Run("Test DefaultAPIService ClustersTypes", func(t *testing.T) { - t.Skip("skip test") // remove to run test resp, httpRes, err := apiClient.DefaultAPI.ClustersTypes(context.Background()).Execute() @@ -82,11 +73,9 @@ func Test_openapi_DefaultAPIService(t *testing.T) { require.Nil(t, err) require.NotNil(t, resp) assert.Equal(t, 200, httpRes.StatusCode) - }) t.Run("Test DefaultAPIService Instances", func(t *testing.T) { - t.Skip("skip test") // remove to run test resp, httpRes, err := apiClient.DefaultAPI.Instances(context.Background()).Execute() @@ -94,11 +83,9 @@ func Test_openapi_DefaultAPIService(t *testing.T) { require.Nil(t, err) require.NotNil(t, resp) assert.Equal(t, 200, httpRes.StatusCode) - }) t.Run("Test DefaultAPIService InstancesCreate", func(t *testing.T) { - t.Skip("skip test") // remove to run test resp, httpRes, err := apiClient.DefaultAPI.InstancesCreate(context.Background()).Execute() @@ -106,11 +93,9 @@ func Test_openapi_DefaultAPIService(t *testing.T) { require.Nil(t, err) require.NotNil(t, resp) assert.Equal(t, 200, httpRes.StatusCode) - }) t.Run("Test DefaultAPIService InstancesDelete", func(t *testing.T) { - t.Skip("skip test") // remove to run test var id string @@ -119,11 +104,9 @@ func Test_openapi_DefaultAPIService(t *testing.T) { require.Nil(t, err) assert.Equal(t, 200, httpRes.StatusCode) - }) t.Run("Test DefaultAPIService InstancesInfo", func(t *testing.T) { - t.Skip("skip test") // remove to run test var id string @@ -133,11 +116,9 @@ func Test_openapi_DefaultAPIService(t *testing.T) { require.Nil(t, err) require.NotNil(t, resp) assert.Equal(t, 200, httpRes.StatusCode) - }) t.Run("Test DefaultAPIService InstancesRestart", func(t *testing.T) { - t.Skip("skip test") // remove to run test var id string @@ -146,11 +127,9 @@ func Test_openapi_DefaultAPIService(t *testing.T) { require.Nil(t, err) assert.Equal(t, 200, httpRes.StatusCode) - }) t.Run("Test DefaultAPIService InstancesTypes", func(t *testing.T) { - t.Skip("skip test") // remove to run test resp, httpRes, err := apiClient.DefaultAPI.InstancesTypes(context.Background()).Execute() @@ -158,11 +137,9 @@ func Test_openapi_DefaultAPIService(t *testing.T) { require.Nil(t, err) require.NotNil(t, resp) assert.Equal(t, 200, httpRes.StatusCode) - }) t.Run("Test DefaultAPIService InstancesUpdate", func(t *testing.T) { - t.Skip("skip test") // remove to run test var id string @@ -171,11 +148,9 @@ func Test_openapi_DefaultAPIService(t *testing.T) { require.Nil(t, err) assert.Equal(t, 200, httpRes.StatusCode) - }) t.Run("Test DefaultAPIService SshKeys", func(t *testing.T) { - t.Skip("skip test") // remove to run test resp, httpRes, err := apiClient.DefaultAPI.SshKeys(context.Background()).Execute() @@ -183,11 +158,9 @@ func Test_openapi_DefaultAPIService(t *testing.T) { require.Nil(t, err) require.NotNil(t, resp) assert.Equal(t, 200, httpRes.StatusCode) - }) t.Run("Test DefaultAPIService SshKeysAdd", func(t *testing.T) { - t.Skip("skip test") // remove to run test resp, httpRes, err := apiClient.DefaultAPI.SshKeysAdd(context.Background()).Execute() @@ -195,11 +168,9 @@ func Test_openapi_DefaultAPIService(t *testing.T) { require.Nil(t, err) require.NotNil(t, resp) assert.Equal(t, 200, httpRes.StatusCode) - }) t.Run("Test DefaultAPIService SshKeysDelete", func(t *testing.T) { - t.Skip("skip test") // remove to run test var id string @@ -208,11 +179,9 @@ func Test_openapi_DefaultAPIService(t *testing.T) { require.Nil(t, err) assert.Equal(t, 200, httpRes.StatusCode) - }) t.Run("Test DefaultAPIService SshKeysInfo", func(t *testing.T) { - t.Skip("skip test") // remove to run test var id string @@ -222,11 +191,9 @@ func Test_openapi_DefaultAPIService(t *testing.T) { require.Nil(t, err) require.NotNil(t, resp) assert.Equal(t, 200, httpRes.StatusCode) - }) t.Run("Test DefaultAPIService SshKeysSetDefault", func(t *testing.T) { - t.Skip("skip test") // remove to run test var id string @@ -235,11 +202,9 @@ func Test_openapi_DefaultAPIService(t *testing.T) { require.Nil(t, err) assert.Equal(t, 200, httpRes.StatusCode) - }) t.Run("Test DefaultAPIService Templates", func(t *testing.T) { - t.Skip("skip test") // remove to run test resp, httpRes, err := apiClient.DefaultAPI.Templates(context.Background()).Execute() @@ -247,11 +212,9 @@ func Test_openapi_DefaultAPIService(t *testing.T) { require.Nil(t, err) require.NotNil(t, resp) assert.Equal(t, 200, httpRes.StatusCode) - }) t.Run("Test DefaultAPIService TemplatesDelete", func(t *testing.T) { - t.Skip("skip test") // remove to run test var templateId string @@ -260,11 +223,9 @@ func Test_openapi_DefaultAPIService(t *testing.T) { require.Nil(t, err) assert.Equal(t, 200, httpRes.StatusCode) - }) t.Run("Test DefaultAPIService TemplatesFeatured", func(t *testing.T) { - t.Skip("skip test") // remove to run test resp, httpRes, err := apiClient.DefaultAPI.TemplatesFeatured(context.Background()).Execute() @@ -272,11 +233,9 @@ func Test_openapi_DefaultAPIService(t *testing.T) { require.Nil(t, err) require.NotNil(t, resp) assert.Equal(t, 200, httpRes.StatusCode) - }) t.Run("Test DefaultAPIService TemplatesInfo", func(t *testing.T) { - t.Skip("skip test") // remove to run test var templateId string @@ -286,11 +245,9 @@ func Test_openapi_DefaultAPIService(t *testing.T) { require.Nil(t, err) require.NotNil(t, resp) assert.Equal(t, 200, httpRes.StatusCode) - }) t.Run("Test DefaultAPIService TemplatesSave", func(t *testing.T) { - t.Skip("skip test") // remove to run test resp, httpRes, err := apiClient.DefaultAPI.TemplatesSave(context.Background()).Execute() @@ -298,11 +255,9 @@ func Test_openapi_DefaultAPIService(t *testing.T) { require.Nil(t, err) require.NotNil(t, resp) assert.Equal(t, 200, httpRes.StatusCode) - }) t.Run("Test DefaultAPIService TemplatesUpdate", func(t *testing.T) { - t.Skip("skip test") // remove to run test var templateId string @@ -311,11 +266,9 @@ func Test_openapi_DefaultAPIService(t *testing.T) { require.Nil(t, err) assert.Equal(t, 200, httpRes.StatusCode) - }) t.Run("Test DefaultAPIService Volumes", func(t *testing.T) { - t.Skip("skip test") // remove to run test resp, httpRes, err := apiClient.DefaultAPI.Volumes(context.Background()).Execute() @@ -323,11 +276,9 @@ func Test_openapi_DefaultAPIService(t *testing.T) { require.Nil(t, err) require.NotNil(t, resp) assert.Equal(t, 200, httpRes.StatusCode) - }) t.Run("Test DefaultAPIService VolumesCreate", func(t *testing.T) { - t.Skip("skip test") // remove to run test resp, httpRes, err := apiClient.DefaultAPI.VolumesCreate(context.Background()).Execute() @@ -335,11 +286,9 @@ func Test_openapi_DefaultAPIService(t *testing.T) { require.Nil(t, err) require.NotNil(t, resp) assert.Equal(t, 200, httpRes.StatusCode) - }) t.Run("Test DefaultAPIService VolumesDelete", func(t *testing.T) { - t.Skip("skip test") // remove to run test var id string @@ -348,11 +297,9 @@ func Test_openapi_DefaultAPIService(t *testing.T) { require.Nil(t, err) assert.Equal(t, 200, httpRes.StatusCode) - }) t.Run("Test DefaultAPIService VolumesInfo", func(t *testing.T) { - t.Skip("skip test") // remove to run test var id string @@ -362,11 +309,9 @@ func Test_openapi_DefaultAPIService(t *testing.T) { require.Nil(t, err) require.NotNil(t, resp) assert.Equal(t, 200, httpRes.StatusCode) - }) t.Run("Test DefaultAPIService VolumesTypes", func(t *testing.T) { - t.Skip("skip test") // remove to run test resp, httpRes, err := apiClient.DefaultAPI.VolumesTypes(context.Background()).Execute() @@ -374,7 +319,5 @@ func Test_openapi_DefaultAPIService(t *testing.T) { require.Nil(t, err) require.NotNil(t, resp) assert.Equal(t, 200, httpRes.StatusCode) - }) - } diff --git a/v1/providers/shadeform/instance.go b/v1/providers/shadeform/instance.go index 2101a2c6..d87d22fe 100644 --- a/v1/providers/shadeform/instance.go +++ b/v1/providers/shadeform/instance.go @@ -293,7 +293,7 @@ func (c *ShadeformClient) getLifecycleStatus(status string) v1.LifecycleStatus { // convertInstanceInfoResponseToV1Instance - converts Instance Info to v1 instance func (c *ShadeformClient) convertInstanceInfoResponseToV1Instance(instanceInfo openapi.InstanceInfoResponse) (*v1.Instance, error) { - instanceType := c.getInstanceType(string(instanceInfo.Cloud), instanceInfo.ShadeInstanceType) + instanceType := c.getInstanceType(instanceInfo.Cloud, instanceInfo.ShadeInstanceType) lifeCycleStatus := c.getLifecycleStatus(string(instanceInfo.Status)) tags, err := c.convertShadeformTagToV1Tag(instanceInfo.Tags) @@ -346,7 +346,7 @@ func (c *ShadeformClient) convertInstanceInfoResponseToV1Instance(instanceInfo o // convertInstanceInfoResponseToV1Instance - converts /instances response to v1 instance; the api struct is slightly // different from instance info response and expected to diverge so keeping it as a separate function for now func (c *ShadeformClient) convertShadeformInstanceToV1Instance(shadeformInstance openapi.Instance) (*v1.Instance, error) { - instanceType := c.getInstanceType(string(shadeformInstance.Cloud), shadeformInstance.ShadeInstanceType) + instanceType := c.getInstanceType(shadeformInstance.Cloud, shadeformInstance.ShadeInstanceType) lifeCycleStatus := c.getLifecycleStatus(string(shadeformInstance.Status)) tags, err := c.convertShadeformTagToV1Tag(shadeformInstance.Tags) diff --git a/v1/providers/shadeform/instancetype.go b/v1/providers/shadeform/instancetype.go index 91f6d563..06b0701f 100644 --- a/v1/providers/shadeform/instancetype.go +++ b/v1/providers/shadeform/instancetype.go @@ -201,7 +201,7 @@ func (c *ShadeformClient) getEstimatedDeployTime(shadeformInstanceType openapi.I // convertShadeformInstanceTypeToV1InstanceTypes - converts a shadeform returned instance type to a specific instance type and region of availability func (c *ShadeformClient) convertShadeformInstanceTypeToV1InstanceType(shadeformInstanceType openapi.InstanceType) ([]v1.InstanceType, error) { - instanceType := c.getInstanceType(string(shadeformInstanceType.Cloud), shadeformInstanceType.ShadeInstanceType) + instanceType := c.getInstanceType(shadeformInstanceType.Cloud, shadeformInstanceType.ShadeInstanceType) instanceTypes := []v1.InstanceType{}