diff --git a/changelogs/unreleased/2775-xtreme-vikram-yadav b/changelogs/unreleased/2775-xtreme-vikram-yadav new file mode 100644 index 0000000000..9992c85237 --- /dev/null +++ b/changelogs/unreleased/2775-xtreme-vikram-yadav @@ -0,0 +1 @@ +allowed Go plugins to apply yaml \ No newline at end of file diff --git a/pkg/plugin/api/api_test.go b/pkg/plugin/api/api_test.go index 8d61f7cb36..cb0b3fc4fc 100644 --- a/pkg/plugin/api/api_test.go +++ b/pkg/plugin/api/api_test.go @@ -143,6 +143,25 @@ func TestAPI(t *testing.T) { require.NoError(t, err) }, }, + { + name: "applyYaml", + initFunc: func(t *testing.T, mocks *apiMocks) { + mocks.objectStore.EXPECT(). + CreateOrUpdateFromYAML(contextType, "default", "---\nyaml"). + Return([]string{}, nil). + Do(func(ctx context.Context, namespace, yaml string) { + require.Equal(t, "bar", ctx.Value(api.DashboardMetadataKey("foo"))) + }) + }, + doFunc: func(t *testing.T, client *api.Client) { + clientCtx, cancel := context.WithTimeout(context.Background(), 1*time.Second) + defer cancel() + + clientCtx = metadata.AppendToOutgoingContext(clientCtx, "x-octant-foo", "bar") + _, err := client.ApplyYaml(clientCtx, "default", "---\nyaml") + require.NoError(t, err) + }, + }, { name: "get", initFunc: func(t *testing.T, mocks *apiMocks) { diff --git a/pkg/plugin/api/client.go b/pkg/plugin/api/client.go index 8ccf5d1510..31a379c668 100644 --- a/pkg/plugin/api/client.go +++ b/pkg/plugin/api/client.go @@ -149,6 +149,20 @@ func (c *Client) Update(ctx context.Context, object *unstructured.Unstructured) return err } +// ApplyYaml creates or updates resource(s) based on input yaml string. +func (c *Client) ApplyYaml(ctx context.Context, namespace, yaml string) ([]string, error) { + client := c.DashboardConnection.Client() + + req := &proto.ApplyYamlRequest{ + Namespace: namespace, + Yaml: yaml, + } + + res, err := client.ApplyYaml(ctx, req) + + return res.Resources, err +} + func (c *Client) Create(ctx context.Context, object *unstructured.Unstructured) error { client := c.DashboardConnection.Client() diff --git a/pkg/plugin/api/client_test.go b/pkg/plugin/api/client_test.go index 0c1bb6ee4e..4f5100d19f 100644 --- a/pkg/plugin/api/client_test.go +++ b/pkg/plugin/api/client_test.go @@ -42,6 +42,32 @@ func TestClient_Update(t *testing.T) { require.NoError(t, err) } +func TestClient_ApplyYaml(t *testing.T) { + controller := gomock.NewController(t) + defer controller.Finish() + + ctx := context.Background() + namespace := "foo-namespace" + yamlString := "---\napiVersion:apps/v1" + + dashboardClient := fake.NewMockDashboardClient(controller) + req := &proto.ApplyYamlRequest{ + Namespace: namespace, + Yaml: yamlString, + } + dashboardClient.EXPECT().ApplyYaml(gomock.Any(), req).Return(&proto.ApplyYamlResponse{}, nil) + + conn := fake.NewMockDashboardConnection(controller) + conn.EXPECT().Client().Return(dashboardClient) + + connOpt := MockDashboardConnection(conn) + + client, err := api.NewClient("address", connOpt) + require.NoError(t, err) + + _, err = client.ApplyYaml(ctx, namespace, yamlString) + require.NoError(t, err) +} func TestClient_ForceFrontendUpdate(t *testing.T) { controller := gomock.NewController(t) defer controller.Finish() diff --git a/pkg/plugin/api/fake/mock_dash_service.go b/pkg/plugin/api/fake/mock_dash_service.go index 19ad89a395..4a4e1ad792 100644 --- a/pkg/plugin/api/fake/mock_dash_service.go +++ b/pkg/plugin/api/fake/mock_dash_service.go @@ -40,6 +40,21 @@ func (m *MockService) EXPECT() *MockServiceMockRecorder { return m.recorder } +// ApplyYaml mocks base method. +func (m *MockService) ApplyYaml(arg0 context.Context, arg1, arg2 string) ([]string, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ApplyYaml", arg0, arg1, arg2) + ret0, _ := ret[0].([]string) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ApplyYaml indicates an expected call of ApplyYaml. +func (mr *MockServiceMockRecorder) ApplyYaml(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ApplyYaml", reflect.TypeOf((*MockService)(nil).ApplyYaml), arg0, arg1, arg2) +} + // CancelPortForward mocks base method. func (m *MockService) CancelPortForward(arg0 context.Context, arg1 string) { m.ctrl.T.Helper() diff --git a/pkg/plugin/api/fake/mock_dashboard_client.go b/pkg/plugin/api/fake/mock_dashboard_client.go index 5e89f55942..6bb1b2f0d2 100644 --- a/pkg/plugin/api/fake/mock_dashboard_client.go +++ b/pkg/plugin/api/fake/mock_dashboard_client.go @@ -37,6 +37,26 @@ func (m *MockDashboardClient) EXPECT() *MockDashboardClientMockRecorder { return m.recorder } +// ApplyYaml mocks base method. +func (m *MockDashboardClient) ApplyYaml(arg0 context.Context, arg1 *proto.ApplyYamlRequest, arg2 ...grpc.CallOption) (*proto.ApplyYamlResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ApplyYaml", varargs...) + ret0, _ := ret[0].(*proto.ApplyYamlResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ApplyYaml indicates an expected call of ApplyYaml. +func (mr *MockDashboardClientMockRecorder) ApplyYaml(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ApplyYaml", reflect.TypeOf((*MockDashboardClient)(nil).ApplyYaml), varargs...) +} + // CancelPortForward mocks base method. func (m *MockDashboardClient) CancelPortForward(arg0 context.Context, arg1 *proto.CancelPortForwardRequest, arg2 ...grpc.CallOption) (*proto.Empty, error) { m.ctrl.T.Helper() diff --git a/pkg/plugin/api/proto/dashboard_api.pb.go b/pkg/plugin/api/proto/dashboard_api.pb.go index d5d40d819f..4c26645bef 100644 --- a/pkg/plugin/api/proto/dashboard_api.pb.go +++ b/pkg/plugin/api/proto/dashboard_api.pb.go @@ -2,7 +2,7 @@ // versions: // protoc-gen-go v1.27.1 // protoc v3.17.3 -// source: dashboard_api.proto +// source: pkg/plugin/api/proto/dashboard_api.proto package proto @@ -36,7 +36,7 @@ type Empty struct { func (x *Empty) Reset() { *x = Empty{} if protoimpl.UnsafeEnabled { - mi := &file_dashboard_api_proto_msgTypes[0] + mi := &file_pkg_plugin_api_proto_dashboard_api_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -49,7 +49,7 @@ func (x *Empty) String() string { func (*Empty) ProtoMessage() {} func (x *Empty) ProtoReflect() protoreflect.Message { - mi := &file_dashboard_api_proto_msgTypes[0] + mi := &file_pkg_plugin_api_proto_dashboard_api_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -62,7 +62,7 @@ func (x *Empty) ProtoReflect() protoreflect.Message { // Deprecated: Use Empty.ProtoReflect.Descriptor instead. func (*Empty) Descriptor() ([]byte, []int) { - return file_dashboard_api_proto_rawDescGZIP(), []int{0} + return file_pkg_plugin_api_proto_dashboard_api_proto_rawDescGZIP(), []int{0} } type KeyRequest struct { @@ -80,7 +80,7 @@ type KeyRequest struct { func (x *KeyRequest) Reset() { *x = KeyRequest{} if protoimpl.UnsafeEnabled { - mi := &file_dashboard_api_proto_msgTypes[1] + mi := &file_pkg_plugin_api_proto_dashboard_api_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -93,7 +93,7 @@ func (x *KeyRequest) String() string { func (*KeyRequest) ProtoMessage() {} func (x *KeyRequest) ProtoReflect() protoreflect.Message { - mi := &file_dashboard_api_proto_msgTypes[1] + mi := &file_pkg_plugin_api_proto_dashboard_api_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -106,7 +106,7 @@ func (x *KeyRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use KeyRequest.ProtoReflect.Descriptor instead. func (*KeyRequest) Descriptor() ([]byte, []int) { - return file_dashboard_api_proto_rawDescGZIP(), []int{1} + return file_pkg_plugin_api_proto_dashboard_api_proto_rawDescGZIP(), []int{1} } func (x *KeyRequest) GetNamespace() string { @@ -155,7 +155,7 @@ type ListResponse struct { func (x *ListResponse) Reset() { *x = ListResponse{} if protoimpl.UnsafeEnabled { - mi := &file_dashboard_api_proto_msgTypes[2] + mi := &file_pkg_plugin_api_proto_dashboard_api_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -168,7 +168,7 @@ func (x *ListResponse) String() string { func (*ListResponse) ProtoMessage() {} func (x *ListResponse) ProtoReflect() protoreflect.Message { - mi := &file_dashboard_api_proto_msgTypes[2] + mi := &file_pkg_plugin_api_proto_dashboard_api_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -181,7 +181,7 @@ func (x *ListResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ListResponse.ProtoReflect.Descriptor instead. func (*ListResponse) Descriptor() ([]byte, []int) { - return file_dashboard_api_proto_rawDescGZIP(), []int{2} + return file_pkg_plugin_api_proto_dashboard_api_proto_rawDescGZIP(), []int{2} } func (x *ListResponse) GetObjects() [][]byte { @@ -202,7 +202,7 @@ type GetResponse struct { func (x *GetResponse) Reset() { *x = GetResponse{} if protoimpl.UnsafeEnabled { - mi := &file_dashboard_api_proto_msgTypes[3] + mi := &file_pkg_plugin_api_proto_dashboard_api_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -215,7 +215,7 @@ func (x *GetResponse) String() string { func (*GetResponse) ProtoMessage() {} func (x *GetResponse) ProtoReflect() protoreflect.Message { - mi := &file_dashboard_api_proto_msgTypes[3] + mi := &file_pkg_plugin_api_proto_dashboard_api_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -228,7 +228,7 @@ func (x *GetResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetResponse.ProtoReflect.Descriptor instead. func (*GetResponse) Descriptor() ([]byte, []int) { - return file_dashboard_api_proto_rawDescGZIP(), []int{3} + return file_pkg_plugin_api_proto_dashboard_api_proto_rawDescGZIP(), []int{3} } func (x *GetResponse) GetObject() []byte { @@ -249,7 +249,7 @@ type UpdateRequest struct { func (x *UpdateRequest) Reset() { *x = UpdateRequest{} if protoimpl.UnsafeEnabled { - mi := &file_dashboard_api_proto_msgTypes[4] + mi := &file_pkg_plugin_api_proto_dashboard_api_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -262,7 +262,7 @@ func (x *UpdateRequest) String() string { func (*UpdateRequest) ProtoMessage() {} func (x *UpdateRequest) ProtoReflect() protoreflect.Message { - mi := &file_dashboard_api_proto_msgTypes[4] + mi := &file_pkg_plugin_api_proto_dashboard_api_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -275,7 +275,7 @@ func (x *UpdateRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateRequest.ProtoReflect.Descriptor instead. func (*UpdateRequest) Descriptor() ([]byte, []int) { - return file_dashboard_api_proto_rawDescGZIP(), []int{4} + return file_pkg_plugin_api_proto_dashboard_api_proto_rawDescGZIP(), []int{4} } func (x *UpdateRequest) GetObject() []byte { @@ -294,7 +294,7 @@ type UpdateResponse struct { func (x *UpdateResponse) Reset() { *x = UpdateResponse{} if protoimpl.UnsafeEnabled { - mi := &file_dashboard_api_proto_msgTypes[5] + mi := &file_pkg_plugin_api_proto_dashboard_api_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -307,7 +307,7 @@ func (x *UpdateResponse) String() string { func (*UpdateResponse) ProtoMessage() {} func (x *UpdateResponse) ProtoReflect() protoreflect.Message { - mi := &file_dashboard_api_proto_msgTypes[5] + mi := &file_pkg_plugin_api_proto_dashboard_api_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -320,7 +320,7 @@ func (x *UpdateResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateResponse.ProtoReflect.Descriptor instead. func (*UpdateResponse) Descriptor() ([]byte, []int) { - return file_dashboard_api_proto_rawDescGZIP(), []int{5} + return file_pkg_plugin_api_proto_dashboard_api_proto_rawDescGZIP(), []int{5} } type CreateRequest struct { @@ -334,7 +334,7 @@ type CreateRequest struct { func (x *CreateRequest) Reset() { *x = CreateRequest{} if protoimpl.UnsafeEnabled { - mi := &file_dashboard_api_proto_msgTypes[6] + mi := &file_pkg_plugin_api_proto_dashboard_api_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -347,7 +347,7 @@ func (x *CreateRequest) String() string { func (*CreateRequest) ProtoMessage() {} func (x *CreateRequest) ProtoReflect() protoreflect.Message { - mi := &file_dashboard_api_proto_msgTypes[6] + mi := &file_pkg_plugin_api_proto_dashboard_api_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -360,7 +360,7 @@ func (x *CreateRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateRequest.ProtoReflect.Descriptor instead. func (*CreateRequest) Descriptor() ([]byte, []int) { - return file_dashboard_api_proto_rawDescGZIP(), []int{6} + return file_pkg_plugin_api_proto_dashboard_api_proto_rawDescGZIP(), []int{6} } func (x *CreateRequest) GetObject() []byte { @@ -379,7 +379,7 @@ type CreateResponse struct { func (x *CreateResponse) Reset() { *x = CreateResponse{} if protoimpl.UnsafeEnabled { - mi := &file_dashboard_api_proto_msgTypes[7] + mi := &file_pkg_plugin_api_proto_dashboard_api_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -392,7 +392,7 @@ func (x *CreateResponse) String() string { func (*CreateResponse) ProtoMessage() {} func (x *CreateResponse) ProtoReflect() protoreflect.Message { - mi := &file_dashboard_api_proto_msgTypes[7] + mi := &file_pkg_plugin_api_proto_dashboard_api_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -405,7 +405,109 @@ func (x *CreateResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateResponse.ProtoReflect.Descriptor instead. func (*CreateResponse) Descriptor() ([]byte, []int) { - return file_dashboard_api_proto_rawDescGZIP(), []int{7} + return file_pkg_plugin_api_proto_dashboard_api_proto_rawDescGZIP(), []int{7} +} + +type ApplyYamlRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` + Yaml string `protobuf:"bytes,2,opt,name=yaml,proto3" json:"yaml,omitempty"` +} + +func (x *ApplyYamlRequest) Reset() { + *x = ApplyYamlRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_plugin_api_proto_dashboard_api_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ApplyYamlRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ApplyYamlRequest) ProtoMessage() {} + +func (x *ApplyYamlRequest) ProtoReflect() protoreflect.Message { + mi := &file_pkg_plugin_api_proto_dashboard_api_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ApplyYamlRequest.ProtoReflect.Descriptor instead. +func (*ApplyYamlRequest) Descriptor() ([]byte, []int) { + return file_pkg_plugin_api_proto_dashboard_api_proto_rawDescGZIP(), []int{8} +} + +func (x *ApplyYamlRequest) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *ApplyYamlRequest) GetYaml() string { + if x != nil { + return x.Yaml + } + return "" +} + +type ApplyYamlResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Resources []string `protobuf:"bytes,1,rep,name=resources,proto3" json:"resources,omitempty"` +} + +func (x *ApplyYamlResponse) Reset() { + *x = ApplyYamlResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_plugin_api_proto_dashboard_api_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ApplyYamlResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ApplyYamlResponse) ProtoMessage() {} + +func (x *ApplyYamlResponse) ProtoReflect() protoreflect.Message { + mi := &file_pkg_plugin_api_proto_dashboard_api_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ApplyYamlResponse.ProtoReflect.Descriptor instead. +func (*ApplyYamlResponse) Descriptor() ([]byte, []int) { + return file_pkg_plugin_api_proto_dashboard_api_proto_rawDescGZIP(), []int{9} +} + +func (x *ApplyYamlResponse) GetResources() []string { + if x != nil { + return x.Resources + } + return nil } type DeleteResponse struct { @@ -417,7 +519,7 @@ type DeleteResponse struct { func (x *DeleteResponse) Reset() { *x = DeleteResponse{} if protoimpl.UnsafeEnabled { - mi := &file_dashboard_api_proto_msgTypes[8] + mi := &file_pkg_plugin_api_proto_dashboard_api_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -430,7 +532,7 @@ func (x *DeleteResponse) String() string { func (*DeleteResponse) ProtoMessage() {} func (x *DeleteResponse) ProtoReflect() protoreflect.Message { - mi := &file_dashboard_api_proto_msgTypes[8] + mi := &file_pkg_plugin_api_proto_dashboard_api_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -443,7 +545,7 @@ func (x *DeleteResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteResponse.ProtoReflect.Descriptor instead. func (*DeleteResponse) Descriptor() ([]byte, []int) { - return file_dashboard_api_proto_rawDescGZIP(), []int{8} + return file_pkg_plugin_api_proto_dashboard_api_proto_rawDescGZIP(), []int{10} } type PortForwardRequest struct { @@ -460,7 +562,7 @@ type PortForwardRequest struct { func (x *PortForwardRequest) Reset() { *x = PortForwardRequest{} if protoimpl.UnsafeEnabled { - mi := &file_dashboard_api_proto_msgTypes[9] + mi := &file_pkg_plugin_api_proto_dashboard_api_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -473,7 +575,7 @@ func (x *PortForwardRequest) String() string { func (*PortForwardRequest) ProtoMessage() {} func (x *PortForwardRequest) ProtoReflect() protoreflect.Message { - mi := &file_dashboard_api_proto_msgTypes[9] + mi := &file_pkg_plugin_api_proto_dashboard_api_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -486,7 +588,7 @@ func (x *PortForwardRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use PortForwardRequest.ProtoReflect.Descriptor instead. func (*PortForwardRequest) Descriptor() ([]byte, []int) { - return file_dashboard_api_proto_rawDescGZIP(), []int{9} + return file_pkg_plugin_api_proto_dashboard_api_proto_rawDescGZIP(), []int{11} } func (x *PortForwardRequest) GetNamespace() string { @@ -529,7 +631,7 @@ type PortForwardResponse struct { func (x *PortForwardResponse) Reset() { *x = PortForwardResponse{} if protoimpl.UnsafeEnabled { - mi := &file_dashboard_api_proto_msgTypes[10] + mi := &file_pkg_plugin_api_proto_dashboard_api_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -542,7 +644,7 @@ func (x *PortForwardResponse) String() string { func (*PortForwardResponse) ProtoMessage() {} func (x *PortForwardResponse) ProtoReflect() protoreflect.Message { - mi := &file_dashboard_api_proto_msgTypes[10] + mi := &file_pkg_plugin_api_proto_dashboard_api_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -555,7 +657,7 @@ func (x *PortForwardResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use PortForwardResponse.ProtoReflect.Descriptor instead. func (*PortForwardResponse) Descriptor() ([]byte, []int) { - return file_dashboard_api_proto_rawDescGZIP(), []int{10} + return file_pkg_plugin_api_proto_dashboard_api_proto_rawDescGZIP(), []int{12} } func (x *PortForwardResponse) GetPortForwardID() string { @@ -583,7 +685,7 @@ type CancelPortForwardRequest struct { func (x *CancelPortForwardRequest) Reset() { *x = CancelPortForwardRequest{} if protoimpl.UnsafeEnabled { - mi := &file_dashboard_api_proto_msgTypes[11] + mi := &file_pkg_plugin_api_proto_dashboard_api_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -596,7 +698,7 @@ func (x *CancelPortForwardRequest) String() string { func (*CancelPortForwardRequest) ProtoMessage() {} func (x *CancelPortForwardRequest) ProtoReflect() protoreflect.Message { - mi := &file_dashboard_api_proto_msgTypes[11] + mi := &file_pkg_plugin_api_proto_dashboard_api_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -609,7 +711,7 @@ func (x *CancelPortForwardRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CancelPortForwardRequest.ProtoReflect.Descriptor instead. func (*CancelPortForwardRequest) Descriptor() ([]byte, []int) { - return file_dashboard_api_proto_rawDescGZIP(), []int{11} + return file_pkg_plugin_api_proto_dashboard_api_proto_rawDescGZIP(), []int{13} } func (x *CancelPortForwardRequest) GetPortForwardID() string { @@ -630,7 +732,7 @@ type NamespacesResponse struct { func (x *NamespacesResponse) Reset() { *x = NamespacesResponse{} if protoimpl.UnsafeEnabled { - mi := &file_dashboard_api_proto_msgTypes[12] + mi := &file_pkg_plugin_api_proto_dashboard_api_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -643,7 +745,7 @@ func (x *NamespacesResponse) String() string { func (*NamespacesResponse) ProtoMessage() {} func (x *NamespacesResponse) ProtoReflect() protoreflect.Message { - mi := &file_dashboard_api_proto_msgTypes[12] + mi := &file_pkg_plugin_api_proto_dashboard_api_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -656,7 +758,7 @@ func (x *NamespacesResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use NamespacesResponse.ProtoReflect.Descriptor instead. func (*NamespacesResponse) Descriptor() ([]byte, []int) { - return file_dashboard_api_proto_rawDescGZIP(), []int{12} + return file_pkg_plugin_api_proto_dashboard_api_proto_rawDescGZIP(), []int{14} } func (x *NamespacesResponse) GetNamespaces() []string { @@ -680,7 +782,7 @@ type AlertRequest struct { func (x *AlertRequest) Reset() { *x = AlertRequest{} if protoimpl.UnsafeEnabled { - mi := &file_dashboard_api_proto_msgTypes[13] + mi := &file_pkg_plugin_api_proto_dashboard_api_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -693,7 +795,7 @@ func (x *AlertRequest) String() string { func (*AlertRequest) ProtoMessage() {} func (x *AlertRequest) ProtoReflect() protoreflect.Message { - mi := &file_dashboard_api_proto_msgTypes[13] + mi := &file_pkg_plugin_api_proto_dashboard_api_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -706,7 +808,7 @@ func (x *AlertRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use AlertRequest.ProtoReflect.Descriptor instead. func (*AlertRequest) Descriptor() ([]byte, []int) { - return file_dashboard_api_proto_rawDescGZIP(), []int{13} + return file_pkg_plugin_api_proto_dashboard_api_proto_rawDescGZIP(), []int{15} } func (x *AlertRequest) GetType() string { @@ -748,7 +850,7 @@ type LinkResponse struct { func (x *LinkResponse) Reset() { *x = LinkResponse{} if protoimpl.UnsafeEnabled { - mi := &file_dashboard_api_proto_msgTypes[14] + mi := &file_pkg_plugin_api_proto_dashboard_api_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -761,7 +863,7 @@ func (x *LinkResponse) String() string { func (*LinkResponse) ProtoMessage() {} func (x *LinkResponse) ProtoReflect() protoreflect.Message { - mi := &file_dashboard_api_proto_msgTypes[14] + mi := &file_pkg_plugin_api_proto_dashboard_api_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -774,7 +876,7 @@ func (x *LinkResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use LinkResponse.ProtoReflect.Descriptor instead. func (*LinkResponse) Descriptor() ([]byte, []int) { - return file_dashboard_api_proto_rawDescGZIP(), []int{14} + return file_pkg_plugin_api_proto_dashboard_api_proto_rawDescGZIP(), []int{16} } func (x *LinkResponse) GetRef() string { @@ -797,7 +899,7 @@ type EventRequest struct { func (x *EventRequest) Reset() { *x = EventRequest{} if protoimpl.UnsafeEnabled { - mi := &file_dashboard_api_proto_msgTypes[15] + mi := &file_pkg_plugin_api_proto_dashboard_api_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -810,7 +912,7 @@ func (x *EventRequest) String() string { func (*EventRequest) ProtoMessage() {} func (x *EventRequest) ProtoReflect() protoreflect.Message { - mi := &file_dashboard_api_proto_msgTypes[15] + mi := &file_pkg_plugin_api_proto_dashboard_api_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -823,7 +925,7 @@ func (x *EventRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use EventRequest.ProtoReflect.Descriptor instead. func (*EventRequest) Descriptor() ([]byte, []int) { - return file_dashboard_api_proto_rawDescGZIP(), []int{15} + return file_pkg_plugin_api_proto_dashboard_api_proto_rawDescGZIP(), []int{17} } func (x *EventRequest) GetClientID() string { @@ -856,7 +958,7 @@ type EventResponse struct { func (x *EventResponse) Reset() { *x = EventResponse{} if protoimpl.UnsafeEnabled { - mi := &file_dashboard_api_proto_msgTypes[16] + mi := &file_pkg_plugin_api_proto_dashboard_api_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -869,7 +971,7 @@ func (x *EventResponse) String() string { func (*EventResponse) ProtoMessage() {} func (x *EventResponse) ProtoReflect() protoreflect.Message { - mi := &file_dashboard_api_proto_msgTypes[16] + mi := &file_pkg_plugin_api_proto_dashboard_api_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -882,148 +984,160 @@ func (x *EventResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use EventResponse.ProtoReflect.Descriptor instead. func (*EventResponse) Descriptor() ([]byte, []int) { - return file_dashboard_api_proto_rawDescGZIP(), []int{16} -} - -var File_dashboard_api_proto protoreflect.FileDescriptor - -var file_dashboard_api_proto_rawDesc = []byte{ - 0x0a, 0x13, 0x64, 0x61, 0x73, 0x68, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x5f, 0x61, 0x70, 0x69, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x77, 0x72, - 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x07, 0x0a, - 0x05, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0xb5, 0x01, 0x0a, 0x0a, 0x4b, 0x65, 0x79, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, - 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, - 0x61, 0x63, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x70, 0x69, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x61, 0x70, 0x69, 0x56, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x41, 0x0a, 0x0d, 0x6c, - 0x61, 0x62, 0x65, 0x6c, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x79, 0x74, 0x65, 0x73, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, - 0x0d, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x22, 0x28, - 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, - 0x0a, 0x07, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, - 0x07, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x22, 0x25, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x22, - 0x27, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + return file_pkg_plugin_api_proto_dashboard_api_proto_rawDescGZIP(), []int{18} +} + +var File_pkg_plugin_api_proto_dashboard_api_proto protoreflect.FileDescriptor + +var file_pkg_plugin_api_proto_dashboard_api_proto_rawDesc = []byte{ + 0x0a, 0x28, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x64, 0x61, 0x73, 0x68, 0x62, 0x6f, 0x61, 0x72, 0x64, + 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2f, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 0x07, 0x0a, 0x05, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0xb5, 0x01, 0x0a, 0x0a, + 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, + 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, + 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x70, 0x69, 0x56, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x61, 0x70, + 0x69, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x41, 0x0a, 0x0d, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, + 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x79, 0x74, 0x65, 0x73, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0d, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x53, 0x65, 0x6c, 0x65, 0x63, + 0x74, 0x6f, 0x72, 0x22, 0x28, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0c, 0x52, 0x07, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x22, 0x25, 0x0a, + 0x0b, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, + 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x6f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x22, 0x27, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x22, 0x10, 0x0a, + 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x27, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x22, 0x10, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x27, 0x0a, 0x0d, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x6f, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x22, 0x10, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x10, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x92, 0x01, 0x0a, 0x12, 0x50, 0x6f, 0x72, 0x74, - 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, + 0x52, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x22, 0x10, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x44, 0x0a, 0x10, 0x41, 0x70, + 0x70, 0x6c, 0x79, 0x59, 0x61, 0x6d, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x18, 0x0a, 0x07, - 0x70, 0x6f, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, - 0x6f, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, - 0x70, 0x6f, 0x72, 0x74, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x0a, 0x70, 0x6f, 0x72, 0x74, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x5b, 0x0a, 0x13, - 0x50, 0x6f, 0x72, 0x74, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x70, 0x6f, 0x72, 0x74, 0x46, 0x6f, 0x72, 0x77, 0x61, + 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, + 0x79, 0x61, 0x6d, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x79, 0x61, 0x6d, 0x6c, + 0x22, 0x31, 0x0a, 0x11, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x59, 0x61, 0x6d, 0x6c, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x73, 0x22, 0x10, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x92, 0x01, 0x0a, 0x12, 0x50, 0x6f, 0x72, 0x74, 0x46, 0x6f, + 0x72, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, + 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x6f, + 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x6f, 0x64, + 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, + 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x6f, 0x6e, + 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x6f, + 0x72, 0x74, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, + 0x70, 0x6f, 0x72, 0x74, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x5b, 0x0a, 0x13, 0x50, 0x6f, + 0x72, 0x74, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x70, 0x6f, 0x72, 0x74, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, + 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x6f, 0x72, 0x74, 0x46, 0x6f, + 0x72, 0x77, 0x61, 0x72, 0x64, 0x49, 0x44, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x6f, 0x72, 0x74, 0x4e, + 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x70, 0x6f, 0x72, + 0x74, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x40, 0x0a, 0x18, 0x43, 0x61, 0x6e, 0x63, 0x65, + 0x6c, 0x50, 0x6f, 0x72, 0x74, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x0d, 0x70, 0x6f, 0x72, 0x74, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x6f, 0x72, 0x74, - 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x49, 0x44, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x6f, 0x72, - 0x74, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x70, - 0x6f, 0x72, 0x74, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x40, 0x0a, 0x18, 0x43, 0x61, 0x6e, - 0x63, 0x65, 0x6c, 0x50, 0x6f, 0x72, 0x74, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x0d, 0x70, 0x6f, 0x72, 0x74, 0x46, 0x6f, 0x72, - 0x77, 0x61, 0x72, 0x64, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x6f, - 0x72, 0x74, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x49, 0x44, 0x22, 0x34, 0x0a, 0x12, 0x4e, - 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, - 0x73, 0x22, 0x94, 0x01, 0x0a, 0x0c, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x12, 0x3a, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x52, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, - 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x44, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, - 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x44, 0x22, 0x20, 0x0a, 0x0c, 0x4c, 0x69, 0x6e, 0x6b, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x65, 0x66, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x72, 0x65, 0x66, 0x22, 0x62, 0x0a, 0x0c, 0x45, 0x76, - 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6c, - 0x69, 0x65, 0x6e, 0x74, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6c, - 0x69, 0x65, 0x6e, 0x74, 0x49, 0x44, 0x12, 0x1c, 0x0a, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x4e, - 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, - 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x0f, - 0x0a, 0x0d, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, - 0xa1, 0x05, 0x0a, 0x09, 0x44, 0x61, 0x73, 0x68, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x12, 0x2e, 0x0a, - 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x11, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4b, 0x65, - 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, - 0x03, 0x47, 0x65, 0x74, 0x12, 0x11, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4b, 0x65, 0x79, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, - 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, 0x06, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x14, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x35, 0x0a, 0x06, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0x14, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x06, 0x44, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x12, 0x11, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4b, 0x65, 0x79, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x44, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x44, 0x0a, - 0x0b, 0x50, 0x6f, 0x72, 0x74, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x12, 0x19, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x50, 0x6f, 0x72, 0x74, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, - 0x50, 0x6f, 0x72, 0x74, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x11, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x50, 0x6f, 0x72, - 0x74, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x12, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2e, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x50, 0x6f, 0x72, 0x74, 0x46, 0x6f, 0x72, 0x77, 0x61, - 0x72, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0c, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x39, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x4e, - 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x12, 0x0c, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, - 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x31, 0x0a, 0x13, 0x46, 0x6f, 0x72, 0x63, 0x65, 0x46, 0x72, 0x6f, 0x6e, 0x74, - 0x65, 0x6e, 0x64, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x0c, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x0c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, - 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x2e, 0x0a, 0x09, 0x53, 0x65, 0x6e, 0x64, 0x41, 0x6c, 0x65, - 0x72, 0x74, 0x12, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x41, 0x6c, 0x65, 0x72, 0x74, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, - 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x34, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4c, - 0x69, 0x6e, 0x6b, 0x12, 0x11, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4b, 0x65, 0x79, 0x52, + 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x49, 0x44, 0x22, 0x34, 0x0a, 0x12, 0x4e, 0x61, 0x6d, + 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x1e, 0x0a, 0x0a, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x0a, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x22, + 0x94, 0x01, 0x0a, 0x0c, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x74, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x3a, + 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, + 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6c, + 0x69, 0x65, 0x6e, 0x74, 0x49, 0x44, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6c, + 0x69, 0x65, 0x6e, 0x74, 0x49, 0x44, 0x22, 0x20, 0x0a, 0x0c, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x65, 0x66, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x72, 0x65, 0x66, 0x22, 0x62, 0x0a, 0x0c, 0x45, 0x76, 0x65, 0x6e, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6c, 0x69, 0x65, + 0x6e, 0x74, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6c, 0x69, 0x65, + 0x6e, 0x74, 0x49, 0x44, 0x12, 0x1c, 0x0a, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x4e, 0x61, 0x6d, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x4e, 0x61, + 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x0f, 0x0a, 0x0d, + 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xe1, 0x05, + 0x0a, 0x09, 0x44, 0x61, 0x73, 0x68, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x12, 0x2e, 0x0a, 0x04, 0x4c, + 0x69, 0x73, 0x74, 0x12, 0x11, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, - 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x09, 0x53, - 0x65, 0x6e, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x42, 0x35, 0x5a, 0x33, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x76, 0x6d, 0x77, 0x61, 0x72, 0x65, 0x2d, 0x74, 0x61, 0x6e, 0x7a, 0x75, 0x2f, 0x6f, - 0x63, 0x74, 0x61, 0x6e, 0x74, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x03, 0x47, + 0x65, 0x74, 0x12, 0x11, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4b, 0x65, 0x79, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, 0x06, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x12, 0x14, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x35, 0x0a, 0x06, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0x14, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3e, 0x0a, 0x09, 0x41, 0x70, 0x70, 0x6c, 0x79, + 0x59, 0x61, 0x6d, 0x6c, 0x12, 0x17, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x41, 0x70, 0x70, + 0x6c, 0x79, 0x59, 0x61, 0x6d, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x59, 0x61, 0x6d, 0x6c, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x12, 0x11, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x44, 0x0a, 0x0b, 0x50, + 0x6f, 0x72, 0x74, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x12, 0x19, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x50, 0x6f, 0x72, 0x74, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x50, 0x6f, + 0x72, 0x74, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x42, 0x0a, 0x11, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x50, 0x6f, 0x72, 0x74, 0x46, + 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x12, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, + 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x50, 0x6f, 0x72, 0x74, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x39, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x4e, 0x61, 0x6d, + 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x12, 0x0c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4e, 0x61, + 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x31, 0x0a, 0x13, 0x46, 0x6f, 0x72, 0x63, 0x65, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x64, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x0c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x0c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x45, 0x6d, + 0x70, 0x74, 0x79, 0x12, 0x2e, 0x0a, 0x09, 0x53, 0x65, 0x6e, 0x64, 0x41, 0x6c, 0x65, 0x72, 0x74, + 0x12, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x45, 0x6d, + 0x70, 0x74, 0x79, 0x12, 0x34, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6e, + 0x6b, 0x12, 0x11, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x69, 0x6e, + 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x09, 0x53, 0x65, 0x6e, + 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x45, + 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x42, 0x35, 0x5a, 0x33, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x76, 0x6d, 0x77, 0x61, 0x72, 0x65, 0x2d, 0x74, 0x61, 0x6e, 0x7a, 0x75, 0x2f, 0x6f, 0x63, 0x74, + 0x61, 0x6e, 0x74, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - file_dashboard_api_proto_rawDescOnce sync.Once - file_dashboard_api_proto_rawDescData = file_dashboard_api_proto_rawDesc + file_pkg_plugin_api_proto_dashboard_api_proto_rawDescOnce sync.Once + file_pkg_plugin_api_proto_dashboard_api_proto_rawDescData = file_pkg_plugin_api_proto_dashboard_api_proto_rawDesc ) -func file_dashboard_api_proto_rawDescGZIP() []byte { - file_dashboard_api_proto_rawDescOnce.Do(func() { - file_dashboard_api_proto_rawDescData = protoimpl.X.CompressGZIP(file_dashboard_api_proto_rawDescData) +func file_pkg_plugin_api_proto_dashboard_api_proto_rawDescGZIP() []byte { + file_pkg_plugin_api_proto_dashboard_api_proto_rawDescOnce.Do(func() { + file_pkg_plugin_api_proto_dashboard_api_proto_rawDescData = protoimpl.X.CompressGZIP(file_pkg_plugin_api_proto_dashboard_api_proto_rawDescData) }) - return file_dashboard_api_proto_rawDescData + return file_pkg_plugin_api_proto_dashboard_api_proto_rawDescData } -var file_dashboard_api_proto_msgTypes = make([]protoimpl.MessageInfo, 17) -var file_dashboard_api_proto_goTypes = []interface{}{ +var file_pkg_plugin_api_proto_dashboard_api_proto_msgTypes = make([]protoimpl.MessageInfo, 19) +var file_pkg_plugin_api_proto_dashboard_api_proto_goTypes = []interface{}{ (*Empty)(nil), // 0: proto.Empty (*KeyRequest)(nil), // 1: proto.KeyRequest (*ListResponse)(nil), // 2: proto.ListResponse @@ -1032,59 +1146,63 @@ var file_dashboard_api_proto_goTypes = []interface{}{ (*UpdateResponse)(nil), // 5: proto.UpdateResponse (*CreateRequest)(nil), // 6: proto.CreateRequest (*CreateResponse)(nil), // 7: proto.CreateResponse - (*DeleteResponse)(nil), // 8: proto.DeleteResponse - (*PortForwardRequest)(nil), // 9: proto.PortForwardRequest - (*PortForwardResponse)(nil), // 10: proto.PortForwardResponse - (*CancelPortForwardRequest)(nil), // 11: proto.CancelPortForwardRequest - (*NamespacesResponse)(nil), // 12: proto.NamespacesResponse - (*AlertRequest)(nil), // 13: proto.AlertRequest - (*LinkResponse)(nil), // 14: proto.LinkResponse - (*EventRequest)(nil), // 15: proto.EventRequest - (*EventResponse)(nil), // 16: proto.EventResponse - (*wrapperspb.BytesValue)(nil), // 17: google.protobuf.BytesValue - (*timestamppb.Timestamp)(nil), // 18: google.protobuf.Timestamp -} -var file_dashboard_api_proto_depIdxs = []int32{ - 17, // 0: proto.KeyRequest.labelSelector:type_name -> google.protobuf.BytesValue - 18, // 1: proto.AlertRequest.expiration:type_name -> google.protobuf.Timestamp + (*ApplyYamlRequest)(nil), // 8: proto.ApplyYamlRequest + (*ApplyYamlResponse)(nil), // 9: proto.ApplyYamlResponse + (*DeleteResponse)(nil), // 10: proto.DeleteResponse + (*PortForwardRequest)(nil), // 11: proto.PortForwardRequest + (*PortForwardResponse)(nil), // 12: proto.PortForwardResponse + (*CancelPortForwardRequest)(nil), // 13: proto.CancelPortForwardRequest + (*NamespacesResponse)(nil), // 14: proto.NamespacesResponse + (*AlertRequest)(nil), // 15: proto.AlertRequest + (*LinkResponse)(nil), // 16: proto.LinkResponse + (*EventRequest)(nil), // 17: proto.EventRequest + (*EventResponse)(nil), // 18: proto.EventResponse + (*wrapperspb.BytesValue)(nil), // 19: google.protobuf.BytesValue + (*timestamppb.Timestamp)(nil), // 20: google.protobuf.Timestamp +} +var file_pkg_plugin_api_proto_dashboard_api_proto_depIdxs = []int32{ + 19, // 0: proto.KeyRequest.labelSelector:type_name -> google.protobuf.BytesValue + 20, // 1: proto.AlertRequest.expiration:type_name -> google.protobuf.Timestamp 1, // 2: proto.Dashboard.List:input_type -> proto.KeyRequest 1, // 3: proto.Dashboard.Get:input_type -> proto.KeyRequest 4, // 4: proto.Dashboard.Update:input_type -> proto.UpdateRequest 6, // 5: proto.Dashboard.Create:input_type -> proto.CreateRequest - 1, // 6: proto.Dashboard.Delete:input_type -> proto.KeyRequest - 9, // 7: proto.Dashboard.PortForward:input_type -> proto.PortForwardRequest - 11, // 8: proto.Dashboard.CancelPortForward:input_type -> proto.CancelPortForwardRequest - 0, // 9: proto.Dashboard.ListNamespaces:input_type -> proto.Empty - 0, // 10: proto.Dashboard.ForceFrontendUpdate:input_type -> proto.Empty - 13, // 11: proto.Dashboard.SendAlert:input_type -> proto.AlertRequest - 1, // 12: proto.Dashboard.CreateLink:input_type -> proto.KeyRequest - 15, // 13: proto.Dashboard.SendEvent:input_type -> proto.EventRequest - 2, // 14: proto.Dashboard.List:output_type -> proto.ListResponse - 3, // 15: proto.Dashboard.Get:output_type -> proto.GetResponse - 5, // 16: proto.Dashboard.Update:output_type -> proto.UpdateResponse - 7, // 17: proto.Dashboard.Create:output_type -> proto.CreateResponse - 8, // 18: proto.Dashboard.Delete:output_type -> proto.DeleteResponse - 10, // 19: proto.Dashboard.PortForward:output_type -> proto.PortForwardResponse - 0, // 20: proto.Dashboard.CancelPortForward:output_type -> proto.Empty - 12, // 21: proto.Dashboard.ListNamespaces:output_type -> proto.NamespacesResponse - 0, // 22: proto.Dashboard.ForceFrontendUpdate:output_type -> proto.Empty - 0, // 23: proto.Dashboard.SendAlert:output_type -> proto.Empty - 14, // 24: proto.Dashboard.CreateLink:output_type -> proto.LinkResponse - 16, // 25: proto.Dashboard.SendEvent:output_type -> proto.EventResponse - 14, // [14:26] is the sub-list for method output_type - 2, // [2:14] is the sub-list for method input_type + 8, // 6: proto.Dashboard.ApplyYaml:input_type -> proto.ApplyYamlRequest + 1, // 7: proto.Dashboard.Delete:input_type -> proto.KeyRequest + 11, // 8: proto.Dashboard.PortForward:input_type -> proto.PortForwardRequest + 13, // 9: proto.Dashboard.CancelPortForward:input_type -> proto.CancelPortForwardRequest + 0, // 10: proto.Dashboard.ListNamespaces:input_type -> proto.Empty + 0, // 11: proto.Dashboard.ForceFrontendUpdate:input_type -> proto.Empty + 15, // 12: proto.Dashboard.SendAlert:input_type -> proto.AlertRequest + 1, // 13: proto.Dashboard.CreateLink:input_type -> proto.KeyRequest + 17, // 14: proto.Dashboard.SendEvent:input_type -> proto.EventRequest + 2, // 15: proto.Dashboard.List:output_type -> proto.ListResponse + 3, // 16: proto.Dashboard.Get:output_type -> proto.GetResponse + 5, // 17: proto.Dashboard.Update:output_type -> proto.UpdateResponse + 7, // 18: proto.Dashboard.Create:output_type -> proto.CreateResponse + 9, // 19: proto.Dashboard.ApplyYaml:output_type -> proto.ApplyYamlResponse + 10, // 20: proto.Dashboard.Delete:output_type -> proto.DeleteResponse + 12, // 21: proto.Dashboard.PortForward:output_type -> proto.PortForwardResponse + 0, // 22: proto.Dashboard.CancelPortForward:output_type -> proto.Empty + 14, // 23: proto.Dashboard.ListNamespaces:output_type -> proto.NamespacesResponse + 0, // 24: proto.Dashboard.ForceFrontendUpdate:output_type -> proto.Empty + 0, // 25: proto.Dashboard.SendAlert:output_type -> proto.Empty + 16, // 26: proto.Dashboard.CreateLink:output_type -> proto.LinkResponse + 18, // 27: proto.Dashboard.SendEvent:output_type -> proto.EventResponse + 15, // [15:28] is the sub-list for method output_type + 2, // [2:15] is the sub-list for method input_type 2, // [2:2] is the sub-list for extension type_name 2, // [2:2] is the sub-list for extension extendee 0, // [0:2] is the sub-list for field type_name } -func init() { file_dashboard_api_proto_init() } -func file_dashboard_api_proto_init() { - if File_dashboard_api_proto != nil { +func init() { file_pkg_plugin_api_proto_dashboard_api_proto_init() } +func file_pkg_plugin_api_proto_dashboard_api_proto_init() { + if File_pkg_plugin_api_proto_dashboard_api_proto != nil { return } if !protoimpl.UnsafeEnabled { - file_dashboard_api_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_pkg_plugin_api_proto_dashboard_api_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Empty); i { case 0: return &v.state @@ -1096,7 +1214,7 @@ func file_dashboard_api_proto_init() { return nil } } - file_dashboard_api_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_pkg_plugin_api_proto_dashboard_api_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*KeyRequest); i { case 0: return &v.state @@ -1108,7 +1226,7 @@ func file_dashboard_api_proto_init() { return nil } } - file_dashboard_api_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_pkg_plugin_api_proto_dashboard_api_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListResponse); i { case 0: return &v.state @@ -1120,7 +1238,7 @@ func file_dashboard_api_proto_init() { return nil } } - file_dashboard_api_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_pkg_plugin_api_proto_dashboard_api_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetResponse); i { case 0: return &v.state @@ -1132,7 +1250,7 @@ func file_dashboard_api_proto_init() { return nil } } - file_dashboard_api_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_pkg_plugin_api_proto_dashboard_api_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UpdateRequest); i { case 0: return &v.state @@ -1144,7 +1262,7 @@ func file_dashboard_api_proto_init() { return nil } } - file_dashboard_api_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_pkg_plugin_api_proto_dashboard_api_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UpdateResponse); i { case 0: return &v.state @@ -1156,7 +1274,7 @@ func file_dashboard_api_proto_init() { return nil } } - file_dashboard_api_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_pkg_plugin_api_proto_dashboard_api_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateRequest); i { case 0: return &v.state @@ -1168,7 +1286,7 @@ func file_dashboard_api_proto_init() { return nil } } - file_dashboard_api_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_pkg_plugin_api_proto_dashboard_api_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateResponse); i { case 0: return &v.state @@ -1180,7 +1298,31 @@ func file_dashboard_api_proto_init() { return nil } } - file_dashboard_api_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + file_pkg_plugin_api_proto_dashboard_api_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ApplyYamlRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_plugin_api_proto_dashboard_api_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ApplyYamlResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_plugin_api_proto_dashboard_api_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DeleteResponse); i { case 0: return &v.state @@ -1192,7 +1334,7 @@ func file_dashboard_api_proto_init() { return nil } } - file_dashboard_api_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + file_pkg_plugin_api_proto_dashboard_api_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PortForwardRequest); i { case 0: return &v.state @@ -1204,7 +1346,7 @@ func file_dashboard_api_proto_init() { return nil } } - file_dashboard_api_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + file_pkg_plugin_api_proto_dashboard_api_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PortForwardResponse); i { case 0: return &v.state @@ -1216,7 +1358,7 @@ func file_dashboard_api_proto_init() { return nil } } - file_dashboard_api_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + file_pkg_plugin_api_proto_dashboard_api_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CancelPortForwardRequest); i { case 0: return &v.state @@ -1228,7 +1370,7 @@ func file_dashboard_api_proto_init() { return nil } } - file_dashboard_api_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + file_pkg_plugin_api_proto_dashboard_api_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*NamespacesResponse); i { case 0: return &v.state @@ -1240,7 +1382,7 @@ func file_dashboard_api_proto_init() { return nil } } - file_dashboard_api_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + file_pkg_plugin_api_proto_dashboard_api_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AlertRequest); i { case 0: return &v.state @@ -1252,7 +1394,7 @@ func file_dashboard_api_proto_init() { return nil } } - file_dashboard_api_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + file_pkg_plugin_api_proto_dashboard_api_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*LinkResponse); i { case 0: return &v.state @@ -1264,7 +1406,7 @@ func file_dashboard_api_proto_init() { return nil } } - file_dashboard_api_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + file_pkg_plugin_api_proto_dashboard_api_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*EventRequest); i { case 0: return &v.state @@ -1276,7 +1418,7 @@ func file_dashboard_api_proto_init() { return nil } } - file_dashboard_api_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + file_pkg_plugin_api_proto_dashboard_api_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*EventResponse); i { case 0: return &v.state @@ -1293,20 +1435,20 @@ func file_dashboard_api_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_dashboard_api_proto_rawDesc, + RawDescriptor: file_pkg_plugin_api_proto_dashboard_api_proto_rawDesc, NumEnums: 0, - NumMessages: 17, + NumMessages: 19, NumExtensions: 0, NumServices: 1, }, - GoTypes: file_dashboard_api_proto_goTypes, - DependencyIndexes: file_dashboard_api_proto_depIdxs, - MessageInfos: file_dashboard_api_proto_msgTypes, + GoTypes: file_pkg_plugin_api_proto_dashboard_api_proto_goTypes, + DependencyIndexes: file_pkg_plugin_api_proto_dashboard_api_proto_depIdxs, + MessageInfos: file_pkg_plugin_api_proto_dashboard_api_proto_msgTypes, }.Build() - File_dashboard_api_proto = out.File - file_dashboard_api_proto_rawDesc = nil - file_dashboard_api_proto_goTypes = nil - file_dashboard_api_proto_depIdxs = nil + File_pkg_plugin_api_proto_dashboard_api_proto = out.File + file_pkg_plugin_api_proto_dashboard_api_proto_rawDesc = nil + file_pkg_plugin_api_proto_dashboard_api_proto_goTypes = nil + file_pkg_plugin_api_proto_dashboard_api_proto_depIdxs = nil } // Reference imports to suppress errors if they are not otherwise used. @@ -1325,6 +1467,7 @@ type DashboardClient interface { Get(ctx context.Context, in *KeyRequest, opts ...grpc.CallOption) (*GetResponse, error) Update(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*UpdateResponse, error) Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateResponse, error) + ApplyYaml(ctx context.Context, in *ApplyYamlRequest, opts ...grpc.CallOption) (*ApplyYamlResponse, error) Delete(ctx context.Context, in *KeyRequest, opts ...grpc.CallOption) (*DeleteResponse, error) PortForward(ctx context.Context, in *PortForwardRequest, opts ...grpc.CallOption) (*PortForwardResponse, error) CancelPortForward(ctx context.Context, in *CancelPortForwardRequest, opts ...grpc.CallOption) (*Empty, error) @@ -1379,6 +1522,15 @@ func (c *dashboardClient) Create(ctx context.Context, in *CreateRequest, opts .. return out, nil } +func (c *dashboardClient) ApplyYaml(ctx context.Context, in *ApplyYamlRequest, opts ...grpc.CallOption) (*ApplyYamlResponse, error) { + out := new(ApplyYamlResponse) + err := c.cc.Invoke(ctx, "/proto.Dashboard/ApplyYaml", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *dashboardClient) Delete(ctx context.Context, in *KeyRequest, opts ...grpc.CallOption) (*DeleteResponse, error) { out := new(DeleteResponse) err := c.cc.Invoke(ctx, "/proto.Dashboard/Delete", in, out, opts...) @@ -1457,6 +1609,7 @@ type DashboardServer interface { Get(context.Context, *KeyRequest) (*GetResponse, error) Update(context.Context, *UpdateRequest) (*UpdateResponse, error) Create(context.Context, *CreateRequest) (*CreateResponse, error) + ApplyYaml(context.Context, *ApplyYamlRequest) (*ApplyYamlResponse, error) Delete(context.Context, *KeyRequest) (*DeleteResponse, error) PortForward(context.Context, *PortForwardRequest) (*PortForwardResponse, error) CancelPortForward(context.Context, *CancelPortForwardRequest) (*Empty, error) @@ -1483,6 +1636,9 @@ func (*UnimplementedDashboardServer) Update(context.Context, *UpdateRequest) (*U func (*UnimplementedDashboardServer) Create(context.Context, *CreateRequest) (*CreateResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Create not implemented") } +func (*UnimplementedDashboardServer) ApplyYaml(context.Context, *ApplyYamlRequest) (*ApplyYamlResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ApplyYaml not implemented") +} func (*UnimplementedDashboardServer) Delete(context.Context, *KeyRequest) (*DeleteResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented") } @@ -1584,6 +1740,24 @@ func _Dashboard_Create_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +func _Dashboard_ApplyYaml_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ApplyYamlRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DashboardServer).ApplyYaml(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/proto.Dashboard/ApplyYaml", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DashboardServer).ApplyYaml(ctx, req.(*ApplyYamlRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Dashboard_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(KeyRequest) if err := dec(in); err != nil { @@ -1748,6 +1922,10 @@ var _Dashboard_serviceDesc = grpc.ServiceDesc{ MethodName: "Create", Handler: _Dashboard_Create_Handler, }, + { + MethodName: "ApplyYaml", + Handler: _Dashboard_ApplyYaml_Handler, + }, { MethodName: "Delete", Handler: _Dashboard_Delete_Handler, @@ -1782,5 +1960,5 @@ var _Dashboard_serviceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "dashboard_api.proto", + Metadata: "pkg/plugin/api/proto/dashboard_api.proto", } diff --git a/pkg/plugin/api/proto/dashboard_api.proto b/pkg/plugin/api/proto/dashboard_api.proto index 625fb8b9d8..f9bc14c473 100644 --- a/pkg/plugin/api/proto/dashboard_api.proto +++ b/pkg/plugin/api/proto/dashboard_api.proto @@ -40,6 +40,15 @@ message CreateResponse { } +message ApplyYamlRequest { + string namespace = 1; + string yaml = 2; +} + +message ApplyYamlResponse { + repeated string resources = 1; +} + message DeleteResponse { } @@ -90,6 +99,7 @@ service Dashboard { rpc Get(KeyRequest) returns (GetResponse); rpc Update(UpdateRequest) returns (UpdateResponse); rpc Create(CreateRequest) returns (CreateResponse); + rpc ApplyYaml(ApplyYamlRequest) returns (ApplyYamlResponse); rpc Delete(KeyRequest) returns (DeleteResponse); rpc PortForward(PortForwardRequest) returns (PortForwardResponse); rpc CancelPortForward(CancelPortForwardRequest) returns (Empty); diff --git a/pkg/plugin/api/proto/generate.ps1 b/pkg/plugin/api/proto/generate.ps1 new file mode 100644 index 0000000000..f7d138d8e9 --- /dev/null +++ b/pkg/plugin/api/proto/generate.ps1 @@ -0,0 +1,5 @@ +$dir = $PSScriptRoot +$octantRoot = (get-item $dir).parent.parent.parent.parent.FullName +$module = "github.com/vmware-tanzu/octant/pkg/plugin/api/proto" + +protoc -I ${octantRoot}/vendor -I ${octantRoot} -I ${dir} --go_out=plugins=grpc:${dir} --go_opt=module=${module} ${dir}/dashboard_api.proto \ No newline at end of file diff --git a/pkg/plugin/api/server.go b/pkg/plugin/api/server.go index 50e12a718e..09b48792bb 100644 --- a/pkg/plugin/api/server.go +++ b/pkg/plugin/api/server.go @@ -62,6 +62,7 @@ type Service interface { ListNamespaces(ctx context.Context) (NamespacesResponse, error) Update(ctx context.Context, object *unstructured.Unstructured) error Create(ctx context.Context, object *unstructured.Unstructured) error + ApplyYaml(ctx context.Context, namespace, yaml string) ([]string, error) Delete(ctx context.Context, key store.Key) error ForceFrontendUpdate(ctx context.Context) error SendAlert(ctx context.Context, clientID string, alert action.Alert) error @@ -132,6 +133,11 @@ func (s *GRPCService) Create(ctx context.Context, object *unstructured.Unstructu return s.ObjectStore.Create(ctx, object) } +func (s *GRPCService) ApplyYaml(ctx context.Context, namespace, yaml string) ([]string, error) { + ctx = extractObjectStoreMetadata(ctx) + return s.ObjectStore.CreateOrUpdateFromYAML(ctx, namespace, yaml) +} + func (s *GRPCService) Delete(ctx context.Context, key store.Key) error { ctx = extractObjectStoreMetadata(ctx) return s.ObjectStore.Delete(ctx, key) @@ -295,6 +301,20 @@ func (c *grpcServer) Update(ctx context.Context, in *proto.UpdateRequest) (*prot return &proto.UpdateResponse{}, nil } +// ApplyYaml updates an object. +func (c *grpcServer) ApplyYaml(ctx context.Context, in *proto.ApplyYamlRequest) (*proto.ApplyYamlResponse, error) { + var res []string + var err error + + if res, err = c.service.ApplyYaml(ctx, in.Namespace, in.Yaml); err != nil { + return nil, err + } + + return &proto.ApplyYamlResponse{ + Resources: res, + }, nil +} + // Create creates an object in the cluster. func (c *grpcServer) Create(ctx context.Context, in *proto.CreateRequest) (*proto.CreateResponse, error) { object, err := convertToObject(in.Object) diff --git a/pkg/plugin/service/dashboard.go b/pkg/plugin/service/dashboard.go index e59b3c8a95..a6d326eb58 100644 --- a/pkg/plugin/service/dashboard.go +++ b/pkg/plugin/service/dashboard.go @@ -21,6 +21,7 @@ type Dashboard interface { List(ctx context.Context, key store.Key) (*unstructured.UnstructuredList, error) Get(ctx context.Context, key store.Key) (*unstructured.Unstructured, error) Update(ctx context.Context, object *unstructured.Unstructured) error + ApplyYaml(ctx context.Context, namespace, yaml string) ([]string, error) Delete(ctx context.Context, key store.Key) error PortForward(ctx context.Context, req api.PortForwardRequest) (api.PortForwardResponse, error) CancelPortForward(ctx context.Context, id string) diff --git a/pkg/plugin/service/fake/mock_dashboard.go b/pkg/plugin/service/fake/mock_dashboard.go index 88c173791f..a434dac03d 100644 --- a/pkg/plugin/service/fake/mock_dashboard.go +++ b/pkg/plugin/service/fake/mock_dashboard.go @@ -40,6 +40,21 @@ func (m *MockDashboard) EXPECT() *MockDashboardMockRecorder { return m.recorder } +// ApplyYaml mocks base method. +func (m *MockDashboard) ApplyYaml(arg0 context.Context, arg1, arg2 string) ([]string, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ApplyYaml", arg0, arg1, arg2) + ret0, _ := ret[0].([]string) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ApplyYaml indicates an expected call of ApplyYaml. +func (mr *MockDashboardMockRecorder) ApplyYaml(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ApplyYaml", reflect.TypeOf((*MockDashboard)(nil).ApplyYaml), arg0, arg1, arg2) +} + // CancelPortForward mocks base method. func (m *MockDashboard) CancelPortForward(arg0 context.Context, arg1 string) { m.ctrl.T.Helper() diff --git a/web/package-lock.json b/web/package-lock.json index 3c35ffc53c..538dd4db55 100644 --- a/web/package-lock.json +++ b/web/package-lock.json @@ -23206,9 +23206,9 @@ } }, "jszip": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.5.0.tgz", - "integrity": "sha512-WRtu7TPCmYePR1nazfrtuF216cIVon/3GWOvHS9QR5bIwSbnxtdpma6un3jyGGNhHsKCSzn5Ypk+EkDRvTGiFA==", + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.7.1.tgz", + "integrity": "sha512-ghL0tz1XG9ZEmRMcEN2vt7xabrDdqHHeykgARpmZ0BiIctWxM47Vt63ZO2dnp4QYt/xJVLLy5Zv1l/xRdh2byg==", "dev": true, "requires": { "lie": "~3.3.0", diff --git a/web/src/stories/docs/plugins/GoPluginsIntro.story.mdx b/web/src/stories/docs/plugins/GoPluginsIntro.story.mdx index 6ef63d4317..7be9a7e40b 100644 --- a/web/src/stories/docs/plugins/GoPluginsIntro.story.mdx +++ b/web/src/stories/docs/plugins/GoPluginsIntro.story.mdx @@ -100,6 +100,19 @@ Here is an example of setting up your plugin to know when the current namespace } ``` +Besides having custom actions, there are pre-exsiting octant actions which are registered by octant internal modules and they can be leveraged to perform an action. +For example: `action.octant.dev/apply` (/~https://github.com/vmware-tanzu/octant/blob/71e75e12b05764588d3f0aede455d143e35a3355/internal/octant/actions.go#L25) can be used to create/update resources +with yaml string and a namespace. + +Example Payload: +``` +{ + "namespace": "default", + "update": "---\napiVersion: apps/v1 ..." +} +``` + + ## Register and Serve Registering and serving your plugin is the final step to get your plugin communicating with Octant. This is also where you