All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ydb.public.api.protos.ydb_operation.proto Maven / Gradle / Ivy

There is a newer version: 1.45.6
Show newest version
syntax = "proto3";
option cc_enable_arenas = true;

import "google/protobuf/any.proto";
import "google/protobuf/duration.proto";

import "ydb/public/api/protos/annotations/validation.proto";
import "ydb/public/api/protos/ydb_common.proto";
import "ydb/public/api/protos/ydb_issue_message.proto";
import "ydb/public/api/protos/ydb_status_codes.proto";

package Ydb.Operations;

option java_package = "com.yandex.ydb";
option java_outer_classname = "OperationProtos";

message OperationParams {
    enum OperationMode {
        OPERATION_MODE_UNSPECIFIED = 0;

        // Server will only reply once operation is finished (ready=true), and operation object won't be
        // accessible after the reply. This is a basic request-response mode.
        SYNC = 1;

        ASYNC = 2;
    }

    OperationMode operation_mode = 1;

    // Indicates that client is no longer interested in the result of operation after the specified duration
    // starting from the time operation arrives at the server.
    // Server will try to stop the execution of operation and if no result is currently available the operation
    // will receive TIMEOUT status code, which will be sent back to client if it was waiting for the operation result.
    // Timeout of operation does not tell anything about its result, it might be completed successfully
    // or cancelled on server.
    google.protobuf.Duration operation_timeout = 2;

    // Server will try to cancel the operation after the specified duration starting from the time
    // the operation arrives at server.
    // In case of successful cancellation operation will receive CANCELLED status code, which will be
    // sent back to client if it was waiting for the operation result.
    // In case when cancellation isn't possible, no action will be performed.
    google.protobuf.Duration cancel_after = 3;

    // User-defined labels of operation.
    map labels = 4 [(map_key).length.le = 128, (length).le = 128];

    // If enabled, server will report cost information, if supported by the operation.
    // This flag is mostly useful for SYNC operations, to get the cost information in the response.
    Ydb.FeatureFlag.Status report_cost_info = 5;
}

message GetOperationRequest {
    string id = 1 [(required) = true];
}

message GetOperationResponse {
    Operation operation = 1;
}

message CancelOperationRequest {
    string id = 1 [(required) = true];
}

message CancelOperationResponse {
    StatusIds.StatusCode status = 1;
    repeated Ydb.Issue.IssueMessage issues = 2;
}

message ForgetOperationRequest {
    string id = 1 [(required) = true];
}

message ForgetOperationResponse {
    StatusIds.StatusCode status = 1;
    repeated Ydb.Issue.IssueMessage issues = 2;
}

message ListOperationsRequest {
    string kind = 1 [(required) = true];
    uint64 page_size = 2;
    string page_token = 3;
}

message ListOperationsResponse {
    StatusIds.StatusCode status = 1;
    repeated Ydb.Issue.IssueMessage issues = 2;
    repeated Operation operations = 3;
    string next_page_token = 4;
}

message Operation {
    // Identifier of the operation, empty value means no active operation object is present (it was forgotten or
    // not created in the first place, as in SYNC operation mode).
    string id = 1;

    // true - this operation has beed finished (doesn't matter successful or not),
    // so Status field has status code, and Result field can contains result data.
    // false - this operation still running. You can repeat request using operation Id.
    bool ready = 2;

    StatusIds.StatusCode status = 3;

    repeated Ydb.Issue.IssueMessage issues = 4;
    // Result data
    google.protobuf.Any result = 5;

    google.protobuf.Any metadata = 6;

    // Contains information about the cost of the operation.
    // For completed operations, it shows the final cost of the operation.
    // For operations in progress, it might indicate the current cost of the operation (if supported).
    CostInfo cost_info = 7;
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy