Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterNotificationServer(s grpc.ServiceRegistrar, srv NotificationServer)
- func RegisterProtocolServer(s grpc.ServiceRegistrar, srv ProtocolServer)
- type InitRequest
- type NotificationClient
- type NotificationServer
- type PluginDispatchRequest
- func (*PluginDispatchRequest) Descriptor() ([]byte, []int)deprecated
- func (x *PluginDispatchRequest) GetChannelData() *_struct.Struct
- func (x *PluginDispatchRequest) GetMessage() *_struct.Struct
- func (x *PluginDispatchRequest) GetNotificationType() PluginDispatchRequest_NotificationType
- func (x *PluginDispatchRequest) GetOptions() *_struct.Struct
- func (x *PluginDispatchRequest) GetSecretData() *_struct.Struct
- func (*PluginDispatchRequest) ProtoMessage()
- func (x *PluginDispatchRequest) ProtoReflect() protoreflect.Message
- func (x *PluginDispatchRequest) Reset()
- func (x *PluginDispatchRequest) String() string
- type PluginDispatchRequest_NotificationType
- func (PluginDispatchRequest_NotificationType) Descriptor() protoreflect.EnumDescriptor
- func (x PluginDispatchRequest_NotificationType) Enum() *PluginDispatchRequest_NotificationType
- func (PluginDispatchRequest_NotificationType) EnumDescriptor() ([]byte, []int)deprecated
- func (x PluginDispatchRequest_NotificationType) Number() protoreflect.EnumNumber
- func (x PluginDispatchRequest_NotificationType) String() string
- func (PluginDispatchRequest_NotificationType) Type() protoreflect.EnumType
- type PluginInfo
- type PluginVerifyRequest
- func (*PluginVerifyRequest) Descriptor() ([]byte, []int)deprecated
- func (x *PluginVerifyRequest) GetOptions() *_struct.Struct
- func (x *PluginVerifyRequest) GetSecretData() *_struct.Struct
- func (*PluginVerifyRequest) ProtoMessage()
- func (x *PluginVerifyRequest) ProtoReflect() protoreflect.Message
- func (x *PluginVerifyRequest) Reset()
- func (x *PluginVerifyRequest) String() string
- type ProtocolClient
- type ProtocolServer
- type UnimplementedNotificationServer
- type UnimplementedProtocolServer
- type UnsafeNotificationServer
- type UnsafeProtocolServer
Constants ¶
const ( Protocol_Init_FullMethodName = "/spaceone.api.notification.plugin.Protocol/init" Protocol_Verify_FullMethodName = "/spaceone.api.notification.plugin.Protocol/verify" )
const (
Notification_Dispatch_FullMethodName = "/spaceone.api.notification.plugin.Notification/dispatch"
)
Variables ¶
var ( PluginDispatchRequest_NotificationType_name = map[int32]string{ 0: "NOTIFICATION_TYPE_NONE", 1: "INFO", 2: "ERROR", 3: "SUCCESS", 4: "WARNING", } PluginDispatchRequest_NotificationType_value = map[string]int32{ "NOTIFICATION_TYPE_NONE": 0, "INFO": 1, "ERROR": 2, "SUCCESS": 3, "WARNING": 4, } )
Enum value maps for PluginDispatchRequest_NotificationType.
var File_spaceone_api_notification_plugin_notification_proto protoreflect.FileDescriptor
var File_spaceone_api_notification_plugin_protocol_proto protoreflect.FileDescriptor
var Notification_ServiceDesc = grpc.ServiceDesc{ ServiceName: "spaceone.api.notification.plugin.Notification", HandlerType: (*NotificationServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "dispatch", Handler: _Notification_Dispatch_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "spaceone/api/notification/plugin/notification.proto", }
Notification_ServiceDesc is the grpc.ServiceDesc for Notification service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var Protocol_ServiceDesc = grpc.ServiceDesc{ ServiceName: "spaceone.api.notification.plugin.Protocol", HandlerType: (*ProtocolServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "init", Handler: _Protocol_Init_Handler, }, { MethodName: "verify", Handler: _Protocol_Verify_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "spaceone/api/notification/plugin/protocol.proto", }
Protocol_ServiceDesc is the grpc.ServiceDesc for Protocol service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterNotificationServer ¶
func RegisterNotificationServer(s grpc.ServiceRegistrar, srv NotificationServer)
func RegisterProtocolServer ¶
func RegisterProtocolServer(s grpc.ServiceRegistrar, srv ProtocolServer)
Types ¶
type InitRequest ¶
type InitRequest struct { // Option value used when initializing the plugin. Options *_struct.Struct `protobuf:"bytes,1,opt,name=options,proto3" json:"options,omitempty"` // contains filtered or unexported fields }
{ "options": {} }
func (*InitRequest) Descriptor
deprecated
func (*InitRequest) Descriptor() ([]byte, []int)
Deprecated: Use InitRequest.ProtoReflect.Descriptor instead.
func (*InitRequest) GetOptions ¶
func (x *InitRequest) GetOptions() *_struct.Struct
func (*InitRequest) ProtoMessage ¶
func (*InitRequest) ProtoMessage()
func (*InitRequest) ProtoReflect ¶
func (x *InitRequest) ProtoReflect() protoreflect.Message
func (*InitRequest) Reset ¶
func (x *InitRequest) Reset()
func (*InitRequest) String ¶
func (x *InitRequest) String() string
type NotificationClient ¶
type NotificationClient interface { // Dispatches data from Cloudforet to a specific notification Protocol. When dispatching data, data input by a User is included in the `options` parameter, and `notification` information to be delivered is included in the `message` parameter. Also, data dispatched includes basic information such as `notification_type` and `secret_data`. Dispatch(ctx context.Context, in *PluginDispatchRequest, opts ...grpc.CallOption) (*empty.Empty, error) }
NotificationClient is the client API for Notification service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewNotificationClient ¶
func NewNotificationClient(cc grpc.ClientConnInterface) NotificationClient
type NotificationServer ¶
type NotificationServer interface { // Dispatches data from Cloudforet to a specific notification Protocol. When dispatching data, data input by a User is included in the `options` parameter, and `notification` information to be delivered is included in the `message` parameter. Also, data dispatched includes basic information such as `notification_type` and `secret_data`. Dispatch(context.Context, *PluginDispatchRequest) (*empty.Empty, error) // contains filtered or unexported methods }
NotificationServer is the server API for Notification service. All implementations must embed UnimplementedNotificationServer for forward compatibility
type PluginDispatchRequest ¶
type PluginDispatchRequest struct { // Option value required for notification delivery. Options *_struct.Struct `protobuf:"bytes,1,opt,name=options,proto3" json:"options,omitempty"` // Message containing notification information Message *_struct.Struct `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` // The type of Notification NotificationType PluginDispatchRequest_NotificationType `` /* 187-byte string literal not displayed */ // Secret value required for notification delivery. // The secret data usually includes the credential information required for the plugin to access the external system. SecretData *_struct.Struct `protobuf:"bytes,4,opt,name=secret_data,json=secretData,proto3" json:"secret_data,omitempty"` // Channel data required for notification delivery. ChannelData *_struct.Struct `protobuf:"bytes,5,opt,name=channel_data,json=channelData,proto3" json:"channel_data,omitempty"` // contains filtered or unexported fields }
{ "options": {}, "message": { "tags": [ { "key": "Alert Number", "options": {"short": true}, "value": "#108664" }, { "options": {"short": true}, "key": "State", "value": "TRIGGERED" }, { "value": "LOW", "options": {"short": true}, "key": "Urgency" }, { "value": "kubectl-webhook", "key": "Triggered by", "options": {"short": true} }, { "value": "SpaceONE > Project1", "key": "Project" }, { "value": "spaceone-api", "key": "Resource" } ], "occurred_at": "2022-06-27T09:22:57.967Z", "callbacks": [{ "url": "https://monitoring-webhook.dev.spaceone.dev/monitoring/v1/alert/alert-x1v2c3v456/8f2ede36213dqw4d7d5awe07ds32d883/ACKNOWLEDGED", "label": "Acknowledge Alerts"}], "link": "https://spaceone.console.dev.spaceone.dev/alert-manager/alert/alert-x1v2c3v456", "title": "[Alerting] Notification of access to the SpaceONE", "description": "SSH Access to spaceone-api from admin"}, "notification_type": "INFO", "secret_data": "********", "channel_data": {"email": "test5@test.com"} }
func (*PluginDispatchRequest) Descriptor
deprecated
func (*PluginDispatchRequest) Descriptor() ([]byte, []int)
Deprecated: Use PluginDispatchRequest.ProtoReflect.Descriptor instead.
func (*PluginDispatchRequest) GetChannelData ¶
func (x *PluginDispatchRequest) GetChannelData() *_struct.Struct
func (*PluginDispatchRequest) GetMessage ¶
func (x *PluginDispatchRequest) GetMessage() *_struct.Struct
func (*PluginDispatchRequest) GetNotificationType ¶
func (x *PluginDispatchRequest) GetNotificationType() PluginDispatchRequest_NotificationType
func (*PluginDispatchRequest) GetOptions ¶
func (x *PluginDispatchRequest) GetOptions() *_struct.Struct
func (*PluginDispatchRequest) GetSecretData ¶
func (x *PluginDispatchRequest) GetSecretData() *_struct.Struct
func (*PluginDispatchRequest) ProtoMessage ¶
func (*PluginDispatchRequest) ProtoMessage()
func (*PluginDispatchRequest) ProtoReflect ¶
func (x *PluginDispatchRequest) ProtoReflect() protoreflect.Message
func (*PluginDispatchRequest) Reset ¶
func (x *PluginDispatchRequest) Reset()
func (*PluginDispatchRequest) String ¶
func (x *PluginDispatchRequest) String() string
type PluginDispatchRequest_NotificationType ¶
type PluginDispatchRequest_NotificationType int32
const ( PluginDispatchRequest_NOTIFICATION_TYPE_NONE PluginDispatchRequest_NotificationType = 0 PluginDispatchRequest_INFO PluginDispatchRequest_NotificationType = 1 PluginDispatchRequest_ERROR PluginDispatchRequest_NotificationType = 2 PluginDispatchRequest_SUCCESS PluginDispatchRequest_NotificationType = 3 PluginDispatchRequest_WARNING PluginDispatchRequest_NotificationType = 4 )
func (PluginDispatchRequest_NotificationType) Descriptor ¶
func (PluginDispatchRequest_NotificationType) Descriptor() protoreflect.EnumDescriptor
func (PluginDispatchRequest_NotificationType) EnumDescriptor
deprecated
func (PluginDispatchRequest_NotificationType) EnumDescriptor() ([]byte, []int)
Deprecated: Use PluginDispatchRequest_NotificationType.Descriptor instead.
func (PluginDispatchRequest_NotificationType) Number ¶
func (x PluginDispatchRequest_NotificationType) Number() protoreflect.EnumNumber
func (PluginDispatchRequest_NotificationType) String ¶
func (x PluginDispatchRequest_NotificationType) String() string
func (PluginDispatchRequest_NotificationType) Type ¶
func (PluginDispatchRequest_NotificationType) Type() protoreflect.EnumType
type PluginInfo ¶
type PluginInfo struct { // Metadata value required to input various values required for plugin to work. // In the case of protocol plugins, when creating a channel, the plugin contains the definition of additional data (channel data) required for channel transmission. Metadata *_struct.Struct `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` // contains filtered or unexported fields }
{
"metadata": {} }
func (*PluginInfo) Descriptor
deprecated
func (*PluginInfo) Descriptor() ([]byte, []int)
Deprecated: Use PluginInfo.ProtoReflect.Descriptor instead.
func (*PluginInfo) GetMetadata ¶
func (x *PluginInfo) GetMetadata() *_struct.Struct
func (*PluginInfo) ProtoMessage ¶
func (*PluginInfo) ProtoMessage()
func (*PluginInfo) ProtoReflect ¶
func (x *PluginInfo) ProtoReflect() protoreflect.Message
func (*PluginInfo) Reset ¶
func (x *PluginInfo) Reset()
func (*PluginInfo) String ¶
func (x *PluginInfo) String() string
type PluginVerifyRequest ¶
type PluginVerifyRequest struct { // Option values required for the plugin to work. Options *_struct.Struct `protobuf:"bytes,1,opt,name=options,proto3" json:"options,omitempty"` // The secret value required for the plugin to work. // The secret data usually includes the credential information required for the plugin to access the external system. SecretData *_struct.Struct `protobuf:"bytes,2,opt,name=secret_data,json=secretData,proto3" json:"secret_data,omitempty"` // contains filtered or unexported fields }
{ "options": {} }
func (*PluginVerifyRequest) Descriptor
deprecated
func (*PluginVerifyRequest) Descriptor() ([]byte, []int)
Deprecated: Use PluginVerifyRequest.ProtoReflect.Descriptor instead.
func (*PluginVerifyRequest) GetOptions ¶
func (x *PluginVerifyRequest) GetOptions() *_struct.Struct
func (*PluginVerifyRequest) GetSecretData ¶
func (x *PluginVerifyRequest) GetSecretData() *_struct.Struct
func (*PluginVerifyRequest) ProtoMessage ¶
func (*PluginVerifyRequest) ProtoMessage()
func (*PluginVerifyRequest) ProtoReflect ¶
func (x *PluginVerifyRequest) ProtoReflect() protoreflect.Message
func (*PluginVerifyRequest) Reset ¶
func (x *PluginVerifyRequest) Reset()
func (*PluginVerifyRequest) String ¶
func (x *PluginVerifyRequest) String() string
type ProtocolClient ¶
type ProtocolClient interface { // Initializes a specific Protocol. During initialization, the Protocol information to be passed to the Protocol user is delivered as `metadata`. Protocol information includes its name and version. Init(ctx context.Context, in *InitRequest, opts ...grpc.CallOption) (*PluginInfo, error) // Verifies if a specific Protocol is a valid plugin instance. Verify(ctx context.Context, in *PluginVerifyRequest, opts ...grpc.CallOption) (*empty.Empty, error) }
ProtocolClient is the client API for Protocol service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewProtocolClient ¶
func NewProtocolClient(cc grpc.ClientConnInterface) ProtocolClient
type ProtocolServer ¶
type ProtocolServer interface { // Initializes a specific Protocol. During initialization, the Protocol information to be passed to the Protocol user is delivered as `metadata`. Protocol information includes its name and version. Init(context.Context, *InitRequest) (*PluginInfo, error) // Verifies if a specific Protocol is a valid plugin instance. Verify(context.Context, *PluginVerifyRequest) (*empty.Empty, error) // contains filtered or unexported methods }
ProtocolServer is the server API for Protocol service. All implementations must embed UnimplementedProtocolServer for forward compatibility
type UnimplementedNotificationServer ¶
type UnimplementedNotificationServer struct { }
UnimplementedNotificationServer must be embedded to have forward compatible implementations.
func (UnimplementedNotificationServer) Dispatch ¶
func (UnimplementedNotificationServer) Dispatch(context.Context, *PluginDispatchRequest) (*empty.Empty, error)
type UnimplementedProtocolServer ¶
type UnimplementedProtocolServer struct { }
UnimplementedProtocolServer must be embedded to have forward compatible implementations.
func (UnimplementedProtocolServer) Init ¶
func (UnimplementedProtocolServer) Init(context.Context, *InitRequest) (*PluginInfo, error)
func (UnimplementedProtocolServer) Verify ¶
func (UnimplementedProtocolServer) Verify(context.Context, *PluginVerifyRequest) (*empty.Empty, error)
type UnsafeNotificationServer ¶
type UnsafeNotificationServer interface {
// contains filtered or unexported methods
}
UnsafeNotificationServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to NotificationServer will result in compilation errors.
type UnsafeProtocolServer ¶
type UnsafeProtocolServer interface {
// contains filtered or unexported methods
}
UnsafeProtocolServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ProtocolServer will result in compilation errors.