Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add api flows for negotiating a sankey upload #28

Merged
merged 3 commits into from
Oct 21, 2024
Merged
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
28 changes: 28 additions & 0 deletions src/bitdrift_public/protobuf/client/v1/api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ message ApiRequest {
OpaqueConfigurationUpdateAck opaque_configuration_update_ack = 8;
OpaqueRequest opaque_upload = 9;
SankeyDiagramUploadRequest sankey_diagram_upload = 10;
SankeyIntentRequest sankey_intent = 11;
}
}

Expand All @@ -220,6 +221,18 @@ message SankeyDiagramUploadRequest {
repeated Node nodes = 3 [(validate.rules).repeated = {min_items: 1}];
}

// A request to ask whether to upload a Sankey path.
message SankeyIntentRequest {
// The UUID of the intent being negotiated. This is used to correlate the response with the request.
string intent_uuid = 1 [(validate.rules).string = {min_len: 1}];

// The ID of the path that is being considered for upload.
string path_id = 2 [(validate.rules).string = {min_len: 1}];

// The ID of the diagram that the path was discovered in.
string sankey_diagram_id = 3 [(validate.rules).string = {min_len: 1}];
}

// The response sent as part of stream establishment.
message HandshakeResponse {
message StreamSettings {
Expand Down Expand Up @@ -404,6 +417,20 @@ message FlushBuffers {
message SankeyDiagramUploadResponse {
}

// The response to Sankey diagram intent request.
message SankeyIntentResponse {
enum Decision {
// The diagram should be uploaded.
UPLOAD = 0;
// The diagram should be dropped.
DROP = 1;
}

string intent_uuid = 1 [(validate.rules).string = {min_len: 1}];

Decision decision = 2;
}

// A multiplexed response sent over the bitdrift API.
message ApiResponse {
oneof response_type {
Expand All @@ -421,6 +448,7 @@ message ApiResponse {
OpaqueConfigurationUpdate opaque_configuration_update = 10;
OpaqueResponse opaque_upload = 11;
SankeyDiagramUploadResponse sankey_diagram_upload = 12;
SankeyIntentResponse sankey_intent_response = 13;
}
}

Expand Down
Loading