vtadminv16connect

package
v0.0.0-...-770e144 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// VTAdminCreateKeyspaceProcedure is the fully-qualified name of the VTAdmin's CreateKeyspace RPC.
	VTAdminCreateKeyspaceProcedure = "/vtadmin.VTAdmin/CreateKeyspace"
	// VTAdminCreateShardProcedure is the fully-qualified name of the VTAdmin's CreateShard RPC.
	VTAdminCreateShardProcedure = "/vtadmin.VTAdmin/CreateShard"
	// VTAdminDeleteKeyspaceProcedure is the fully-qualified name of the VTAdmin's DeleteKeyspace RPC.
	VTAdminDeleteKeyspaceProcedure = "/vtadmin.VTAdmin/DeleteKeyspace"
	// VTAdminDeleteShardsProcedure is the fully-qualified name of the VTAdmin's DeleteShards RPC.
	VTAdminDeleteShardsProcedure = "/vtadmin.VTAdmin/DeleteShards"
	// VTAdminDeleteTabletProcedure is the fully-qualified name of the VTAdmin's DeleteTablet RPC.
	VTAdminDeleteTabletProcedure = "/vtadmin.VTAdmin/DeleteTablet"
	// VTAdminEmergencyFailoverShardProcedure is the fully-qualified name of the VTAdmin's
	// EmergencyFailoverShard RPC.
	VTAdminEmergencyFailoverShardProcedure = "/vtadmin.VTAdmin/EmergencyFailoverShard"
	// VTAdminFindSchemaProcedure is the fully-qualified name of the VTAdmin's FindSchema RPC.
	VTAdminFindSchemaProcedure = "/vtadmin.VTAdmin/FindSchema"
	// VTAdminGetBackupsProcedure is the fully-qualified name of the VTAdmin's GetBackups RPC.
	VTAdminGetBackupsProcedure = "/vtadmin.VTAdmin/GetBackups"
	// VTAdminGetCellInfosProcedure is the fully-qualified name of the VTAdmin's GetCellInfos RPC.
	VTAdminGetCellInfosProcedure = "/vtadmin.VTAdmin/GetCellInfos"
	// VTAdminGetCellsAliasesProcedure is the fully-qualified name of the VTAdmin's GetCellsAliases RPC.
	VTAdminGetCellsAliasesProcedure = "/vtadmin.VTAdmin/GetCellsAliases"
	// VTAdminGetClustersProcedure is the fully-qualified name of the VTAdmin's GetClusters RPC.
	VTAdminGetClustersProcedure = "/vtadmin.VTAdmin/GetClusters"
	// VTAdminGetFullStatusProcedure is the fully-qualified name of the VTAdmin's GetFullStatus RPC.
	VTAdminGetFullStatusProcedure = "/vtadmin.VTAdmin/GetFullStatus"
	// VTAdminGetGatesProcedure is the fully-qualified name of the VTAdmin's GetGates RPC.
	VTAdminGetGatesProcedure = "/vtadmin.VTAdmin/GetGates"
	// VTAdminGetKeyspaceProcedure is the fully-qualified name of the VTAdmin's GetKeyspace RPC.
	VTAdminGetKeyspaceProcedure = "/vtadmin.VTAdmin/GetKeyspace"
	// VTAdminGetKeyspacesProcedure is the fully-qualified name of the VTAdmin's GetKeyspaces RPC.
	VTAdminGetKeyspacesProcedure = "/vtadmin.VTAdmin/GetKeyspaces"
	// VTAdminGetSchemaProcedure is the fully-qualified name of the VTAdmin's GetSchema RPC.
	VTAdminGetSchemaProcedure = "/vtadmin.VTAdmin/GetSchema"
	// VTAdminGetSchemasProcedure is the fully-qualified name of the VTAdmin's GetSchemas RPC.
	VTAdminGetSchemasProcedure = "/vtadmin.VTAdmin/GetSchemas"
	// VTAdminGetShardReplicationPositionsProcedure is the fully-qualified name of the VTAdmin's
	// GetShardReplicationPositions RPC.
	VTAdminGetShardReplicationPositionsProcedure = "/vtadmin.VTAdmin/GetShardReplicationPositions"
	// VTAdminGetSrvVSchemaProcedure is the fully-qualified name of the VTAdmin's GetSrvVSchema RPC.
	VTAdminGetSrvVSchemaProcedure = "/vtadmin.VTAdmin/GetSrvVSchema"
	// VTAdminGetSrvVSchemasProcedure is the fully-qualified name of the VTAdmin's GetSrvVSchemas RPC.
	VTAdminGetSrvVSchemasProcedure = "/vtadmin.VTAdmin/GetSrvVSchemas"
	// VTAdminGetTabletProcedure is the fully-qualified name of the VTAdmin's GetTablet RPC.
	VTAdminGetTabletProcedure = "/vtadmin.VTAdmin/GetTablet"
	// VTAdminGetTabletsProcedure is the fully-qualified name of the VTAdmin's GetTablets RPC.
	VTAdminGetTabletsProcedure = "/vtadmin.VTAdmin/GetTablets"
	// VTAdminGetTopologyPathProcedure is the fully-qualified name of the VTAdmin's GetTopologyPath RPC.
	VTAdminGetTopologyPathProcedure = "/vtadmin.VTAdmin/GetTopologyPath"
	// VTAdminGetVSchemaProcedure is the fully-qualified name of the VTAdmin's GetVSchema RPC.
	VTAdminGetVSchemaProcedure = "/vtadmin.VTAdmin/GetVSchema"
	// VTAdminGetVSchemasProcedure is the fully-qualified name of the VTAdmin's GetVSchemas RPC.
	VTAdminGetVSchemasProcedure = "/vtadmin.VTAdmin/GetVSchemas"
	// VTAdminGetVtctldsProcedure is the fully-qualified name of the VTAdmin's GetVtctlds RPC.
	VTAdminGetVtctldsProcedure = "/vtadmin.VTAdmin/GetVtctlds"
	// VTAdminGetWorkflowProcedure is the fully-qualified name of the VTAdmin's GetWorkflow RPC.
	VTAdminGetWorkflowProcedure = "/vtadmin.VTAdmin/GetWorkflow"
	// VTAdminGetWorkflowsProcedure is the fully-qualified name of the VTAdmin's GetWorkflows RPC.
	VTAdminGetWorkflowsProcedure = "/vtadmin.VTAdmin/GetWorkflows"
	// VTAdminPingTabletProcedure is the fully-qualified name of the VTAdmin's PingTablet RPC.
	VTAdminPingTabletProcedure = "/vtadmin.VTAdmin/PingTablet"
	// VTAdminPlannedFailoverShardProcedure is the fully-qualified name of the VTAdmin's
	// PlannedFailoverShard RPC.
	VTAdminPlannedFailoverShardProcedure = "/vtadmin.VTAdmin/PlannedFailoverShard"
	// VTAdminRebuildKeyspaceGraphProcedure is the fully-qualified name of the VTAdmin's
	// RebuildKeyspaceGraph RPC.
	VTAdminRebuildKeyspaceGraphProcedure = "/vtadmin.VTAdmin/RebuildKeyspaceGraph"
	// VTAdminRefreshStateProcedure is the fully-qualified name of the VTAdmin's RefreshState RPC.
	VTAdminRefreshStateProcedure = "/vtadmin.VTAdmin/RefreshState"
	// VTAdminRefreshTabletReplicationSourceProcedure is the fully-qualified name of the VTAdmin's
	// RefreshTabletReplicationSource RPC.
	VTAdminRefreshTabletReplicationSourceProcedure = "/vtadmin.VTAdmin/RefreshTabletReplicationSource"
	// VTAdminReloadSchemasProcedure is the fully-qualified name of the VTAdmin's ReloadSchemas RPC.
	VTAdminReloadSchemasProcedure = "/vtadmin.VTAdmin/ReloadSchemas"
	// VTAdminReloadSchemaShardProcedure is the fully-qualified name of the VTAdmin's ReloadSchemaShard
	// RPC.
	VTAdminReloadSchemaShardProcedure = "/vtadmin.VTAdmin/ReloadSchemaShard"
	// VTAdminRemoveKeyspaceCellProcedure is the fully-qualified name of the VTAdmin's
	// RemoveKeyspaceCell RPC.
	VTAdminRemoveKeyspaceCellProcedure = "/vtadmin.VTAdmin/RemoveKeyspaceCell"
	// VTAdminRunHealthCheckProcedure is the fully-qualified name of the VTAdmin's RunHealthCheck RPC.
	VTAdminRunHealthCheckProcedure = "/vtadmin.VTAdmin/RunHealthCheck"
	// VTAdminSetReadOnlyProcedure is the fully-qualified name of the VTAdmin's SetReadOnly RPC.
	VTAdminSetReadOnlyProcedure = "/vtadmin.VTAdmin/SetReadOnly"
	// VTAdminSetReadWriteProcedure is the fully-qualified name of the VTAdmin's SetReadWrite RPC.
	VTAdminSetReadWriteProcedure = "/vtadmin.VTAdmin/SetReadWrite"
	// VTAdminStartReplicationProcedure is the fully-qualified name of the VTAdmin's StartReplication
	// RPC.
	VTAdminStartReplicationProcedure = "/vtadmin.VTAdmin/StartReplication"
	// VTAdminStopReplicationProcedure is the fully-qualified name of the VTAdmin's StopReplication RPC.
	VTAdminStopReplicationProcedure = "/vtadmin.VTAdmin/StopReplication"
	// VTAdminTabletExternallyPromotedProcedure is the fully-qualified name of the VTAdmin's
	// TabletExternallyPromoted RPC.
	VTAdminTabletExternallyPromotedProcedure = "/vtadmin.VTAdmin/TabletExternallyPromoted"
	// VTAdminValidateProcedure is the fully-qualified name of the VTAdmin's Validate RPC.
	VTAdminValidateProcedure = "/vtadmin.VTAdmin/Validate"
	// VTAdminValidateKeyspaceProcedure is the fully-qualified name of the VTAdmin's ValidateKeyspace
	// RPC.
	VTAdminValidateKeyspaceProcedure = "/vtadmin.VTAdmin/ValidateKeyspace"
	// VTAdminValidateSchemaKeyspaceProcedure is the fully-qualified name of the VTAdmin's
	// ValidateSchemaKeyspace RPC.
	VTAdminValidateSchemaKeyspaceProcedure = "/vtadmin.VTAdmin/ValidateSchemaKeyspace"
	// VTAdminValidateShardProcedure is the fully-qualified name of the VTAdmin's ValidateShard RPC.
	VTAdminValidateShardProcedure = "/vtadmin.VTAdmin/ValidateShard"
	// VTAdminValidateVersionKeyspaceProcedure is the fully-qualified name of the VTAdmin's
	// ValidateVersionKeyspace RPC.
	VTAdminValidateVersionKeyspaceProcedure = "/vtadmin.VTAdmin/ValidateVersionKeyspace"
	// VTAdminValidateVersionShardProcedure is the fully-qualified name of the VTAdmin's
	// ValidateVersionShard RPC.
	VTAdminValidateVersionShardProcedure = "/vtadmin.VTAdmin/ValidateVersionShard"
	// VTAdminVTExplainProcedure is the fully-qualified name of the VTAdmin's VTExplain RPC.
	VTAdminVTExplainProcedure = "/vtadmin.VTAdmin/VTExplain"
)

