client

package
v0.0.0-...-9f60fe2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 2, 2023 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package lambdalabs provides primitives to interact with the openapi HTTP API.

Code generated by github.com/deepmap/oapi-codegen version v1.12.4 DO NOT EDIT.

Index

Constants

View Source
const (
	BasicAuthScopes  = "basicAuth.Scopes"
	BearerAuthScopes = "bearerAuth.Scopes"
)

Variables

This section is empty.

Functions

func NewAddSSHKeyRequest

func NewAddSSHKeyRequest(server string, body AddSSHKeyJSONRequestBody) (*http.Request, error)

NewAddSSHKeyRequest calls the generic AddSSHKey builder with application/json body

func NewAddSSHKeyRequestWithBody

func NewAddSSHKeyRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewAddSSHKeyRequestWithBody generates requests for AddSSHKey with any type of body

func NewGetInstanceRequest

func NewGetInstanceRequest(server string, id InstanceId) (*http.Request, error)

NewGetInstanceRequest generates requests for GetInstance

func NewInstanceTypesRequest

func NewInstanceTypesRequest(server string) (*http.Request, error)

NewInstanceTypesRequest generates requests for InstanceTypes

func NewLaunchInstanceRequest

func NewLaunchInstanceRequest(server string, body LaunchInstanceJSONRequestBody) (*http.Request, error)

NewLaunchInstanceRequest calls the generic LaunchInstance builder with application/json body

func NewLaunchInstanceRequestWithBody

func NewLaunchInstanceRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewLaunchInstanceRequestWithBody generates requests for LaunchInstance with any type of body

func NewListInstancesRequest

func NewListInstancesRequest(server string) (*http.Request, error)

NewListInstancesRequest generates requests for ListInstances

func NewListSSHKeysRequest

func NewListSSHKeysRequest(server string) (*http.Request, error)

NewListSSHKeysRequest generates requests for ListSSHKeys

func NewTerminateInstanceRequest

func NewTerminateInstanceRequest(server string, body TerminateInstanceJSONRequestBody) (*http.Request, error)

NewTerminateInstanceRequest calls the generic TerminateInstance builder with application/json body

func NewTerminateInstanceRequestWithBody

func NewTerminateInstanceRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewTerminateInstanceRequestWithBody generates requests for TerminateInstance with any type of body

Types

type AddSSHKey

type AddSSHKey struct {
	// Name Name of the SSH key
	Name SshKeyName `json:"name"`

	// PublicKey Public key for the SSH key
	PublicKey *SshPublicKey `json:"public_key,omitempty"`
}

AddSSHKey The name for the SSH key. Optionally, an existing public key can be supplied for the `public_key` property. If the `public_key` property is omitted, a new key pair is generated. The private key is returned in the response.

type AddSSHKeyJSONBody

type AddSSHKeyJSONBody struct {
	// Name Name of the SSH key
	Name SshKeyName `json:"name"`

	// PublicKey Public key for the SSH key
	PublicKey *SshPublicKey `json:"public_key,omitempty"`
}

AddSSHKeyJSONBody defines parameters for AddSSHKey.

type AddSSHKeyJSONRequestBody

type AddSSHKeyJSONRequestBody AddSSHKeyJSONBody

AddSSHKeyJSONRequestBody defines body for AddSSHKey for application/json ContentType.

type AddSSHKeyResponse

type AddSSHKeyResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *struct {
		// Data Information about a stored SSH key, which can be used to access instances over SSH
		Data SshKey `json:"data"`
	}
	JSON400 *ErrorResponseBody
	JSON401 *ErrorResponseBody
	JSON403 *ErrorResponseBody
}

func ParseAddSSHKeyResponse

func ParseAddSSHKeyResponse(rsp *http.Response) (*AddSSHKeyResponse, error)

ParseAddSSHKeyResponse parses an HTTP response from a AddSSHKeyWithResponse call

func (AddSSHKeyResponse) Status

func (r AddSSHKeyResponse) Status() string

Status returns HTTPResponse.Status

func (AddSSHKeyResponse) StatusCode

