cluster

package
v0.0.0-...-63319d1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MPL-2.0, Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PublicBindTypeAuto         = "auto_assign"
	PublicBindTypeNotUse       = "not_use"
	PublicBindTypeBindExisting = "bind_existing"
)

Variables

View Source
var RequestOpts = golangsdk.RequestOpts{
	MoreHeaders: map[string]string{"Content-Type": "application/json", "X-Language": "en-us"},
}

Functions

func ResetPassword

func ResetPassword(c *golangsdk.ServiceClient, clusterId string, opts ResetPasswordOpts) (*golangsdk.Result, error)

func Resize

func Resize(c *golangsdk.ServiceClient, clusterId string, scaleOutCount int) (*golangsdk.Result, error)

Types

type Cluster

type Cluster struct {
	Status              string             `json:"status"`
	SubStatus           string             `json:"sub_status"`
	Updated             string             `json:"updated"` //ISO8601:YYYY-MM-DDThh:mm:ssZ
	Endpoints           []Endpoints        `json:"endPoints"`
	Name                string             `json:"name"`
	NumberOfNode        int                `json:"number_of_node"`
	AvailabilityZone    string             `json:"availability_zone"`
	SubnetID            string             `json:"subnet_id"`
	PublicEndpoints     []PublicEndpoints  `json:"public_endpoints"`
	Created             string             `json:"created"` //ISO8601:YYYY-MM-DDThh:mm:ssZ
	SecurityGroupID     string             `json:"security_group_id"`
	Port                int                `json:"port"`
	NodeType            string             `json:"node_type"`
	Version             string             `json:"version"`
	PublicIp            *PublicIp          `json:"public_ip"`
	FailedReasons       *FailInfo          `json:"failed_reasons"`
	VpcID               string             `json:"vpc_id"`
	TaskStatus          string             `json:"task_status"`
	UserName            string             `json:"user_name"`
	ID                  string             `json:"id"`
	ActionProgress      map[string]string  `json:"action_progress"`
	RecentEvent         int                `json:"recent_event"`
	Tags                []tags.ResourceTag `json:"tags"`
	EnterpriseProjectId string             `json:"enterprise_project_id"`
}

type ClusterDetail

type ClusterDetail struct {
	Cluster
	PrivateIp      []string        `json:"private_ip"`
	ParameterGroup *ParameterGroup `json:"parameter_group"`
	NodeTypeId     string          `json:"node_type_id"`
	NodeDetail     *NodeDetail     `json:"node_detail"`
	MaintainWindow *MaintainWindow `json:"maintain_window"`
	ResizeInfo     *ResizeInfo     `json:"resize_info"`
}

func Get

func Get(c *golangsdk.ServiceClient, id string) (*ClusterDetail, error)

type ClusterDetailsRst

type ClusterDetailsRst struct {
	Cluster ClusterDetail `json:"cluster"`
}

type CreateClusterRst

type CreateClusterRst struct {
	Cluster IdObject `json:"cluster"`
}

func Create

func Create(c *golangsdk.ServiceClient, opts CreateOptsBuilder) (*CreateClusterRst, error)

type CreateOpts

type CreateOpts struct {
	Name                string        `json:"name" required:"true"`
	NumberOfNode        int           `json:"number_of_node" required:"true"`
	AvailabilityZone    string        `json:"availability_zone,omitempty"`
	SubnetID            string        `json:"subnet_id" required:"true"`
	UserPwd             string        `json:"user_pwd" required:"true"`
	SecurityGroupID     string        `json:"security_group_id" required:"true"`
	PublicIp            *PublicIpOpts `json:"public_ip,omitempty"`
	NodeType            string        `json:"node_type" required:"true"`
	VpcID               string        `json:"vpc_id" required:"true"`
	UserName            string        `json:"user_name" required:"true"`
	Port                int           `json:"port,omitempty"`         //default:8000
	NumberOfCn          *int          `json:"number_of_cn,omitempty"` //default:2
	EnterpriseProjectId string        `json:"enterprise_project_id,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
}

type CreateRsp

type CreateRsp struct {
	ID string `json:"id"`
}

type DeleteResult

type DeleteResult struct {
	golangsdk.ErrResult
}

func Delete

func Delete(c *golangsdk.ServiceClient, id string) (r DeleteResult)

type Endpoints

type Endpoints struct {
	ConnectInfo string `json:"connect_info"`
	JdbcUrl     string `json:"jdbc_url"`
}

type FailInfo

type FailInfo struct {
	ErrorCode string `json:"error_code"`
	ErrorMsg  string `json:"error_msg"`
}

type FailedReasons

type FailedReasons struct {
	FailInfo FailInfo `json:"fail_info"`
}

type GetResult

type GetResult struct {
	golangsdk.Result
}

type IdObject

type IdObject struct {
	Id string `json:"id"`
}

type ListClustersRst

type ListClustersRst struct {
	Clusters []Cluster `json:"clusters"`
}

func List

func List(c *golangsdk.ServiceClient, opts ListOpts) (*ListClustersRst, error)

type ListOpts

type ListOpts struct {
	EnterpriseProjectId string `q:"enterprise_project_id"`
}

type MaintainWindow

type MaintainWindow struct {
	StartTime string `json:"start_time"` // HH:mm,timezoue:GMT+0。
	EndTime   string `json:"end_time"`
	Day       string `json:"day"`
}

type NodeDetail

type NodeDetail struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type ParameterGroup

type ParameterGroup struct {
	Name   string `json:"name"`
	Id     string `json:"id"`
	Status string `json:"status"` // In-Sync,Applying.Pending-Reboot,Sync-Failure
}

type PublicEndpoints

type PublicEndpoints struct {
	PublicConnectInfo string `json:"public_connect_info"`
	JdbcUrl           string `json:"jdbc_url"`
}

type PublicIp

type PublicIp struct {
	EipID          string `json:"eip_id"`
	PublicBindType string `json:"public_bind_type"`
}

type PublicIpOpts

type PublicIpOpts struct {
	EipID          string `json:"eip_id,omitempty"`
	PublicBindType string `json:"public_bind_type,omitempty"`
}

type ResetPasswordOpts

type ResetPasswordOpts struct {
	NewPassword string `json:"new_password" required:"true"`
}

type ResizeInfo

type ResizeInfo struct {
	ResizeStatus  string `json:"resize_status"` //GROWING,RESIZE_FAILURE
	StartTime     string `json:"start_time"`    //ISO8601:YYYY-MM-DDThh:mm:ss
	TargetNodeNum int    `json:"target_node_num"`
	OriginNodeNum int    `json:"origin_node_num"`
}

Jump to

Keyboard shortcuts

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