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

feat: add siren subscriptions api proto #72

Merged
merged 1 commit into from
Dec 6, 2021
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
102 changes: 100 additions & 2 deletions odpf/siren/v1beta1/siren.proto
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,62 @@ service SirenService {
};
}


rpc ListSubscriptions(google.protobuf.Empty) returns (ListSubscriptionsResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
summary: "List subscriptions";
tags: "Subscription";
};

option (google.api.http) = {
get: "/v1beta1/subscriptions"
};
}

rpc CreateSubscription(CreateSubscriptionRequest) returns (Subscription) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
summary: "Create a subscription";
tags: "Subscription";
};

option (google.api.http) = {
post: "/v1beta1/subscriptions"
body: "*"
};
}

rpc GetSubscription(GetSubscriptionRequest) returns (Subscription) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
summary: "Get a subscription";
tags: "Subscription";
};

option (google.api.http) = {
get: "/v1beta1/subscriptions/{id}"
};
}

rpc UpdateSubscription(UpdateSubscriptionRequest) returns (Subscription) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
summary: "Update a subscription";
tags: "Subscription";
};
option (google.api.http) = {
put: "/v1beta1/subscriptions/{id}",
body: "*"
};
}

rpc DeleteSubscription(DeleteSubscriptionRequest) returns (google.protobuf.Empty) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
summary: "Delete a subscription";
tags: "Subscription";
};

option (google.api.http) = {
delete: "/v1beta1/subscriptions/{id}"
};
}

rpc ListReceivers(google.protobuf.Empty) returns (ListReceiversResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
summary: "list receivers";
Expand Down Expand Up @@ -429,6 +484,49 @@ message DeleteNamespaceRequest {
uint64 id = 1;
}

message ReceiverMetadata {
uint64 id = 1;
map<string, string> configuration = 4;
}

message Subscription {
uint64 id = 1;
string urn = 2 [(validate.rules).string.pattern = "^[A-Za-z0-9_-]+$"];
uint64 namespace = 3;
repeated ReceiverMetadata receivers = 4;
map<string, string> match = 5;
google.protobuf.Timestamp created_at = 6;
google.protobuf.Timestamp updated_at = 7;
}

message ListSubscriptionsResponse {
repeated Subscription subscriptions = 1;
}

message CreateSubscriptionRequest {
string urn = 1 [(validate.rules).string.pattern = "^[A-Za-z0-9_-]+$"];
uint64 namespace = 2;
repeated ReceiverMetadata receivers = 3;
map<string, string> match = 4;
}

message GetSubscriptionRequest {
uint64 id = 1;
}

message UpdateSubscriptionRequest {
uint64 id = 1;
string urn = 2 [(validate.rules).string.pattern = "^[A-Za-z0-9_-]+$"];
uint64 namespace = 3;
repeated ReceiverMetadata receivers = 4;
map<string, string> match = 5;
}

message DeleteSubscriptionRequest {
uint64 id = 1;
}


message Receiver {
uint64 id = 1;
string name = 2;
Expand Down Expand Up @@ -546,7 +644,7 @@ message Rule {

message Variables {
string name = 1 [(validate.rules).string.pattern = "^[A-Za-z0-9_-]+$"];
string value = 2 [(validate.rules).string.pattern = "^[A-Za-z0-9_-]+$"];
string value = 2;
string type = 3;
string description = 4;
}
Expand Down