From 49e27c0807111f0f38db31f9303369ff76a666dc Mon Sep 17 00:00:00 2001 From: Alex Dadgar Date: Tue, 7 Aug 2018 16:16:23 -0700 Subject: [PATCH] SetConfig --- plugins/base/base.pb.go | 260 +++++++++++++++++++++++++++++++++------- plugins/base/base.proto | 23 +++- 2 files changed, 236 insertions(+), 47 deletions(-) diff --git a/plugins/base/base.pb.go b/plugins/base/base.pb.go index f8edab5cb..9c2127c0c 100644 --- a/plugins/base/base.pb.go +++ b/plugins/base/base.pb.go @@ -1,12 +1,11 @@ // Code generated by protoc-gen-go. DO NOT EDIT. -// source: hashicorp/nomad/plugins/base/base.proto +// source: base.proto package hashicorp_nomad_plugins_base import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" -import empty "github.com/golang/protobuf/ptypes/empty" import hclspec "hashicorp/nomad/plugins/shared/hclspec" import ( @@ -49,9 +48,40 @@ func (x PluginType) String() string { return proto.EnumName(PluginType_name, int32(x)) } func (PluginType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_base_b0ba14970497002b, []int{0} + return fileDescriptor_base_6491f5f52ef6eb79, []int{0} } +// PluginInfoRequest is used to request the plugins basic information. +type PluginInfoRequest struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *PluginInfoRequest) Reset() { *m = PluginInfoRequest{} } +func (m *PluginInfoRequest) String() string { return proto.CompactTextString(m) } +func (*PluginInfoRequest) ProtoMessage() {} +func (*PluginInfoRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_base_6491f5f52ef6eb79, []int{0} +} +func (m *PluginInfoRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_PluginInfoRequest.Unmarshal(m, b) +} +func (m *PluginInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_PluginInfoRequest.Marshal(b, m, deterministic) +} +func (dst *PluginInfoRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_PluginInfoRequest.Merge(dst, src) +} +func (m *PluginInfoRequest) XXX_Size() int { + return xxx_messageInfo_PluginInfoRequest.Size(m) +} +func (m *PluginInfoRequest) XXX_DiscardUnknown() { + xxx_messageInfo_PluginInfoRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_PluginInfoRequest proto.InternalMessageInfo + // PluginInfoResponse returns basic information about the plugin such // that Nomad can decide whether to load the plugin or not. type PluginInfoResponse struct { @@ -74,7 +104,7 @@ func (m *PluginInfoResponse) Reset() { *m = PluginInfoResponse{} } func (m *PluginInfoResponse) String() string { return proto.CompactTextString(m) } func (*PluginInfoResponse) ProtoMessage() {} func (*PluginInfoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_base_b0ba14970497002b, []int{0} + return fileDescriptor_base_6491f5f52ef6eb79, []int{1} } func (m *PluginInfoResponse) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_PluginInfoResponse.Unmarshal(m, b) @@ -122,6 +152,37 @@ func (m *PluginInfoResponse) GetName() string { return "" } +// ConfigSchemaRequest is used to request the configurations schema. +type ConfigSchemaRequest struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ConfigSchemaRequest) Reset() { *m = ConfigSchemaRequest{} } +func (m *ConfigSchemaRequest) String() string { return proto.CompactTextString(m) } +func (*ConfigSchemaRequest) ProtoMessage() {} +func (*ConfigSchemaRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_base_6491f5f52ef6eb79, []int{2} +} +func (m *ConfigSchemaRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ConfigSchemaRequest.Unmarshal(m, b) +} +func (m *ConfigSchemaRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ConfigSchemaRequest.Marshal(b, m, deterministic) +} +func (dst *ConfigSchemaRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConfigSchemaRequest.Merge(dst, src) +} +func (m *ConfigSchemaRequest) XXX_Size() int { + return xxx_messageInfo_ConfigSchemaRequest.Size(m) +} +func (m *ConfigSchemaRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ConfigSchemaRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ConfigSchemaRequest proto.InternalMessageInfo + // ConfigSchemaResponse returns the plugins configuration schema. type ConfigSchemaResponse struct { // spec is the plugins configuration schema @@ -135,7 +196,7 @@ func (m *ConfigSchemaResponse) Reset() { *m = ConfigSchemaResponse{} } func (m *ConfigSchemaResponse) String() string { return proto.CompactTextString(m) } func (*ConfigSchemaResponse) ProtoMessage() {} func (*ConfigSchemaResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_base_b0ba14970497002b, []int{1} + return fileDescriptor_base_6491f5f52ef6eb79, []int{3} } func (m *ConfigSchemaResponse) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ConfigSchemaResponse.Unmarshal(m, b) @@ -162,9 +223,84 @@ func (m *ConfigSchemaResponse) GetSpec() *hclspec.Spec { return nil } +// SetConfigRequest is used to set the configuration +type SetConfigRequest struct { + // msgpack_config is the configuration encoded as MessagePack. + MsgpackConfig []byte `protobuf:"bytes,1,opt,name=msgpack_config,json=msgpackConfig,proto3" json:"msgpack_config,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SetConfigRequest) Reset() { *m = SetConfigRequest{} } +func (m *SetConfigRequest) String() string { return proto.CompactTextString(m) } +func (*SetConfigRequest) ProtoMessage() {} +func (*SetConfigRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_base_6491f5f52ef6eb79, []int{4} +} +func (m *SetConfigRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SetConfigRequest.Unmarshal(m, b) +} +func (m *SetConfigRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SetConfigRequest.Marshal(b, m, deterministic) +} +func (dst *SetConfigRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_SetConfigRequest.Merge(dst, src) +} +func (m *SetConfigRequest) XXX_Size() int { + return xxx_messageInfo_SetConfigRequest.Size(m) +} +func (m *SetConfigRequest) XXX_DiscardUnknown() { + xxx_messageInfo_SetConfigRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_SetConfigRequest proto.InternalMessageInfo + +func (m *SetConfigRequest) GetMsgpackConfig() []byte { + if m != nil { + return m.MsgpackConfig + } + return nil +} + +// SetConfigResponse is used to respond to setting the configuration +type SetConfigResponse struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SetConfigResponse) Reset() { *m = SetConfigResponse{} } +func (m *SetConfigResponse) String() string { return proto.CompactTextString(m) } +func (*SetConfigResponse) ProtoMessage() {} +func (*SetConfigResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_base_6491f5f52ef6eb79, []int{5} +} +func (m *SetConfigResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SetConfigResponse.Unmarshal(m, b) +} +func (m *SetConfigResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SetConfigResponse.Marshal(b, m, deterministic) +} +func (dst *SetConfigResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_SetConfigResponse.Merge(dst, src) +} +func (m *SetConfigResponse) XXX_Size() int { + return xxx_messageInfo_SetConfigResponse.Size(m) +} +func (m *SetConfigResponse) XXX_DiscardUnknown() { + xxx_messageInfo_SetConfigResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_SetConfigResponse proto.InternalMessageInfo + func init() { + proto.RegisterType((*PluginInfoRequest)(nil), "hashicorp.nomad.plugins.base.PluginInfoRequest") proto.RegisterType((*PluginInfoResponse)(nil), "hashicorp.nomad.plugins.base.PluginInfoResponse") + proto.RegisterType((*ConfigSchemaRequest)(nil), "hashicorp.nomad.plugins.base.ConfigSchemaRequest") proto.RegisterType((*ConfigSchemaResponse)(nil), "hashicorp.nomad.plugins.base.ConfigSchemaResponse") + proto.RegisterType((*SetConfigRequest)(nil), "hashicorp.nomad.plugins.base.SetConfigRequest") + proto.RegisterType((*SetConfigResponse)(nil), "hashicorp.nomad.plugins.base.SetConfigResponse") proto.RegisterEnum("hashicorp.nomad.plugins.base.PluginType", PluginType_name, PluginType_value) } @@ -181,9 +317,11 @@ const _ = grpc.SupportPackageIsVersion4 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type BasePluginClient interface { // PluginInfo describes the type and version of a plugin. - PluginInfo(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*PluginInfoResponse, error) + PluginInfo(ctx context.Context, in *PluginInfoRequest, opts ...grpc.CallOption) (*PluginInfoResponse, error) // ConfigSchema returns the schema for parsing the plugins configuration. - ConfigSchema(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ConfigSchemaResponse, error) + ConfigSchema(ctx context.Context, in *ConfigSchemaRequest, opts ...grpc.CallOption) (*ConfigSchemaResponse, error) + // SetConfig is used to set the configuration. + SetConfig(ctx context.Context, in *SetConfigRequest, opts ...grpc.CallOption) (*SetConfigResponse, error) } type basePluginClient struct { @@ -194,7 +332,7 @@ func NewBasePluginClient(cc *grpc.ClientConn) BasePluginClient { return &basePluginClient{cc} } -func (c *basePluginClient) PluginInfo(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*PluginInfoResponse, error) { +func (c *basePluginClient) PluginInfo(ctx context.Context, in *PluginInfoRequest, opts ...grpc.CallOption) (*PluginInfoResponse, error) { out := new(PluginInfoResponse) err := c.cc.Invoke(ctx, "/hashicorp.nomad.plugins.base.BasePlugin/PluginInfo", in, out, opts...) if err != nil { @@ -203,7 +341,7 @@ func (c *basePluginClient) PluginInfo(ctx context.Context, in *empty.Empty, opts return out, nil } -func (c *basePluginClient) ConfigSchema(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ConfigSchemaResponse, error) { +func (c *basePluginClient) ConfigSchema(ctx context.Context, in *ConfigSchemaRequest, opts ...grpc.CallOption) (*ConfigSchemaResponse, error) { out := new(ConfigSchemaResponse) err := c.cc.Invoke(ctx, "/hashicorp.nomad.plugins.base.BasePlugin/ConfigSchema", in, out, opts...) if err != nil { @@ -212,12 +350,23 @@ func (c *basePluginClient) ConfigSchema(ctx context.Context, in *empty.Empty, op return out, nil } +func (c *basePluginClient) SetConfig(ctx context.Context, in *SetConfigRequest, opts ...grpc.CallOption) (*SetConfigResponse, error) { + out := new(SetConfigResponse) + err := c.cc.Invoke(ctx, "/hashicorp.nomad.plugins.base.BasePlugin/SetConfig", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // BasePluginServer is the server API for BasePlugin service. type BasePluginServer interface { // PluginInfo describes the type and version of a plugin. - PluginInfo(context.Context, *empty.Empty) (*PluginInfoResponse, error) + PluginInfo(context.Context, *PluginInfoRequest) (*PluginInfoResponse, error) // ConfigSchema returns the schema for parsing the plugins configuration. - ConfigSchema(context.Context, *empty.Empty) (*ConfigSchemaResponse, error) + ConfigSchema(context.Context, *ConfigSchemaRequest) (*ConfigSchemaResponse, error) + // SetConfig is used to set the configuration. + SetConfig(context.Context, *SetConfigRequest) (*SetConfigResponse, error) } func RegisterBasePluginServer(s *grpc.Server, srv BasePluginServer) { @@ -225,7 +374,7 @@ func RegisterBasePluginServer(s *grpc.Server, srv BasePluginServer) { } func _BasePlugin_PluginInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(empty.Empty) + in := new(PluginInfoRequest) if err := dec(in); err != nil { return nil, err } @@ -237,13 +386,13 @@ func _BasePlugin_PluginInfo_Handler(srv interface{}, ctx context.Context, dec fu FullMethod: "/hashicorp.nomad.plugins.base.BasePlugin/PluginInfo", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BasePluginServer).PluginInfo(ctx, req.(*empty.Empty)) + return srv.(BasePluginServer).PluginInfo(ctx, req.(*PluginInfoRequest)) } return interceptor(ctx, in, info, handler) } func _BasePlugin_ConfigSchema_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(empty.Empty) + in := new(ConfigSchemaRequest) if err := dec(in); err != nil { return nil, err } @@ -255,7 +404,25 @@ func _BasePlugin_ConfigSchema_Handler(srv interface{}, ctx context.Context, dec FullMethod: "/hashicorp.nomad.plugins.base.BasePlugin/ConfigSchema", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BasePluginServer).ConfigSchema(ctx, req.(*empty.Empty)) + return srv.(BasePluginServer).ConfigSchema(ctx, req.(*ConfigSchemaRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BasePlugin_SetConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetConfigRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BasePluginServer).SetConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/hashicorp.nomad.plugins.base.BasePlugin/SetConfig", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BasePluginServer).SetConfig(ctx, req.(*SetConfigRequest)) } return interceptor(ctx, in, info, handler) } @@ -272,38 +439,43 @@ var _BasePlugin_serviceDesc = grpc.ServiceDesc{ MethodName: "ConfigSchema", Handler: _BasePlugin_ConfigSchema_Handler, }, + { + MethodName: "SetConfig", + Handler: _BasePlugin_SetConfig_Handler, + }, }, Streams: []grpc.StreamDesc{}, - Metadata: "hashicorp/nomad/plugins/base/base.proto", + Metadata: "base.proto", } -func init() { - proto.RegisterFile("hashicorp/nomad/plugins/base/base.proto", fileDescriptor_base_b0ba14970497002b) -} +func init() { proto.RegisterFile("base.proto", fileDescriptor_base_6491f5f52ef6eb79) } -var fileDescriptor_base_b0ba14970497002b = []byte{ - // 366 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x91, 0x41, 0x4b, 0xfb, 0x40, - 0x10, 0xc5, 0x9b, 0xfe, 0x43, 0xff, 0x38, 0xd5, 0x12, 0x16, 0x91, 0x52, 0x3d, 0x94, 0x80, 0x58, - 0xa4, 0x6c, 0x34, 0xe2, 0xcd, 0x83, 0x5a, 0x73, 0x28, 0x42, 0x95, 0x54, 0x6b, 0x0f, 0x42, 0xd9, - 0xa6, 0xd3, 0x24, 0xd0, 0x64, 0x97, 0x6c, 0x2b, 0xf4, 0xb3, 0x79, 0xf5, 0x83, 0x49, 0x76, 0x9b, - 0xda, 0x83, 0x2d, 0x5e, 0x92, 0x61, 0xf7, 0xf7, 0x66, 0x67, 0xde, 0x83, 0xb3, 0x88, 0xc9, 0x28, - 0x0e, 0x78, 0x26, 0x9c, 0x94, 0x27, 0x6c, 0xe2, 0x88, 0xd9, 0x22, 0x8c, 0x53, 0xe9, 0x8c, 0x99, - 0x44, 0xf5, 0xa1, 0x22, 0xe3, 0x73, 0x4e, 0x4e, 0xd6, 0x20, 0x55, 0x20, 0x5d, 0x81, 0x34, 0x67, - 0x1a, 0xc7, 0x21, 0xe7, 0xe1, 0x0c, 0x1d, 0xc5, 0x8e, 0x17, 0x53, 0x07, 0x13, 0x31, 0x5f, 0x6a, - 0x69, 0xe3, 0x7a, 0xdb, 0x1b, 0x32, 0x62, 0x19, 0x4e, 0x9c, 0x28, 0x98, 0x49, 0x81, 0x41, 0xfe, - 0x1f, 0xe5, 0x85, 0x96, 0xd9, 0x9f, 0x06, 0x90, 0x67, 0x45, 0x76, 0xd3, 0x29, 0xf7, 0x51, 0x0a, - 0x9e, 0x4a, 0x24, 0x37, 0x60, 0xce, 0x97, 0x02, 0xeb, 0x46, 0xd3, 0x68, 0xd5, 0xdc, 0x16, 0xdd, - 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0xff, 0x73, 0x63, 0x9c, 0xc4, 0xb5, 0x02, 0x00, 0x00, +var fileDescriptor_base_6491f5f52ef6eb79 = []byte{ + // 411 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x53, 0xdd, 0x8a, 0xd3, 0x40, + 0x14, 0x6e, 0x6a, 0xa8, 0xf4, 0xf4, 0x87, 0x38, 0x55, 0x28, 0xc1, 0x8b, 0x12, 0x10, 0x8a, 0x94, + 0x89, 0x8d, 0x78, 0x21, 0x78, 0xa1, 0xd6, 0x5e, 0x14, 0xa1, 0x4a, 0xaa, 0xd5, 0xbb, 0x30, 0x4d, + 0xa7, 0x4d, 0xb0, 0x99, 0x99, 0x66, 0x52, 0xa5, 0xcf, 0xe6, 0x0b, 0xed, 0x63, 0x2c, 0x99, 0x49, + 0xba, 0xd9, 0x65, 0xb7, 0x74, 0xaf, 0x32, 0x9c, 0xef, 0xe7, 0x9c, 0xf3, 0x1d, 0x02, 0xb0, 0x22, + 0x92, 0x62, 0x91, 0xf2, 0x8c, 0xa3, 0x97, 0x11, 0x91, 0x51, 0x1c, 0xf2, 0x54, 0x60, 0xc6, 0x13, + 0xb2, 0xc6, 0x62, 0x77, 0xd8, 0xc6, 0x4c, 0xe2, 0x9c, 0x63, 0xbf, 0x3b, 0xa1, 0xae, 0x42, 0xdd, + 0x02, 0x75, 0x65, 0x44, 0x52, 0xba, 0x76, 0xa3, 0x70, 0x27, 0x05, 0x0d, 0xf3, 0x6f, 0x90, 0x3f, + 0xb4, 0xa9, 0xd3, 0x83, 0x67, 0xdf, 0x15, 0x71, 0xc6, 0x36, 0xdc, 0xa7, 0xfb, 0x03, 0x95, 0x99, + 0xf3, 0xdf, 0x00, 0x54, 0xad, 0x4a, 0xc1, 0x99, 0xa4, 0xe8, 0x03, 0x98, 0xd9, 0x51, 0xd0, 0xbe, + 0x31, 0x30, 0x86, 0x5d, 0x6f, 0x88, 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0x97, 0x5c, 0xaa, 0x72, 0x7f, + 0xfb, 0xcd, 0xe5, 0x02, 0x3d, 0xb2, 0x53, 0x43, 0xff, 0xa0, 0x5d, 0x8d, 0x17, 0x8d, 0xcf, 0x7b, + 0xdc, 0x73, 0x21, 0xdb, 0x7b, 0x8c, 0xe4, 0xd4, 0x98, 0x41, 0xf3, 0x14, 0x21, 0xc2, 0xe7, 0x2d, + 0xee, 0x9e, 0xc9, 0x76, 0x2f, 0xe6, 0x97, 0xfd, 0x56, 0x0d, 0xf5, 0xe3, 0xbc, 0xbd, 0x0e, 0x00, + 0x00, 0xff, 0xff, 0x56, 0x9e, 0x46, 0x0c, 0x9b, 0x03, 0x00, 0x00, } diff --git a/plugins/base/base.proto b/plugins/base/base.proto index 7dcdcead9..20166d878 100644 --- a/plugins/base/base.proto +++ b/plugins/base/base.proto @@ -1,17 +1,19 @@ syntax = "proto3"; package hashicorp.nomad.plugins.base; -import "google/protobuf/empty.proto"; import "hashicorp/nomad/plugins/shared/hclspec/hcl_spec.proto"; // BasePlugin is the methods that all Nomad plugins must support. service BasePlugin { // PluginInfo describes the type and version of a plugin. - rpc PluginInfo(google.protobuf.Empty) returns (PluginInfoResponse) {} + rpc PluginInfo(PluginInfoRequest) returns (PluginInfoResponse) {} // ConfigSchema returns the schema for parsing the plugins configuration. - rpc ConfigSchema(google.protobuf.Empty) returns (ConfigSchemaResponse) {} + rpc ConfigSchema(ConfigSchemaRequest) returns (ConfigSchemaResponse) {} + + // SetConfig is used to set the configuration. + rpc SetConfig(SetConfigRequest) returns (SetConfigResponse) {} } // PluginType enumerates the type of plugins Nomad supports @@ -21,6 +23,9 @@ enum PluginType { DEVICE = 2; } +// PluginInfoRequest is used to request the plugins basic information. +message PluginInfoRequest {} + // PluginInfoResponse returns basic information about the plugin such // that Nomad can decide whether to load the plugin or not. message PluginInfoResponse { @@ -39,8 +44,20 @@ message PluginInfoResponse { string name = 4; } +// ConfigSchemaRequest is used to request the configurations schema. +message ConfigSchemaRequest {} + // ConfigSchemaResponse returns the plugins configuration schema. message ConfigSchemaResponse { // spec is the plugins configuration schema hashicorp.nomad.plugins.shared.hclspec.Spec spec = 1; } + +// SetConfigRequest is used to set the configuration +message SetConfigRequest { + // msgpack_config is the configuration encoded as MessagePack. + bytes msgpack_config = 1; +} + +// SetConfigResponse is used to respond to setting the configuration +message SetConfigResponse {}