Skip to content

Commit

Permalink
feat(siren): add create alert with namespace api (raystack#234)
Browse files Browse the repository at this point in the history
* feat: add create alert per namespace api

* feat(siren): distinguish create alert request response
  • Loading branch information
mabdh authored Jan 10, 2023
1 parent 6f1940b commit 03dcfd9
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions odpf/siren/v1beta1/siren.proto
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,19 @@ service SirenService {
};
}

rpc CreateAlertsWithNamespace(CreateAlertsWithNamespaceRequest) returns (CreateAlertsWithNamespaceResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
summary: "create alerts with namespace";
tags: "Alert";
};

option (google.api.http) = {
post: "/v1beta1/alerts/{provider_type}/{provider_id}/{namespace_id}"
body: "body"
};
}


rpc ListRules(ListRulesRequest) returns (ListRulesResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
summary: "list rules";
Expand Down Expand Up @@ -613,6 +626,7 @@ message Alert {
string severity = 6;
string rule = 7;
google.protobuf.Timestamp triggered_at = 8;
uint64 namespace_id = 9;
}

message ListAlertsRequest {
Expand All @@ -621,6 +635,8 @@ message ListAlertsRequest {
string resource_name = 3 [(validate.rules).string.pattern = "^[A-Za-z0-9_-]+$"];
uint64 start_time = 4;
uint64 end_time = 5;
uint64 namespace_id = 6;

}

message ListAlertsResponse {
Expand All @@ -637,6 +653,17 @@ message CreateAlertsResponse {
repeated Alert alerts = 1;
}

message CreateAlertsWithNamespaceRequest {
string provider_type= 1;
uint64 provider_id = 2;
google.protobuf.Struct body = 3;
uint64 namespace_id = 4;
}

message CreateAlertsWithNamespaceResponse {
repeated Alert alerts = 1;
}

message Annotations {
string metric_name = 1;
string metric_value = 2;
Expand Down

0 comments on commit 03dcfd9

Please sign in to comment.