Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 45 additions & 16 deletions api/submitqueue/gateway/proto/gateway.proto
Original file line number Diff line number Diff line change
Expand Up @@ -82,22 +82,46 @@ message CancelRequest {
message CancelResponse {
}

// StatusRequest defines a request to look up the current status of a previously submitted request.
message StatusRequest {
// Globally unique identifier for the request, as returned by Land in the LandResponse.
// RequestSummary is the gateway-owned materialized current view of one received request.
message RequestSummary {
// Globally unique request identifier. This is request_id in internal storage.
string sqid = 1;
// Queue supplied when the request was received.
string queue = 2;
// Change URIs supplied when the request was received, in caller order.
repeated string change_uris = 3;
// Receipt time in Unix milliseconds.
int64 received_at_ms = 4;
// Current customer-friendly status of the request.
string status = 5;
// Last error associated with the current status. Empty when absent.
string last_error = 6;
// Display and debugging metadata associated with the current status.
map<string, string> metadata = 7;
}

// StatusByIDRequest selects one request by the sqid returned from Land.
message StatusByIDRequest {
// Globally unique identifier for the request.
string sqid = 1;
}

// StatusByIDResponse contains the current materialized request view.
message StatusByIDResponse {
// Matching request.
RequestSummary request = 1;
}

// StatusByChangeIDRequest selects requests by an exact pinned change URI.
message StatusByChangeIDRequest {
// Exact change URI supplied in a Land request.
string change_id = 1;
}

// StatusResponse defines the response to a status request.
// The status is eventually consistent with the request store; it might take some time to converge, typically no more than a few seconds.
message StatusResponse {
// Current customer-friendly status of the request (e.g. "accepted", "validating", "landed", "error").
// Status is a free-form string because the system may introduce new statuses without breaking existing clients.
string status = 1;
// Last error message associated with the current status. Empty string if there is no error.
string last_error = 2;
// Free-form key-value metadata associated with the current status, for display or debugging purposes. Empty if none.
map<string, string> metadata = 3;
// StatusByChangeIDResponse contains matching requests newest first.
message StatusByChangeIDResponse {
// Matching requests ordered by receipt time descending, then sqid descending.
repeated RequestSummary requests = 1;
}

// ***************
Expand All @@ -124,6 +148,8 @@ message RequestNotFoundError {
Error error = 1;
// The sqid that was not found.
string sqid = 2;
// Exact change ID that was not found. Populated only for change-ID lookup.
string change_id = 3;
}

// ***************
Expand Down Expand Up @@ -152,7 +178,10 @@ service SubmitQueueGateway {
// error) must be checked through the separate status / request-log API.
rpc Cancel(CancelRequest) returns (CancelResponse) {}

// Status returns the current status of a previously submitted request, identified by its sqid.
// The status is eventually consistent with the request store and reconciled from the append-only request log.
rpc Status(StatusRequest) returns (StatusResponse) {}
// StatusByID returns the current materialized status of one request.
rpc StatusByID(StatusByIDRequest) returns (StatusByIDResponse) {}

// StatusByChangeID returns current materialized statuses for an exact pinned change URI.
rpc StatusByChangeID(StatusByChangeIDRequest) returns (StatusByChangeIDResponse) {}

}
Loading
Loading