Documentation
¶
Index ¶
- func ChangeClusterName(client *golangsdk.ServiceClient, clusterID string, opts ChangeClusterNameOpts) error
- func ChangePassword(client *golangsdk.ServiceClient, clusterID string, opts ChangePasswordOpts) (err error)
- func Delete(client *golangsdk.ServiceClient, id string) (err error)
- func DisablePublicAccess(client *golangsdk.ServiceClient, opts ManagePublicAccessOpts) (string, error)
- func DisablePublicWhitelist(client *golangsdk.ServiceClient, clusterID string) error
- func DownloadCertificate(client *golangsdk.ServiceClient, clusterID string) (string, error)
- func EnablePublicAccess(client *golangsdk.ServiceClient, opts ManagePublicAccessOpts) (string, error)
- func EnablePublicWhitelist(client *golangsdk.ServiceClient, clusterId, whitelist string) error
- func RestartCluster(client *golangsdk.ServiceClient, clusterID string) error
- func ScaleInCluster(client *golangsdk.ServiceClient, clusterID string, opts []ScaleInOpts) error
- func UpdateClusterFlavor(client *golangsdk.ServiceClient, clusterID string, opts ClusterFlavorOpts) error
- func UpdatePublicAccess(client *golangsdk.ServiceClient, opts ManagePublicAccessOpts) error
- func UpdateSecurityGroup(client *golangsdk.ServiceClient, clusterID string, opts SecurityGroupOpts) error
- func UpdateSecurityMode(client *golangsdk.ServiceClient, clusterID string, opts SecurityModeOpts) error
- func WaitForCluster(client *golangsdk.ServiceClient, id string, timeout int) error
- func WaitForClusterOperationSucces(client *golangsdk.ServiceClient, id string, timeout int) error
- func WaitForClusterToExtend(client *golangsdk.ServiceClient, id string, timeout int) error
- type AddNodesOpts
- type AddNodesResponse
- type BackupStrategy
- type Bandwidth
- type ChangeClusterNameOpts
- type ChangePasswordOpts
- type Cluster
- type ClusterExtendCommonOpts
- type ClusterExtendOptsBuilder
- type ClusterExtendSpecialOpts
- type ClusterFlavorOpts
- type CreateOpts
- type CreatedCluster
- type Datastore
- type DiskEncryption
- type Eip
- type ExtendedCluster
- type ExtendedInstance
- type FailedReasons
- type Instance
- type InstanceSpec
- type ManagePublicAccessOpts
- type Nics
- type PublicAccessOpts
- type PublicKibana
- type PublicNetwork
- type ScaleInOpts
- type ScaleInRequest
- type SecurityGroupOpts
- type SecurityModeOpts
- type ShowClusterVolume
- type Volume
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChangeClusterName ¶ added in v0.9.4
func ChangeClusterName(client *golangsdk.ServiceClient, clusterID string, opts ChangeClusterNameOpts) error
ChangeClusterName function is used to change the name of a cluster.
func ChangePassword ¶ added in v0.9.4
func ChangePassword(client *golangsdk.ServiceClient, clusterID string, opts ChangePasswordOpts) (err error)
ChangePassword function is used to change the password of a cluster.
func DisablePublicAccess ¶ added in v0.9.4
func DisablePublicAccess(client *golangsdk.ServiceClient, opts ManagePublicAccessOpts) (string, error)
DisablePublicAccess function is used to disable public network access
func DisablePublicWhitelist ¶ added in v0.9.4
func DisablePublicWhitelist(client *golangsdk.ServiceClient, clusterID string) error
DisablePublicWhitelist function is used to disable whitelist for a single ip
func DownloadCertificate ¶
func EnablePublicAccess ¶ added in v0.9.4
func EnablePublicAccess(client *golangsdk.ServiceClient, opts ManagePublicAccessOpts) (string, error)
EnablePublicAccess function is used to enable public network access
func EnablePublicWhitelist ¶ added in v0.9.4
func EnablePublicWhitelist(client *golangsdk.ServiceClient, clusterId, whitelist string) error
EnablePublicWhitelist function is used to enable public whitelist
func RestartCluster ¶ added in v0.9.4
func RestartCluster(client *golangsdk.ServiceClient, clusterID string) error
RestartCluster function is used to restart a cluster.
func ScaleInCluster ¶ added in v0.9.4
func ScaleInCluster(client *golangsdk.ServiceClient, clusterID string, opts []ScaleInOpts) error
ScaleInCluster scales in a cluster by removing specified nodes.
func UpdateClusterFlavor ¶ added in v0.9.4
func UpdateClusterFlavor(client *golangsdk.ServiceClient, clusterID string, opts ClusterFlavorOpts) error
UpdateClusterFlavor is used to modify the specifications of a cluster or specifications of a specified node type.
func UpdatePublicAccess ¶ added in v0.9.4
func UpdatePublicAccess(client *golangsdk.ServiceClient, opts ManagePublicAccessOpts) error
UpdatePublicAccess function is used to enable public network access
func UpdateSecurityGroup ¶ added in v0.9.4
func UpdateSecurityGroup(client *golangsdk.ServiceClient, clusterID string, opts SecurityGroupOpts) error
UpdateSecurityGroup - change the security group of a cluster.
func UpdateSecurityMode ¶ added in v0.9.4
func UpdateSecurityMode(client *golangsdk.ServiceClient, clusterID string, opts SecurityModeOpts) error
UpdateSecurityMode - change the security mode of a cluster.
func WaitForCluster ¶ added in v0.9.4
func WaitForCluster(client *golangsdk.ServiceClient, id string, timeout int) error
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 AddNodesOpts ¶ added in v0.9.4
type AddNodesOpts struct {
// NodeSize - Number of nodes. The value range is 1 to 32.
// If the node type is ess-master, the number of nodes must be an odd number in the range 3 to 10.
// If the node type is ess-client, the number of nodes must be in the range 1 to 32.
NodeSize int `json:"node_size" required:"true"`
// Flavor - Flavor ID.
Flavor string `json:"flavor_ref" required:"true"`
// Type of the volume.
// One of:
// - `COMMON`: Common I/O
// - `HIGH`: High I/O
// - `ULTRAHIGH`: Ultra-high I/O
VolumeType string `json:"volume_type" required:"true"`
}
AddNodesOpts defines options to add master or client nodes .
type AddNodesResponse ¶ added in v0.9.4
type AddNodesResponse struct {
ID string `json:"id"`
}
func AddClusterNodes ¶ added in v0.9.4
func AddClusterNodes(client *golangsdk.ServiceClient, clusterID string, NodeType string, opts AddNodesOpts) (*AddNodesResponse, error)
AddClusterNodes function lets you add master and client nodes to a cluster.
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 ChangeClusterNameOpts ¶ added in v0.9.4
type ChangeClusterNameOpts struct {
// DisplayName contains options for new name
// This object is passed to the snapshots.ChangeClusterName function.
DisplayName string `json:"displayName" required:"true"`
}
type ChangePasswordOpts ¶ added in v0.9.4
type ChangePasswordOpts struct {
// DisplayName contains options for new name
// This object is passed to the snapshots.ChangeClusterName function.
NewPassword string `json:"newpassword" required:"true"`
}
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"`
Tags []tags.ResourceTag `json:"tags"`
PublicKibana *PublicKibana `json:"publicKibanaResp"`
PublicNetwork *PublicNetwork `json:"elbWhiteList"`
PublicIp string `json:"publicIp"`
VpcEpIp string `json:"vpcepIp"`
BandwidthSize int `json:"bandwidthSize"`
BackupAvailable bool `json:"backupAvailable"`
}
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.
type ClusterExtendOptsBuilder ¶
type ClusterExtendOptsBuilder interface {
}
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
type ClusterFlavorOpts ¶ added in v0.9.4
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"`
}
type CreatedCluster ¶
func Create ¶
func Create(client *golangsdk.ServiceClient, opts CreateOpts) (*CreatedCluster, error)
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 Eip ¶ added in v0.9.4
type Eip struct {
Bandwidth Bandwidth `json:"bandWidth" required:"true"`
}
type ExtendedCluster ¶
type ExtendedCluster struct {
ID string `json:"id"`
Instances []ExtendedInstance `json:"instances"`
}
func ExtendCluster ¶
func ExtendCluster(client *golangsdk.ServiceClient, clusterID string, opts ClusterExtendOptsBuilder) (*ExtendedCluster, error)
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.
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 ManagePublicAccessOpts ¶ added in v0.9.4
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 PublicAccessOpts ¶ added in v0.9.4
type PublicAccessOpts struct {
Eip Eip `json:"eip"`
}
type PublicKibana ¶ added in v0.6.1
type PublicKibana struct {
// Bandwidth range. Unit: Mbit/s
Bandwidth int `json:"eipSize"`
// Kibana public network access information.
ElbWhiteList *PublicNetwork `json:"elbWhiteListResp"`
// Specifies the IP address for accessing Kibana.
PublicIp string `json:"publicKibanaIp"`
}
type PublicNetwork ¶ added in v0.6.1
type PublicNetwork struct {
// Whether the public network access control is enabled.
// true: Public network access control is enabled.
// false: Public network access control is disabled.
Enabled bool `json:"enableWhiteList"`
// Whitelist of public network for accessing Kibana.
Whitelist string `json:"whiteList"`
}
type ScaleInOpts ¶ added in v0.9.4
type ScaleInOpts struct {
// Type specifies the type of instance to be scaled in.
// Select at least one from `ess`, `ess-cold`, `ess-master`, and `ess-client`.
Type string `json:"type"`
// ReduceNodeNum is the number of nodes to be removed.
// After scaling in, there must be at least one node in each AZ under each node type.
// In a cross-AZ cluster, the difference between the number of nodes of the same type in different AZs cannot exceed 1.
// For a cluster with Master nodes, the number of removed master nodes in a scale-in must be fewer than half of the original master node count.
ReduceNodeNum int `json:"reducedNodeNum"`
}
ScaleInOpts defines options for scaling in a cluster.
type ScaleInRequest ¶ added in v0.9.4
type ScaleInRequest struct {
Shrink []ScaleInOpts `json:"shrink"`
}
ScaleInRequest is a wrapper to structure the "shrink" key in the JSON body.
type SecurityGroupOpts ¶ added in v0.9.4
type SecurityGroupOpts struct {
// Security group ID.
SecurityGroupID string `json:"security_group_ids" required:"true"`
}
type SecurityModeOpts ¶ added in v0.9.4
type ShowClusterVolume ¶ added in v0.6.1
Source Files
¶
- AddClusterNodes.go
- ChangeClusterName.go
- ChangePassword.go
- Create.go
- Delete.go
- DisablePublicAccess.go
- DisablePublicWhitelist.go
- DownloadCertificate.go
- EnablePublicAccess.go
- EnablePublicWhitelist.go
- ExtendCluster.go
- Get.go
- List.go
- RestartCluster.go
- ScaleInCluster.go
- UpdateClusterFlavor.go
- UpdatePublicAccess.go
- UpdateSecurityGroup.go
- UpdateSecurityMode.go
- results.go
- util.go