Documentation
¶
Index ¶
- func ClusterServerURL(c *gcorecloud.ServiceClient, clusterID, serverID string) string
- func ClusterServersURL(c *gcorecloud.ServiceClient, clusterID string) string
- func Delete(client *gcorecloud.ServiceClient, clusterID, serverID string, ...) (r tasks.Result)
- func ExtractServersInto(r pagination.Page, v interface{}) error
- func List(client *gcorecloud.ServiceClient, clusterID string, opts ListOptsBuilder) pagination.Pager
- type DeleteServerOpts
- type DeleteServerOptsBuilder
- type ListOpts
- type ListOptsBuilder
- type Server
- type ServerPage
- type Tag
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClusterServerURL ¶ added in v0.20.0
func ClusterServerURL(c *gcorecloud.ServiceClient, clusterID, serverID string) string
ClusterServerURL returns URL for accessing a single server in a specific GPU cluster
func ClusterServersURL ¶
func ClusterServersURL(c *gcorecloud.ServiceClient, clusterID string) string
ClusterServersURL returns URL for listing servers in a specific GPU cluster
func Delete ¶ added in v0.20.0
func Delete(client *gcorecloud.ServiceClient, clusterID, serverID string, opts DeleteServerOptsBuilder) (r tasks.Result)
Delete removes a specific server from a GPU cluster by its ID.
func ExtractServersInto ¶ added in v0.20.0
func ExtractServersInto(r pagination.Page, v interface{}) error
func List ¶
func List(client *gcorecloud.ServiceClient, clusterID string, opts ListOptsBuilder) pagination.Pager
List retrieves servers of a specific GPU cluster.
Types ¶
type DeleteServerOpts ¶ added in v0.20.0
type DeleteServerOpts struct {
AllFloatingIPs bool `q:"all_floating_ips" validate:"omitempty,allowed_without=FloatingIPIDs"`
AllReservedFixedIPs bool `q:"all_reserved_fixed_ips" validate:"omitempty,allowed_without=ReservedFixedIPIDs"`
AllVolumes bool `q:"all_volumes" validate:"omitempty,allowed_without=VolumeIDs"`
FloatingIPIDs []string `q:"floating_ip_ids" validate:"omitempty,allowed_without=AllFloatingIPs,dive,uuid4" delimiter:"comma"`
ReservedFixedIPIDs []string `q:"reserved_fixed_ip_ids" validate:"omitempty,allowed_without=AllReservedFixedIPs,dive,uuid4" delimiter:"comma"`
VolumeIDs []string `q:"volume_ids" validate:"omitempty,allowed_without=AllVolumes,dive,uuid4" delimiter:"comma"`
}
DeleteServerOpts specifies the parameters for the Delete method.
func (DeleteServerOpts) ToServerDeleteQuery ¶ added in v0.20.0
func (opts DeleteServerOpts) ToServerDeleteQuery() (string, error)
ToDeleteClusterActionMap builds a request body from DeleteInstanceOpts.
func (DeleteServerOpts) Validate ¶ added in v0.20.0
func (opts DeleteServerOpts) Validate() error
Validate checks if the provided options are valid.
type DeleteServerOptsBuilder ¶ added in v0.20.0
DeleteServerOptsBuilder allows extensions to add parameters to delete server options.
type ListOpts ¶ added in v0.25.1
type ListOpts struct {
Limit int `q:"limit" validate:"omitempty,gt=0"`
Offset int `q:"offset" validate:"omitempty,gte=0"`
}
ListOpts allows the filtering and sorting of paginated collections through the API.
func (ListOpts) ToListClustersQuery ¶ added in v0.25.1
ToListClustersQuery formats a ListOpts into a query string.
type ListOptsBuilder ¶ added in v0.25.1
ListOptsBuilder allows extensions to add additional parameters to the List request.
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 []gcorecloud.ItemName `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(r pagination.Page) ([]Server, error)
ExtractServers accepts a Page struct, specifically a ServerPage struct, and extracts the elements into a slice of Server structs. In other words, a generic collection is mapped into a relevant slice.
func ListAll ¶ added in v0.20.0
func ListAll(client *gcorecloud.ServiceClient, clusterID string, opts ListOptsBuilder) ([]Server, error)
ListAll is a convenience function that returns all servers of a specific GPU cluster.
type ServerPage ¶ added in v0.20.0
type ServerPage struct {
pagination.OffsetPageBase
}
ServerPage is the page returned by a pager when traversing over a collection of servers.