vtctld API Transition

The following table highlights old vtctld API methods and their counterparts in the newer VTAdmin API.

Some methods do not have a 1:1 mapping from vtctld to VTAdmin. These cases include:

  • vtctld methods that are split out into many different VTAdmin methods (ex. keyspace and tablet action methods)
  • vtctld methods that are not supported in VTAdmin (ex. executing a vtctl command)
  • vtctld methods that we plan to support, but do not currently support, in VTAdmin
  • VTAdmin methods that were not supported by vtctld API; noted here because they may be useful

One of the main differences between vtctld and VTAdmin API is that VTAdmin API returns results across all clusters discovered by VTAdmin cluster discovery. VTAdmin API methods that accept a cluster_id parameter are methods that will return results from all clusters, unless the aforementioned filter parameter is provided.

vtctld and VTAdmin API methods #

Summaryvtctld API (old)vtctld params (old)vtadmin API (new)vtadmin params (new)Notes
Get cellsGET /cells-GET /api/cells--
Get keyspacesGET /keyspaces-GET /api/keyspaces
  • cluster_id: Optional cluster filter
  • -
    Get a keyspaceGET /keyspaces/<keyspace>-GET /api/keyspace/<cluster>/<keyspace>
  • cluster_id: Optional cluster filter
  • -
    Rebuild keyspace graph--PUT /api/keyspace/<cluster>/<keyspace>/rebuild_keyspace_graph
  • allow_partial: Specifies whether a SNAPSHOT keyspace is allowed to serve with an incomplete set of shards. Ignored for all other types of keyspaces
  • cells: Specifies a comma-separated list of cells to update
  • -
    Remove keyspace cell--PUT /api/keyspace/<cluster>/<keyspace>/remove_keyspace_cell
  • cell: Cell to be removed
  • force: Proceed even if the cell's topology server cannot be reached. The assumption is that you turned down the entire cell, and just need to update the global topo data.
  • recursive: Also delete all tablets in that cell belonging to the specified keyspace.
  • -
    Validate keyspacePOST /keyspaces/<keyspace>action: ValidateKeyspacePUT /api/keyspace/<cluster><keyspace>/validate
  • ping_tablets: Indicates whether all tablets should be pinged during the validation process
  • -
    Validate keyspace schemaPOST /keyspaces/<keyspace>action: ValidateSchemaKeyspacePUT /keyspace/<cluster>/<keyspace>/validate/schema--
    Validate keyspace versionPOST /keyspaces/<keyspace>action: ValidateVersionKeyspacePUT /api/keyspace/<cluster>/<keyspace>/validate/version--
    Validate keyspace permissionsPOST /keyspaces/<keyspace>action: ValidatePermissionsKeyspaceTo be implemented in VTAdmin-Need to implement in VTAdmin
    Delete keyspace--DELETE /api/keyspace/<cluster>/<keyspace>
  • recursive: Recursively delete all shards in the keyspace. If not specified or set to false, the keyspace must be empty (have no shards), or DeleteKeyspace returns an error
  • -
    Get keyspace tabletsGET /keyspace/<keyspace>/tabletscell, cellsGET /api/tablets
  • cluster_id: Optional cluster filter
  • -
    Get keyspace tablets for a specific shardGET /keyspace/<keyspace>/tablets/<shard>cell, cellsGET /api/tablets
  • cluster_id: Optional cluster filter
  • -
    Get shardsGET /shards-GET /api/keyspaces
  • cluster_id: Optional cluster filter
  • In VTAdmin, to get all shards across all keyspaces, first get all keyspaces, and shards are returned within every keyspace keyspace.Shards
    Get a shardGET /shards/<shard>-GET /api/keyspace/<cluster>/<keyspace>
  • cluster_id: Optional cluster filter
  • In VTAdmin, to get a shard, first get the shard's keyspace, and then filter for the shard in keyspace.Shards
    Validate a shardPOST /shards/<shard>action: ValidateShardPUT /api/shard/<cluster>/<keyspace>/<shard>/validate
  • ping_tablets: Indicates whether all tablets should be pinged during the validation process.
  • -
    Validate shard schemaPOST /shards/<shard>action: ValidateSchemaShardTo be implemented in VTAdmin-Need to implement in VTAdmin
    Validate shard versionPOST /shards/<shard>action: ValidateVersionShardPUT /api/shard/<cluster>/<keyspace>/<shard>/validate_version--
    Validate shard permissionsPOST /shards/<shard>action: ValidatePermissionsShardTo be implemented in VTAdmin-Need to implement in VTAdmin
    Get SrvKeyspaces for a cellGET /srv_keyspace/<cell>-GET /api/srvkeyspaces
  • cell: Optional cell filter
  • cluster_id: Optional cluster filter
  • The VTAdmin method returns all SrvKeyspaces across all clusters and their keyspaces if the cluster_id parameter is not provided.
    Get SrvKeyspaces for a specific keyspaceGET/srv_keyspace/<cell>/<keyspace>-GET /api/srvkeyspace/<cluster>/<keyspace>
  • cell: Optional cell filter
  • -
    Get all tablets by cell and/or shardGET /tabletsshard,cellGET /api/tablets
  • cluster_id: Optional cluster filter
  • -
    Get a tabletGET /tablets/<tablet>-GET /api/tablets/<tablet>
  • cluster_id: Optional cluster filter
  • -
    Get tablet healthGET /tablets/<tablet>/health-GET /api/tablet/<tablet>/healthcheck
  • cluster_id: Optional cluster filter
  • -
    Get a tablet's full status--GET /api/tablet/<tablet>/full_status
  • cluster_id: Optional cluster filter
  • -
    Ping tabletPOST /tablets/<tablet>action: PingTabletGET /api/tablet/<tablet>/ping
  • cluster_id: Optional cluster filter
  • -
    Refresh tabletPOST /tablets/<tablet>action: RefreshStatePUT /api/tablet/<tablet>/refresh
  • cluster_id: Optional cluster filter
  • -
    Refresh tablet replication source--PUT /api/tablet/<tablet>/refresh_replication_source
  • cluster_id: Optional cluster filter
  • -
    Reload tablet schemaPOST /tablets/<tablet>action: ReloadSchemaPUT /api/tablet/<tablet>/reload_schema
  • cluster_id: Optional cluster filter
  • -
    Set tablet to read-only--PUT /api/tablet/<tablet>/set_read_only
  • cluster_id: Optional cluster filter
  • -
    Set tablet to read-write--PUT /api/tablet/<tablet>/set_read_write
  • cluster_id: Optional cluster filter
  • -
    Start replication on tablet--PUT /api/tablet/<tablet>/start_replication
  • cluster_id: Optional cluster filter
  • -
    Stop replication on tablet--PUT /api/tablet/<tablet>/stop_replication
  • cluster_id: Optional cluster filter
  • -
    Mark tablet as externally promoted--POST /api/tablet/<tablet>/externally_promoted
  • cluster_id: Optional cluster filter
  • -
    Delete tabletPOST /tablets/<tablet>action: DeleteTabletDELETE /api/tablet/<tablet>
  • allow_primary: Whether or not the primary can be deleted
  • cluster_id: Optional cluster filter
  • -
    Run a vtctl commandGET /vtctlbody: array of vtctl commandsUnsupported by VTAdmin-We recommend using vtctldclient for running any other vtctl commands
    Apply schema changesPOST /schema/applykeyspace, sql, ddl_strategy, replica_timeout_secondsUnsupported by VTAdmin-Unsupported by VTAdmin
    Get vtctl featuresGET /features-GET /debug/env-Returns the current env vars for VTAdmin API. Must have http-no-debug flag set to false.

    vtctld API Transition