Documentation ¶
Index ¶
- func Create(c *gcorecloud.ServiceClient, opts CreateOptsBuilder) (r tasks.Result)
- func Delete(c *gcorecloud.ServiceClient, clusterID string) (r tasks.Result)
- func ExtractClusterIDFromTask(task *tasks.Task) (string, error)
- func ExtractClustersInto(r pagination.Page, v interface{}) error
- func ExtractVersionInto(r pagination.Page, v interface{}) error
- func ExtractVersions(r pagination.Page) ([]string, error)
- func Instances(c *gcorecloud.ServiceClient, clusterID string) pagination.Pager
- func InstancesAll(c *gcorecloud.ServiceClient, clusterID string) ([]instances.Instance, error)
- func List(c *gcorecloud.ServiceClient, opts ListOptsBuilder) pagination.Pager
- func Resize(c *gcorecloud.ServiceClient, clusterID, poolID string, opts ResizeOptsBuilder) (r tasks.Result)
- func Upgrade(c *gcorecloud.ServiceClient, clusterID string, opts UpgradeOptsBuilder) (r tasks.Result)
- func Versions(c *gcorecloud.ServiceClient) pagination.Pager
- func VersionsAll(c *gcorecloud.ServiceClient) ([]string, error)
- type Cluster
- type ClusterCACertificate
- type ClusterCertificateCAResult
- type ClusterCertificateSignResult
- type ClusterList
- type ClusterListWithPool
- type ClusterPage
- type ClusterSignCertificate
- type ClusterSignCertificateOpts
- type ClusterSignCertificateOptsBuilder
- type ClusterTaskResult
- type ClusterWithPool
- type Config
- type ConfigResult
- type CreateOpts
- type CreateOptsBuilder
- type GetResult
- type ListOpts
- type ListOptsBuilder
- type ResizeOpts
- type ResizeOptsBuilder
- type UpgradeOpts
- type UpgradeOptsBuilder
- type VersionPage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Create ¶
func Create(c *gcorecloud.ServiceClient, opts CreateOptsBuilder) (r tasks.Result)
Create accepts a CreateOpts struct and creates a new cluster using the values provided.
func Delete ¶
func Delete(c *gcorecloud.ServiceClient, clusterID string) (r tasks.Result)
Delete accepts a unique ID and deletes the cluster associated with it.
func ExtractClustersInto ¶
func ExtractClustersInto(r pagination.Page, v interface{}) error
func ExtractVersionInto ¶
func ExtractVersionInto(r pagination.Page, v interface{}) error
func ExtractVersions ¶
func ExtractVersions(r pagination.Page) ([]string, error)
ExtractVersions accepts a Page struct, specifically a VersionPage struct, and extracts the elements into a slice of strings.
func Instances ¶
func Instances(c *gcorecloud.ServiceClient, clusterID string) pagination.Pager
Instances returns a Pager which allows you to iterate over a collection of cluster instances.
func InstancesAll ¶
func InstancesAll(c *gcorecloud.ServiceClient, clusterID string) ([]instances.Instance, error)
InstancesAll returns all cluster instances.
func List ¶
func List(c *gcorecloud.ServiceClient, opts ListOptsBuilder) pagination.Pager
List returns a Pager which allows you to iterate over a collection of clusters. It accepts a ListOpts struct, which allows you to filter and sort the returned collection for greater efficiency.
func Resize ¶
func Resize(c *gcorecloud.ServiceClient, clusterID, poolID string, opts ResizeOptsBuilder) (r tasks.Result)
Resize accepts a ResizeOpts struct and updates an existing cluster using the values provided.
func Upgrade ¶
func Upgrade(c *gcorecloud.ServiceClient, clusterID string, opts UpgradeOptsBuilder) (r tasks.Result)
Upgrade accepts a UpgradeOpts struct and upgrades an existing cluster using the values provided.
func Versions ¶
func Versions(c *gcorecloud.ServiceClient) pagination.Pager
Versions returns available cluster versions.
func VersionsAll ¶
func VersionsAll(c *gcorecloud.ServiceClient) ([]string, error)
VersionsAll returns all cluster versions.
Types ¶
type Cluster ¶
type Cluster struct { StatusReason string `json:"status_reason"` APIAddress *gcorecloud.URL `json:"api_address"` CoeVersion string `json:"coe_version"` ContainerVersion string `json:"container_version"` DiscoveryURL *gcorecloud.URL `json:"discovery_url"` HealthStatusReason map[string]string `json:"health_status_reason"` ProjectID string `json:"project_id"` UserID string `json:"user_id"` NodeAddresses []net.IP `json:"node_addresses"` MasterAddresses []net.IP `json:"master_addresses"` FixedNetwork string `json:"fixed_network"` FixedSubnet string `json:"fixed_subnet"` FloatingIPEnabled bool `json:"floating_ip_enabled"` Faults map[string]string `json:"faults"` *ClusterList }
Cluster represents a cluster structure.
type ClusterCACertificate ¶
type ClusterCACertificate struct { ClusterUUID string `json:"cluster_uuid"` PEM string `json:"pem"` }
ClusterCACertificate represents a cluster CA certificate structure.
type ClusterCertificateCAResult ¶
type ClusterCertificateCAResult struct {
gcorecloud.Result
}
ClusterCertificateCAResult represents the result of CA cluster certificates
func Certificate ¶
func Certificate(c *gcorecloud.ServiceClient, clusterID string) (r ClusterCertificateCAResult)
Certificate accepts a unique ID and return cluster CA.
func (ClusterCertificateCAResult) Extract ¶
func (r ClusterCertificateCAResult) Extract() (*ClusterCACertificate, error)
Extract is a function that accepts a result and extracts a cluster CA certificate.
type ClusterCertificateSignResult ¶
type ClusterCertificateSignResult struct {
gcorecloud.Result
}
ClusterCertificateSignResult represents the result of signing cluster certificate operation
func SignCertificate ¶
func SignCertificate(c *gcorecloud.ServiceClient, clusterID string, opts ClusterSignCertificateOptsBuilder) (r ClusterCertificateSignResult)
SignCertificate accepts a unique ID and sign cluster certificate.
func (ClusterCertificateSignResult) Extract ¶
func (r ClusterCertificateSignResult) Extract() (*ClusterSignCertificate, error)
Extract is a function that accepts a result and extracts a cluster signed certificate.
type ClusterList ¶
type ClusterList struct { UUID string `json:"uuid"` Name string `json:"name"` ClusterTemplateID string `json:"cluster_template_id"` KeyPair string `json:"keypair"` NodeCount int `json:"node_count"` MasterCount int `json:"master_count"` DockerVolumeSize int `json:"docker_volume_size"` Labels map[string]string `json:"labels"` MasterFlavorID string `json:"master_flavor_id"` FlavorID string `json:"flavor_id"` CreateTimeout int `json:"create_timeout"` StackID string `json:"stack_id"` Status string `json:"status"` HealthStatus types.HealthStatus `json:"health_status"` Version string `json:"version"` CreatedAt time.Time `json:"created_at"` UpdatedAt *time.Time `json:"updated_at"` }
Cluster represents a cluster structure in list response.
type ClusterListWithPool ¶
type ClusterListWithPool struct { Pools []pools.ClusterListPool `json:"pools"` *ClusterList }
func ExtractClusters ¶
func ExtractClusters(r pagination.Page) ([]ClusterListWithPool, error)
ExtractCluster accepts a Page struct, specifically a ClusterPage struct, and extracts the elements into a slice of ClusterListWithPool structs. In other words, a generic collection is mapped into a relevant slice.
func ListAll ¶
func ListAll(c *gcorecloud.ServiceClient, opts ListOptsBuilder) ([]ClusterListWithPool, error)
ListALL returns all magnum clusters.
type ClusterPage ¶
type ClusterPage struct {
pagination.LinkedPageBase
}
VersionPage is the page returned by a pager when traversing over a collection of clusters.
func (ClusterPage) IsEmpty ¶
func (r ClusterPage) IsEmpty() (bool, error)
IsEmpty checks whether a ClusterPage struct is empty.
func (ClusterPage) NextPageURL ¶
func (r ClusterPage) NextPageURL() (string, error)
NextPageURL is invoked when a paginated collection of clusters has reached the end of a page and the pager seeks to traverse over a new one. In order to do this, it needs to construct the next page's URL.
type ClusterSignCertificate ¶
type ClusterSignCertificate struct { ClusterUUID string `json:"cluster_uuid"` PEM string `json:"pem"` CSR string `json:"csr"` }
ClusterSignCertificate represents a cluster signed certificate structure.
type ClusterSignCertificateOpts ¶
type ClusterSignCertificateOpts struct {
CSR string `json:"csr" validate:"required"`
}
ClusterSignCertificateOpts represents a options to sign cluster certificate.
func (ClusterSignCertificateOpts) ToClusterSignCertificateMap ¶
func (opts ClusterSignCertificateOpts) ToClusterSignCertificateMap() (map[string]interface{}, error)
ToClusterSignCertificateMap builds a request body from ClusterSignCertificateOpts.
type ClusterSignCertificateOptsBuilder ¶
type ClusterSignCertificateOptsBuilder interface {
ToClusterSignCertificateMap() (map[string]interface{}, error)
}
ClusterSignCertificateOptsBuilder allows extensions to add additional parameters to the SignCertificate request.
type ClusterTaskResult ¶
type ClusterTaskResult struct {
K8sClusters []string `json:"k8s_clusters" mapstructure:"k8s_clusters"`
}
type ClusterWithPool ¶
type ClusterWithPool struct { *Cluster Pools []pools.ClusterPool `json:"pools"` }
type Config ¶
type Config struct {
Config string `json:"config,omitempty"`
}
Config represents a k8s config structure.
type ConfigResult ¶
type ConfigResult struct {
gcorecloud.Result
}
ConfigResult represents the result of kubernetes config
func GetConfig ¶
func GetConfig(c *gcorecloud.ServiceClient, clusterID string) (r ConfigResult)
GetConfig accepts a unique ID and get cluster k8s config.
func (ConfigResult) Extract ¶
func (r ConfigResult) Extract() (*Config, error)
Extract is a function that accepts a result and extracts a cluster config.
type CreateOpts ¶
type CreateOpts struct { Name string `json:"name" required:"true"` FixedNetwork string `json:"fixed_network" required:"true" validate:"required,uuid4"` FixedSubnet string `json:"fixed_subnet" required:"true" validate:"required,uuid4"` KeyPair string `json:"keypair,omitempty"` PodsIPPool *gcorecloud.CIDR `json:"pods_ip_pool,omitempty"` ServicesIPPool *gcorecloud.CIDR `json:"services_ip_pool,omitempty"` AutoHealingEnabled bool `json:"auto_healing_enabled"` MasterLBFloatingIPEnabled bool `json:"master_lb_floating_ip_enabled,omitempty"` Version string `json:"version,omitempty" validate:"omitempty,sem"` Pools []pools.CreateOpts `json:"pools" required:"true" validate:"required,min=1,dive"` }
CreateOpts represents options used to create a cluster.
func (CreateOpts) ToClusterCreateMap ¶
func (opts CreateOpts) ToClusterCreateMap() (map[string]interface{}, error)
ToClusterCreateMap builds a request body from CreateOpts.
type CreateOptsBuilder ¶
CreateOptsBuilder allows extensions to add additional parameters to the Create request.
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 Cluster.
func Get ¶
func Get(c *gcorecloud.ServiceClient, id string) (r GetResult)
Get retrieves a specific cluster based on its unique ID.
func (GetResult) Extract ¶
func (r GetResult) Extract() (*ClusterWithPool, error)
Extract is a function that accepts a result and extracts a cluster resource.
func (GetResult) ExtractInto ¶
func (r GetResult) ExtractInto(v interface{}) error
type ListOpts ¶
type ListOpts struct { Limit int `q:"limit"` Marker string `q:"marker"` SortKey string `q:"sort_key"` SortDir string `q:"sort_dir"` Detail bool `q:"detail"` }
ListOpts allows the filtering and sorting of paginated collections through the API. Filtering is achieved by passing in struct field values that map to the clusters attributes you want to see returned. SortKey allows you to sort by a particular clusters attribute. SortDir sets the direction, and is either `asc' or `desc'. Marker and Limit are used for pagination.
func (ListOpts) ToClusterListQuery ¶
ToClusterListQuery formats a ListOpts into a query string.
type ListOptsBuilder ¶
ListOptsBuilder allows extensions to add additional parameters to the Versions request.
type ResizeOpts ¶
type ResizeOpts struct { NodeCount int `json:"node_count" required:"true" validate:"required,gt=0"` NodesToRemove []string `json:"nodes_to_remove,omitempty" validate:"omitempty,dive,uuid4"` }
ResizeOpts represents options used to update a cluster.
func (ResizeOpts) ToClusterResizeMap ¶
func (opts ResizeOpts) ToClusterResizeMap() (map[string]interface{}, error)
ToClusterResizeMap builds a request body from ResizeOpts.
type ResizeOptsBuilder ¶
ResizeOptsBuilder allows extensions to add additional parameters to the Resize request.
type UpgradeOpts ¶
type UpgradeOpts struct { Pool string `json:"pool,omitempty" validate:"omitempty,uuid4"` Version string `json:"version" required:"true" validate:"required,sem"` }
UpgradeOpts represents options used to upgrade a cluster.
func (UpgradeOpts) ToClusterUpgradeMap ¶
func (opts UpgradeOpts) ToClusterUpgradeMap() (map[string]interface{}, error)
ToClusterUpgradeMap builds a request body from UpgradeOpts.
type UpgradeOptsBuilder ¶
UpgradeOptsBuilder allows extensions to add additional parameters to the Upgrade request.
type VersionPage ¶
type VersionPage struct {
pagination.LinkedPageBase
}
VersionPage is the page returned by a pager when traversing over a collection of cluster versions.
func (VersionPage) IsEmpty ¶
func (r VersionPage) IsEmpty() (bool, error)
IsEmpty checks whether a VersionPage struct is empty.