Documentation
¶
Index ¶
- Constants
- func ClusterURL(c *gcorecloud.ServiceClient, clusterID string) string
- func ClustersURL(c *gcorecloud.ServiceClient) string
- func Create(client *gcorecloud.ServiceClient, opts CreateClusterOptsBuilder) (r tasks.Result)
- func Delete(client *gcorecloud.ServiceClient, clusterID string) (r tasks.Result)
- func FloatingIPSourceStringList() []string
- func IPFamilyTypeListStringList() []string
- func InterfaceTypeStringList() []string
- func VolumeSourcesStringList() []string
- func VolumeTypesStringList() []string
- type AnySubnetInterface
- type AnySubnetInterfaceOpts
- type Cluster
- type ClusterServerSettings
- type ClusterStatusType
- func (ct *ClusterStatusType) IsValid() error
- func (ct *ClusterStatusType) List() []ClusterStatusType
- func (ct *ClusterStatusType) MarshalJSON() ([]byte, error)
- func (ct *ClusterStatusType) String() string
- func (ct *ClusterStatusType) StringList() []string
- func (ct *ClusterStatusType) UnmarshalJSON(data []byte) error
- func (ct *ClusterStatusType) ValidOrNil() (*ClusterStatusType, error)
- type CreateClusterOpts
- type CreateClusterOptsBuilder
- type ExternalInterface
- type ExternalInterfaceOpts
- type FloatingIP
- type FloatingIPOpts
- type FloatingIPSource
- type GetResult
- type IPFamilyType
- type InterfaceOpts
- type InterfaceType
- type InterfaceUnion
- type RenameClusterOpts
- type RenameClusterOptsBuilder
- type ServerCredentialsOpts
- type ServerSettingsOpts
- type SubnetInterface
- type SubnetInterfaceOpts
- type Volume
- type VolumeOpts
- type VolumeSource
- type VolumeType
Constants ¶
const ( IPv4IPFamilyType IPFamilyType = "ipv4" IPv6IPFamilyType IPFamilyType = "ipv6" DualStackIPFamilyType IPFamilyType = "dual" Standard VolumeType = "standard" SsdHiIops VolumeType = "ssd_hiiops" SsdLowLatency VolumeType = "ssd_lowlatency" SsdLocal VolumeType = "ssd_local" Cold VolumeType = "cold" Ultra VolumeType = "ultra" New ClusterStatusType = "new" Active ClusterStatusType = "active" Suspended ClusterStatusType = "suspended" Error ClusterStatusType = "error" NewVolume VolumeSource = "new" Image VolumeSource = "image" Snapshot VolumeSource = "snapshot" External InterfaceType = "external" Subnet InterfaceType = "subnet" AnySubnet InterfaceType = "any_subnet" NewFloatingIP FloatingIPSource = "new" ExistingFloatingIP FloatingIPSource = "existing" )
Variables ¶
This section is empty.
Functions ¶
func ClusterURL ¶
func ClusterURL(c *gcorecloud.ServiceClient, clusterID string) string
ClusterURL returns URL for specific GPU cluster operations
func ClustersURL ¶
func ClustersURL(c *gcorecloud.ServiceClient) string
ClustersURL returns URL for GPU clusters operations
func Create ¶
func Create(client *gcorecloud.ServiceClient, opts CreateClusterOptsBuilder) (r tasks.Result)
func Delete ¶
func Delete(client *gcorecloud.ServiceClient, clusterID string) (r tasks.Result)
Delete removes a specific GPU cluster by its ID.
func FloatingIPSourceStringList ¶
func FloatingIPSourceStringList() []string
func IPFamilyTypeListStringList ¶
func IPFamilyTypeListStringList() []string
func InterfaceTypeStringList ¶
func InterfaceTypeStringList() []string
func VolumeSourcesStringList ¶
func VolumeSourcesStringList() []string
func VolumeTypesStringList ¶
func VolumeTypesStringList() []string
Types ¶
type AnySubnetInterface ¶
type AnySubnetInterface struct {
NetworkID string `json:"network_id"`
Name *string `json:"name"`
Type string `json:"type"`
IPFamily IPFamilyType `json:"ip_family"`
IPAddress *string `json:"ip_address"`
FloatingIP *FloatingIP `json:"floating_ip"`
}
type AnySubnetInterfaceOpts ¶
type AnySubnetInterfaceOpts struct {
NetworkID string `json:"network_id" validate:"required"`
Name *string `json:"name,omitempty"`
Type string `json:"type" validate:"required"`
IPFamily IPFamilyType `json:"ip_family,omitempty"`
IPAddress *string `json:"ip_address,omitempty"`
FloatingIP *FloatingIPOpts `json:"floating_ip,omitempty"`
}
type Cluster ¶
type Cluster struct {
ID string `json:"id"`
Name string `json:"name"`
Status ClusterStatusType `json:"status"`
FlavorID string `json:"flavor_id"`
Metadata []map[string]interface{} `json:"metadata"`
ServersCount int `json:"servers_count"`
CreatedAt gcorecloud.JSONRFC3339Z `json:"created_at"`
UpdatedAt *gcorecloud.JSONRFC3339Z `json:"updated_at"`
ServersIDs *[]string `json:"servers_ids"`
ServersSettings ClusterServerSettings `json:"servers_settings"`
}
type ClusterServerSettings ¶
type ClusterServerSettings struct {
Interfaces []InterfaceUnion `json:"interfaces"`
SecurityGroups []string `json:"security_groups"`
Volumes []Volume `json:"volumes"`
UserData string `json:"user_data"`
KeypairName *string `json:"keypair_name"`
}
type ClusterStatusType ¶
type ClusterStatusType string
func (*ClusterStatusType) IsValid ¶
func (ct *ClusterStatusType) IsValid() error
func (*ClusterStatusType) List ¶
func (ct *ClusterStatusType) List() []ClusterStatusType
func (*ClusterStatusType) MarshalJSON ¶
func (ct *ClusterStatusType) MarshalJSON() ([]byte, error)
MarshalJSON - implements Marshaller interface
func (*ClusterStatusType) String ¶
func (ct *ClusterStatusType) String() string
func (*ClusterStatusType) StringList ¶
func (ct *ClusterStatusType) StringList() []string
func (*ClusterStatusType) UnmarshalJSON ¶
func (ct *ClusterStatusType) UnmarshalJSON(data []byte) error
UnmarshalJSON - implements Unmarshaler interface
func (*ClusterStatusType) ValidOrNil ¶
func (ct *ClusterStatusType) ValidOrNil() (*ClusterStatusType, error)
type CreateClusterOpts ¶
type CreateClusterOpts struct {
Name string `json:"name" validate:"required"`
Flavor string `json:"flavor" validate:"required"`
Tags map[string]string `json:"tags,omitempty"`
ServersCount int `json:"servers_count,omitempty"`
ServersSettings ServerSettingsOpts `json:"servers_settings,omitempty"`
}
CreateClusterOpts allows extensions to add parameters to create cluster options.
func (CreateClusterOpts) ToCreateClusterMap ¶
func (opts CreateClusterOpts) ToCreateClusterMap() (map[string]interface{}, error)
func (CreateClusterOpts) Validate ¶
func (opts CreateClusterOpts) Validate() error
Validate checks if the provided options are valid.
type CreateClusterOptsBuilder ¶
CreateClusterOptsBuilder allows extensions to add additional parameters to the Create request.
type ExternalInterface ¶
type ExternalInterface struct {
Name *string `json:"name"`
Type string `json:"type"`
IPFamily IPFamilyType `json:"ip_family"`
}
type ExternalInterfaceOpts ¶
type ExternalInterfaceOpts struct {
Name *string `json:"name,omitempty"`
Type string `json:"type" validate:"required"`
IPFamily IPFamilyType `json:"ip_family,omitempty"`
}
type FloatingIP ¶
type FloatingIP struct {
Source string `json:"source"`
}
type FloatingIPOpts ¶
type FloatingIPOpts struct {
Source string `json:"source" validate:"required,enum"`
}
type FloatingIPSource ¶
type FloatingIPSource string
func FloatingIPSourceList ¶
func FloatingIPSourceList() []FloatingIPSource
func (*FloatingIPSource) String ¶
func (fis *FloatingIPSource) String() string
type GetResult ¶
type GetResult struct {
// contains filtered or unexported fields
}
GetResult represents the result of a get operation. Call its Extract method to interpret it as a Image.
func Get ¶
func Get(client *gcorecloud.ServiceClient, clusterID string) (r GetResult)
Get retrieves a specific GPU cluster by its ID.
func Rename ¶
func Rename(client *gcorecloud.ServiceClient, clusterID string, opts RenameClusterOptsBuilder) (r GetResult)
Rename changes the name of a GPU cluster.
func (GetResult) Extract ¶
Extract is a function that accepts a result and extracts a cluster resource.
func (GetResult) ExtractInto ¶
func (r GetResult) ExtractInto(v interface{}) error
type IPFamilyType ¶
type IPFamilyType string
func IPFamilyTypeList ¶
func IPFamilyTypeList() []IPFamilyType
func (*IPFamilyType) IsValid ¶
func (it *IPFamilyType) IsValid() error
func (*IPFamilyType) MarshalJSON ¶
func (it *IPFamilyType) MarshalJSON() ([]byte, error)
MarshalJSON - implements Marshaller interface
func (*IPFamilyType) String ¶
func (it *IPFamilyType) String() string
func (*IPFamilyType) UnmarshalJSON ¶
func (it *IPFamilyType) UnmarshalJSON(data []byte) error
UnmarshalJSON - implements Unmarshaler interface
func (*IPFamilyType) ValidOrNil ¶
func (it *IPFamilyType) ValidOrNil() (*IPFamilyType, error)
type InterfaceOpts ¶
type InterfaceOpts interface {
// contains filtered or unexported methods
}
type InterfaceType ¶
type InterfaceType string
func InterfaceTypeList ¶
func InterfaceTypeList() []InterfaceType
func (*InterfaceType) String ¶
func (it *InterfaceType) String() string
type InterfaceUnion ¶
type InterfaceUnion struct {
ExternalInterface *ExternalInterface
SubnetInterface *SubnetInterface
AnySubnetInterface *AnySubnetInterface
}
func (*InterfaceUnion) ExtractInterfaceType ¶
func (i *InterfaceUnion) ExtractInterfaceType(data []byte) (string, error)
ExtractInterfaceType extracts the interface type from the data, returning the type if it is valid. If the type is not valid, an error is returned. If the type is not found, an error is returned.
func (*InterfaceUnion) InterfaceType ¶
func (i *InterfaceUnion) InterfaceType() string
func (*InterfaceUnion) MarshalJSON ¶
func (i *InterfaceUnion) MarshalJSON() ([]byte, error)
func (*InterfaceUnion) UnmarshalJSON ¶
func (i *InterfaceUnion) UnmarshalJSON(data []byte) error
type RenameClusterOpts ¶
type RenameClusterOpts struct {
Name string `json:"name" validate:"required"`
}
RenameClusterOpts specifies the parameters for the Rename method.
func (RenameClusterOpts) ToRenameClusterActionMap ¶
func (opts RenameClusterOpts) ToRenameClusterActionMap() (map[string]interface{}, error)
ToRenameClusterActionMap builds a request body from RenameInstanceOpts.
func (RenameClusterOpts) Validate ¶
func (opts RenameClusterOpts) Validate() error
Validate checks if the provided options are valid.
type RenameClusterOptsBuilder ¶
type RenameClusterOptsBuilder interface {
ToRenameClusterActionMap() (map[string]interface{}, error)
}
RenameClusterOptsBuilder allows extensions to add parameters to rename cluster options.
type ServerCredentialsOpts ¶
type ServerSettingsOpts ¶
type ServerSettingsOpts struct {
Interfaces []InterfaceOpts `json:"interfaces"`
SecurityGroups []string `json:"security_groups,omitempty"`
Volumes []VolumeOpts `json:"volumes"`
UserData *string `json:"user_data,omitempty"`
Credentials *ServerCredentialsOpts `json:"credentials,omitempty"`
}
type SubnetInterface ¶
type SubnetInterface struct {
NetworkID string `json:"network_id"`
Name *string `json:"name"`
Type string `json:"type"`
SubnetID string `json:"subnet_id"`
FloatingIP *FloatingIP `json:"floating_ip"`
}
type SubnetInterfaceOpts ¶
type SubnetInterfaceOpts struct {
NetworkID string `json:"network_id" validate:"required"`
Name *string `json:"name,omitempty"`
Type string `json:"type" validate:"required"`
SubnetID string `json:"subnet_id" validate:"required"`
FloatingIP *FloatingIPOpts `json:"floating_ip,omitempty"`
}
type Volume ¶
type Volume struct {
Size int `json:"size"`
Type VolumeType `json:"type"`
DeletedOnTermination bool `json:"deleted_on_termination"`
Metadata []map[string]interface{} `json:"metadata"`
Name *string `json:"name"`
BootIndex *int `json:"boot_index"`
ImageID *string `json:"image_id"`
SnapshotID *string `json:"snapshot_id"`
}
Volume represents a volume structure.
type VolumeOpts ¶
type VolumeOpts struct {
Source VolumeSource `json:"source" validate:"required,enum"`
BootIndex int `json:"boot_index" validate:"required"`
DeleteOnTermination bool `json:"delete_on_termination,omitempty"`
Name string `json:"name" validate:"required"`
Size int `json:"size,omitempty" validate:"required"`
ImageID string `json:"image_id,omitempty" validate:"rfe=Source:image,allowed_without=SnapshotID,omitempty,uuid4"`
SnapshotID string `json:"snapshot_id,omitempty" validate:"rfe=Source:snapshot,allowed_without=ImageID,omitempty,uuid4"`
Tags map[string]string `json:"tags,omitempty"`
Type VolumeType `json:"type,omitempty" validate:"required,enum"`
}
VolumeOpts represents options used to create a volume.
type VolumeSource ¶
type VolumeSource string
func VolumeSourcesList ¶
func VolumeSourcesList() []VolumeSource
func (*VolumeSource) String ¶
func (vs *VolumeSource) String() string
type VolumeType ¶
type VolumeType string
func VolumeTypesList ¶
func VolumeTypesList() []VolumeType
func (*VolumeType) IsValid ¶
func (vt *VolumeType) IsValid() error
func (*VolumeType) MarshalJSON ¶
func (vt *VolumeType) MarshalJSON() ([]byte, error)
MarshalJSON - implements Marshaller interface
func (*VolumeType) String ¶
func (vt *VolumeType) String() string
func (*VolumeType) UnmarshalJSON ¶
func (vt *VolumeType) UnmarshalJSON(data []byte) error
UnmarshalJSON - implements Unmarshaler interface
func (*VolumeType) ValidOrNil ¶
func (vt *VolumeType) ValidOrNil() (*VolumeType, error)