These constants are the fully-qualified names of the RPCs defined in this package. They're exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.

Note that these are different from the fully-qualified method names used by google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to reflection-formatted method names, remove the leading slash and convert the remaining slash to a period.

View Source
const (
	// VTAdminName is the fully-qualified name of the VTAdmin service.
	VTAdminName = "vtadmin.VTAdmin"
)

Variables

This section is empty.

Functions

func NewVTAdminHandler

func NewVTAdminHandler(svc VTAdminHandler, opts ...connect.HandlerOption) (string, http.Handler)

NewVTAdminHandler builds an HTTP handler from the service implementation. It returns the path on which to mount the handler and the handler itself.

By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf and JSON codecs. They also support gzip compression.

Types

type UnimplementedVTAdminHandler

type UnimplementedVTAdminHandler struct{}

UnimplementedVTAdminHandler returns CodeUnimplemented from all methods.

func (UnimplementedVTAdminHandler) GetSchema

func (UnimplementedVTAdminHandler) GetTablet

type VTAdminClient

type VTAdminClient interface {
	// CreateKeyspace creates a new keyspace in the given cluster.
	CreateKeyspace(context.Context, *connect.Request[v16.CreateKeyspaceRequest]) (*connect.Response[v16.CreateKeyspaceResponse], error)
	// CreateShard creates a new shard in the given cluster and keyspace.
	CreateShard(context.Context, *connect.Request[v16.CreateShardRequest]) (*connect.Response[v161.CreateShardResponse], error)
	// DeleteKeyspace deletes a keyspace in the given cluster.
	DeleteKeyspace(context.Context, *connect.Request[v16.DeleteKeyspaceRequest]) (*connect.Response[v161.DeleteKeyspaceResponse], error)
	// DeleteShard deletes one or more shards in the given cluster and keyspace.
	DeleteShards(context.Context, *connect.Request[v16.DeleteShardsRequest]) (*connect.Response[v161.DeleteShardsResponse], error)
	// DeleteTablet deletes a tablet from the topology
	DeleteTablet(context.Context, *connect.Request[v16.DeleteTabletRequest]) (*connect.Response[v16.DeleteTabletResponse], error)
	// EmergencyFailoverShard fails over a shard to a new primary. It assumes
	// the old primary is dead or otherwise not responding.
	EmergencyFailoverShard(context.Context, *connect.Request[v16.EmergencyFailoverShardRequest]) (*connect.Response[v16.EmergencyFailoverShardResponse], error)
	// FindSchema returns a single Schema that matches the provided table name
	// across all specified clusters IDs. Not specifying a set of cluster IDs
	// causes the search to span all configured clusters.
	//
	// An error occurs if either no table exists across any of the clusters with
	// the specified table name, or if multiple tables exist with that name.
	FindSchema(context.Context, *connect.Request[v16.FindSchemaRequest]) (*connect.Response[v16.Schema], error)
	// GetBackups returns backups grouped by cluster.
	GetBackups(context.Context, *connect.Request[v16.GetBackupsRequest]) (*connect.Response[v16.GetBackupsResponse], error)
	// GetCellInfos returns the CellInfo objects for the specified clusters.
	//
	// Callers may optionally restrict the set of CellInfos, or restrict the
	// response to include only cell names.
	GetCellInfos(context.Context, *connect.Request[v16.GetCellInfosRequest]) (*connect.Response[v16.GetCellInfosResponse], error)
	// GetCellsAliases returns the CellsAliases data for the specified clusters.
	GetCellsAliases(context.Context, *connect.Request[v16.GetCellsAliasesRequest]) (*connect.Response[v16.GetCellsAliasesResponse], error)
	// GetClusters returns all configured clusters.
	GetClusters(context.Context, *connect.Request[v16.GetClustersRequest]) (*connect.Response[v16.GetClustersResponse], error)
	// GetFullStatus returns the full status of MySQL including the replication information, semi-sync information, GTID information among others
	GetFullStatus(context.Context, *connect.Request[v16.GetFullStatusRequest]) (*connect.Response[v161.GetFullStatusResponse], error)
	// GetGates returns all gates across all the specified clusters.
	GetGates(context.Context, *connect.Request[v16.GetGatesRequest]) (*connect.Response[v16.GetGatesResponse], error)
	// GetKeyspace returns a keyspace by name in the specified cluster.
	GetKeyspace(context.Context, *connect.Request[v16.GetKeyspaceRequest]) (*connect.Response[v16.Keyspace], error)
	// GetKeyspaces returns all keyspaces across the specified clusters.
	GetKeyspaces(context.Context, *connect.Request[v16.GetKeyspacesRequest]) (*connect.Response[v16.GetKeyspacesResponse], error)
	// GetSchema returns the schema for the specified (cluster, keyspace, table)
	// tuple.
	GetSchema(context.Context, *connect.Request[v16.GetSchemaRequest]) (*connect.Response[v16.Schema], error)
	// GetSchemas returns all schemas across the specified clusters.
	GetSchemas(context.Context, *connect.Request[v16.GetSchemasRequest]) (*connect.Response[v16.GetSchemasResponse], error)
	// GetShardReplicationPositions returns shard replication positions grouped
	// by cluster.
	GetShardReplicationPositions(context.Context, *connect.Request[v16.GetShardReplicationPositionsRequest]) (*connect.Response[v16.GetShardReplicationPositionsResponse], error)
	// GetSrvVSchema returns the SrvVSchema for the given cluster and cell.
	GetSrvVSchema(context.Context, *connect.Request[v16.GetSrvVSchemaRequest]) (*connect.Response[v16.SrvVSchema], error)
	// GetSrvVSchemas returns all SrvVSchemas across all (or specified) clusters
	// and cells.
	GetSrvVSchemas(context.Context, *connect.Request[v16.GetSrvVSchemasRequest]) (*connect.Response[v16.GetSrvVSchemasResponse], error)
	// GetTablet looks up a tablet by hostname across all clusters and returns
	// the result.
	GetTablet(context.Context, *connect.Request[v16.GetTabletRequest]) (*connect.Response[v16.Tablet], error)
	// GetTablets returns all tablets across all the specified clusters.
	GetTablets(context.Context, *connect.Request[v16.GetTabletsRequest]) (*connect.Response[v16.GetTabletsResponse], error)
	// GetTopologyPath returns the cell located at the specified path in the topology server.
	GetTopologyPath(context.Context, *connect.Request[v16.GetTopologyPathRequest]) (*connect.Response[v161.GetTopologyPathResponse], error)
	// GetVSchema returns a VSchema for the specified keyspace in the specified
	// cluster.
	GetVSchema(context.Context, *connect.Request[v16.GetVSchemaRequest]) (*connect.Response[v16.VSchema], error)
	// GetVSchemas returns the VSchemas for all specified clusters.
	GetVSchemas(context.Context, *connect.Request[v16.GetVSchemasRequest]) (*connect.Response[v16.GetVSchemasResponse], error)
	// GetVtctlds returns the Vtctlds for all specified clusters.
	GetVtctlds(context.Context, *connect.Request[v16.GetVtctldsRequest]) (*connect.Response[v16.GetVtctldsResponse], error)
	// GetWorkflow returns a single Workflow for a given cluster, keyspace, and
	// workflow name.
	GetWorkflow(context.Context, *connect.Request[v16.GetWorkflowRequest]) (*connect.Response[v16.Workflow], error)
	// GetWorkflows returns the Workflows for all specified clusters.
	GetWorkflows(context.Context, *connect.Request[v16.GetWorkflowsRequest]) (*connect.Response[v16.GetWorkflowsResponse], error)
	// PingTablet checks that the specified tablet is awake and responding to
	// RPCs. This command can be blocked by other in-flight operations.
	PingTablet(context.Context, *connect.Request[v16.PingTabletRequest]) (*connect.Response[v16.PingTabletResponse], error)
	// PlannedFailoverShard fails over the shard to a new primary, or away from
	// an old primary. Both the old and new primaries must be reachable and
	// running.
	//
	// NOTE: A planned failover will not consider replicas outside the current
	// shard primary's cell as promotion candidates unless NewPrimary is
	// explicitly provided in the request.
	PlannedFailoverShard(context.Context, *connect.Request[v16.PlannedFailoverShardRequest]) (*connect.Response[v16.PlannedFailoverShardResponse], error)
	// RebuildKeyspaceGraph rebuilds the serving data for a keyspace.
	RebuildKeyspaceGraph(context.Context, *connect.Request[v16.RebuildKeyspaceGraphRequest]) (*connect.Response[v16.RebuildKeyspaceGraphResponse], error)
	// RefreshState reloads the tablet record on the specified tablet.
	RefreshState(context.Context, *connect.Request[v16.RefreshStateRequest]) (*connect.Response[v16.RefreshStateResponse], error)
	// RefreshTabletReplicationSource performs a `CHANGE REPLICATION SOURCE TO`
	// on a tablet to replicate from the current primary in the shard.
	RefreshTabletReplicationSource(context.Context, *connect.Request[v16.RefreshTabletReplicationSourceRequest]) (*connect.Response[v16.RefreshTabletReplicationSourceResponse], error)
	// ReloadSchemas reloads the schema definition across keyspaces, shards, or
	// tablets in one or more clusters, depending on the request fields (see
	// ReloadSchemasRequest for details).
	ReloadSchemas(context.Context, *connect.Request[v16.ReloadSchemasRequest]) (*connect.Response[v16.ReloadSchemasResponse], error)
	// ReloadSchemaShard reloads the schema on all tablets in a shard. This is done on a best-effort basis.
	ReloadSchemaShard(context.Context, *connect.Request[v16.ReloadSchemaShardRequest]) (*connect.Response[v16.ReloadSchemaShardResponse], error)
	// RemoveKeyspaceCell removes the cell from the Cells list for all shards in the keyspace, and the SrvKeyspace for that keyspace in that cell.
	RemoveKeyspaceCell(context.Context, *connect.Request[v16.RemoveKeyspaceCellRequest]) (*connect.Response[v16.RemoveKeyspaceCellResponse], error)
	// RunHealthCheck runs a healthcheck on the tablet.
	RunHealthCheck(context.Context, *connect.Request[v16.RunHealthCheckRequest]) (*connect.Response[v16.RunHealthCheckResponse], error)
	// SetReadOnly sets the tablet to read-only mode.
	SetReadOnly(context.Context, *connect.Request[v16.SetReadOnlyRequest]) (*connect.Response[v16.SetReadOnlyResponse], error)
	// SetReadWrite sets the tablet to read-write mode.
	SetReadWrite(context.Context, *connect.Request[v16.SetReadWriteRequest]) (*connect.Response[v16.SetReadWriteResponse], error)
	// StartReplication runs the underlying database command to start
	// replication on a tablet.
	StartReplication(context.Context, *connect.Request[v16.StartReplicationRequest]) (*connect.Response[v16.StartReplicationResponse], error)
	// StopReplication runs the underlying database command to stop replication
	// on a tablet
	StopReplication(context.Context, *connect.Request[v16.StopReplicationRequest]) (*connect.Response[v16.StopReplicationResponse], error)
	// TabletExternallyPromoted updates the metadata in a cluster's topology
	// to acknowledge a shard primary change performed by an external tool
	// (e.g. orchestrator*).
	//
	// See the Reparenting guide for more information:
	// https://vitess.io/docs/user-guides/configuration-advanced/reparenting/#external-reparenting.
	//
	// * "orchestrator" here refers to external orchestrator, not the newer,
	// Vitess-aware orchestrator, VTOrc.
	TabletExternallyPromoted(context.Context, *connect.Request[v16.TabletExternallyPromotedRequest]) (*connect.Response[v16.TabletExternallyPromotedResponse], error)
	// Validate validates all nodes in a cluster that are reachable from the global replication graph,
	// as well as all tablets in discoverable cells, are consistent
	Validate(context.Context, *connect.Request[v16.ValidateRequest]) (*connect.Response[v161.ValidateResponse], error)
	// ValidateKeyspace validates that all nodes reachable from the specified
	// keyspace are consistent.
	ValidateKeyspace(context.Context, *connect.Request[v16.ValidateKeyspaceRequest]) (*connect.Response[v161.ValidateKeyspaceResponse], error)
	// ValidateSchemaKeyspace validates that the schema on the primary tablet
	// for shard 0 matches the schema on all of the other tablets in the
	// keyspace.
	ValidateSchemaKeyspace(context.Context, *connect.Request[v16.ValidateSchemaKeyspaceRequest]) (*connect.Response[v161.ValidateSchemaKeyspaceResponse], error)
	// ValidateShard validates that that all nodes reachable from the specified shard are consistent.
	ValidateShard(context.Context, *connect.Request[v16.ValidateShardRequest]) (*connect.Response[v161.ValidateShardResponse], error)
	// ValidateVersionKeyspace validates that the version on the primary of
	// shard 0 matches all of the other tablets in the keyspace.
	ValidateVersionKeyspace(context.Context, *connect.Request[v16.ValidateVersionKeyspaceRequest]) (*connect.Response[v161.ValidateVersionKeyspaceResponse], error)
	// ValidateVersionShard validates that the version on the primary matches all of the replicas.
	ValidateVersionShard(context.Context, *connect.Request[v16.ValidateVersionShardRequest]) (*connect.Response[v161.ValidateVersionShardResponse], error)
	// VTExplain provides information on how Vitess plans to execute a
	// particular query.
	VTExplain(context.Context, *connect.Request[v16.VTExplainRequest]) (*connect.Response[v16.VTExplainResponse], error)
}