func (r AddSSHKeyResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type AddSSHKeyResponseBody

type AddSSHKeyResponseBody struct {
	// Data Information about a stored SSH key, which can be used to access instances over SSH
	Data SshKey `json:"data"`
}

AddSSHKeyResponseBody The added or generated SSH public key. If a new key pair was generated, the response body contains a `private_key` property that *must* be saved locally. Lambda Cloud does not store private keys.

type BadRequest

type BadRequest = ErrorResponseBody

BadRequest defines model for badRequest.

type Client

type Client struct {
	// The endpoint of the server conforming to this interface, with scheme,
	// https://api.deepmap.com for example. This can contain a path relative
	// to the server, such as https://api.deepmap.com/dev-test, and all the
	// paths in the swagger spec will be appended to the server.
	Server string

	// Doer for performing requests, typically a *http.Client with any
	// customized settings, such as certificate chains.
	Client HttpRequestDoer

	// A list of callbacks for modifying requests which are generated before sending over
	// the network.
	RequestEditors []RequestEditorFn
}

Client which conforms to the OpenAPI3 specification for this service.

func NewClient

func NewClient(server string, opts ...ClientOption) (*Client, error)

Creates a new Client, with reasonable defaults

func (*Client) AddSSHKey

func (c *Client) AddSSHKey(ctx context.Context, body AddSSHKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) AddSSHKeyWithBody

func (c *Client) AddSSHKeyWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetInstance

func (c *Client) GetInstance(ctx context.Context, id InstanceId, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) InstanceTypes

func (c *Client) InstanceTypes(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) LaunchInstance

func (c *Client) LaunchInstance(ctx context.Context, body LaunchInstanceJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) LaunchInstanceWithBody

func (c *Client) LaunchInstanceWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) ListInstances

func (c *Client) ListInstances(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) ListSSHKeys

func (c *Client) ListSSHKeys(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) TerminateInstance

func (c *Client) TerminateInstance(ctx context.Context, body TerminateInstanceJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) TerminateInstanceWithBody

func (c *Client) TerminateInstanceWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

type ClientInterface

type ClientInterface interface {
	// LaunchInstance request with any body
	LaunchInstanceWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	LaunchInstance(ctx context.Context, body LaunchInstanceJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// TerminateInstance request with any body
	TerminateInstanceWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	TerminateInstance(ctx context.Context, body TerminateInstanceJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// InstanceTypes request
	InstanceTypes(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListInstances request
	ListInstances(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetInstance request
	GetInstance(ctx context.Context, id InstanceId, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListSSHKeys request
	ListSSHKeys(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

	// AddSSHKey request with any body
	AddSSHKeyWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	AddSSHKey(ctx context.Context, body AddSSHKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
}

The interface specification for the client above.

type ClientOption

type ClientOption func(*Client) error

ClientOption allows setting custom parameters during construction

func WithBaseURL

func WithBaseURL(baseURL string) ClientOption

WithBaseURL overrides the baseURL.

func WithHTTPClient

func WithHTTPClient(doer HttpRequestDoer) ClientOption

WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.

func WithRequestEditorFn

func WithRequestEditorFn(fn RequestEditorFn) ClientOption

WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.

type ClientWithResponses

type ClientWithResponses struct {
	ClientInterface
}

ClientWithResponses builds on ClientInterface to offer response payloads

func NewClientWithResponses

func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)

NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling

func (*ClientWithResponses) AddSSHKeyWithBodyWithResponse

func (c *ClientWithResponses) AddSSHKeyWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AddSSHKeyResponse, error)

AddSSHKeyWithBodyWithResponse request with arbitrary body returning *AddSSHKeyResponse

func (*ClientWithResponses) AddSSHKeyWithResponse

func (c *ClientWithResponses) AddSSHKeyWithResponse(ctx context.Context, body AddSSHKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*AddSSHKeyResponse, error)

func (*ClientWithResponses) GetInstanceWithResponse

func (c *ClientWithResponses) GetInstanceWithResponse(ctx context.Context, id InstanceId, reqEditors ...RequestEditorFn) (*GetInstanceResponse, error)

GetInstanceWithResponse request returning *GetInstanceResponse

func (*ClientWithResponses) InstanceTypesWithResponse

func (c *ClientWithResponses) InstanceTypesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*InstanceTypesResponse, error)

InstanceTypesWithResponse request returning *InstanceTypesResponse

func (*ClientWithResponses) LaunchInstanceWithBodyWithResponse

func (c *ClientWithResponses) LaunchInstanceWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*LaunchInstanceResponse, error)

LaunchInstanceWithBodyWithResponse request with arbitrary body returning *LaunchInstanceResponse

func (*ClientWithResponses) LaunchInstanceWithResponse

func (c *ClientWithResponses) LaunchInstanceWithResponse(ctx context.Context, body LaunchInstanceJSONRequestBody, reqEditors ...RequestEditorFn) (*LaunchInstanceResponse, error)

func (*ClientWithResponses) ListInstancesWithResponse

func (c *ClientWithResponses) ListInstancesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListInstancesResponse, error)

ListInstancesWithResponse request returning *ListInstancesResponse

func (*ClientWithResponses) ListSSHKeysWithResponse

func (c *ClientWithResponses) ListSSHKeysWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListSSHKeysResponse, error)

ListSSHKeysWithResponse request returning *ListSSHKeysResponse

func (*ClientWithResponses) TerminateInstanceWithBodyWithResponse

func (c *ClientWithResponses) TerminateInstanceWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*TerminateInstanceResponse, error)

