plugin

package
v0.0.0-...-ae3c806 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 1, 2024 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

View Source
const (
	Protocol_Init_FullMethodName   = "/spaceone.api.notification.plugin.Protocol/init"
	Protocol_Verify_FullMethodName = "/spaceone.api.notification.plugin.Protocol/verify"
)
View Source
const (
	Notification_Dispatch_FullMethodName = "/spaceone.api.notification.plugin.Notification/dispatch"
)

Variables

View Source
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.

View Source
var File_spaceone_api_notification_plugin_notification_proto protoreflect.FileDescriptor
View Source
var File_spaceone_api_notification_plugin_protocol_proto protoreflect.FileDescriptor
View Source
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)

View Source
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.

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 (*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) Enum

func (PluginDispatchRequest_NotificationType) EnumDescriptor deprecated

func (PluginDispatchRequest_NotificationType) EnumDescriptor() ([]byte, []int)

Deprecated: Use PluginDispatchRequest_NotificationType.Descriptor instead.

func (PluginDispatchRequest_NotificationType) Number

func (PluginDispatchRequest_NotificationType) String

func (PluginDispatchRequest_NotificationType) Type

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

type UnimplementedProtocolServer

type UnimplementedProtocolServer struct {
}

UnimplementedProtocolServer must be embedded to have forward compatible implementations.

func (UnimplementedProtocolServer) Init

func (UnimplementedProtocolServer) Verify

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL