Documentation
¶
Index ¶
- Constants
- type APIError
- type AddSSHKeyRequest
- type Client
- func (c *Client) AddSSHKey(req *AddSSHKeyRequest) (*SSHKey, error)
- func (c *Client) DeleteSSHKey(id string) error
- func (c *Client) GetInstance(id string) (*Instance, error)
- func (c *Client) LaunchInstance(req *LaunchRequest) (*LaunchResponse, error)
- func (c *Client) ListInstanceTypes() ([]*InstanceTypeAvailability, error)
- func (c *Client) ListInstances() ([]*Instance, error)
- func (c *Client) ListSSHKeys() ([]*SSHKey, error)
- func (c *Client) RenameInstance(instanceID, name string) error
- func (c *Client) TerminateInstance(instanceIDs []string) (*TerminateResponse, error)
- type Instance
- type InstanceSpecs
- type InstanceType
- type InstanceTypeAvailability
- type LaunchRequest
- type LaunchResponse
- type Region
- type RenameInstanceRequest
- type SSHKey
- type TerminateRequest
- type TerminateResponse
Constants ¶
const (
DefaultBaseURL = "https://cloud.lambdalabs.com/api/v1"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddSSHKeyRequest ¶
type AddSSHKeyRequest struct {
Name string `json:"name"`
PublicKey string `json:"public_key,omitempty"`
}
AddSSHKeyRequest represents a request to add an SSH key
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) AddSSHKey ¶
func (c *Client) AddSSHKey(req *AddSSHKeyRequest) (*SSHKey, error)
AddSSHKey adds a new SSH key
func (*Client) DeleteSSHKey ¶
DeleteSSHKey deletes an SSH key
func (*Client) GetInstance ¶
GetInstance returns details for a specific instance
func (*Client) LaunchInstance ¶
func (c *Client) LaunchInstance(req *LaunchRequest) (*LaunchResponse, error)
LaunchInstance launches a new instance
func (*Client) ListInstanceTypes ¶
func (c *Client) ListInstanceTypes() ([]*InstanceTypeAvailability, error)
ListInstanceTypes returns all available instance types
func (*Client) ListInstances ¶
ListInstances returns all running instances
func (*Client) ListSSHKeys ¶
ListSSHKeys returns all SSH keys
func (*Client) RenameInstance ¶ added in v0.3.0
RenameInstance renames an instance
func (*Client) TerminateInstance ¶
func (c *Client) TerminateInstance(instanceIDs []string) (*TerminateResponse, error)
TerminateInstance terminates instances
type Instance ¶
type Instance struct {
ID string `json:"id"`
Name string `json:"name"`
IP string `json:"ip"`
Status string `json:"status"`
SSHKeyNames []string `json:"ssh_key_names"`
FileSystemNames []string `json:"file_system_names"`
Region *Region `json:"region"`
InstanceType *InstanceType `json:"instance_type"`
Hostname string `json:"hostname"`
JupyterToken string `json:"jupyter_token"`
JupyterURL string `json:"jupyter_url"`
}
Instance represents a Lambda Cloud instance
type InstanceSpecs ¶
type InstanceSpecs struct {
VCPUs int `json:"vcpus"`
MemoryGiB int `json:"memory_gib"`
StorageGiB int `json:"storage_gib"`
GPUs int `json:"gpus"`
GPUType string `json:"gpu_type"`
}
InstanceSpecs represents the hardware specs of an instance type
type InstanceType ¶
type InstanceType struct {
Name string `json:"name"`
Description string `json:"description"`
PriceCentsPerHour int `json:"price_cents_per_hour"`
Specs *InstanceSpecs `json:"specs"`
}
InstanceType represents a Lambda Cloud instance type
type InstanceTypeAvailability ¶
type InstanceTypeAvailability struct {
InstanceType *InstanceType `json:"instance_type"`
RegionsWithCapacity []*Region `json:"regions_with_capacity_available"`
}
InstanceTypeAvailability represents availability of an instance type
type LaunchRequest ¶
type LaunchRequest struct {
RegionName string `json:"region_name"`
InstanceTypeName string `json:"instance_type_name"`
SSHKeyNames []string `json:"ssh_key_names"`
FileSystemNames []string `json:"file_system_names,omitempty"`
Quantity int `json:"quantity,omitempty"`
Name string `json:"name,omitempty"`
UserData string `json:"user_data,omitempty"`
}
LaunchRequest represents a request to launch instances
type LaunchResponse ¶
type LaunchResponse struct {
InstanceIDs []string `json:"instance_ids"`
}
LaunchResponse represents the response from launching instances
type RenameInstanceRequest ¶ added in v0.3.0
type RenameInstanceRequest struct {
Name string `json:"name"`
}
RenameInstanceRequest represents a request to rename an instance
type SSHKey ¶
type SSHKey struct {
ID string `json:"id"`
Name string `json:"name"`
PublicKey string `json:"public_key"`
}
SSHKey represents an SSH key
type TerminateRequest ¶
type TerminateRequest struct {
InstanceIDs []string `json:"instance_ids"`
}
TerminateRequest represents a request to terminate instances
type TerminateResponse ¶
type TerminateResponse struct {
TerminatedInstances []*Instance `json:"terminated_instances"`
}
TerminateResponse represents the response from terminating instances