ms_http

package
v0.0.0-...-f7ca884 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

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 ResumeComputeCluster(endpoint, token, instanceID, clusterID string) error

func SuspendComputeCluster

func SuspendComputeCluster(endpoint, token, instanceID, clusterID string) error

suspend cluster

Types

type Cluster

type Cluster struct {
	ClusterName string      `json:"cluster_name"`
	ClusterID   string      `json:"cluster_id"`
	Type        string      `json:"type"`
	Nodes       []*NodeInfo `json:"nodes"`
}

type MSRequest

type MSRequest struct {
	InstanceID string  `json:"instance_id"`
	Cluster    Cluster `json:"cluster"`
}

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 GetBECluster(endpoint, token, cloudUniqueId, clusterId string) ([]*NodeInfo, error)

func GetFECluster

func GetFECluster(endpoint, token, instanceId, cloudUniqueId string) ([]*NodeInfo, error)

Jump to

Keyboard shortcuts

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