зеркало из https://github.com/github/vitess-gh.git
178 строки
8.6 KiB
Protocol Buffer
178 строки
8.6 KiB
Protocol Buffer
/*
|
|
Copyright 2019 The Vitess Authors.
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
you may not use this file except in compliance with the License.
|
|
You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
See the License for the specific language governing permissions and
|
|
limitations under the License.
|
|
*/
|
|
|
|
// This file contains the service definition for making management API
|
|
// calls to VtTablet.
|
|
|
|
syntax = "proto3";
|
|
option go_package = "vitess.io/vitess/go/vt/proto/tabletmanagerservice";
|
|
|
|
package tabletmanagerservice;
|
|
|
|
import "tabletmanagerdata.proto";
|
|
|
|
// TabletManager is a service definition for tabletmanagerdata.TabletManager.
|
|
service TabletManager {
|
|
//
|
|
// Various read-only methods
|
|
//
|
|
|
|
// Ping returns the input payload
|
|
rpc Ping(tabletmanagerdata.PingRequest) returns (tabletmanagerdata.PingResponse) {};
|
|
|
|
// Sleep sleeps for the provided duration
|
|
rpc Sleep(tabletmanagerdata.SleepRequest) returns (tabletmanagerdata.SleepResponse) {};
|
|
|
|
// ExecuteHook executes the hook remotely
|
|
rpc ExecuteHook(tabletmanagerdata.ExecuteHookRequest) returns (tabletmanagerdata.ExecuteHookResponse) {};
|
|
|
|
// GetSchema asks the tablet for its schema
|
|
rpc GetSchema(tabletmanagerdata.GetSchemaRequest) returns (tabletmanagerdata.GetSchemaResponse) {};
|
|
|
|
// GetPermissions asks the tablet for its permissions
|
|
rpc GetPermissions(tabletmanagerdata.GetPermissionsRequest) returns (tabletmanagerdata.GetPermissionsResponse) {};
|
|
|
|
//
|
|
// Various read-write methods
|
|
//
|
|
|
|
rpc SetReadOnly(tabletmanagerdata.SetReadOnlyRequest) returns (tabletmanagerdata.SetReadOnlyResponse) {};
|
|
|
|
rpc SetReadWrite(tabletmanagerdata.SetReadWriteRequest) returns (tabletmanagerdata.SetReadWriteResponse) {};
|
|
|
|
// ChangeType asks the remote tablet to change its type
|
|
rpc ChangeType(tabletmanagerdata.ChangeTypeRequest) returns (tabletmanagerdata.ChangeTypeResponse) {};
|
|
|
|
rpc RefreshState(tabletmanagerdata.RefreshStateRequest) returns (tabletmanagerdata.RefreshStateResponse) {};
|
|
|
|
rpc RunHealthCheck(tabletmanagerdata.RunHealthCheckRequest) returns (tabletmanagerdata.RunHealthCheckResponse) {};
|
|
|
|
rpc ReloadSchema(tabletmanagerdata.ReloadSchemaRequest) returns (tabletmanagerdata.ReloadSchemaResponse) {};
|
|
|
|
rpc PreflightSchema(tabletmanagerdata.PreflightSchemaRequest) returns (tabletmanagerdata.PreflightSchemaResponse) {};
|
|
|
|
rpc ApplySchema(tabletmanagerdata.ApplySchemaRequest) returns (tabletmanagerdata.ApplySchemaResponse) {};
|
|
|
|
rpc LockTables(tabletmanagerdata.LockTablesRequest) returns (tabletmanagerdata.LockTablesResponse) {};
|
|
|
|
rpc UnlockTables(tabletmanagerdata.UnlockTablesRequest) returns (tabletmanagerdata.UnlockTablesResponse) {};
|
|
|
|
rpc ExecuteQuery(tabletmanagerdata.ExecuteQueryRequest) returns (tabletmanagerdata.ExecuteQueryResponse) {};
|
|
|
|
rpc ExecuteFetchAsDba(tabletmanagerdata.ExecuteFetchAsDbaRequest) returns (tabletmanagerdata.ExecuteFetchAsDbaResponse) {};
|
|
|
|
rpc ExecuteFetchAsAllPrivs(tabletmanagerdata.ExecuteFetchAsAllPrivsRequest) returns (tabletmanagerdata.ExecuteFetchAsAllPrivsResponse) {};
|
|
|
|
rpc ExecuteFetchAsApp(tabletmanagerdata.ExecuteFetchAsAppRequest) returns (tabletmanagerdata.ExecuteFetchAsAppResponse) {};
|
|
|
|
//
|
|
// Replication related methods
|
|
//
|
|
|
|
// ReplicationStatus returns the current replication status.
|
|
rpc ReplicationStatus(tabletmanagerdata.ReplicationStatusRequest) returns (tabletmanagerdata.ReplicationStatusResponse) {};
|
|
|
|
// PrimaryStatus returns the current primary status.
|
|
rpc PrimaryStatus(tabletmanagerdata.PrimaryStatusRequest) returns (tabletmanagerdata.PrimaryStatusResponse) {};
|
|
|
|
// PrimaryPosition returns the current primary position
|
|
rpc PrimaryPosition(tabletmanagerdata.PrimaryPositionRequest) returns (tabletmanagerdata.PrimaryPositionResponse) {};
|
|
|
|
// WaitForPosition waits for the position to be reached
|
|
rpc WaitForPosition(tabletmanagerdata.WaitForPositionRequest) returns (tabletmanagerdata.WaitForPositionResponse) {};
|
|
|
|
// StopReplication makes mysql stop its replication
|
|
rpc StopReplication(tabletmanagerdata.StopReplicationRequest) returns (tabletmanagerdata.StopReplicationResponse) {};
|
|
|
|
// StopReplicationMinimum stops the mysql replication after it reaches
|
|
// the provided minimum point
|
|
rpc StopReplicationMinimum(tabletmanagerdata.StopReplicationMinimumRequest) returns (tabletmanagerdata.StopReplicationMinimumResponse) {};
|
|
|
|
// StartReplication starts the mysql replication
|
|
rpc StartReplication(tabletmanagerdata.StartReplicationRequest) returns (tabletmanagerdata.StartReplicationResponse) {};
|
|
|
|
// StartReplicationUnitAfter starts the mysql replication until and including
|
|
// the provided position
|
|
rpc StartReplicationUntilAfter(tabletmanagerdata.StartReplicationUntilAfterRequest) returns (tabletmanagerdata.StartReplicationUntilAfterResponse) {};
|
|
|
|
// GetReplicas asks for the list of mysql replicas
|
|
rpc GetReplicas(tabletmanagerdata.GetReplicasRequest) returns (tabletmanagerdata.GetReplicasResponse) {};
|
|
|
|
// VReplication API
|
|
rpc VReplicationExec(tabletmanagerdata.VReplicationExecRequest) returns(tabletmanagerdata.VReplicationExecResponse) {};
|
|
rpc VReplicationWaitForPos(tabletmanagerdata.VReplicationWaitForPosRequest) returns(tabletmanagerdata.VReplicationWaitForPosResponse) {};
|
|
|
|
// VDiff API
|
|
rpc VDiff(tabletmanagerdata.VDiffRequest) returns(tabletmanagerdata.VDiffResponse) {};
|
|
|
|
//
|
|
// Reparenting related functions
|
|
//
|
|
|
|
// ResetReplication makes the target not replicating
|
|
rpc ResetReplication(tabletmanagerdata.ResetReplicationRequest) returns (tabletmanagerdata.ResetReplicationResponse) {};
|
|
|
|
// InitPrimary initializes the tablet as a primary
|
|
rpc InitPrimary(tabletmanagerdata.InitPrimaryRequest) returns (tabletmanagerdata.InitPrimaryResponse) {};
|
|
|
|
// PopulateReparentJournal tells the tablet to add an entry to its
|
|
// reparent journal
|
|
rpc PopulateReparentJournal(tabletmanagerdata.PopulateReparentJournalRequest) returns (tabletmanagerdata.PopulateReparentJournalResponse) {};
|
|
|
|
// InitReplica tells the tablet to reparent to the primary unconditionally
|
|
rpc InitReplica(tabletmanagerdata.InitReplicaRequest) returns (tabletmanagerdata.InitReplicaResponse) {};
|
|
|
|
// DemotePrimary tells the soon-to-be-former primary it's gonna change
|
|
rpc DemotePrimary(tabletmanagerdata.DemotePrimaryRequest) returns (tabletmanagerdata.DemotePrimaryResponse) {};
|
|
|
|
// UndoDemotePrimary reverts all changes made by DemotePrimary
|
|
rpc UndoDemotePrimary(tabletmanagerdata.UndoDemotePrimaryRequest) returns (tabletmanagerdata.UndoDemotePrimaryResponse) {};
|
|
|
|
// ReplicaWasPromoted tells the remote tablet it is now the primary
|
|
rpc ReplicaWasPromoted(tabletmanagerdata.ReplicaWasPromotedRequest) returns (tabletmanagerdata.ReplicaWasPromotedResponse) {};
|
|
|
|
// ResetReplicationParameters resets the replica replication parameters
|
|
rpc ResetReplicationParameters(tabletmanagerdata.ResetReplicationParametersRequest) returns (tabletmanagerdata.ResetReplicationParametersResponse) {};
|
|
|
|
// FullStatus collects and returns the full status of MySQL including the replication information, semi-sync information, GTID information among others
|
|
rpc FullStatus(tabletmanagerdata.FullStatusRequest) returns (tabletmanagerdata.FullStatusResponse) {};
|
|
|
|
// SetReplicationSource tells the replica to reparent
|
|
rpc SetReplicationSource(tabletmanagerdata.SetReplicationSourceRequest) returns (tabletmanagerdata.SetReplicationSourceResponse) {};
|
|
|
|
// ReplicaWasRestarted tells the remote tablet its primary has changed
|
|
rpc ReplicaWasRestarted(tabletmanagerdata.ReplicaWasRestartedRequest) returns (tabletmanagerdata.ReplicaWasRestartedResponse) {};
|
|
|
|
// StopReplicationAndGetStatus stops MySQL replication, and returns the
|
|
// replication status
|
|
rpc StopReplicationAndGetStatus(tabletmanagerdata.StopReplicationAndGetStatusRequest) returns (tabletmanagerdata.StopReplicationAndGetStatusResponse) {};
|
|
|
|
// PromoteReplica makes the replica the new primary
|
|
rpc PromoteReplica(tabletmanagerdata.PromoteReplicaRequest) returns (tabletmanagerdata.PromoteReplicaResponse) {};
|
|
|
|
//
|
|
// Backup related methods
|
|
//
|
|
|
|
rpc Backup(tabletmanagerdata.BackupRequest) returns (stream tabletmanagerdata.BackupResponse) {};
|
|
|
|
// RestoreFromBackup deletes all local data and restores it from the latest backup.
|
|
rpc RestoreFromBackup(tabletmanagerdata.RestoreFromBackupRequest) returns (stream tabletmanagerdata.RestoreFromBackupResponse) {};
|
|
|
|
// Generic VExec request. Can be used for various purposes
|
|
rpc VExec(tabletmanagerdata.VExecRequest) returns(tabletmanagerdata.VExecResponse) {};
|
|
}
|