TerminateInstanceWithBodyWithResponse request with arbitrary body returning *TerminateInstanceResponse

func (*ClientWithResponses) TerminateInstanceWithResponse

func (c *ClientWithResponses) TerminateInstanceWithResponse(ctx context.Context, body TerminateInstanceJSONRequestBody, reqEditors ...RequestEditorFn) (*TerminateInstanceResponse, error)

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// LaunchInstance request with any body
	LaunchInstanceWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*LaunchInstanceResponse, error)

	LaunchInstanceWithResponse(ctx context.Context, body LaunchInstanceJSONRequestBody, reqEditors ...RequestEditorFn) (*LaunchInstanceResponse, error)

	// TerminateInstance request with any body
	TerminateInstanceWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*TerminateInstanceResponse, error)

	TerminateInstanceWithResponse(ctx context.Context, body TerminateInstanceJSONRequestBody, reqEditors ...RequestEditorFn) (*TerminateInstanceResponse, error)

	// InstanceTypes request
	InstanceTypesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*InstanceTypesResponse, error)

	// ListInstances request
	ListInstancesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListInstancesResponse, error)

	// GetInstance request
	GetInstanceWithResponse(ctx context.Context, id InstanceId, reqEditors ...RequestEditorFn) (*GetInstanceResponse, error)

	// ListSSHKeys request
	ListSSHKeysWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListSSHKeysResponse, error)

	// AddSSHKey request with any body
	AddSSHKeyWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AddSSHKeyResponse, error)

	AddSSHKeyWithResponse(ctx context.Context, body AddSSHKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*AddSSHKeyResponse, error)
}

ClientWithResponsesInterface is the interface specification for the client with responses above.

type Error

type Error struct {
	// Code Unique identifier for the type of error
	Code ErrorCode `json:"code"`

	// Message Detailed description of the error
	Message string `json:"message"`

	// Suggestion Suggestion of possible ways to fix the error.
	Suggestion *string `json:"suggestion"`
}

Error defines model for error.

type ErrorCode

type ErrorCode string

ErrorCode Unique identifier for the type of error

const (
	GlobalaccountInactive                           ErrorCode = "global/account-inactive"
	GlobalinvalidApiKey                             ErrorCode = "global/invalid-api-key"
	GlobalinvalidParameters                         ErrorCode = "global/invalid-parameters"
	GlobalobjectDoesNotExist                        ErrorCode = "global/object-does-not-exist"
	Globalunknown                                   ErrorCode = "global/unknown"
	InstanceOperationslaunchfileSystemInWrongRegion ErrorCode = "instance-operations/launch/file-system-in-wrong-region"
	InstanceOperationslaunchfileSystemsNotSupported ErrorCode = "instance-operations/launch/file-systems-not-supported"
	InstanceOperationslaunchinsufficientCapacity    ErrorCode = "instance-operations/launch/insufficient-capacity"
)

Defines values for ErrorCode.

type ErrorResponseBody

type ErrorResponseBody struct {
	Error Error `json:"error"`
}

ErrorResponseBody defines model for errorResponseBody.

type FileSystemName

type FileSystemName = string

FileSystemName Name of a file system

type Forbidden

type Forbidden = ErrorResponseBody

Forbidden defines model for forbidden.

type GetInstanceResponse

type GetInstanceResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *struct {
		// Data Virtual machine (VM) in Lambda Cloud
		Data Instance `json:"data"`
	}
	JSON401 *ErrorResponseBody
	JSON403 *ErrorResponseBody
	JSON404 *ErrorResponseBody
}

func ParseGetInstanceResponse

func ParseGetInstanceResponse(rsp *http.Response) (*GetInstanceResponse, error)