VTAdminClient is a client for the vtadmin.VTAdmin service.

func NewVTAdminClient

func NewVTAdminClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) VTAdminClient

NewVTAdminClient constructs a client for the vtadmin.VTAdmin service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb() options.

The URL supplied here should be the base URL for the Connect or gRPC server (for example, http://api.acme.com or https://acme.com/grpc).

type VTAdminHandler

type VTAdminHandler interface {
	// CreateKeyspace creates a new keyspace in the given cluster.
	CreateKeyspace(context.Context, *connect.Request[v16.CreateKeyspaceRequest]) (*connect.Response[v16.CreateKeyspaceResponse], error)
	// CreateShard creates a new shard in the given cluster and keyspace.
	CreateShard(context.Context, *connect.Request[v16.CreateShardRequest]) (*connect.Response[v161.CreateShardResponse], error)
	// DeleteKeyspace deletes a keyspace in the given cluster.
	DeleteKeyspace(context.Context, *connect.Request[v16.DeleteKeyspaceRequest]) (*connect.Response[v161.DeleteKeyspaceResponse], error)
	// DeleteShard deletes one or more shards in the given cluster and keyspace.
	DeleteShards(context.Context, *connect.Request[v16.DeleteShardsRequest]) (*connect.Response[v161.DeleteShardsResponse], error)
	// DeleteTablet deletes a tablet from the topology
	DeleteTablet(context.Context, *connect.Request[v16.DeleteTabletRequest]) (*connect.Response[v16.DeleteTabletResponse], error)
	// EmergencyFailoverShard fails over a shard to a new primary. It assumes
	// the old primary is dead or otherwise not responding.
	EmergencyFailoverShard(context.Context, *connect.Request[v16.EmergencyFailoverShardRequest]) (*connect.Response[v16.EmergencyFailoverShardResponse], error)
	// FindSchema returns a single Schema that matches the provided table name
	// across all specified clusters IDs. Not specifying a set of cluster IDs
	// causes the search to span all configured clusters.
	//
	// An error occurs if either no table exists across any of the clusters with
	// the specified table name, or if multiple tables exist with that name.
	FindSchema(context.Context, *connect.Request[v16.FindSchemaRequest]) (*connect.Response[v16.Schema], error)
	// GetBackups returns backups grouped by cluster.
	GetBackups(context.Context, *connect.Request[v16.GetBackupsRequest]) (*connect.Response[v16.GetBackupsResponse], error)
	// GetCellInfos returns the CellInfo objects for the specified clusters.
	//
	// Callers may optionally restrict the set of CellInfos, or restrict the
	// response to include only cell names.
	GetCellInfos(context.Context, *connect.Request[v16.GetCellInfosRequest]) (*connect.Response[v16.GetCellInfosResponse], error)
	// GetCellsAliases returns the CellsAliases data for the specified clusters.
	GetCellsAliases(context.Context, *connect.Request[v16.GetCellsAliasesRequest]) (*connect.Response[v16.GetCellsAliasesResponse], error)
	// GetClusters returns all configured clusters.
	GetClusters(context.Context, *connect.Request[v16.GetClustersRequest]) (*connect.Response[v16.GetClustersResponse], error)
	// GetFullStatus returns the full status of MySQL including the replication information, semi-sync information, GTID information among others
	GetFullStatus(context.Context, *connect.Request[v16.GetFullStatusRequest]) (*connect.Response[v161.GetFullStatusResponse], error)
	// GetGates returns all gates across all the specified clusters.
	GetGates(context.Context, *connect.Request[v16.GetGatesRequest]) (*connect.Response[v16.GetGatesResponse], error)
	// GetKeyspace returns a keyspace by name in the specified cluster.
	GetKeyspace(context.Context, *connect.Request[v16.GetKeyspaceRequest]) (*connect.Response[v16.Keyspace], error)
	// GetKeyspaces returns all keyspaces across the specified clusters.
	GetKeyspaces(context.Context, *connect.Request[v16.GetKeyspacesRequest]) (*connect.Response[v16.GetKeyspacesResponse], error)
	// GetSchema returns the schema for the specified (cluster, keyspace, table)
	// tuple.
	GetSchema(context.Context, *connect.Request[v16.GetSchemaRequest]) (*connect.Response[v16.Schema], error)
	// GetSchemas returns all schemas across the specified clusters.
	GetSchemas(context.Context, *connect.Request[v16.GetSchemasRequest]) (*connect.Response[v16.GetSchemasResponse], error)
	// GetShardReplicationPositions returns shard replication positions grouped
	// by cluster.
	GetShardReplicationPositions(context.Context, *connect.Request[v16.GetShardReplicationPositionsRequest]) (*connect.Response[v16.GetShardReplicationPositionsResponse], error)
	// GetSrvVSchema returns the SrvVSchema for the given cluster and cell.
	GetSrvVSchema(context.Context, *connect.Request[v16.GetSrvVSchemaRequest]) (*connect.Response[v16.SrvVSchema], error)
	// GetSrvVSchemas returns all SrvVSchemas across all (or specified) clusters
	// and cells.
	GetSrvVSchemas(context.Context, *connect.Request[v16.GetSrvVSchemasRequest]) (*connect.Response[v16.GetSrvVSchemasResponse], error)
	// GetTablet looks up a tablet by hostname across all clusters and returns
	// the result.
	GetTablet(context.Context, *connect.Request[v16.GetTabletRequest]) (*connect.Response[v16.Tablet], error)
	// GetTablets returns all tablets across all the specified clusters.
	GetTablets(context.Context, *connect.Request[v16.GetTabletsRequest]) (*connect.Response[v16.GetTabletsResponse], error)
	// GetTopologyPath returns the cell located at the specified path in the topology server.
	GetTopologyPath(context.Context, *connect.Request[v16.GetTopologyPathRequest]) (*connect.Response[v161.GetTopologyPathResponse], error)
	// GetVSchema returns a VSchema for the specified keyspace in the specified
	// cluster.
	GetVSchema(context.Context, *connect.Request[v16.GetVSchemaRequest]) (*connect.Response[v16.VSchema], error)
	// GetVSchemas returns the VSchemas for all specified clusters.
	GetVSchemas(context.Context, *connect.Request[v16.GetVSchemasRequest]) (*connect.Response[v16.GetVSchemasResponse], error)
	// GetVtctlds returns the Vtctlds for all specified clusters.
	GetVtctlds(context.Context, *connect.Request[v16.GetVtctldsRequest]) (*connect.Response[v16.GetVtctldsResponse], error)
	// GetWorkflow returns a single Workflow for a given cluster, keyspace, and
	// workflow name.
	GetWorkflow(context.Context, *connect.Request[v16.GetWorkflowRequest]) (*connect.Response[v16.Workflow], error)
	// GetWorkflows returns the Workflows for all specified clusters.
	GetWorkflows(context.Context, *connect.Request[v16.GetWorkflowsRequest]) (*connect.Response[v16.GetWorkflowsResponse], error)
	// PingTablet checks that the specified tablet is awake and responding to
	// RPCs. This command can be blocked by other in-flight operations.
	PingTablet(context.Context, *connect.Request[v16.PingTabletRequest]) (*connect.Response[v16.PingTabletResponse], error)
	// PlannedFailoverShard fails over the shard to a new primary, or away from
	// an old primary. Both the old and new primaries must be reachable and
	// running.
	//
	// NOTE: A planned failover will not consider replicas outside the current
	// shard primary's cell as promotion candidates unless NewPrimary is
	// explicitly provided in the request.
	PlannedFailoverShard(context.Context, *connect.Request[v16.PlannedFailoverShardRequest]) (*connect.Response[v16.PlannedFailoverShardResponse], error)
	// RebuildKeyspaceGraph rebuilds the serving data for a keyspace.
	RebuildKeyspaceGraph(context.Context, *connect.Request[v16.RebuildKeyspaceGraphRequest]) (*connect.Response[v16.RebuildKeyspaceGraphResponse], error)
	// RefreshState reloads the tablet record on the specified tablet.
	RefreshState(context.Context, *connect.Request[v16.RefreshStateRequest]) (*connect.Response[v16.RefreshStateResponse], error)
	// RefreshTabletReplicationSource performs a `CHANGE REPLICATION SOURCE TO`
	// on a tablet to replicate from the current primary in the shard.
	RefreshTabletReplicationSource(context.Context, *connect.Request[v16.RefreshTabletReplicationSourceRequest]) (*connect.Response[v16.RefreshTabletReplicationSourceResponse], error)
	// ReloadSchemas reloads the schema definition across keyspaces, shards, or
	// tablets in one or more clusters, depending on the request fields (see
	// ReloadSchemasRequest for details).
	ReloadSchemas(context.Context, *connect.Request[v16.ReloadSchemasRequest]) (*connect.Response[v16.ReloadSchemasResponse], error)
	// ReloadSchemaShard reloads the schema on all tablets in a shard. This is done on a best-effort basis.
	ReloadSchemaShard(context.Context, *connect.Request[v16.ReloadSchemaShardRequest]) (*connect.Response[v16.ReloadSchemaShardResponse], error)
	// RemoveKeyspaceCell removes the cell from the Cells list for all shards in the keyspace, and the SrvKeyspace for that keyspace in that cell.
	RemoveKeyspaceCell(context.Context, *connect.Request[v16.RemoveKeyspaceCellRequest]) (*connect.Response[v16.RemoveKeyspaceCellResponse], error)
	// RunHealthCheck runs a healthcheck on the tablet.
	RunHealthCheck(context.Context, *connect.Request[v16.RunHealthCheckRequest]) (*connect.Response[v16.RunHealthCheckResponse], error)
	// SetReadOnly sets the tablet to read-only mode.
	SetReadOnly(context.Context, *connect.Request[v16.SetReadOnlyRequest]) (*connect.Response[v16.SetReadOnlyResponse], error)
	// SetReadWrite sets the tablet to read-write mode.
	SetReadWrite(context.Context, *connect.Request[v16.SetReadWriteRequest]) (*connect.Response[v16.SetReadWriteResponse], error)
	// StartReplication runs the underlying database command to start
	// replication on a tablet.
	StartReplication(context.Context, *connect.Request[v16.StartReplicationRequest]) (*connect.Response[v16.StartReplicationResponse], error)
	// StopReplication runs the underlying database command to stop replication
	// on a tablet
	StopReplication(context.Context, *connect.Request[v16.StopReplicationRequest]) (*connect.Response[v16.StopReplicationResponse], error)
	// TabletExternallyPromoted updates the metadata in a cluster's topology
	// to acknowledge a shard primary change performed by an external tool
	// (e.g. orchestrator*).
	//
	// See the Reparenting guide for more information:
	// https://vitess.io/docs/user-guides/configuration-advanced/reparenting/#external-reparenting.
	//
	// * "orchestrator" here refers to external orchestrator, not the newer,
	// Vitess-aware orchestrator, VTOrc.
	TabletExternallyPromoted(context.Context, *connect.Request[v16.TabletExternallyPromotedRequest]) (*connect.Response[v16.TabletExternallyPromotedResponse], error)
	// Validate validates all nodes in a cluster that are reachable from the global replication graph,
	// as well as all tablets in discoverable cells, are consistent
	Validate(context.Context, *connect.Request[v16.ValidateRequest]) (*connect.Response[v161.ValidateResponse], error)
	// ValidateKeyspace validates that all nodes reachable from the specified
	// keyspace are consistent.
	ValidateKeyspace(context.Context, *connect.Request[v16.ValidateKeyspaceRequest]) (*connect.Response[v161.ValidateKeyspaceResponse], error)
	// ValidateSchemaKeyspace validates that the schema on the primary tablet
	// for shard 0 matches the schema on all of the other tablets in the
	// keyspace.
	ValidateSchemaKeyspace(context.Context, *connect.Request[v16.ValidateSchemaKeyspaceRequest]) (*connect.Response[v161.ValidateSchemaKeyspaceResponse], error)
	// ValidateShard validates that that all nodes reachable from the specified shard are consistent.
	ValidateShard(context.Context, *connect.Request[v16.ValidateShardRequest]) (*connect.Response[v161.ValidateShardResponse], error)
	// ValidateVersionKeyspace validates that the version on the primary of
	// shard 0 matches all of the other tablets in the keyspace.
	ValidateVersionKeyspace(context.Context, *connect.Request[v16.ValidateVersionKeyspaceRequest]) (*connect.Response[v161.ValidateVersionKeyspaceResponse], error)
	// ValidateVersionShard validates that the version on the primary matches all of the replicas.
	ValidateVersionShard(context.Context, *connect.Request[v16.ValidateVersionShardRequest]) (*connect.Response[v161.ValidateVersionShardResponse], error)
	// VTExplain provides information on how Vitess plans to execute a
	// particular query.
	VTExplain(context.Context, *connect.Request[v16.VTExplainRequest]) (*connect.Response[v16.VTExplainResponse], error)
}

VTAdminHandler is an implementation of the vtadmin.VTAdmin service.

Jump to

Keyboard shortcuts

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