Skip to content
Merged
Show file tree
Hide file tree
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
56 changes: 56 additions & 0 deletions proto/spaceone/api/alert_manager/plugin/event.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
syntax = "proto3";

package spaceone.api.alert_manager.plugin;

option go_package = "github.com/cloudforet-io/api/dist/go/spaceone/api/alert-manager/plugin";

import "google/protobuf/empty.proto";
import "google/protobuf/struct.proto";
import "spaceone/api/alert_manager/v1/event.proto";

service Event {
rpc parse (ParseRequest) returns (EventsInfo) {}
}

message ParseRequest {
google.protobuf.Struct options = 1;
google.protobuf.Struct data = 2;

string domain_id = 21;
}

enum EventType {
EVENT_TYPE_NONE = 0;
RECOVERY = 1;
ALERT = 2;
}

message EventResource {
// +optional
string resource_id = 1;
// +optional
string resource_type = 2;
// +optional
string name = 3;
}

message EventInfo {
string event_key = 1;
EventType event_type = 2;
string title = 3;
string description = 4;
spaceone.api.alert_manager.v1.EventSeverity severity = 5;
string rule = 6;
string image_url = 7;
repeated string resources = 8;
string provider = 9;
string account = 10;
google.protobuf.Struct additional_info = 11;

string occurred_at = 31;
}

message EventsInfo {
repeated EventInfo results = 1;
}

54 changes: 54 additions & 0 deletions proto/spaceone/api/alert_manager/plugin/notification.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
syntax = "proto3";

package spaceone.api.alert_manager.plugin;

option go_package = "github.com/cloudforet-io/api/dist/go/spaceone/api/alert-manager/plugin";

import "google/protobuf/empty.proto";
import "google/protobuf/struct.proto";

service Notification {
rpc dispatch (DispatchRequest) returns (google.protobuf.Empty) {}
}

message NotificationTag {
string key = 1;
string value = 2;
google.protobuf.Struct options = 3;
}

message NotificationCallback {
string label = 1;
string url = 2;
google.protobuf.Struct options = 3;
}

message NotificationMessage {
string title = 1;
string link = 2;
string description = 3;
string image_url = 4;

repeated NotificationTag tags = 11;
repeated NotificationCallback callbacks = 12;

string occurred_at = 31;
}

message DispatchRequest {
enum NotificationType {
NOTIFICATION_TYPE_NONE = 0;
ERROR = 1;
WARNING = 2;
SUCCESS = 3;
INFO = 4;
}

google.protobuf.Struct options = 1;
google.protobuf.Struct secret_data = 2;
google.protobuf.Struct channel_data = 3;
NotificationMessage message = 4;
NotificationType notification_type = 5;

string domain_id = 21;
}
31 changes: 31 additions & 0 deletions proto/spaceone/api/alert_manager/plugin/protocol.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// A Collector is a plugin collecting data of external infrastructure resources.
syntax = "proto3";

package spaceone.api.alert_manager.plugin;

option go_package = "github.com/cloudforet-io/api/dist/go/spaceone/api/alert-manager/plugin";

import "google/protobuf/empty.proto";
import "google/protobuf/struct.proto";

service Protocol {
rpc init (InitRequest) returns (PluginInfo) {}
rpc verify (VerifyRequest) returns (google.protobuf.Empty) {}
}

message InitRequest {
google.protobuf.Struct options = 1;

string domain_id = 21;
}

message VerifyRequest {
google.protobuf.Struct options = 1;
google.protobuf.Struct secret_data = 2;

string domain_id = 21;
}

message PluginInfo {
google.protobuf.Struct metadata = 1;
}
29 changes: 29 additions & 0 deletions proto/spaceone/api/alert_manager/plugin/webhook.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
syntax = "proto3";

package spaceone.api.alert_manager.plugin;

option go_package = "github.com/cloudforet-io/api/dist/go/spaceone/api/alert-manager/plugin";

import "google/protobuf/empty.proto";
import "google/protobuf/struct.proto";

service Webhook {
rpc init (InitRequest) returns (PluginInfo) {}
rpc verify (VerifyRequest) returns (google.protobuf.Empty) {}
}

message InitRequest {
google.protobuf.Struct options = 1;

string domain_id = 21;
}

message VerifyRequest {
google.protobuf.Struct options = 1;

string domain_id = 21;
}

message PluginInfo {
google.protobuf.Struct metadata = 1;
}
Loading
Loading