ParseGetInstanceResponse parses an HTTP response from a GetInstanceWithResponse call

func (GetInstanceResponse) Status

func (r GetInstanceResponse) Status() string

Status returns HTTPResponse.Status

func (GetInstanceResponse) StatusCode

func (r GetInstanceResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type HttpRequestDoer

type HttpRequestDoer interface {
	Do(req *http.Request) (*http.Response, error)
}

Doer performs HTTP requests.

The standard http.Client implements this interface.

type Instance

type Instance struct {
	// FileSystemNames Names of the file systems, if any, attached to the instance
	FileSystemNames []FileSystemName `json:"file_system_names"`

	// Hostname Hostname assigned to this instance, which resolves to the instance's IP.
	Hostname *string `json:"hostname"`

	// Id Unique identifier (ID) of an instance
	Id InstanceId `json:"id"`

	// InstanceType Hardware configuration and pricing of an instance type
	InstanceType *InstanceType `json:"instance_type,omitempty"`

	// Ip IPv4 address of the instance
	Ip *string `json:"ip"`

	// JupyterToken Secret token used to log into the jupyter lab server hosted on the instance.
	JupyterToken *string `json:"jupyter_token"`

	// JupyterUrl URL that opens a jupyter lab notebook on the instance.
	JupyterUrl *string `json:"jupyter_url"`

	// Name User-provided name for the instance
	Name   *InstanceName `json:"name"`
	Region *Region       `json:"region,omitempty"`

	// SshKeyNames Names of the SSH keys allowed to access the instance
	SshKeyNames []SshKeyName `json:"ssh_key_names"`

	// Status The current status of the instance
	Status InstanceStatus `json:"status"`
}

Instance Virtual machine (VM) in Lambda Cloud

type InstanceId

type InstanceId = string

InstanceId Unique identifier (ID) of an instance

type InstanceName

type InstanceName = string

InstanceName User-provided name for the instance

type InstanceResponse

type InstanceResponse struct {
	// Data Virtual machine (VM) in Lambda Cloud
	Data Instance `json:"data"`
}

InstanceResponse defines model for instance.

type InstanceStatus

type InstanceStatus string

InstanceStatus The current status of the instance

const (
	Active     InstanceStatus = "active"
	Booting    InstanceStatus = "booting"
	Terminated InstanceStatus = "terminated"
	Unhealthy  InstanceStatus = "unhealthy"
)

Defines values for InstanceStatus.

type InstanceType

type InstanceType struct {
	// Description Long name of the instance type
	Description string `json:"description"`

	// Name Name of an instance type
	Name InstanceTypeName `json:"name"`

	// PriceCentsPerHour Price of the instance type, in US cents per hour
	PriceCentsPerHour int `json:"price_cents_per_hour"`
	Specs             struct {
		// MemoryGib Amount of RAM, in gibibytes (GiB)
		MemoryGib int `json:"memory_gib"`

		// StorageGib Amount of storage, in gibibytes (GiB).
		StorageGib int `json:"storage_gib"`

		// Vcpus Number of virtual CPUs
		Vcpus int `json:"vcpus"`
	} `json:"specs"`
}

InstanceType Hardware configuration and pricing of an instance type

type InstanceTypeName

type InstanceTypeName = string

InstanceTypeName Name of an instance type

type InstanceTypes

type InstanceTypes struct {
	// Data Dict of instance_type_name to instance_type and region availability.
	Data map[string]struct {
		// InstanceType Hardware configuration and pricing of an instance type
		InstanceType InstanceType `json:"instance_type"`

		// RegionsWithCapacityAvailable List of regions, if any, that have this instance type available
		RegionsWithCapacityAvailable []Region `json:"regions_with_capacity_available"`
	} `json:"data"`
}

InstanceTypes defines model for instanceTypes.

type InstanceTypesResponse

type InstanceTypesResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *struct {
		// Data Dict of instance_type_name to instance_type and region availability.
		Data map[string]struct {
			// InstanceType Hardware configuration and pricing of an instance type
			InstanceType InstanceType `json:"instance_type"`

			// RegionsWithCapacityAvailable List of regions, if any, that have this instance type available
			RegionsWithCapacityAvailable []Region `json:"regions_with_capacity_available"`
		} `json:"data"`
	}
	JSON401 *ErrorResponseBody
	JSON403 *ErrorResponseBody
}

func ParseInstanceTypesResponse

