api

package
v0.0.0-...-83a6fd2 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Version string

Functions

func AddPublicSSHKey

func AddPublicSSHKey(key []byte) error

func CreateEndpoint

func CreateEndpoint(endpointInput *CreateEndpointInput) (endpointId string, err error)

func CreatePod

func CreatePod(podInput *CreatePodInput) (pod map[string]interface{}, err error)

func CreateTemplate

func CreateTemplate(templateInput *CreateTemplateInput) (templateId string, err error)

func GetCloud

func GetCloud(in *GetCloudInput) (gpuTypes []interface{}, err error)

func Query

func Query(input Input) (res *http.Response, err error)

func RemovePod

func RemovePod(id string) (ok bool, err error)

func StartOnDemandPod

func StartOnDemandPod(id string) (pod map[string]interface{}, err error)

func StartSpotPod

func StartSpotPod(id string, bidPerGpu float32) (podBidResume map[string]interface{}, err error)

func StopPod

func StopPod(id string) (podStop map[string]interface{}, err error)

func UpdateEndpointTemplate

func UpdateEndpointTemplate(endpointId string, templateId string) (err error)

Types

type CreateEndpointInput

type CreateEndpointInput struct {
	Name            string `json:"name"`
	TemplateId      string `json:"templateId"`
	GpuIds          string `json:"gpuIds"`
	NetworkVolumeId string `json:"networkVolumeId"`
	Locations       string `json:"locations"`
	IdleTimeout     int    `json:"idleTimeout"`
	ScalerType      string `json:"scalerType"`
	ScalerValue     int    `json:"scalerValue"`
	WorkersMin      int    `json:"workersMin"`
	WorkersMax      int    `json:"workersMax"`
}

type CreatePodInput

type CreatePodInput struct {
	CloudType         string    `json:"cloudType"`
	ContainerDiskInGb int       `json:"containerDiskInGb"`
	DeployCost        float32   `json:"deployCost,omitempty"`
	DockerArgs        string    `json:"dockerArgs"`
	Env               []*PodEnv `json:"env"`
	GpuCount          int       `json:"gpuCount"`
	GpuTypeId         string    `json:"gpuTypeId"`
	ImageName         string    `json:"imageName"`
	MinMemoryInGb     int       `json:"minMemoryInGb"`
	MinVcpuCount      int       `json:"minVcpuCount"`
	Name              string    `json:"name"`
	NetworkVolumeId   string    `json:"networkVolumeId"`
	Ports             string    `json:"ports"`
	SupportPublicIp   bool      `json:"supportPublicIp"`
	StartSSH          bool      `json:"startSsh"`
	TemplateId        string    `json:"templateId"`
	VolumeInGb        int       `json:"volumeInGb"`
	VolumeMountPath   string    `json:"volumeMountPath"`
}

type CreateTemplateInput

type CreateTemplateInput struct {
	Name              string    `json:"name"`
	ImageName         string    `json:"imageName"`
	DockerStartCmd    string    `json:"dockerArgs"`
	ContainerDiskInGb int       `json:"containerDiskInGb"`
	VolumeInGb        int       `json:"volumeInGb"`
	VolumeMountPath   string    `json:"volumeMountPath"`
	Ports             string    `json:"ports"`
	Env               []*PodEnv `json:"env"`
	IsServerless      bool      `json:"isServerless"`
	StartSSH          bool      `json:"startSsh"`
	IsPublic          bool      `json:"isPublic"`
	Readme            string    `json:"readme"`
}

type Endpoint

type Endpoint struct {
	Name string `json:"name"`
	Id   string
}

there are many more fields in the result of the query but I just care about these for CLI port

func GetEndpoints

func GetEndpoints() (endpoints []*Endpoint, err error)

type EndpointData

type EndpointData struct {
	Myself *MySelfDataEndpoint
}

type EndpointOut

type EndpointOut struct {
	Data   *EndpointData   `json:"data"`
	Errors []*GraphQLError `json:"errors"`
}

type GetCloudInput

type GetCloudInput struct {
	GpuCount      int   `json:"gpuCount"`
	MinMemoryInGb int   `json:"minMemoryInGb,omitempty"`
	MinVcpuCount  int   `json:"minVcpuCount,omitempty"`
	SecureCloud   *bool `json:"secureCloud"`
	TotalDisk     int   `json:"totalDisk,omitempty"`
}

type GraphQLError

type GraphQLError struct {
	Message string
}

type Input

type Input struct {
	Query     string                 `json:"query"`
	Variables map[string]interface{} `json:"variables"`
}

type Machine

type Machine struct {
	GpuDisplayName string
}

type MySelfData

type MySelfData struct {
	PubKey         string
	Pods           []*Pod
	NetworkVolumes []*NetworkVolume
}

type MySelfDataEndpoint

type MySelfDataEndpoint struct {
	Endpoints []*Endpoint
}

type NetworkVolume

type NetworkVolume struct {
	Id           string `json:"id"`
	DataCenterId string `json:"dataCenterId"`
	Name         string `json:"name"`
	Size         int    `json:"size"`
}

func GetNetworkVolumes

func GetNetworkVolumes() (volumes []*NetworkVolume, err error)

type Pod

type Pod struct {
	Id                string
	ContainerDiskInGb int
	CostPerHr         float32
	DesiredStatus     string
	DockerArgs        string
	Env               []string
	GpuCount          int
	ImageName         string
	MemoryInGb        int
	Name              string
	PodType           string
	Ports             string
	VcpuCount         int
	VolumeInGb        int
	VolumeMountPath   string
	Machine           *Machine
	Runtime           *Runtime
}

func GetPods

func GetPods() (pods []*Pod, err error)

type PodData

type PodData struct {
	Myself *MySelfData
}

type PodEnv

type PodEnv struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type PodOut

type PodOut struct {
	Data   *PodData        `json:"data"`
	Errors []*GraphQLError `json:"errors"`
}

type PodRuntimePorts

type PodRuntimePorts struct {
	Ip          string
	IsIpPublic  bool
	PrivatePort int
	PublicPort  int
	Type        string
}

type Runtime

type Runtime struct {
	Ports []*PodRuntimePorts
}

type SSHKey

type SSHKey struct {
	Name        string `json:"name"`
	Type        string `json:"type"`
	Key         string `json:"key"`
	Fingerprint string `json:"fingerprint"`
}

func GetPublicSSHKeys

func GetPublicSSHKeys() (string, []SSHKey, error)

type UpdateEndpointTemplateInput

type UpdateEndpointTemplateInput struct {
	TemplateId string `json:"templateId"`
	EndpointId string `json:"endpointId"`
}

type UserOut

type UserOut struct {
	Data   *PodData        `json:"data"`
	Errors []*GraphQLError `json:"errors"`
}

Jump to

Keyboard shortcuts

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