Documentation
¶
Index ¶
- Constants
- func ResumeComputeCluster(endpoint, token, instanceID, clusterID string) error
- func SuspendComputeCluster(endpoint, token, instanceID, clusterID string) error
- type Cluster
- type MSRequest
- type MSResponse
- func CreateInstance(endpoint, token string, instanceInfo []byte) (*MSResponse, error)
- func DeleteInstance(endpoint, token, instanceId string) (*MSResponse, error)
- func DropBENodes(endpoint, token, instanceID string, cluster Cluster) (*MSResponse, error)
- func DropComputeCluster(endpoint, token, instanceID string, ccs *dv1.ComputeClusterStatus) (*MSResponse, error)
- func DropFENodes(endpoint, token, instanceID string, nodes []*NodeInfo) (*MSResponse, error)
- func GetInstance(endpoint, token, instanceId string) (*MSResponse, error)
- func SetClusterStatus(endpoint, token, instanceID, clusterID, status string) (*MSResponse, error)
- type NodeInfo
Constants ¶
View Source
const ( CREATE_INSTANCE_PREFIX_TEMPLATE = `http://%s/MetaService/http/create_instance?token=%s` DELETE_INSTANCE_PREFIX_TEMPLATE = `http://%s/MetaService/http/drop_instance?token=%s` GET_INSTANCE_PREFIX_TEMPLATE = `http://%s/MetaService/http/get_instance?token=%s&instance_id=%s` DROP_NODE_PREFIX_TEMPLATE = `http://%s/MetaService/http/drop_node?token=%s` GET_CLUSTER_PREFIX_TEMPLATE = `http://%s/MetaService/http/get_cluster?token=%s` SET_CLUSTER_STATUS_PREFIX_TEMPLATE = `http://%s/MetaService/http/set_cluster_status?token=%s` DROP_CLUSTER_STATUS_PREFIX_TEMPLATE = `http://%s/MetaService/http/drop_cluster?token=%s` )
View Source
const ( SuccessCode string = "OK" ALREADY_EXIST string = "ALREADY_EXISTED" NotFound string = "NOT_FOUND" INTERNAL_ERROR string = "INTERNAL_ERROR" FeClusterId = "RESERVED_CLUSTER_ID_FOR_SQL_SERVER" FeClusterName = "RESERVED_CLUSTER_NAME_FOR_SQL_SERVER" FeNodeType = "SQL" BeNodeType = "COMPUTE" )
Variables ¶
This section is empty.
Functions ¶
func ResumeComputeCluster ¶
func SuspendComputeCluster ¶
suspend cluster
Types ¶
type MSResponse ¶
type MSResponse struct { Code string `json:"code,omitempty"` Msg string `json:"msg,omitempty"` Result map[string]interface{} `json:"result,omitempty"` }
func CreateInstance ¶
func CreateInstance(endpoint, token string, instanceInfo []byte) (*MSResponse, error)
func DeleteInstance ¶
func DeleteInstance(endpoint, token, instanceId string) (*MSResponse, error)
func DropBENodes ¶
func DropBENodes(endpoint, token, instanceID string, cluster Cluster) (*MSResponse, error)
DropBENodes dropNodesFromSpecifyCluster drop all nodes of specify cluster from ms
func DropComputeCluster ¶
func DropComputeCluster(endpoint, token, instanceID string, ccs *dv1.ComputeClusterStatus) (*MSResponse, error)
func DropFENodes ¶
func DropFENodes(endpoint, token, instanceID string, nodes []*NodeInfo) (*MSResponse, error)
func GetInstance ¶
func GetInstance(endpoint, token, instanceId string) (*MSResponse, error)
func SetClusterStatus ¶
func SetClusterStatus(endpoint, token, instanceID, clusterID, status string) (*MSResponse, error)
SetClusterStatus resume cluster
func (*MSResponse) MSResponseResultNodesToNodeInfos ¶
func (mr *MSResponse) MSResponseResultNodesToNodeInfos() ([]*NodeInfo, error)
type NodeInfo ¶
type NodeInfo struct { CloudUniqueID string `json:"cloud_unique_id"` IP string `json:"ip"` Ctime string `json:"-"` Mtime string `json:"-"` Status string `json:"-"` NodeType string `json:"node_type,omitempty"` EditLogPort int `json:"edit_log_port,omitempty"` HeartbeatPort int `json:"heartbeat_port,omitempty"` Host string `json:"-"` }
func GetBECluster ¶
func GetFECluster ¶
Click to show internal directories.
Click to hide internal directories.