Documentation
¶
Index ¶
- func List(client *golangsdk.ServiceClient) (p pagination.Pager)
- func WaitForClusterOperationSucces(client *golangsdk.ServiceClient, id string, timeout int) error
- func WaitForClusterToExtend(client *golangsdk.ServiceClient, id string, timeout int) error
- type BackupStrategy
- type CertificateResult
- type Cluster
- type ClusterExtendCommonOpts
- type ClusterExtendOptsBuilder
- type ClusterExtendSpecialOpts
- type ClusterPage
- type CreateOpts
- type CreateOptsBuilder
- type CreateResult
- type CreatedCluster
- type Datastore
- type DeleteResult
- type DiskEncryption
- type ExtendResult
- type ExtendedCluster
- type ExtendedInstance
- type FailedReasons
- type GetResult
- type Instance
- type InstanceSpec
- type Nics
- type Volume
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func List ¶
func List(client *golangsdk.ServiceClient) (p pagination.Pager)
func WaitForClusterOperationSucces ¶
func WaitForClusterOperationSucces(client *golangsdk.ServiceClient, id string, timeout int) error
func WaitForClusterToExtend ¶
func WaitForClusterToExtend(client *golangsdk.ServiceClient, id string, timeout int) error
Types ¶
type BackupStrategy ¶
type BackupStrategy struct {
// Period - time when a snapshot is created every day.
// Snapshots can only be created on the hour.
// The time format is the time followed by the time zone, specifically, `HH:mm z`.
// In the format, `HH:mm` refers to the hour time and `z` refers to the time zone, for example,
// `00:00 GMT+08:00` and `01:00 GMT+08:00`.
Period string `json:"period" required:"true"`
// Prefix - prefix of the name of the snapshot that is automatically created.
Prefix string `json:"prefix" required:"true"`
// KeepDay - number of days for which automatically created snapshots are reserved.
//
// Value range: `1` to `90`
KeepDay int `json:"keepday" required:"true"`
}
type CertificateResult ¶
func DownloadCertificate ¶
func DownloadCertificate(client *golangsdk.ServiceClient, clusterID string) (r CertificateResult)
func (CertificateResult) Extract ¶
func (r CertificateResult) Extract() (string, error)
type Cluster ¶
type Cluster struct {
Datastore Datastore `json:"datastore"`
Instances []Instance `json:"instances"`
Updated string `json:"updated"`
Name string `json:"name"`
Created string `json:"created"`
ID string `json:"id"`
Status string `json:"status"`
Endpoint string `json:"endpoint"`
ActionProgress map[string]string `json:"actionProgress"`
Actions []string `json:"actions"`
FailedReasons *FailedReasons `json:"failed_reasons"`
HttpsEnabled bool `json:"httpsEnable"`
AuthorityEnabled bool `json:"authorityEnable"`
DiskEncrypted bool `json:"diskEncrypted"`
CmkID string `json:"cmkId"`
VpcID string `json:"vpcId"`
SubnetID string `json:"subnetId"`
SecurityGroupID string `json:"securityGroupId" required:"true"`
Tags []tags.ResourceTag `json:"tags"`
}
func ExtractClusters ¶
func ExtractClusters(r pagination.Page) ([]Cluster, error)
type ClusterExtendCommonOpts ¶
type ClusterExtendCommonOpts struct {
// ModifySize - number of instances to be added.
ModifySize int `json:"modifySize"`
}
ClusterExtendCommonOpts is used to extend cluster with only `common` nodes. Clusters with master, client, or cold data nodes cannot use this.
func (ClusterExtendCommonOpts) ToExtendClusterMap ¶
func (opts ClusterExtendCommonOpts) ToExtendClusterMap() (map[string]interface{}, error)
type ClusterExtendSpecialOpts ¶
type ClusterExtendSpecialOpts struct {
// Type of the instance to be scaled out.
// Select at least one from `ess`, `ess-cold`, `ess-master`, and `ess-client`.
// You can only add instances, rather than increase storage capacity, on nodes of the `ess-master` and `ess-client` types.
Type string `json:"type"`
// NodeSize - number of instances to be scaled out.
// The total number of existing instances and newly added instances in a cluster cannot exceed 32.
NodeSize int `json:"nodesize"`
// DiskSize - Storage capacity of the instance to be expanded.
// The total storage capacity of existing instances and newly added instances in a cluster cannot exceed the maximum instance storage capacity allowed when a cluster is being created. In addition, you can expand the instance storage capacity for a cluster for up to six times.
//
// Unit: GB
DiskSize int `json:"disksize"`
}
ClusterExtendSpecialOpts is used to extend cluster with special nodes. If a cluster has master, client, or cold data nodes, this should be used
func (ClusterExtendSpecialOpts) ToExtendClusterMap ¶
func (opts ClusterExtendSpecialOpts) ToExtendClusterMap() (map[string]interface{}, error)
type ClusterPage ¶
type ClusterPage struct {
pagination.SinglePageBase
}
func (ClusterPage) GetBody ¶
func (p ClusterPage) GetBody() interface{}
func (ClusterPage) IsEmpty ¶
func (p ClusterPage) IsEmpty() (bool, error)
type CreateOpts ¶
type CreateOpts struct {
// Instance - instance specification
Instance *InstanceSpec `json:"instance" required:"true"`
// Datastore - type of the data search engine
Datastore *Datastore `json:"datastore,omitempty"`
// Name - cluster name.
// It contains 4 to 32 characters. Only letters, digits, hyphens (-), and underscores (_) are allowed.
// The value must start with a letter.
Name string `json:"name" required:"true"`
// InstanceNum - number of clusters. The value range is 1 to 32.
InstanceNum int `json:"instanceNum" required:"true"`
// BackupStrategy - configuration of automatic snapshot creation.
// This function is enabled by default.
BackupStrategy *BackupStrategy `json:"backupStrategy,omitempty"`
// DiskEncryption - disk encryption configuration
DiskEncryption *DiskEncryption `json:"diskEncryption" required:"true"`
// HttpsEnabled - whether communication is not encrypted on the cluster.
HttpsEnabled string `json:"httpsEnable,omitempty"`
// AuthorityEnabled - whether to enable authentication.
// Available values include `true` and `false`. Authentication is disabled by default.
// When authentication is enabled, `HttpsEnabled` must be set to `true`.
AuthorityEnabled bool `json:"authorityEnable,omitempty"`
// AdminPassword - password of the cluster user `admin` in security mode.
// This parameter is mandatory only when `AuthorityEnabled` is set to `true`.
AdminPassword string `json:"adminPwd,omitempty"`
// Tags - tags of a cluster.
Tags []tags.ResourceTag `json:"tags,omitempty"`
}
func (CreateOpts) ToClusterCreateMap ¶
func (opts CreateOpts) ToClusterCreateMap() (map[string]interface{}, error)
type CreateOptsBuilder ¶
type CreateResult ¶
func Create ¶
func Create(client *golangsdk.ServiceClient, opts CreateOptsBuilder) (r CreateResult)
func (CreateResult) Extract ¶
func (r CreateResult) Extract() (*CreatedCluster, error)
type CreatedCluster ¶
type DeleteResult ¶
func Delete ¶
func Delete(client *golangsdk.ServiceClient, id string) (r DeleteResult)
type DiskEncryption ¶
type DiskEncryption struct {
// SystemEncrypted - value `1` indicates encryption is performed, and value `0` indicates encryption is not performed.
// Boolean sucks.
Encrypted string `json:"systemEncrypted" required:"true"`
// Key ID.
// - The Default Master Keys cannot be used to create grants.
// Specifically, you cannot use Default Master Keys whose aliases end with `/default` in KMS to create clusters.
// - After a cluster is created, do not delete the key used by the cluster. Otherwise, the cluster will become unavailable.
CmkID string `json:"systemCmkid"`
}
type ExtendResult ¶
func ExtendCluster ¶
func ExtendCluster(client *golangsdk.ServiceClient, clusterID string, opts ClusterExtendOptsBuilder) (r ExtendResult)
ExtendCluster - extends cluster capacity.
ClusterExtendCommonOpts should be used as options to extend cluster with only `common` nodes.
ClusterExtendSpecialOpts should be used if extended cluster has master, client, or cold data nodes.
func (ExtendResult) Extract ¶
func (r ExtendResult) Extract() (*ExtendedCluster, error)
type ExtendedCluster ¶
type ExtendedCluster struct {
ID string `json:"id"`
Instances []ExtendedInstance `json:"instances"`
}
type ExtendedInstance ¶
type FailedReasons ¶
type InstanceSpec ¶
type InstanceSpec struct {
// Flavor - instance flavor name.
Flavor string `json:"flavorRef" required:"true"`
// Volume - information about the volume.
Volume *Volume `json:"volume" required:"true"`
// Nics - subnet information.
Nics *Nics `json:"nics" required:"true"`
AvailabilityZone string `json:"availability_zone,omitempty"`
}
type Nics ¶
type Nics struct {
// VpcID - VPC ID which is used for configuring cluster network.
VpcID string `json:"vpcId" required:"true"`
// SubnetID - Subnet ID.
// All instances in a cluster must have the same subnet.
SubnetID string `json:"netId" required:"true"`
// SecurityGroupID - Security group ID.
// All instances in a cluster must have the same security grou.
SecurityGroupID string `json:"securityGroupId" required:"true"`
}
Click to show internal directories.
Click to hide internal directories.