Skip to content

Commit

Permalink
Merge pull request #204 from whdalsrnt/master
Browse files Browse the repository at this point in the history
feat: change monitoring protos for SpaceONE 2.0
  • Loading branch information
whdalsrnt authored Dec 17, 2023
2 parents 3a6afd0 + 0ff6c73 commit 331698f
Show file tree
Hide file tree
Showing 7 changed files with 81 additions and 119 deletions.
75 changes: 35 additions & 40 deletions proto/spaceone/api/monitoring/v1/alert.proto
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,19 @@ service Alert {
body: "*"
};
}
// Updates the state of an Alert via callback URL by creating a temporary `access_key` while generating a Notification about the Alert.
rpc update_state (UpdateAlertStateRequest) returns (AlertInfo) {


rpc assign_user (AssignUserRequest) returns (AlertInfo) {
option (google.api.http) = {
post: "/monitoring/v1/alert/update-state"
post: "/monitoring/v1/alert/assign-user"
body: "*"
};
}

// Updates the state of an Alert via callback URL by creating a temporary `access_key` while generating a Notification about the Alert.
// +noauth
rpc update_state (UpdateAlertStateRequest) returns (AlertInfo) {}

// Deletes a specific Alert and remove it from the list of Alerts. You must specify the `alert_id` of the Alert to delete.
rpc delete (AlertRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
Expand Down Expand Up @@ -89,11 +93,6 @@ message AlertResource {
string name = 3;
}

message AlertResponder {
string resource_type = 1;
string resource_id = 2;
}

//{
// "title": "sample test",
// "description": "This is a description of sample.",
Expand Down Expand Up @@ -126,21 +125,11 @@ message UpdateAlertRequest {
// +optional
string state = 3;
// +optional
string status_message = 4;
// +optional
string description = 5;
// +optional
string assignee = 6;
// +optional
AlertUrgency urgency = 7;
// +optional
string project_id = 8;
// +optional
bool reset_status_message = 11;
string description = 4;
// +optional
bool reset_description = 12;
AlertUrgency urgency = 5;
// +optional
bool reset_assignee = 13;
string project_id = 21;
}

//{
Expand All @@ -154,6 +143,11 @@ message UpdateAlertStateRequest {
string state = 3;
}

message AssignUserRequest {
string alert_id = 1;
string assignee = 2;
}

//{
// "alert_id": "alert-123456789012",
//}
Expand Down Expand Up @@ -191,11 +185,13 @@ message AlertQuery {
// +optional
string triggered_by = 13;
// +optional
string webhook_id = 21;
string workspace_id = 21;
// +optional
string escalation_policy_id = 22;
string project_id = 22;
// +optional
string project_id = 23;
string webhook_id = 23;
// +optional
string escalation_policy_id = 24;
}

//{
Expand All @@ -221,26 +217,25 @@ message AlertInfo {
string alert_id = 2;
string title = 3;
AlertState state = 4;
string status_message = 5;
string description = 6;
string assignee = 7;
AlertUrgency urgency = 8;
string severity = 9;
string rule = 10;
string description = 5;
string assignee = 6;
AlertUrgency urgency = 7;
string severity = 8;
string rule = 9;
string image_url = 10;
AlertResource resource = 11;
string provider = 12;
string account = 13;
int32 escalation_step = 14;
int32 escalation_ttl = 15;
string image_url = 16;
google.protobuf.Struct additional_info = 17;
string triggered_by = 18;
string webhook_id = 19;
string escalation_policy_id = 20;
google.protobuf.Struct additional_info = 14;
int32 escalation_step = 15;
int32 escalation_ttl = 16;
string triggered_by = 17;

string project_id = 21;
string domain_id = 21;
string workspace_id = 22;
string domain_id = 23;
string project_id = 23;
string webhook_id = 24;
string escalation_policy_id = 25;

string created_at = 31;
string updated_at = 32;
Expand Down
32 changes: 3 additions & 29 deletions proto/spaceone/api/monitoring/v1/data_source.proto
Original file line number Diff line number Diff line change
Expand Up @@ -133,18 +133,10 @@ enum MonitoringType {
// "domain_id": "domain-123456789012"
//}
message RegisterDataSourceRequest {

enum ResourceGroup {
RESOURCE_GROUP_NONE = 0;
DOMAIN = 1;
WORKSPACE = 2;
}

string name = 1;
DataSourcePluginInfo plugin_info = 3;
DataSourcePluginInfo plugin_info = 2;
// +optional
google.protobuf.Struct tags = 4;
ResourceGroup resource_group = 5;
google.protobuf.Struct tags = 3;
}

//{
Expand Down Expand Up @@ -197,13 +189,6 @@ message DataSourceRequest {
// "domain_id": "domain-123456789012"
//}
message DataSourceQuery {

enum ResourceGroup {
RESOURCE_GROUP_NONE = 0;
DOMAIN = 1;
WORKSPACE = 2;
}

// +optional
spaceone.api.core.v1.Query query = 1;
// +optional
Expand All @@ -216,10 +201,6 @@ message DataSourceQuery {
MonitoringType monitoring_type = 5;
// +optional
string provider = 6;
// +optional
ResourceGroup resource_group = 7;
// +optional
string workspace_id = 8;
}

//{
Expand Down Expand Up @@ -271,12 +252,6 @@ message DataSourceInfo {
DISABLED = 2;
}

enum ResourceGroup {
RESOURCE_GROUP_NONE = 0;
DOMAIN = 1;
WORKSPACE = 2;
}

string data_source_id = 1;
string name = 2;
State state = 3;
Expand All @@ -285,10 +260,9 @@ message DataSourceInfo {
google.protobuf.Struct capability = 6;
DataSourcePluginInfo plugin_info = 7;
google.protobuf.Struct tags = 8;
ResourceGroup resource_group = 9;

string workspace_id = 20;
string domain_id = 21;

string created_at = 31;
}

Expand Down
41 changes: 19 additions & 22 deletions proto/spaceone/api/monitoring/v1/event.proto
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,10 @@ import "spaceone/api/core/v1/query.proto";

service Event {
// Creates a new Event. The Event creation process starts with validation checking whether the input data is from a webhook or not. After the input data is validated, the data is processed and used to create the Event.
rpc create (CreateEventRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/monitoring/v1/event/create"
body: "*"
};
}
rpc create (CreateEventRequest) returns (google.protobuf.Empty) {}

// Gets a specific Event matching the input parameters, `event_id` and `domain_id`. Prints detailed information about the Event.
rpc get (GetEventRequest) returns (EventInfo) {
rpc get (EventRequest) returns (EventInfo) {
option (google.api.http) = {
post: "/monitoring/v1/event/get"
body: "*"
Expand Down Expand Up @@ -59,7 +54,7 @@ message CreateEventRequest {
//{
// "event_id": "event-4e16ba3bd384",
//}
message GetEventRequest {
message EventRequest {
string event_id = 1;
}

Expand All @@ -85,11 +80,13 @@ message EventQuery {
// +optional
string account = 8;
// +optional
string alert_id = 11;
string workspace_id = 21;
// +optional
string project_id = 22;
// +optional
string webhook_id = 12;
string alert_id = 23;
// +optional
string project_id = 13;
string webhook_id = 24;
}

//{
Expand Down Expand Up @@ -138,18 +135,18 @@ message EventInfo {
string description = 5;
string severity = 6;
string rule = 7;
EventResource resource = 8;
string provider = 9;
string account = 10;
string image_url = 11;
google.protobuf.Struct raw_data = 21;
google.protobuf.Struct additional_info = 22;
string alert_id = 31;
string webhook_id = 32;
string image_url = 8;
EventResource resource = 9;
string provider = 10;
string account = 11;
google.protobuf.Struct additional_info = 12;
google.protobuf.Struct raw_data = 13;

string project_id = 33;
string workspace_id = 34;
string domain_id = 35;
string domain_id = 21;
string workspace_id = 22;
string project_id = 23;
string alert_id = 24;
string webhook_id = 25;

string created_at = 41;
string occurred_at = 42;
Expand Down
26 changes: 9 additions & 17 deletions proto/spaceone/api/monitoring/v1/event_rule.proto
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,10 @@ message CreateEventRuleRequest {
// +optional
EventRuleOptions options = 5;
// +optional
string project_id = 6;
google.protobuf.Struct tags = 6;
ResourceGroup resource_group = 20;
// +optional
google.protobuf.Struct tags = 7;
ResourceGroup resource_group = 8;
string project_id = 21;
}

//{
Expand Down Expand Up @@ -197,23 +197,16 @@ message EventRuleRequest {
// "domain_id": "domain-123456789012"
//}
message EventRuleQuery {

enum ResourceGroup {
RESOURCE_GROUP_NONE = 0;
WORKSPACE = 1;
PROJECT = 2;
}

// +optional
spaceone.api.core.v1.Query query = 1;
// +optional
string event_rule_id = 2;
// +optional
string name = 3;
// +optional
ResourceGroup resource_group = 4;
string workspace_id = 21;
// +optional
string project_id = 5;
string project_id = 22;
}

//{
Expand Down Expand Up @@ -244,7 +237,6 @@ message EventRuleQuery {
// "created_at": "2022-01-02T06:02:31.517Z"
//}
message EventRuleInfo {

enum ConditionsPolicy {
NONE = 0;
ALL = 1;
Expand All @@ -265,12 +257,12 @@ message EventRuleInfo {
ConditionsPolicy conditions_policy = 5;
EventRuleActions actions = 6;
EventRuleOptions options = 7;
string project_id = 9;
google.protobuf.Struct tags = 10;
ResourceGroup resource_group = 11;
google.protobuf.Struct tags = 8;

string workspace_id = 20;
ResourceGroup resource_group = 20;
string domain_id = 21;
string workspace_id = 22;
string project_id = 23;

string created_at = 31;
}
Expand Down
8 changes: 5 additions & 3 deletions proto/spaceone/api/monitoring/v1/note.proto
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ message NoteQuery {
// +optional
string created_by = 4;
// +optional
string project_id = 5;
string workspace_id = 21;
// +optional
string project_id = 22;
}

//{
Expand All @@ -118,9 +120,9 @@ message NoteInfo {
string note = 3;
string created_by = 11;

string project_id = 19;
string workspace_id = 20;
string domain_id = 21;
string workspace_id = 22;
string project_id = 23;

string created_at = 31;
}
Expand Down
10 changes: 6 additions & 4 deletions proto/spaceone/api/monitoring/v1/project_alert_config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ message ProjectAlertConfigQuery {
// +optional
string project_id = 2;
// +optional
string escalation_policy_id = 3;
string escalation_policy_id = 21;
}

//{
Expand All @@ -150,9 +150,11 @@ message ProjectAlertConfigInfo {
string project_id = 1;
AlertOptions options = 2;
spaceone.api.monitoring.v1.EscalationPolicyInfo escalation_policy_info = 3;
string domain_id = 11;
string workspace_id = 20;
string created_at = 21;

string domain_id = 21;
string workspace_id = 22;

string created_at = 31;
}

//{
Expand Down
Loading

0 comments on commit 331698f

Please sign in to comment.