Documentation ¶
Index ¶
- func AllocNodeForKeyspaceGroup(c *gin.Context)
- func CreateKeyspace(c *gin.Context)
- func CreateKeyspaceGroups(c *gin.Context)
- func DeleteKeyspaceGroupByID(c *gin.Context)
- func FinishSplitKeyspaceByID(c *gin.Context)
- func GetKeyspaceGroupByID(c *gin.Context)
- func GetKeyspaceGroups(c *gin.Context)
- func LoadAllKeyspaces(c *gin.Context)
- func LoadKeyspace(c *gin.Context)
- func LoadKeyspaceByID(c *gin.Context)
- func RegisterKeyspace(r *gin.RouterGroup)
- func RegisterTSOKeyspaceGroup(r *gin.RouterGroup)
- func SplitKeyspaceGroupByID(c *gin.Context)
- func UpdateKeyspaceConfig(c *gin.Context)
- func UpdateKeyspaceState(c *gin.Context)
- type AllocNodeForKeyspaceGroupParams
- type CreateKeyspaceGroupParams
- type CreateKeyspaceParams
- type KeyspaceMeta
- type LoadAllKeyspacesResponse
- type SplitKeyspaceGroupByIDParams
- type UpdateConfigParams
- type UpdateStateParam
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllocNodeForKeyspaceGroup ¶
AllocNodeForKeyspaceGroup allocates nodes for keyspace group.
func CreateKeyspace ¶
CreateKeyspace creates keyspace according to given input.
@Tags keyspaces @Summary Create new keyspace. @Param body body CreateKeyspaceParams true "Create keyspace parameters" @Produce json @Success 200 {object} KeyspaceMeta @Failure 400 {string} string "The input is invalid." @Failure 500 {string} string "PD server failed to proceed the request." @Router /keyspaces [post]
func CreateKeyspaceGroups ¶
CreateKeyspaceGroups creates keyspace groups.
func DeleteKeyspaceGroupByID ¶
DeleteKeyspaceGroupByID deletes keyspace group by ID.
func FinishSplitKeyspaceByID ¶
FinishSplitKeyspaceByID finishes split keyspace group by ID.
func GetKeyspaceGroupByID ¶
GetKeyspaceGroupByID gets keyspace group by ID.
func GetKeyspaceGroups ¶
GetKeyspaceGroups gets keyspace groups from the start ID with limit. If limit is 0, it will load all keyspace groups from the start ID.
func LoadAllKeyspaces ¶
LoadAllKeyspaces loads range of keyspaces.
@Tags keyspaces @Summary list keyspaces. @Param page_token query string false "page token" @Param limit query string false "maximum number of results to return" @Produce json @Success 200 {object} LoadAllKeyspacesResponse @Failure 400 {string} string "The input is invalid." @Failure 500 {string} string "PD server failed to proceed the request." @Router /keyspaces [get]
func LoadKeyspace ¶
LoadKeyspace returns target keyspace.
@Tags keyspaces @Summary Get keyspace info. @Param name path string true "Keyspace Name" @Produce json @Success 200 {object} KeyspaceMeta @Failure 500 {string} string "PD server failed to proceed the request." @Router /keyspaces/{name} [get]
func LoadKeyspaceByID ¶
LoadKeyspaceByID returns target keyspace.
@Tags keyspaces @Summary Get keyspace info. @Param id path string true "Keyspace id" @Produce json @Success 200 {object} KeyspaceMeta @Failure 500 {string} string "PD server failed to proceed the request." @Router /keyspaces/id/{id} [get]
func RegisterKeyspace ¶
func RegisterKeyspace(r *gin.RouterGroup)
RegisterKeyspace register keyspace related handlers to router paths.
func RegisterTSOKeyspaceGroup ¶
func RegisterTSOKeyspaceGroup(r *gin.RouterGroup)
RegisterTSOKeyspaceGroup registers keyspace group handlers to the server.
func SplitKeyspaceGroupByID ¶
SplitKeyspaceGroupByID splits keyspace group by ID into a new keyspace group with the given new ID. And the keyspaces in the old keyspace group will be moved to the new keyspace group.
func UpdateKeyspaceConfig ¶
UpdateKeyspaceConfig updates target keyspace's config. This api uses PATCH semantic and supports JSON Merge Patch. format and processing rules.
@Tags keyspaces @Summary Update keyspace config. @Param name path string true "Keyspace Name" @Param body body UpdateConfigParams true "Update keyspace parameters" @Produce json @Success 200 {object} KeyspaceMeta @Failure 400 {string} string "The input is invalid." @Failure 500 {string} string "PD server failed to proceed the request."
Router /keyspaces/{name}/config [patch]
func UpdateKeyspaceState ¶
UpdateKeyspaceState update the target keyspace's state.
@Tags keyspaces @Summary Update keyspace state. @Param name path string true "Keyspace Name" @Param body body UpdateStateParam true "New state for the keyspace" @Produce json @Success 200 {object} KeyspaceMeta @Failure 400 {string} string "The input is invalid." @Failure 500 {string} string "PD server failed to proceed the request."
Router /keyspaces/{name}/state [put]
Types ¶
type AllocNodeForKeyspaceGroupParams ¶
type AllocNodeForKeyspaceGroupParams struct {
Replica int `json:"replica"`
}
AllocNodeForKeyspaceGroupParams defines the params for allocating nodes for keyspace groups.
type CreateKeyspaceGroupParams ¶
type CreateKeyspaceGroupParams struct {
KeyspaceGroups []*endpoint.KeyspaceGroup `json:"keyspace-groups"`
}
CreateKeyspaceGroupParams defines the params for creating keyspace groups.
type CreateKeyspaceParams ¶
type CreateKeyspaceParams struct { Name string `json:"name"` Config map[string]string `json:"config"` }
CreateKeyspaceParams represents parameters needed when creating a new keyspace. NOTE: This type is exported by HTTP API. Please pay more attention when modifying it.
type KeyspaceMeta ¶
type KeyspaceMeta struct {
*keyspacepb.KeyspaceMeta
}
KeyspaceMeta wraps keyspacepb.KeyspaceMeta to provide custom JSON marshal.
func (*KeyspaceMeta) MarshalJSON ¶
func (meta *KeyspaceMeta) MarshalJSON() ([]byte, error)
MarshalJSON creates custom marshal of KeyspaceMeta with the following: 1. Keyspace State are marshaled to their corresponding name for better readability.
func (*KeyspaceMeta) UnmarshalJSON ¶
func (meta *KeyspaceMeta) UnmarshalJSON(data []byte) error
UnmarshalJSON reverse KeyspaceMeta's the Custom JSON marshal.
type LoadAllKeyspacesResponse ¶
type LoadAllKeyspacesResponse struct { Keyspaces []*KeyspaceMeta `json:"keyspaces"` // Token that can be used to read immediate next page. // If it's empty, then end has been reached. NextPageToken string `json:"next_page_token"` }
LoadAllKeyspacesResponse represents response given when loading all keyspaces. NOTE: This type is exported by HTTP API. Please pay more attention when modifying it.
type SplitKeyspaceGroupByIDParams ¶
type SplitKeyspaceGroupByIDParams struct { NewID uint32 `json:"new-id"` Keyspaces []uint32 `json:"keyspaces"` }
SplitKeyspaceGroupByIDParams defines the params for splitting a keyspace group.
type UpdateConfigParams ¶
UpdateConfigParams represents parameters needed to modify target keyspace's configs. NOTE: This type is exported by HTTP API. Please pay more attention when modifying it. A Map of string to string pointer is used to differentiate between json null and "", which will both be set to "" if value type is string during binding.
type UpdateStateParam ¶
type UpdateStateParam struct {
State string `json:"state"`
}
UpdateStateParam represents parameters needed to modify target keyspace's state. NOTE: This type is exported by HTTP API. Please pay more attention when modifying it.