func ParseInstanceTypesResponse(rsp *http.Response) (*InstanceTypesResponse, error)

ParseInstanceTypesResponse parses an HTTP response from a InstanceTypesWithResponse call

func (InstanceTypesResponse) Status

func (r InstanceTypesResponse) Status() string

Status returns HTTPResponse.Status

func (InstanceTypesResponse) StatusCode

func (r InstanceTypesResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Instances

type Instances struct {
	Data []Instance `json:"data"`
}

Instances defines model for instances.

type InternalServerError

type InternalServerError = ErrorResponseBody

InternalServerError defines model for internalServerError.

type Launch

type Launch struct {
	// FileSystemNames Names of the file systems to attach to the instances. Currently, only one (if any) file system may be specified.
	FileSystemNames *[]FileSystemName `json:"file_system_names,omitempty"`

	// InstanceTypeName Name of an instance type
	InstanceTypeName InstanceTypeName `json:"instance_type_name"`

	// Name User-provided name for the instance
	Name *InstanceName `json:"name"`

	// Quantity Number of instances to launch
	Quantity *int `json:"quantity,omitempty"`

	// RegionName Short name of a region
	RegionName RegionName `json:"region_name"`

	// SshKeyNames Names of the SSH keys to allow access to the instances. Currently, exactly one SSH key must be specified.
	SshKeyNames []SshKeyName `json:"ssh_key_names"`
}

Launch defines model for launch.

type LaunchInstanceJSONBody

type LaunchInstanceJSONBody struct {
	// FileSystemNames Names of the file systems to attach to the instances. Currently, only one (if any) file system may be specified.
	FileSystemNames *[]FileSystemName `json:"file_system_names,omitempty"`

	// InstanceTypeName Name of an instance type
	InstanceTypeName InstanceTypeName `json:"instance_type_name"`

	// Name User-provided name for the instance
	Name *InstanceName `json:"name"`

	// Quantity Number of instances to launch
	Quantity *int `json:"quantity,omitempty"`

	// RegionName Short name of a region
	RegionName RegionName `json:"region_name"`

	// SshKeyNames Names of the SSH keys to allow access to the instances. Currently, exactly one SSH key must be specified.
	SshKeyNames []SshKeyName `json:"ssh_key_names"`
}

LaunchInstanceJSONBody defines parameters for LaunchInstance.

type LaunchInstanceJSONRequestBody

type LaunchInstanceJSONRequestBody LaunchInstanceJSONBody

LaunchInstanceJSONRequestBody defines body for LaunchInstance for application/json ContentType.

type LaunchInstanceResponse

type LaunchInstanceResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *struct {
		Data struct {
			// InstanceIds The unique identifiers (IDs) of the launched instances. Note: if a quantity was specified, fewer than the requested quantity might have been launched.
			InstanceIds []InstanceId `json:"instance_ids"`
		} `json:"data"`
	}
	JSON400 *ErrorResponseBody
	JSON401 *ErrorResponseBody
	JSON403 *ErrorResponseBody
	JSON404 *ErrorResponseBody
	JSON500 *ErrorResponseBody
}

func ParseLaunchInstanceResponse

func ParseLaunchInstanceResponse(rsp *http.Response) (*LaunchInstanceResponse, error)

ParseLaunchInstanceResponse parses an HTTP response from a LaunchInstanceWithResponse call

func (LaunchInstanceResponse) Status

func (r LaunchInstanceResponse) Status() string

Status returns HTTPResponse.Status

func (LaunchInstanceResponse) StatusCode

func (r LaunchInstanceResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type LaunchResponse

type LaunchResponse struct {
	Data struct {
		// InstanceIds The unique identifiers (IDs) of the launched instances. Note: if a quantity was specified, fewer than the requested quantity might have been launched.
		InstanceIds []InstanceId `json:"instance_ids"`
	} `json:"data"`
}

LaunchResponse defines model for launch.

type ListInstancesResponse

type ListInstancesResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *struct {
		Data []Instance `json:"data"`
	}
	JSON401 *ErrorResponseBody
	JSON403 *ErrorResponseBody
}

func ParseListInstancesResponse

func ParseListInstancesResponse(rsp *http.Response) (*ListInstancesResponse, error)

ParseListInstancesResponse parses an HTTP response from a ListInstancesWithResponse call

func (ListInstancesResponse) Status

func (r ListInstancesResponse) Status() string

Status returns HTTPResponse.Status

