Skip to content

Latest commit

 

History

History
664 lines (416 loc) · 16.5 KB

File metadata and controls

664 lines (416 loc) · 16.5 KB

\DefaultAPI

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

AddSSHKey

AddSSHKey200Response AddSSHKey(ctx).AddSSHKeyRequest(addSSHKeyRequest).Execute()

Add SSH key

Example

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)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiAddSSHKeyRequest struct via the builder pattern

Name Type Description Notes
addSSHKeyRequest AddSSHKeyRequest

Return type

AddSSHKey200Response

Authorization

basicAuth, bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DeleteSSHKey

DeleteSSHKey(ctx, id).Execute()

Delete SSH key

Example

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)
	}
}

Path Parameters

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

Other parameters are passed through a pointer to a apiDeleteSSHKeyRequest struct via the builder pattern

Name Type Description Notes

Return type

(empty response body)

Authorization

basicAuth, bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetInstance

GetInstance200Response GetInstance(ctx, id).Execute()

List details of a specific instance

Example

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)
}

Path Parameters

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

Other parameters are passed through a pointer to a apiGetInstanceRequest struct via the builder pattern

Name Type Description Notes

Return type

GetInstance200Response

Authorization

basicAuth, bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

InstanceTypes

InstanceTypes200Response InstanceTypes(ctx).Execute()

Retrieve list of offered instance types

Example

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)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

Other parameters are passed through a pointer to a apiInstanceTypesRequest struct via the builder pattern

Return type

InstanceTypes200Response

Authorization

basicAuth, bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

LaunchInstance

LaunchInstance200Response LaunchInstance(ctx).LaunchInstanceRequest(launchInstanceRequest).Execute()

Launch instances

Example

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)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiLaunchInstanceRequest struct via the builder pattern

Name Type Description Notes
launchInstanceRequest LaunchInstanceRequest

Return type

LaunchInstance200Response

Authorization

basicAuth, bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ListFileSystems

ListFileSystems200Response ListFileSystems(ctx).Execute()

List file systems

Example

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)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

Other parameters are passed through a pointer to a apiListFileSystemsRequest struct via the builder pattern

Return type

ListFileSystems200Response

Authorization

basicAuth, bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ListInstances

ListInstances200Response ListInstances(ctx).Execute()

List running instances

Example

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)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

Other parameters are passed through a pointer to a apiListInstancesRequest struct via the builder pattern

Return type

ListInstances200Response

Authorization

basicAuth, bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ListSSHKeys

ListSSHKeys200Response ListSSHKeys(ctx).Execute()

List SSH keys

Example

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)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

Other parameters are passed through a pointer to a apiListSSHKeysRequest struct via the builder pattern

Return type

ListSSHKeys200Response

Authorization

basicAuth, bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RestartInstance

RestartInstance200Response RestartInstance(ctx).RestartInstanceRequest(restartInstanceRequest).Execute()

Restart instances

Example

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)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiRestartInstanceRequest struct via the builder pattern

Name Type Description Notes
restartInstanceRequest RestartInstanceRequest

Return type

RestartInstance200Response

Authorization

basicAuth, bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

TerminateInstance

TerminateInstance200Response TerminateInstance(ctx).TerminateInstanceRequest(terminateInstanceRequest).Execute()

Terminate an instance

Example

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)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiTerminateInstanceRequest struct via the builder pattern

Name Type Description Notes
terminateInstanceRequest TerminateInstanceRequest

Return type

TerminateInstance200Response

Authorization

basicAuth, bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]