servers

package
v0.18.1 Latest Latest
Warning

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

Go to latest
Published: May 14, 2025 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClusterServersURL

func ClusterServersURL(c *gcorecloud.ServiceClient, clusterID string) string

ClusterServersURL returns URL for listing servers in a specific GPU cluster

Types

type ListResult

type ListResult struct {
	gcorecloud.Result
}

ListResult represents the result of a List operation.

func List

func List(client *gcorecloud.ServiceClient, clusterID string) (r ListResult)

List retrieves servers of a specific GPU cluster.

func (ListResult) Extract

func (r ListResult) Extract() (*ServersPage, error)

Extract is a function that accepts a result and extracts a list of servers.

type Server

type Server struct {
	ID             string    `json:"id"`
	ImageID        *string   `json:"image_id"`
	TaskID         *string   `json:"task_id"`
	Flavor         string    `json:"flavor"`
	KeypairID      *string   `json:"keypair_id"`
	Name           string    `json:"name"`
	Status         string    `json:"status"`
	IPAddresses    []string  `json:"ip_addresses"`
	SecurityGroups []string  `json:"security_groups"`
	Tags           []Tag     `json:"tags"`
	CreatedAt      time.Time `json:"created_at"`
	UpdatedAt      time.Time `json:"updated_at"`
}

Server represents a server in a GPU cluster

func ExtractServers

func ExtractServers(lr ListResult) ([]Server, error)

ExtractServers accepts a ListResult and extracts the servers.

type ServersPage

type ServersPage struct {
	Count   int      `json:"count"`
	Results []Server `json:"results"`
}

ServersPage represents a page of servers results.

func (ServersPage) IsEmpty

func (r ServersPage) IsEmpty() bool

IsEmpty returns true if a ServersPage contains no results.

type Tag

type Tag struct {
	Key      string `json:"key"`
	Value    string `json:"value"`
	ReadOnly bool   `json:"read_only"`
}

Tag represents a server tag

Jump to

Keyboard shortcuts

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