Documentation
¶
Index ¶
- Constants
- func DeleteClusterByID(projectID, clusterID uint64) error
- func DoGET(url string, payload, output interface{}) (*resty.Response, error)
- func DoPOST(url string, payload, output interface{}) (*resty.Response, error)
- func InitClient(publicKey, privateKey string) error
- func IsValidProjectID(projectID uint64) (bool, error)
- func PauseClusterByID(projectID, clusterID uint64) error
- func ResumeClusterByID(projectID, clusterID uint64) error
- type Cluster
- type ClusterConfig
- type ClusterPauseConfig
- type ClusterStatus
- type ComponentTiDB
- type ComponentTiFlash
- type ComponentTiKV
- type Components
- type ConnectionString
- type CreateClusterReq
- type CreateClusterResp
- type GetAllClustersResp
- type GetAllProjectsResp
- type GetSpecificationsResp
- type IPAccess
- type Project
- type Specification
Constants ¶
View Source
const (
Host = "https://api.tidbcloud.com"
)
Variables ¶
This section is empty.
Functions ¶
func DeleteClusterByID ¶
deleteClusterByID delete a cluster
func InitClient ¶
func IsValidProjectID ¶
func PauseClusterByID ¶
func ResumeClusterByID ¶
Types ¶
type Cluster ¶
type Cluster struct {
ID uint64 `json:"id,string"`
ProjectID uint64 `json:"project_id,string"`
Name string `json:"name"`
Port int32 `json:"port"`
TiDBVersion string `json:"tidb_version"`
ClusterType string `json:"cluster_type"`
CloudProvider string `json:"cloud_provider"`
Region string `json:"region"`
Status ClusterStatus `json:"status"`
CreateTimestamp string `json:"create_timestamp"`
Config ClusterConfig `json:"config"`
ConnectionStrings ConnectionString `json:"connection_strings"`
}
type ClusterConfig ¶
type ClusterConfig struct {
RootPassword string `json:"root_password"`
Port int32 `json:"port"`
Paused bool `json:"paused"`
Components Components `json:"components"`
IPAccessList []IPAccess `json:"ip_access_list"`
}
type ClusterPauseConfig ¶
type ClusterPauseConfig struct {
Config struct {
Paused bool `json:"paused"`
} `json:"config"`
}
type ClusterStatus ¶
type ComponentTiDB ¶
type ComponentTiFlash ¶
type ComponentTiKV ¶
type Components ¶
type Components struct {
TiDB *ComponentTiDB `json:"tidb,omitempty"`
TiKV *ComponentTiKV `json:"tikv,omitempty"`
TiFlash *ComponentTiFlash `json:"tiflash,omitempty"`
}
type ConnectionString ¶
type CreateClusterReq ¶
type CreateClusterReq struct {
Name string `json:"name"`
ClusterType string `json:"cluster_type"`
CloudProvider string `json:"cloud_provider"`
Region string `json:"region"`
Config ClusterConfig `json:"config"`
}
type CreateClusterResp ¶
type CreateClusterResp struct {
ClusterID uint64 `json:"id,string"`
Message string `json:"message"`
}
func CreateDedicatedCluster ¶
func CreateDedicatedCluster(projectID uint64, spec *Specification) (*CreateClusterResp, error)
createDedicatedCluster create a cluster in the given project
type GetAllClustersResp ¶
type GetAllProjectsResp ¶
type GetSpecificationsResp ¶
type GetSpecificationsResp struct {
Items []Specification `json:"items"`
}
func GetSpecifications ¶
func GetSpecifications() (*GetSpecificationsResp, error)
getSpecifications returns all the available specifications
type Project ¶
type Project struct {
ID uint64 `json:"id,string"`
OrgID uint64 `json:"org_id,string"`
Name string `json:"name"`
ClusterCount int64 `json:"cluster_count"`
UserCount int64 `json:"user_count"`
CreateTimestamp int64 `json:"create_timestamp,string"`
}
func GetAllProjects ¶
getAllProjects list all projects in current organization
func GetProjectByName ¶
type Specification ¶
type Specification struct {
ClusterType string `json:"cluster_type"`
CloudProvider string `json:"cloud_provider"`
Region string `json:"region"`
Tidb []struct {
NodeSize string `json:"node_size"`
NodeQuantityRange struct {
Min int `json:"min"`
Step int `json:"step"`
} `json:"node_quantity_range"`
} `json:"tidb"`
Tikv []struct {
NodeSize string `json:"node_size"`
NodeQuantityRange struct {
Min int `json:"min"`
Step int `json:"step"`
} `json:"node_quantity_range"`
StorageSizeGibRange struct {
Min int `json:"min"`
Max int `json:"max"`
} `json:"storage_size_gib_range"`
} `json:"tikv"`
Tiflash []struct {
NodeSize string `json:"node_size"`
NodeQuantityRange struct {
Step int `json:"step"`
} `json:"node_quantity_range"`
StorageSizeGibRange struct {
Min int `json:"min"`
Max int `json:"max"`
} `json:"storage_size_gib_range"`
} `json:"tiflash"`
}
func GetDedicatedSpec ¶
func GetDedicatedSpec(specifications *GetSpecificationsResp) (*Specification, error)
Click to show internal directories.
Click to hide internal directories.