Help us shape the future of Go! Take the 2026 Go Developer Survey

clusters

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2021 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

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

type CertificateResult struct {
	golangsdk.Result
}

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 ClusterExtendOptsBuilder

type ClusterExtendOptsBuilder interface {
	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 CreateOptsBuilder interface {
	ToClusterCreateMap() (map[string]interface{}, error)
}

type CreateResult

type CreateResult struct {
	golangsdk.Result
}

func Create

func Create(client *golangsdk.ServiceClient, opts CreateOptsBuilder) (r CreateResult)

func (CreateResult) Extract

func (r CreateResult) Extract() (*CreatedCluster, error)

type CreatedCluster

type CreatedCluster struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

type Datastore

type Datastore struct {
	// Version - engine version.
	// The default value is 6.2.3.
	Version string `json:"version" required:"true"`

	// Type - Engine type.
	// The default value is `elasticsearch`.
	Type string `json:"type,omitempty"`
}

type DeleteResult

type DeleteResult struct {
	golangsdk.ErrResult
}

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

type ExtendResult struct {
	golangsdk.Result
}

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 ExtendedInstance struct {
	ID      string `json:"id"`
	Name    string `json:"name"`
	Type    string `json:"type"`
	ShardID string `json:"shard_id"`
}

type FailedReasons

type FailedReasons struct {
	ErrorCode    string `json:"errorCode"`
	ErrorMessage string `json:"errorMsg"`
}

type GetResult

type GetResult struct {
	golangsdk.Result
}

func Get

func Get(client *golangsdk.ServiceClient, id string) (r GetResult)

func (GetResult) Extract

func (r GetResult) Extract() (*Cluster, error)

type Instance

type Instance struct {
	Type             string `json:"type"`
	ID               string `json:"id"`
	Name             string `json:"name"`
	Status           string `json:"status"`
	SpecCode         string `json:"specCode"`
	AvailabilityZone string `json:"azCode"`
}

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"`
}

type Volume

type Volume struct {
	// Type of the volume.
	// One of:
	//   - `COMMON`: Common I/O
	//   - `HIGH`: High I/O
	//   - `ULTRAHIGH`: Ultra-high I/O
	Type string `json:"volume_type" required:"true"`

	// Size of the volume, which must be a multiple of 4 and 10.
	// Unit: GB.
	Size int `json:"size" required:"true"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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