Obtaining the status of long-running operations

Use the ydb operation get subcommand to obtain the status of the specified long-running operation.

General format of the command:

ydb [global options...] operation get [options...] <id>
  • global options: Global parameters.
  • options: Parameters of the subcommand.
  • id: The ID of the long-running operation. The ID contains characters that can be interpreted by your command shell. If necessary, use shielding, for example, '<id>' for bash.

View a description of the command to obtain the status of a long-running operation:

ydb operation get --help

Parameters of the subcommand

Name Description
--format Input format.
Default value: pretty.
Acceptable values:
  • pretty: A human-readable format.
  • proto-json-base64: Protobuf result in [JSON] format(https://en.wikipedia.org/wiki/JSON), binary strings are encoded in Base64.

Examples

Note

The examples use the quickstart profile. To learn more, see Creating a profile to connect to a test database.

Obtain the status of the long-running operation with the ydb://buildindex/7?id=281489389055514 ID:

ydb -p quickstart operation get \
  'ydb://buildindex/7?id=281489389055514'

Result:

┌───────────────────────────────────────┬───────┬─────────┬───────┬──────────┬─────────────────────┬─────────────┐
| id                                    | ready | status  | state | progress | table               | index       |
├───────────────────────────────────────┼───────┼─────────┼───────┼──────────┼─────────────────────┼─────────────┤
| ydb://buildindex/7?id=281489389055514 | true  | SUCCESS | Done  | 100.00%  | /my-database/series | idx_release |
└───────────────────────────────────────┴───────┴─────────┴───────┴──────────┴─────────────────────┴─────────────┘