func (ListInstancesResponse) StatusCode

func (r ListInstancesResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListSSHKeysResponse

type ListSSHKeysResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *struct {
		Data []SshKey `json:"data"`
	}
	JSON401 *ErrorResponseBody
	JSON403 *ErrorResponseBody
}

func ParseListSSHKeysResponse

func ParseListSSHKeysResponse(rsp *http.Response) (*ListSSHKeysResponse, error)

ParseListSSHKeysResponse parses an HTTP response from a ListSSHKeysWithResponse call

func (ListSSHKeysResponse) Status

func (r ListSSHKeysResponse) Status() string

Status returns HTTPResponse.Status

func (ListSSHKeysResponse) StatusCode

func (r ListSSHKeysResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type NotFound

type NotFound = ErrorResponseBody

NotFound defines model for notFound.

type Region

type Region struct {
	// Description Long name of a region
	Description string `json:"description"`

	// Name Short name of a region
	Name RegionName `json:"name"`
}

Region defines model for region.

type RegionName

type RegionName = string

RegionName Short name of a region

type RequestEditorFn

type RequestEditorFn func(ctx context.Context, req *http.Request) error

RequestEditorFn is the function signature for the RequestEditor callback function

type SshKey

type SshKey struct {
	// Id Unique identifier (ID) of an SSH key
	Id SshKeyId `json:"id"`

	// Name Name of the SSH key
	Name SshKeyName `json:"name"`

	// PrivateKey Private key for the SSH key. Only returned when generating a new key pair.
	PrivateKey *SshPrivateKey `json:"private_key"`

	// PublicKey Public key for the SSH key
	PublicKey SshPublicKey `json:"public_key"`
}

SshKey Information about a stored SSH key, which can be used to access instances over SSH

type SshKeyId

type SshKeyId = string

SshKeyId Unique identifier (ID) of an SSH key

type SshKeyName

type SshKeyName = string

SshKeyName Name of the SSH key

type SshKeys

type SshKeys struct {
	Data []SshKey `json:"data"`
}

SshKeys defines model for sshKeys.

type SshPrivateKey

type SshPrivateKey = string

SshPrivateKey Private key for the SSH key. Only returned when generating a new key pair.

type SshPublicKey

type SshPublicKey = string

SshPublicKey Public key for the SSH key

type Terminate

type Terminate struct {
	// InstanceIds The unique identifiers (IDs) of the instances to terminate
	InstanceIds []InstanceId `json:"instance_ids"`
}

Terminate defines model for terminate.

type TerminateInstanceJSONBody

type TerminateInstanceJSONBody struct {
	// InstanceIds The unique identifiers (IDs) of the instances to terminate
	InstanceIds []InstanceId `json:"instance_ids"`
}

TerminateInstanceJSONBody defines parameters for TerminateInstance.

type TerminateInstanceJSONRequestBody

type TerminateInstanceJSONRequestBody TerminateInstanceJSONBody

TerminateInstanceJSONRequestBody defines body for TerminateInstance for application/json ContentType.

type TerminateInstanceResponse

type TerminateInstanceResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *struct {
		Data struct {
			// TerminatedInstances List of instances that were terminated. Note: this list might not contain all instances requested to be terminated.
			TerminatedInstances []Instance `json:"terminated_instances"`
		} `json:"data"`
	}
	JSON400 *ErrorResponseBody
	JSON401 *ErrorResponseBody
	JSON403 *ErrorResponseBody
	JSON404 *ErrorResponseBody
	JSON500 *ErrorResponseBody
}

func ParseTerminateInstanceResponse

func ParseTerminateInstanceResponse(rsp *http.Response) (*TerminateInstanceResponse, error)

ParseTerminateInstanceResponse parses an HTTP response from a TerminateInstanceWithResponse call

func (TerminateInstanceResponse) Status

func (r TerminateInstanceResponse) Status() string

Status returns HTTPResponse.Status

func (TerminateInstanceResponse) StatusCode

func (r TerminateInstanceResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type TerminateResponse

type TerminateResponse struct {
	Data struct {
		// TerminatedInstances List of instances that were terminated. Note: this list might not contain all instances requested to be terminated.
		TerminatedInstances []Instance `json:"terminated_instances"`
	} `json:"data"`
}

TerminateResponse defines model for terminate.

type Unauthorized

type Unauthorized = ErrorResponseBody

Unauthorized defines model for unauthorized.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL