All URIs are relative to https://cloud.lambda.ai/api/v1
| Method | HTTP request | Description |
|---|---|---|
| AddSSHKey | Post /ssh-keys | Add SSH key |
| DeleteSSHKey | Delete /ssh-keys/{id} | Delete SSH key |
| GetInstance | Get /instances/{id} | List details of a specific instance |
| InstanceTypes | Get /instance-types | Retrieve list of offered instance types |
| LaunchInstance | Post /instance-operations/launch | Launch instances |
| ListFileSystems | Get /file-systems | List file systems |
| ListInstances | Get /instances | List running instances |
| ListSSHKeys | Get /ssh-keys | List SSH keys |
| RestartInstance | Post /instance-operations/restart | Restart instances |
| TerminateInstance | Post /instance-operations/terminate | Terminate an instance |
AddSSHKey200Response AddSSHKey(ctx).AddSSHKeyRequest(addSSHKeyRequest).Execute()
Add SSH key
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/brevdev/cloud"
)
func main() {
addSSHKeyRequest := *openapiclient.NewAddSSHKeyRequest("macbook-pro") // AddSSHKeyRequest |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.DefaultAPI.AddSSHKey(context.Background()).AddSSHKeyRequest(addSSHKeyRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.AddSSHKey``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `AddSSHKey`: AddSSHKey200Response
fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.AddSSHKey`: %v\n", resp)
}Other parameters are passed through a pointer to a apiAddSSHKeyRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| addSSHKeyRequest | AddSSHKeyRequest |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeleteSSHKey(ctx, id).Execute()
Delete SSH key
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/brevdev/cloud"
)
func main() {
id := "id_example" // string | The unique identifier (ID) of the SSH key
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.DefaultAPI.DeleteSSHKey(context.Background(), id).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.DeleteSSHKey``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| id | string | The unique identifier (ID) of the SSH key |
Other parameters are passed through a pointer to a apiDeleteSSHKeyRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
(empty response body)
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetInstance200Response GetInstance(ctx, id).Execute()
List details of a specific instance
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/brevdev/cloud"
)
func main() {
id := "id_example" // string | The unique identifier (ID) of the instance
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.DefaultAPI.GetInstance(context.Background(), id).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.GetInstance``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetInstance`: GetInstance200Response
fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.GetInstance`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| id | string | The unique identifier (ID) of the instance |
Other parameters are passed through a pointer to a apiGetInstanceRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
InstanceTypes200Response InstanceTypes(ctx).Execute()
Retrieve list of offered instance types
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.InstanceTypes(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.InstanceTypes``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `InstanceTypes`: InstanceTypes200Response
fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.InstanceTypes`: %v\n", resp)
}This endpoint does not need any parameter.
Other parameters are passed through a pointer to a apiInstanceTypesRequest struct via the builder pattern
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
LaunchInstance200Response LaunchInstance(ctx).LaunchInstanceRequest(launchInstanceRequest).Execute()
Launch instances
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/brevdev/cloud"
)
func main() {
launchInstanceRequest := *openapiclient.NewLaunchInstanceRequest("us-tx-1", "gpu_1x_a100", []string{"macbook-pro"}) // LaunchInstanceRequest |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.DefaultAPI.LaunchInstance(context.Background()).LaunchInstanceRequest(launchInstanceRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.LaunchInstance``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `LaunchInstance`: LaunchInstance200Response
fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.LaunchInstance`: %v\n", resp)
}Other parameters are passed through a pointer to a apiLaunchInstanceRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| launchInstanceRequest | LaunchInstanceRequest |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListFileSystems200Response ListFileSystems(ctx).Execute()
List file systems
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.ListFileSystems(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.ListFileSystems``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListFileSystems`: ListFileSystems200Response
fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.ListFileSystems`: %v\n", resp)
}This endpoint does not need any parameter.
Other parameters are passed through a pointer to a apiListFileSystemsRequest struct via the builder pattern
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListInstances200Response ListInstances(ctx).Execute()
List running instances
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.ListInstances(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.ListInstances``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListInstances`: ListInstances200Response
fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.ListInstances`: %v\n", resp)
}This endpoint does not need any parameter.
Other parameters are passed through a pointer to a apiListInstancesRequest struct via the builder pattern
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListSSHKeys200Response ListSSHKeys(ctx).Execute()
List SSH keys
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.ListSSHKeys(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.ListSSHKeys``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListSSHKeys`: ListSSHKeys200Response
fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.ListSSHKeys`: %v\n", resp)
}This endpoint does not need any parameter.
Other parameters are passed through a pointer to a apiListSSHKeysRequest struct via the builder pattern
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
RestartInstance200Response RestartInstance(ctx).RestartInstanceRequest(restartInstanceRequest).Execute()
Restart instances
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/brevdev/cloud"
)
func main() {
restartInstanceRequest := *openapiclient.NewRestartInstanceRequest([]string{"0920582c7ff041399e34823a0be62549"}) // RestartInstanceRequest |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.DefaultAPI.RestartInstance(context.Background()).RestartInstanceRequest(restartInstanceRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.RestartInstance``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `RestartInstance`: RestartInstance200Response
fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.RestartInstance`: %v\n", resp)
}Other parameters are passed through a pointer to a apiRestartInstanceRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| restartInstanceRequest | RestartInstanceRequest |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
TerminateInstance200Response TerminateInstance(ctx).TerminateInstanceRequest(terminateInstanceRequest).Execute()
Terminate an instance
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/brevdev/cloud"
)
func main() {
terminateInstanceRequest := *openapiclient.NewTerminateInstanceRequest([]string{"0920582c7ff041399e34823a0be62549"}) // TerminateInstanceRequest |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.DefaultAPI.TerminateInstance(context.Background()).TerminateInstanceRequest(terminateInstanceRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.TerminateInstance``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `TerminateInstance`: TerminateInstance200Response
fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.TerminateInstance`: %v\n", resp)
}Other parameters are passed through a pointer to a apiTerminateInstanceRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| terminateInstanceRequest | TerminateInstanceRequest |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]