Skip to content

Commit 14e84a9

Browse files
add: add Alert Manager proto
1 parent 9de2107 commit 14e84a9

13 files changed

+2392
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,205 @@
1+
syntax = "proto3";
2+
3+
package spaceone.api.alert_manager.v1;
4+
5+
option go_package = "github.com/cloudforet-io/api/dist/go/spaceone/api/alert-manager/v1";
6+
7+
import "google/protobuf/empty.proto";
8+
import "google/protobuf/struct.proto";
9+
import "google/api/annotations.proto";
10+
import "spaceone/api/core/v2/query.proto";
11+
12+
service Alert {
13+
rpc create (AlertCreateRequest) returns (ServiceInfo) {
14+
option (google.api.http) = {
15+
post: "/alert-manager/v1/alert/create"
16+
body: "*"
17+
};
18+
}
19+
rpc update (AlertUpdateRequest) returns (ServiceInfo) {
20+
option (google.api.http) = {
21+
post: "/alert-manager/v1/alert/update"
22+
body: "*"
23+
};
24+
}
25+
rpc delete (AlertRequest) returns (google.protobuf.Empty) {
26+
option (google.api.http) = {
27+
post: "/alert-manager/v1/alert/delete"
28+
body: "*"
29+
};
30+
}
31+
rpc get (AlertRequest) returns (ServiceInfo) {
32+
option (google.api.http) = {
33+
post: "/alert-manager/v1/alert/get"
34+
body: "*"
35+
};
36+
}
37+
rpc list (AlertSearchQuery) returns (ServicesInfo) {
38+
option (google.api.http) = {
39+
post: "/alert-manager/v1/alert/list"
40+
body: "*"
41+
};
42+
}
43+
rpc history (AlertChangeMemberRequest) returns (ServiceInfo) {
44+
option (google.api.http) = {
45+
post: "/alert-manager/v1/alert/update"
46+
body: "*"
47+
};
48+
}
49+
rpc analyze (AlertChangeMemberRequest) returns (ServiceInfo) {
50+
option (google.api.http) = {
51+
post: "/alert-manager/v1/alert/update"
52+
body: "*"
53+
};
54+
}
55+
rpc stat (AlertStatQuery) returns (google.protobuf.Struct) {
56+
option (google.api.http) = {
57+
post: "/alert_manager/v1/alert/stat"
58+
body: "*"
59+
};
60+
}
61+
}
62+
63+
64+
//////////
65+
//Receive
66+
//////////
67+
68+
message Members {
69+
repeated string USER = 1;
70+
repeated string USER_GROUP = 2;
71+
}
72+
73+
message Options {
74+
enum notification_urgency_ {
75+
NOTIFICATION_NONE = 0;
76+
ALL = 1;
77+
HIGH_ONLY = 2;
78+
}
79+
enum recovery_mode {
80+
RECOVERY_NONE = 0;
81+
AUTO = 1;
82+
MANUAL = 2;
83+
}
84+
}
85+
86+
message AlertCreateRequest {
87+
string name = 1;
88+
string service_key = 2;
89+
// +optional
90+
string description = 3;
91+
// +optional
92+
google.protobuf.Struct members = 4;
93+
// +optional
94+
Options options = 5;
95+
}
96+
97+
message AlertUpdateRequest {
98+
string service_id = 1;
99+
// +optional
100+
string name = 2;
101+
// +optional
102+
string description = 3;
103+
// +optional
104+
Options options = 4;
105+
string escalation_policy_id = 5;
106+
}
107+
108+
message AlertChangeMemberRequest {
109+
string service_id = 1;
110+
Members members = 2;
111+
}
112+
113+
message AlertRequest {
114+
string service_id = 1;
115+
}
116+
117+
message AlertSearchQuery {
118+
// +optional
119+
spaceone.api.core.v2.Query query = 1;
120+
// +optional
121+
string service_id = 2;
122+
// +optional
123+
string escalation_policy_id = 3;
124+
// +optional
125+
bool include_details = 4;
126+
}
127+
128+
message AlertStatQuery {
129+
spaceone.api.core.v2.StatisticsQuery query = 1;
130+
}
131+
132+
133+
//////////
134+
//Returns
135+
//////////
136+
137+
message ServiceInfo {
138+
string service_id = 1;
139+
string name = 2;
140+
string service_key = 3;
141+
string description = 4;
142+
google.protobuf.Struct members = 5;
143+
Options options = 6;
144+
// +optional
145+
google.protobuf.Struct channels = 7;
146+
// +optional
147+
google.protobuf.Struct webhooks = 8;
148+
// +optional
149+
google.protobuf.Struct alerts = 9;
150+
string escalation_policy_id = 10;
151+
string workspace_id = 11;
152+
string domain_id = 12;
153+
string created_at = 13;
154+
string updated_at = 14;
155+
}
156+
157+
message ServicesInfo {
158+
repeated ServiceInfo results = 1;
159+
int32 total_count = 2;
160+
}
161+
162+
163+
///////////////
164+
//Data Formats
165+
///////////////
166+
167+
//Channel
168+
message Channels {
169+
repeated ServiceChannelsInfo service_channel_info = 1;
170+
}
171+
172+
message ServiceChannelsInfo {
173+
string channel_id = 1;
174+
string name = 2;
175+
string state = 3;
176+
string channel_type = 4;
177+
google.protobuf.Struct data = 5;
178+
google.protobuf.Struct schedule = 6;
179+
google.protobuf.Struct tags = 7;
180+
string secret_id = 8;
181+
string protocol_id = 9;
182+
string service_id = 10;
183+
string workspace_id = 11;
184+
string domain_id = 12;
185+
string created_at = 13;
186+
}
187+
188+
//Webhooks
189+
message Webhooks {
190+
repeated WebhookInfo webhook_info = 1;
191+
}
192+
message WebhookInfo {
193+
string webhook_id = 1;
194+
}
195+
196+
//Alerts
197+
message Alerts {
198+
AlertInfo TOTAL = 1;
199+
AlertInfo TRIGGERRED = 2;
200+
AlertInfo ACKNOWLEDGED = 3;
201+
}
202+
message AlertInfo {
203+
int32 high = 1;
204+
int32 low = 2;
205+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
syntax = "proto3";
2+
3+
package spaceone.api.alert_manager.v1;
4+
5+
option go_package = "github.com/cloudforet-io/api/dist/go/spaceone/api/alert-manager/v1";
6+
7+
import "google/protobuf/empty.proto";
8+
import "google/protobuf/struct.proto";
9+
import "google/api/annotations.proto";
10+
import "spaceone/api/core/v2/query.proto";
11+
12+
service EscalationPolicy {
13+
rpc create (EscalationPolicyCreateRequest) returns (EscalationPolicyInfo) {
14+
option (google.api.http) = {
15+
post: "/alert-manager/v1/escalation-policy/create"
16+
body: "*"
17+
};
18+
}
19+
rpc delete (EscalationPolicyRequest) returns (google.protobuf.Empty) {
20+
option (google.api.http) = {
21+
post: "/alert-manager/v1/escalation-policy/delete"
22+
body: "*"
23+
};
24+
}
25+
rpc get (EscalationPolicyRequest) returns (EscalationPolicyInfo) {
26+
option (google.api.http) = {
27+
post: "/alert-manager/v1/escalation-policy/get"
28+
body: "*"
29+
};
30+
}
31+
rpc list (EscalationPolicySearchQuery) returns (EscalationPoliciesInfo) {
32+
option (google.api.http) = {
33+
post: "/alert-manager/v1/escalation-policy/list"
34+
body: "*"
35+
};
36+
}
37+
rpc stat (EscalationPolicyStatQuery) returns (google.protobuf.Struct) {
38+
option (google.api.http) = {
39+
post: "/alert_manager/v1/escalation-policy/stat"
40+
body: "*"
41+
};
42+
}
43+
}
44+
45+
46+
//////////
47+
//Receive
48+
//////////
49+
message EscalationPolicyCreateRequest {
50+
51+
enum FinishCondition {
52+
FINISH_CONDITION_NONE = 0;
53+
ACKNOWLEDGED = 1;
54+
RESOLVED = 2;
55+
}
56+
57+
string name = 1;
58+
repeated google.protobuf.Struct rules = 2;
59+
// +optional
60+
int32 repeat_count = 3;
61+
// +optional
62+
FinishCondition finish_condition = 4;
63+
// +optional
64+
google.protobuf.Struct tags = 5;
65+
string service_id = 6;
66+
}
67+
68+
message EscalationPolicyRequest {
69+
string escalation_policy_id = 1;
70+
}
71+
72+
message EscalationPolicySearchQuery {
73+
// +optional
74+
spaceone.api.core.v2.Query query = 1;
75+
// +optional
76+
string escalation_policy_id = 2;
77+
// +optional
78+
string name = 3;
79+
// +optional
80+
string finish_condition = 4;
81+
// +optional
82+
string service_id = 5;
83+
}
84+
85+
message EscalationPolicyStatQuery {
86+
spaceone.api.core.v2.StatisticsQuery query = 1;
87+
}
88+
89+
90+
//////////
91+
//Returns
92+
//////////
93+
94+
message EscalationPolicyInfo {
95+
string escalation_policy_id = 1;
96+
string name = 2;
97+
repeated google.protobuf.Struct rules = 3;
98+
int32 repeat_count = 4;
99+
string finish_condition = 5;
100+
google.protobuf.Struct tags = 6;
101+
string service_id = 7;
102+
string workspace_id = 8;
103+
string domain_id = 9;
104+
string created_at = 10;
105+
}
106+
107+
message EscalationPoliciesInfo {
108+
repeated EscalationPolicyInfo results = 1;
109+
int32 total_count = 2;
110+
}

0 commit comments

Comments
 (0)