vitess.io/vitess@v0.16.2/proto/vtadmin.proto (about)

     1  /*
     2  Copyright 2020 The Vitess Authors.
     3  
     4  Licensed under the Apache License, Version 2.0 (the "License");
     5  you may not use this file except in compliance with the License.
     6  You may obtain a copy of the License at
     7  
     8      http://www.apache.org/licenses/LICENSE-2.0
     9  
    10  Unless required by applicable law or agreed to in writing, software
    11  distributed under the License is distributed on an "AS IS" BASIS,
    12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  See the License for the specific language governing permissions and
    14  limitations under the License.
    15  */
    16  
    17  // This package contains the types used by VTAdmin (and later an RPC service).
    18  
    19  syntax = "proto3";
    20  option go_package = "vitess.io/vitess/go/vt/proto/vtadmin";
    21  
    22  package vtadmin;
    23  
    24  import "logutil.proto";
    25  import "mysqlctl.proto";
    26  import "tabletmanagerdata.proto";
    27  import "topodata.proto";
    28  import "vschema.proto";
    29  import "vtctldata.proto";
    30  
    31  /* Services */
    32  
    33  // VTAdmin is the Vitess Admin API service. It provides RPCs that operate on
    34  // across a range of Vitess clusters.
    35  service VTAdmin {
    36      // CreateKeyspace creates a new keyspace in the given cluster.
    37      rpc CreateKeyspace(CreateKeyspaceRequest) returns (CreateKeyspaceResponse) {};
    38      // CreateShard creates a new shard in the given cluster and keyspace.
    39      rpc CreateShard(CreateShardRequest) returns (vtctldata.CreateShardResponse) {};
    40      // DeleteKeyspace deletes a keyspace in the given cluster.
    41      rpc DeleteKeyspace(DeleteKeyspaceRequest) returns (vtctldata.DeleteKeyspaceResponse) {};
    42      // DeleteShard deletes one or more shards in the given cluster and keyspace.
    43      rpc DeleteShards(DeleteShardsRequest) returns (vtctldata.DeleteShardsResponse) {};
    44      // DeleteTablet deletes a tablet from the topology
    45      rpc DeleteTablet(DeleteTabletRequest) returns (DeleteTabletResponse) {};
    46      // EmergencyFailoverShard fails over a shard to a new primary. It assumes
    47      // the old primary is dead or otherwise not responding.
    48      rpc EmergencyFailoverShard(EmergencyFailoverShardRequest) returns (EmergencyFailoverShardResponse) {};
    49      // FindSchema returns a single Schema that matches the provided table name
    50      // across all specified clusters IDs. Not specifying a set of cluster IDs
    51      // causes the search to span all configured clusters.
    52      //
    53      // An error occurs if either no table exists across any of the clusters with
    54      // the specified table name, or if multiple tables exist with that name.
    55      rpc FindSchema(FindSchemaRequest) returns (Schema) {};
    56      // GetBackups returns backups grouped by cluster.
    57      rpc GetBackups(GetBackupsRequest) returns (GetBackupsResponse) {};
    58      // GetCellInfos returns the CellInfo objects for the specified clusters.
    59      //
    60      // Callers may optionally restrict the set of CellInfos, or restrict the
    61      // response to include only cell names.
    62      rpc GetCellInfos(GetCellInfosRequest) returns (GetCellInfosResponse) {};
    63      // GetCellsAliases returns the CellsAliases data for the specified clusters.
    64      rpc GetCellsAliases(GetCellsAliasesRequest) returns (GetCellsAliasesResponse) {};
    65      // GetClusters returns all configured clusters.
    66      rpc GetClusters(GetClustersRequest) returns (GetClustersResponse) {};
    67      // GetFullStatus returns the full status of MySQL including the replication information, semi-sync information, GTID information among others
    68      rpc GetFullStatus(GetFullStatusRequest) returns (vtctldata.GetFullStatusResponse) {};
    69      // GetGates returns all gates across all the specified clusters.
    70      rpc GetGates(GetGatesRequest) returns (GetGatesResponse) {};
    71      // GetKeyspace returns a keyspace by name in the specified cluster.
    72      rpc GetKeyspace(GetKeyspaceRequest) returns (Keyspace) {};
    73      // GetKeyspaces returns all keyspaces across the specified clusters.
    74      rpc GetKeyspaces(GetKeyspacesRequest) returns (GetKeyspacesResponse) {};
    75      // GetSchema returns the schema for the specified (cluster, keyspace, table)
    76      // tuple.
    77      rpc GetSchema(GetSchemaRequest) returns (Schema) {};
    78      // GetSchemas returns all schemas across the specified clusters.
    79      rpc GetSchemas(GetSchemasRequest) returns (GetSchemasResponse) {};
    80      // GetShardReplicationPositions returns shard replication positions grouped
    81      // by cluster.
    82      rpc GetShardReplicationPositions(GetShardReplicationPositionsRequest) returns (GetShardReplicationPositionsResponse) {};
    83      // GetSrvVSchema returns the SrvVSchema for the given cluster and cell.
    84      rpc GetSrvVSchema (GetSrvVSchemaRequest) returns (SrvVSchema) {};
    85      // GetSrvVSchemas returns all SrvVSchemas across all (or specified) clusters
    86      // and cells.
    87      rpc GetSrvVSchemas(GetSrvVSchemasRequest) returns (GetSrvVSchemasResponse) {};
    88      // GetTablet looks up a tablet by hostname across all clusters and returns
    89      // the result.
    90      rpc GetTablet(GetTabletRequest) returns (Tablet) {};
    91      // GetTablets returns all tablets across all the specified clusters.
    92      rpc GetTablets(GetTabletsRequest) returns (GetTabletsResponse) {};
    93      // GetTopologyPath returns the cell located at the specified path in the topology server.
    94      rpc GetTopologyPath(GetTopologyPathRequest) returns (vtctldata.GetTopologyPathResponse){};
    95      // GetVSchema returns a VSchema for the specified keyspace in the specified
    96      // cluster.
    97      rpc GetVSchema(GetVSchemaRequest) returns (VSchema) {};
    98      // GetVSchemas returns the VSchemas for all specified clusters.
    99      rpc GetVSchemas(GetVSchemasRequest) returns (GetVSchemasResponse) {};
   100      // GetVtctlds returns the Vtctlds for all specified clusters.
   101      rpc GetVtctlds(GetVtctldsRequest) returns (GetVtctldsResponse) {};
   102      // GetWorkflow returns a single Workflow for a given cluster, keyspace, and
   103      // workflow name.
   104      rpc GetWorkflow(GetWorkflowRequest) returns (Workflow) {};
   105      // GetWorkflows returns the Workflows for all specified clusters.
   106      rpc GetWorkflows(GetWorkflowsRequest) returns (GetWorkflowsResponse) {};
   107      // PingTablet checks that the specified tablet is awake and responding to
   108      // RPCs. This command can be blocked by other in-flight operations.
   109      rpc PingTablet(PingTabletRequest) returns (PingTabletResponse) {};
   110      // PlannedFailoverShard fails over the shard to a new primary, or away from
   111      // an old primary. Both the old and new primaries must be reachable and
   112      // running.
   113      //
   114      // NOTE: A planned failover will not consider replicas outside the current
   115      // shard primary's cell as promotion candidates unless NewPrimary is
   116      // explicitly provided in the request.
   117      rpc PlannedFailoverShard(PlannedFailoverShardRequest) returns (PlannedFailoverShardResponse) {};
   118      // RebuildKeyspaceGraph rebuilds the serving data for a keyspace.
   119      rpc RebuildKeyspaceGraph(RebuildKeyspaceGraphRequest) returns (RebuildKeyspaceGraphResponse) {};
   120      // RefreshState reloads the tablet record on the specified tablet.
   121      rpc RefreshState(RefreshStateRequest) returns (RefreshStateResponse) {};
   122      // RefreshTabletReplicationSource performs a `CHANGE REPLICATION SOURCE TO`
   123      // on a tablet to replicate from the current primary in the shard.
   124      rpc RefreshTabletReplicationSource(RefreshTabletReplicationSourceRequest) returns (RefreshTabletReplicationSourceResponse) {};
   125      // ReloadSchemas reloads the schema definition across keyspaces, shards, or
   126      // tablets in one or more clusters, depending on the request fields (see
   127      // ReloadSchemasRequest for details).
   128      rpc ReloadSchemas(ReloadSchemasRequest) returns (ReloadSchemasResponse) {};
   129      // ReloadSchemaShard reloads the schema on all tablets in a shard. This is done on a best-effort basis.
   130      rpc ReloadSchemaShard(ReloadSchemaShardRequest) returns (ReloadSchemaShardResponse) {};
   131      // RemoveKeyspaceCell removes the cell from the Cells list for all shards in the keyspace, and the SrvKeyspace for that keyspace in that cell.
   132      rpc RemoveKeyspaceCell(RemoveKeyspaceCellRequest) returns (RemoveKeyspaceCellResponse) {};
   133      // RunHealthCheck runs a healthcheck on the tablet.
   134      rpc RunHealthCheck(RunHealthCheckRequest) returns (RunHealthCheckResponse) {};
   135      // SetReadOnly sets the tablet to read-only mode.
   136      rpc SetReadOnly(SetReadOnlyRequest) returns (SetReadOnlyResponse) {};
   137      // SetReadWrite sets the tablet to read-write mode.
   138      rpc SetReadWrite(SetReadWriteRequest) returns (SetReadWriteResponse) {};
   139      // StartReplication runs the underlying database command to start
   140      // replication on a tablet.
   141      rpc StartReplication(StartReplicationRequest) returns (StartReplicationResponse) {};
   142      // StopReplication runs the underlying database command to stop replication
   143      // on a tablet
   144      rpc StopReplication(StopReplicationRequest) returns (StopReplicationResponse) {};
   145      // TabletExternallyPromoted updates the metadata in a cluster's topology
   146      // to acknowledge a shard primary change performed by an external tool
   147      // (e.g. orchestrator*).
   148      //
   149      // See the Reparenting guide for more information:
   150      // https://vitess.io/docs/user-guides/configuration-advanced/reparenting/#external-reparenting.
   151      //
   152      // * "orchestrator" here refers to external orchestrator, not the newer,
   153      // Vitess-aware orchestrator, VTOrc.
   154      rpc TabletExternallyPromoted(TabletExternallyPromotedRequest) returns (TabletExternallyPromotedResponse) {};
   155      // Validate validates all nodes in a cluster that are reachable from the global replication graph,
   156      // as well as all tablets in discoverable cells, are consistent
   157      rpc Validate(ValidateRequest) returns (vtctldata.ValidateResponse) {};
   158      // ValidateKeyspace validates that all nodes reachable from the specified
   159      // keyspace are consistent.
   160      rpc ValidateKeyspace(ValidateKeyspaceRequest) returns (vtctldata.ValidateKeyspaceResponse) {};
   161      // ValidateSchemaKeyspace validates that the schema on the primary tablet
   162      // for shard 0 matches the schema on all of the other tablets in the
   163      // keyspace.
   164      rpc ValidateSchemaKeyspace(ValidateSchemaKeyspaceRequest) returns (vtctldata.ValidateSchemaKeyspaceResponse) {};
   165      // ValidateShard validates that that all nodes reachable from the specified shard are consistent.
   166      rpc ValidateShard(ValidateShardRequest) returns (vtctldata.ValidateShardResponse) {};
   167      // ValidateVersionKeyspace validates that the version on the primary of
   168      // shard 0 matches all of the other tablets in the keyspace.
   169      rpc ValidateVersionKeyspace(ValidateVersionKeyspaceRequest) returns (vtctldata.ValidateVersionKeyspaceResponse) {};
   170      // ValidateVersionShard validates that the version on the primary matches all of the replicas.
   171      rpc ValidateVersionShard(ValidateVersionShardRequest) returns (vtctldata.ValidateVersionShardResponse) {};
   172      // VTExplain provides information on how Vitess plans to execute a
   173      // particular query.
   174      rpc VTExplain(VTExplainRequest) returns (VTExplainResponse) {};
   175  }
   176  
   177  /* Data types */
   178  
   179  // Cluster represents information about a Vitess cluster.
   180  message Cluster {
   181      string id = 1;
   182      string name = 2;
   183  }
   184  
   185  message ClusterBackup {
   186      Cluster cluster = 1;
   187      mysqlctl.BackupInfo backup = 2;
   188  }
   189  
   190  message ClusterCellsAliases {
   191      Cluster cluster = 1;
   192      map<string, topodata.CellsAlias> aliases = 2;
   193  }
   194  
   195  message ClusterCellInfo {
   196      Cluster cluster = 1;
   197      string name = 2;
   198      // CellInfo contains the data for the cell.
   199      //
   200      // It may be nil if the GetCellsInfosRequest specified NamesOnly.
   201      topodata.CellInfo cell_info = 3;
   202  }
   203  
   204  message ClusterShardReplicationPosition {
   205      Cluster cluster = 1;
   206      string keyspace = 2;
   207      string shard = 3;
   208      vtctldata.ShardReplicationPositionsResponse position_info = 4;
   209  }
   210  
   211  message ClusterWorkflows {
   212      repeated Workflow workflows = 1;
   213      // Warnings is a list of non-fatal errors encountered when fetching
   214      // workflows for a particular cluster.
   215      repeated string warnings = 2;
   216  }
   217  
   218  // Keyspace represents information about a keyspace in a particular Vitess
   219  // cluster.
   220  message Keyspace {
   221      Cluster cluster = 1;
   222      vtctldata.Keyspace keyspace = 2;
   223      map<string, vtctldata.Shard> shards = 3;
   224  }
   225  
   226  message Schema {
   227      Cluster cluster = 1;
   228      string keyspace = 2;
   229  
   230      repeated tabletmanagerdata.TableDefinition table_definitions = 3;
   231      // TableSizes is a mapping of table name to TableSize information.
   232      map<string, TableSize> table_sizes = 4;
   233  
   234      message ShardTableSize {
   235          uint64 row_count = 1;
   236          uint64 data_length = 2;
   237      }
   238  
   239      // TableSize aggregates table size information across all shards containing
   240      // in the given keyspace and cluster, as well as per-shard size information.
   241      message TableSize {
   242          uint64 row_count = 1;
   243          uint64 data_length = 2;
   244          map<string, ShardTableSize> by_shard = 3;
   245      }
   246  }
   247  
   248  // Shard groups the vtctldata information about a shard record together with
   249  // the Vitess cluster it belongs to.
   250  message Shard {
   251      Cluster cluster = 1;
   252      vtctldata.Shard shard = 2;
   253  }
   254  
   255  message SrvVSchema {
   256      string cell = 1;
   257      Cluster cluster = 2;
   258      vschema.SrvVSchema srv_v_schema = 3;
   259  }
   260  
   261  // Tablet groups the topo information of a tablet together with the Vitess
   262  // cluster it belongs to.
   263  message Tablet {
   264      Cluster cluster = 1;
   265      topodata.Tablet tablet = 2;
   266  
   267      enum ServingState {
   268          UNKNOWN = 0;
   269          SERVING = 1;
   270          NOT_SERVING = 2;
   271      }
   272  
   273      ServingState state = 3;
   274      string FQDN = 4;
   275  }
   276  
   277  // VSchema represents the vschema for a keyspace in the cluster it belongs to.
   278  message VSchema {
   279      Cluster cluster = 1;
   280      // Name is the name of the keyspace this VSchema is for.
   281      string name = 2;
   282      vschema.Keyspace v_schema = 3;
   283  }
   284  
   285  // Vtctld represents information about a single Vtctld host.
   286  message Vtctld {
   287      string hostname = 1;
   288      Cluster cluster = 2;
   289      string FQDN = 3;
   290  }
   291  
   292  // VTGate represents information about a single VTGate host.
   293  message VTGate {
   294      // Hostname is the shortname of the VTGate.
   295      string hostname = 1;
   296      // Pool is group the VTGate serves queries for. Some deployments segment
   297      // VTGates into groups or pools, based on the workloads they serve queries
   298      // for. Use of this field is optional.
   299      string pool = 2;
   300      // Cell is the topology cell the VTGate is in.
   301      string cell = 3;
   302      // Cluster is the cluster the VTGate serves.
   303      Cluster cluster = 4;
   304      // Keyspaces is the list of keyspaces-to-watch for the VTGate.
   305      repeated string keyspaces = 5;
   306      string FQDN = 6;
   307  }
   308  
   309  message Workflow {
   310      Cluster cluster = 1;
   311      string keyspace = 2;
   312      vtctldata.Workflow workflow = 3;
   313  }
   314  
   315  /* Request/Response types */
   316  
   317  message CreateKeyspaceRequest {
   318      string cluster_id = 1;
   319      vtctldata.CreateKeyspaceRequest options = 2;
   320  }
   321  
   322  message CreateKeyspaceResponse {
   323      Keyspace keyspace = 1;
   324  }
   325  
   326  message CreateShardRequest {
   327      string cluster_id = 1;
   328      vtctldata.CreateShardRequest options = 2;
   329  }
   330  
   331  message DeleteKeyspaceRequest {
   332      string cluster_id = 1;
   333      vtctldata.DeleteKeyspaceRequest options = 2;
   334  }
   335  
   336  message DeleteShardsRequest {
   337      string cluster_id = 1;
   338      vtctldata.DeleteShardsRequest options = 2;
   339  }
   340  
   341  message DeleteTabletRequest {
   342      topodata.TabletAlias alias = 1;
   343      repeated string cluster_ids = 2;
   344      bool allow_primary = 3;
   345  }
   346  
   347  message DeleteTabletResponse {
   348      string status = 1;
   349      Cluster cluster = 2;
   350  }
   351  
   352  message EmergencyFailoverShardRequest {
   353      string cluster_id = 1;
   354      vtctldata.EmergencyReparentShardRequest options = 2;
   355  }
   356  
   357  message EmergencyFailoverShardResponse {
   358      Cluster cluster = 1;
   359      string keyspace = 2;
   360      string shard = 3;
   361      // PromotedPrimary is the tablet alias that was promoted to shard primary.
   362      // If NewPrimary was set in the request options, then this will be the
   363      // same tablet alias. Otherwise, it will be the alias of the tablet found
   364      // to be most up-to-date in the shard.
   365      topodata.TabletAlias promoted_primary = 4;
   366      repeated logutil.Event events = 5;
   367  }
   368  
   369  message FindSchemaRequest {
   370      string table = 1;
   371      repeated string cluster_ids = 2;
   372      GetSchemaTableSizeOptions table_size_options = 3;
   373  }
   374  
   375  message GetBackupsRequest {
   376      repeated string cluster_ids = 1;
   377      // Keyspaces, if set, limits backups to just the specified keyspaces.
   378      // Applies to all clusters in the request.
   379      repeated string keyspaces = 2;
   380      // KeyspaceShards, if set, limits backups to just the specified
   381      // keyspace/shards. Applies to all clusters in the request.
   382      //
   383      // This field takes precedence over Keyspaces. If KeyspaceShards is set,
   384      // Keyspaces is ignored.
   385      repeated string keyspace_shards = 3;
   386      // RequestOptions controls the per-shard request options when making
   387      // GetBackups requests to vtctlds. Note that the Keyspace and Shard fields
   388      // of this field are ignored; it is used only to specify Limit and Detailed
   389      // fields.
   390      vtctldata.GetBackupsRequest request_options = 4;
   391  }
   392  
   393  message GetBackupsResponse {
   394      repeated ClusterBackup backups = 1;
   395  }
   396  
   397  message GetCellInfosRequest {
   398      repeated string cluster_ids = 1;
   399      // Cells, if specified, limits the response to include only CellInfo objects
   400      // with those names. If omitted, all CellInfo objects in each cluster are
   401      // returned.
   402      //
   403      // Mutually-exclusive with NamesOnly. If both are set, this field takes
   404      // precedence.
   405      repeated string cells = 2;
   406      // Return only the cell names in each cluster; the actual CellInfo objects
   407      // will be empty.
   408      bool names_only = 3;
   409  }
   410  
   411  message GetCellInfosResponse {
   412      repeated ClusterCellInfo cell_infos = 1;
   413  }
   414  
   415  message GetCellsAliasesRequest {
   416      repeated string cluster_ids = 1;
   417  }
   418  
   419  message GetCellsAliasesResponse {
   420      repeated ClusterCellsAliases aliases = 1;
   421  }
   422  
   423  message GetClustersRequest {}
   424  
   425  message GetClustersResponse {
   426      repeated Cluster clusters = 1;
   427  }
   428  
   429  message GetFullStatusRequest {
   430    string cluster_id = 1;
   431    topodata.TabletAlias alias = 2;
   432  }
   433  
   434  message GetGatesRequest {
   435      repeated string cluster_ids = 1;
   436  }
   437  
   438  message GetGatesResponse {
   439      repeated VTGate gates = 1;
   440  }
   441  
   442  message GetKeyspaceRequest {
   443      string cluster_id = 1;
   444      string keyspace = 2;
   445  }
   446  
   447  message GetKeyspacesRequest {
   448      repeated string cluster_ids = 1;
   449  }
   450  
   451  message GetKeyspacesResponse {
   452      repeated Keyspace keyspaces = 1;
   453  }
   454  
   455  message GetSchemaRequest {
   456      string cluster_id = 1;
   457      string keyspace = 2;
   458      string table = 3;
   459      GetSchemaTableSizeOptions table_size_options = 4;
   460  }
   461  
   462  message GetSchemasRequest {
   463      repeated string cluster_ids = 1;
   464      GetSchemaTableSizeOptions table_size_options = 2;
   465  }
   466  
   467  message GetSchemasResponse {
   468      repeated Schema schemas = 1;
   469  }
   470  
   471  message GetShardReplicationPositionsRequest {
   472      repeated string cluster_ids = 1;
   473      // Keyspaces, if set, limits replication positions to just the specified
   474      // keyspaces. Applies to all clusters in the request.
   475      repeated string keyspaces = 2;
   476      // KeyspaceShards, if set, limits replicatin positions to just the specified
   477      // keyspace/shards. Applies to all clusters in the request.
   478      //
   479      // This field takes precedence over Keyspaces. If KeyspaceShards is set,
   480      // Keyspaces is ignored.
   481      repeated string keyspace_shards = 3;
   482  }
   483  
   484  message GetShardReplicationPositionsResponse {
   485      repeated ClusterShardReplicationPosition replication_positions = 1;
   486  }
   487  
   488  message GetSrvVSchemaRequest {
   489      string cluster_id = 1;
   490      string cell = 2;
   491  }
   492  
   493  message GetSrvVSchemasRequest {
   494      repeated string cluster_ids = 1;
   495      repeated string cells = 2;
   496  }
   497  
   498  message GetSrvVSchemasResponse {
   499      repeated SrvVSchema srv_v_schemas = 1;
   500  }
   501  
   502  message GetSchemaTableSizeOptions {
   503      bool aggregate_sizes = 1;
   504      bool include_non_serving_shards = 2;
   505  }
   506  
   507  message GetTabletRequest {
   508      // Unique (per cluster) tablet alias.
   509      topodata.TabletAlias alias = 1;
   510      // ClusterIDs is an optional parameter to narrow the scope of the search, if
   511      // the caller knows which cluster the tablet may be in, or, to disambiguate
   512      // if multiple clusters have a tablet with the same hostname.
   513      repeated string cluster_ids = 2;
   514  }
   515  
   516  message GetTabletsRequest {
   517      repeated string cluster_ids = 1;
   518  }
   519  
   520  message GetTabletsResponse {
   521      repeated Tablet tablets = 1;
   522  }
   523  
   524  message GetTopologyPathRequest {
   525    string cluster_id = 1;
   526    string path = 2;
   527  }
   528  
   529  message GetVSchemaRequest {
   530      string cluster_id = 1;
   531      string keyspace = 2;
   532  }
   533  
   534  message GetVSchemasRequest {
   535      repeated string cluster_ids = 1;
   536  }
   537  
   538  message GetVSchemasResponse {
   539      repeated VSchema v_schemas = 1;
   540  }
   541  
   542  message GetVtctldsRequest {
   543      repeated string cluster_ids = 1;
   544  }
   545  
   546  message GetVtctldsResponse {
   547      repeated Vtctld vtctlds = 1;
   548  }
   549  
   550  message GetWorkflowRequest {
   551      string cluster_id = 1;
   552      string keyspace = 2;
   553      string name = 3;
   554      bool active_only = 4;
   555  }
   556  
   557  message GetWorkflowsRequest {
   558      repeated string cluster_ids = 1;
   559      // ActiveOnly specifies whether to return workflows that are currently
   560      // active (running or paused) instead of all workflows.
   561      bool active_only = 2;
   562      // Keyspaces is a list of keyspaces to restrict the workflow search to. Note
   563      // that the keyspaces list applies across all cluster IDs in the request.
   564      //
   565      // If, for example, you have two clusters, each with a keyspace called "foo"
   566      // and want the workflows from "foo" in cluster1 but not from cluster2, you
   567      // must make two requests.
   568      //
   569      // Keyspaces and IgnoreKeyspaces are mutually-exclusive, and Keyspaces takes
   570      // precedence; if Keyspaces is a non-empty list, then IgnoreKeyspaces is
   571      // ignored completely.
   572      repeated string keyspaces = 3;
   573      // IgnoreKeyspaces is a list of keyspaces to skip during the workflow
   574      // search. It has the same semantics as the Keyspaces parameter, so refer to
   575      // that documentation for more details.
   576      repeated string ignore_keyspaces = 4;
   577  }
   578  
   579  message GetWorkflowsResponse {
   580      map <string, ClusterWorkflows> workflows_by_cluster = 1;
   581  }
   582  
   583  message PingTabletRequest {
   584      // Unique (per cluster) tablet alias of the standard form: "$cell-$uid"
   585      topodata.TabletAlias alias = 1;
   586      // ClusterIDs is an optional parameter to narrow the scope of the search, if
   587      // the caller knows which cluster the tablet may be in, or, to disambiguate
   588      // if multiple clusters have a tablet with the same hostname.
   589      repeated string cluster_ids = 2;
   590  }
   591  
   592  message PingTabletResponse {
   593      string status = 1;
   594      Cluster cluster = 2;
   595  }
   596  
   597  message PlannedFailoverShardRequest {
   598      string cluster_id = 1;
   599      vtctldata.PlannedReparentShardRequest options = 2;
   600  }
   601  
   602  message PlannedFailoverShardResponse {
   603      Cluster cluster = 1;
   604      string keyspace = 2;
   605      string shard = 3;
   606      // PromotedPrimary is the tablet alias that was promoted to shard primary.
   607      // If NewPrimary was set in the request options, then this will be the
   608      // same tablet alias. Otherwise, it will be the alias of the tablet found
   609      // to be most up-to-date in the shard.
   610      topodata.TabletAlias promoted_primary = 4;
   611      repeated logutil.Event events = 5;
   612  }
   613  
   614  message RebuildKeyspaceGraphRequest {
   615    string cluster_id = 1;
   616    string keyspace = 2;
   617    repeated string cells = 3;
   618    bool allow_partial = 4;
   619  }
   620  
   621  message RebuildKeyspaceGraphResponse {
   622    string status = 1;
   623  }
   624  
   625  message RefreshStateRequest {
   626      topodata.TabletAlias alias = 1;
   627      repeated string cluster_ids = 2;
   628  }
   629  
   630  message RefreshStateResponse {
   631      string status = 1;
   632      Cluster cluster = 2;
   633  }
   634  
   635  message ReloadSchemasRequest {
   636      // Keyspaces, if set, will reload schemas across one or more keyspaces. A
   637      // keyspace not existing in a cluster will not fail the overall request.
   638      //
   639      // Superceded by KeyspaceShards and Tablets, in that order.
   640      repeated string keyspaces = 1;
   641      // KeyspaceShards, if set, will reload schemas across one or more shards.
   642      // Each element must be a valid keyspace/shard according to
   643      // topoproto.ParseKeyspaceShard. A shard not existing in a cluster will not
   644      // fail the overall request.
   645      //
   646      // Supercedes Keyspaces, and is superceded by Tablets.
   647      repeated string keyspace_shards = 2;
   648      // Tablets, if set will reload schemas across one or more tablets.
   649      // Supercedes both Keyspaces and KeyspaceShards.
   650      repeated topodata.TabletAlias tablets = 3;
   651      // ClusterIds optionally restricts the reload operation to clusters with
   652      // the specified IDs. An empty list of ClusterIds will operate on all
   653      // clusters.
   654      repeated string cluster_ids = 4;
   655      // Concurrency controls the number of tablets to reload at any given time.
   656      // Its semantics depend on whether the request is for keyspace, shard, or
   657      // tablet mode.
   658      //
   659      // In Keyspaces mode, Concurrency is the number of tablets to reload at once
   660      // *per keyspace*.
   661      //
   662      // In KeyspaceShards mode, Concurrency is the number of tablets to reload at
   663      // once *per shard*.
   664      //
   665      // In Tablets mode, Concurrency is the number of tablets to reload at once
   666      // *per cluster*.
   667      uint32 concurrency = 5;
   668      // WaitPosition is the replication position that replicating tablets should
   669      // reach prior to reloading their schemas.
   670      //
   671      // Does not apply in Tablets mode.
   672      string wait_position = 6;
   673      // IncludePrimary, if set, will reload the schemas on PRIMARY tablets as
   674      // well as REPLICA and RDONLY.
   675      //
   676      // Does not apply in Tablets mode.
   677      bool include_primary = 7;
   678  }
   679  
   680  message ReloadSchemasResponse {
   681      // KeyspaceResult is a grouping of a Keyspace and any log events that
   682      // occurred in that keyspace during a schema reload (usually associated with
   683      // partial errors - ReloadSchemas requests are best-effort).
   684      //
   685      // It is only set when a ReloadSchemas request mandates Keyspaces mode
   686      // (see ReloadSchemasRequest).
   687      message KeyspaceResult {
   688          Keyspace keyspace = 1;
   689          repeated logutil.Event events = 2;
   690      }
   691      // KeyspaceResults is the list of KeyspaceResult objects for a ReloadSchemas
   692      // operation. It is only set when the request mandates Keyspaces mode (see
   693      // ReloadSchemasRequest).
   694      repeated KeyspaceResult keyspace_results = 1;
   695  
   696      // ShardResult is a grouping of a Shard and any log events that occurred in
   697      // that shard during a schema reload (usually associated with partial
   698      // errors - ReloadSchemas requests are best-effort).
   699      //
   700      // It is only set when a ReloadSchemas request mandates KeyspaceShards mode
   701      // (see ReloadSchemasRequest).
   702      message ShardResult {
   703          Shard shard = 1;
   704          repeated logutil.Event events = 2;
   705      }
   706      // ShardResults is the list of ShardResult objects for a ReloadSchemas
   707      // operation. It is only set when the request mandates KeyspaceShards mode
   708      // (see ReloadSchemasRequest).
   709      repeated ShardResult shard_results = 2;
   710  
   711      // TabletResult is a grouping of a Tablet and the result of reloading that
   712      // Tablet's schema. Result will either be the string "ok", or the error
   713      // message from that tablet. Note ReloadSchemas is best-effort, so tablet's
   714      // failing to reload is not treated as an overall failure.
   715      //
   716      // It is only set when a ReloadSchemas request mandates Tablets mode (see
   717      // ReloadSchemasRequest).
   718      message TabletResult {
   719          Tablet tablet = 1;
   720          string result = 2;
   721      }
   722      // TabletResults is the list of TabletResult objects for a ReloadSchemas
   723      // operation. It is only set when the request mandates Tablets mode (see
   724      // ReloadSchemasRequest).
   725      repeated TabletResult tablet_results = 3;
   726  }
   727  
   728  message ReloadSchemaShardRequest {
   729    string cluster_id = 1;
   730    string keyspace = 2;
   731    string shard = 3;
   732    string wait_position = 4;
   733    bool include_primary = 5;
   734  
   735    uint32 concurrency = 6;
   736  }
   737  
   738  message ReloadSchemaShardResponse {
   739    repeated logutil.Event events = 1;
   740  }
   741  
   742  message RefreshTabletReplicationSourceRequest {
   743      topodata.TabletAlias alias = 1;
   744      repeated string cluster_ids = 2;
   745  }
   746  
   747  message RefreshTabletReplicationSourceResponse {
   748      string keyspace = 1;
   749      string shard = 2;
   750      topodata.TabletAlias primary = 3;
   751      Cluster cluster = 4;
   752  }
   753  
   754  message RemoveKeyspaceCellRequest {
   755    string cluster_id = 1;
   756    string keyspace = 2;
   757    string cell = 3;
   758    bool force = 4;
   759    bool recursive = 5;
   760  }
   761  
   762  message RemoveKeyspaceCellResponse {
   763    string status = 1;
   764  }
   765  
   766  message RunHealthCheckRequest {
   767      topodata.TabletAlias alias = 1;
   768      repeated string cluster_ids = 2;
   769  }
   770  
   771  message RunHealthCheckResponse {
   772      string status = 1;
   773      Cluster cluster = 2;
   774  }
   775  
   776  message SetReadOnlyRequest {
   777      topodata.TabletAlias alias = 1;
   778      repeated string cluster_ids = 2;
   779  }
   780  
   781  message SetReadOnlyResponse {
   782  }
   783  
   784  message SetReadWriteRequest {
   785      topodata.TabletAlias alias = 1;
   786      repeated string cluster_ids = 2;
   787  }
   788  
   789  message SetReadWriteResponse {
   790  }
   791  
   792  message StartReplicationRequest {
   793      topodata.TabletAlias alias = 1;
   794      repeated string cluster_ids = 2;
   795  }
   796  
   797  message StartReplicationResponse {
   798      string status = 1;
   799      Cluster cluster = 2;
   800  }
   801  
   802  message StopReplicationRequest {
   803      topodata.TabletAlias alias = 1;
   804      repeated string cluster_ids = 2;
   805  }
   806  
   807  message StopReplicationResponse {
   808      string status = 1;
   809      Cluster cluster = 2;
   810  }
   811  
   812  message TabletExternallyPromotedRequest {
   813      // Tablet is the alias of the tablet that was promoted externally and should
   814      // be updated to the shard primary in the topo.
   815      topodata.TabletAlias alias = 1;
   816      repeated string cluster_ids = 2;
   817  }
   818    
   819  message TabletExternallyPromotedResponse {
   820      Cluster cluster = 1;
   821      string keyspace = 2;
   822      string shard = 3;
   823      topodata.TabletAlias new_primary = 4;
   824      topodata.TabletAlias old_primary = 5;
   825  }
   826  
   827  message TabletExternallyReparentedRequest {
   828    topodata.TabletAlias alias = 1;
   829    repeated string cluster_ids = 2;
   830  }
   831  
   832  message ValidateRequest {
   833    string cluster_id = 1;
   834    bool ping_tablets = 2;
   835  }
   836  
   837  message ValidateKeyspaceRequest {
   838      string cluster_id = 1;
   839      string keyspace = 2;
   840      bool ping_tablets = 3;
   841  }
   842  
   843  message ValidateSchemaKeyspaceRequest {
   844      string cluster_id = 1;
   845      string keyspace = 2;
   846  }
   847  
   848  message ValidateShardRequest {
   849    string cluster_id = 1;
   850    string keyspace = 2;
   851    string shard = 3;
   852    bool ping_tablets = 4;
   853  }
   854  
   855  message ValidateVersionKeyspaceRequest {
   856      string cluster_id = 1;
   857      string keyspace = 2;
   858  }
   859  
   860  message ValidateVersionShardRequest {
   861    string cluster_id = 1;
   862    string keyspace = 2;
   863    string shard = 3;
   864  }
   865  
   866  message VTExplainRequest {
   867      string cluster = 1;
   868      string keyspace = 2;
   869      string sql = 3;
   870  }
   871  
   872  message VTExplainResponse {
   873      string response = 1;
   874  }