From a7835aa43e1c6a13374e8f7eb36ea7271390c96b Mon Sep 17 00:00:00 2001 From: Erik Rasmussen Date: Tue, 13 Aug 2024 23:05:00 -0500 Subject: [PATCH] Add a generic command (#133) * Add a freeform command resource * Typo * Implement a command component * Regen SDKs --- .../unmango/baremetal/v1alpha1/command.pb.go | 624 +++++++++++------- .../baremetal/v1alpha1/command_grpc.pb.go | 38 ++ .../unmango/baremetal/v1alpha1/command.proto | 10 + provider/cmd/provisioner/main.go | 1 + provider/pkg/provider/command/command.go | 76 +++ provider/pkg/provisioner/command/exec.go | 2 +- provider/pkg/provisioner/command/service.go | 57 +- provider/provider.go | 2 + sdk/dotnet/Command/Command.cs | 98 +++ sdk/dotnet/Command/README.md | 0 sdk/go/baremetal/command/command.go | 151 +++++ sdk/go/baremetal/command/init.go | 44 ++ sdk/go/baremetal/x/command/command.go | 132 ++++ sdk/go/baremetal/x/command/init.go | 44 ++ sdk/nodejs/command/command.ts | 77 +++ sdk/nodejs/command/index.ts | 25 + sdk/nodejs/index.ts | 2 + sdk/nodejs/tsconfig.json | 2 + sdk/python/unmango_baremetal/__init__.py | 11 + .../unmango_baremetal/command/__init__.py | 8 + .../unmango_baremetal/command/command.py | 152 +++++ tests/command_test.go | 79 +++ tests/util/provisioner.go | 1 + 23 files changed, 1392 insertions(+), 244 deletions(-) create mode 100644 provider/pkg/provider/command/command.go create mode 100644 sdk/dotnet/Command/Command.cs create mode 100644 sdk/dotnet/Command/README.md create mode 100644 sdk/go/baremetal/command/command.go create mode 100644 sdk/go/baremetal/command/init.go create mode 100644 sdk/go/baremetal/x/command/command.go create mode 100644 sdk/go/baremetal/x/command/init.go create mode 100644 sdk/nodejs/command/command.ts create mode 100644 sdk/nodejs/command/index.ts create mode 100644 sdk/python/unmango_baremetal/command/__init__.py create mode 100644 sdk/python/unmango_baremetal/command/command.py create mode 100644 tests/command_test.go diff --git a/gen/go/unmango/baremetal/v1alpha1/command.pb.go b/gen/go/unmango/baremetal/v1alpha1/command.pb.go index a9a671ce..356e66d4 100644 --- a/gen/go/unmango/baremetal/v1alpha1/command.pb.go +++ b/gen/go/unmango/baremetal/v1alpha1/command.pb.go @@ -93,6 +93,108 @@ func (Bin) EnumDescriptor() ([]byte, []int) { return file_unmango_baremetal_v1alpha1_command_proto_rawDescGZIP(), []int{0} } +type ExecRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Args []string `protobuf:"bytes,1,rep,name=args,proto3" json:"args,omitempty"` + Stdin *string `protobuf:"bytes,2,opt,name=stdin,proto3,oneof" json:"stdin,omitempty"` +} + +func (x *ExecRequest) Reset() { + *x = ExecRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_unmango_baremetal_v1alpha1_command_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExecRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExecRequest) ProtoMessage() {} + +func (x *ExecRequest) ProtoReflect() protoreflect.Message { + mi := &file_unmango_baremetal_v1alpha1_command_proto_msgTypes[0] + 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 ExecRequest.ProtoReflect.Descriptor instead. +func (*ExecRequest) Descriptor() ([]byte, []int) { + return file_unmango_baremetal_v1alpha1_command_proto_rawDescGZIP(), []int{0} +} + +func (x *ExecRequest) GetArgs() []string { + if x != nil { + return x.Args + } + return nil +} + +func (x *ExecRequest) GetStdin() string { + if x != nil && x.Stdin != nil { + return *x.Stdin + } + return "" +} + +type ExecResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Result *Result `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"` +} + +func (x *ExecResponse) Reset() { + *x = ExecResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_unmango_baremetal_v1alpha1_command_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExecResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExecResponse) ProtoMessage() {} + +func (x *ExecResponse) ProtoReflect() protoreflect.Message { + mi := &file_unmango_baremetal_v1alpha1_command_proto_msgTypes[1] + 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 ExecResponse.ProtoReflect.Descriptor instead. +func (*ExecResponse) Descriptor() ([]byte, []int) { + return file_unmango_baremetal_v1alpha1_command_proto_rawDescGZIP(), []int{1} +} + +func (x *ExecResponse) GetResult() *Result { + if x != nil { + return x.Result + } + return nil +} + type CreateRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -106,7 +208,7 @@ type CreateRequest struct { func (x *CreateRequest) Reset() { *x = CreateRequest{} if protoimpl.UnsafeEnabled { - mi := &file_unmango_baremetal_v1alpha1_command_proto_msgTypes[0] + mi := &file_unmango_baremetal_v1alpha1_command_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -119,7 +221,7 @@ func (x *CreateRequest) String() string { func (*CreateRequest) ProtoMessage() {} func (x *CreateRequest) ProtoReflect() protoreflect.Message { - mi := &file_unmango_baremetal_v1alpha1_command_proto_msgTypes[0] + mi := &file_unmango_baremetal_v1alpha1_command_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -132,7 +234,7 @@ func (x *CreateRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateRequest.ProtoReflect.Descriptor instead. func (*CreateRequest) Descriptor() ([]byte, []int) { - return file_unmango_baremetal_v1alpha1_command_proto_rawDescGZIP(), []int{0} + return file_unmango_baremetal_v1alpha1_command_proto_rawDescGZIP(), []int{2} } func (x *CreateRequest) GetCommand() *Command { @@ -169,7 +271,7 @@ type CreateResponse struct { func (x *CreateResponse) Reset() { *x = CreateResponse{} if protoimpl.UnsafeEnabled { - mi := &file_unmango_baremetal_v1alpha1_command_proto_msgTypes[1] + mi := &file_unmango_baremetal_v1alpha1_command_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -182,7 +284,7 @@ func (x *CreateResponse) String() string { func (*CreateResponse) ProtoMessage() {} func (x *CreateResponse) ProtoReflect() protoreflect.Message { - mi := &file_unmango_baremetal_v1alpha1_command_proto_msgTypes[1] + mi := &file_unmango_baremetal_v1alpha1_command_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -195,7 +297,7 @@ func (x *CreateResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateResponse.ProtoReflect.Descriptor instead. func (*CreateResponse) Descriptor() ([]byte, []int) { - return file_unmango_baremetal_v1alpha1_command_proto_rawDescGZIP(), []int{1} + return file_unmango_baremetal_v1alpha1_command_proto_rawDescGZIP(), []int{3} } func (x *CreateResponse) GetResult() *Result { @@ -233,7 +335,7 @@ type UpdateRequest struct { func (x *UpdateRequest) Reset() { *x = UpdateRequest{} if protoimpl.UnsafeEnabled { - mi := &file_unmango_baremetal_v1alpha1_command_proto_msgTypes[2] + mi := &file_unmango_baremetal_v1alpha1_command_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -246,7 +348,7 @@ func (x *UpdateRequest) String() string { func (*UpdateRequest) ProtoMessage() {} func (x *UpdateRequest) ProtoReflect() protoreflect.Message { - mi := &file_unmango_baremetal_v1alpha1_command_proto_msgTypes[2] + mi := &file_unmango_baremetal_v1alpha1_command_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -259,7 +361,7 @@ func (x *UpdateRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateRequest.ProtoReflect.Descriptor instead. func (*UpdateRequest) Descriptor() ([]byte, []int) { - return file_unmango_baremetal_v1alpha1_command_proto_rawDescGZIP(), []int{2} + return file_unmango_baremetal_v1alpha1_command_proto_rawDescGZIP(), []int{4} } func (x *UpdateRequest) GetCommand() *Command { @@ -303,7 +405,7 @@ type UpdateResponse struct { func (x *UpdateResponse) Reset() { *x = UpdateResponse{} if protoimpl.UnsafeEnabled { - mi := &file_unmango_baremetal_v1alpha1_command_proto_msgTypes[3] + mi := &file_unmango_baremetal_v1alpha1_command_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -316,7 +418,7 @@ func (x *UpdateResponse) String() string { func (*UpdateResponse) ProtoMessage() {} func (x *UpdateResponse) ProtoReflect() protoreflect.Message { - mi := &file_unmango_baremetal_v1alpha1_command_proto_msgTypes[3] + mi := &file_unmango_baremetal_v1alpha1_command_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -329,7 +431,7 @@ func (x *UpdateResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateResponse.ProtoReflect.Descriptor instead. func (*UpdateResponse) Descriptor() ([]byte, []int) { - return file_unmango_baremetal_v1alpha1_command_proto_rawDescGZIP(), []int{3} + return file_unmango_baremetal_v1alpha1_command_proto_rawDescGZIP(), []int{5} } func (x *UpdateResponse) GetResult() *Result { @@ -365,7 +467,7 @@ type DeleteRequest struct { func (x *DeleteRequest) Reset() { *x = DeleteRequest{} if protoimpl.UnsafeEnabled { - mi := &file_unmango_baremetal_v1alpha1_command_proto_msgTypes[4] + mi := &file_unmango_baremetal_v1alpha1_command_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -378,7 +480,7 @@ func (x *DeleteRequest) String() string { func (*DeleteRequest) ProtoMessage() {} func (x *DeleteRequest) ProtoReflect() protoreflect.Message { - mi := &file_unmango_baremetal_v1alpha1_command_proto_msgTypes[4] + mi := &file_unmango_baremetal_v1alpha1_command_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -391,7 +493,7 @@ func (x *DeleteRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead. func (*DeleteRequest) Descriptor() ([]byte, []int) { - return file_unmango_baremetal_v1alpha1_command_proto_rawDescGZIP(), []int{4} + return file_unmango_baremetal_v1alpha1_command_proto_rawDescGZIP(), []int{6} } func (x *DeleteRequest) GetPrevious() *Operation { @@ -419,7 +521,7 @@ type DeleteResponse struct { func (x *DeleteResponse) Reset() { *x = DeleteResponse{} if protoimpl.UnsafeEnabled { - mi := &file_unmango_baremetal_v1alpha1_command_proto_msgTypes[5] + mi := &file_unmango_baremetal_v1alpha1_command_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -432,7 +534,7 @@ func (x *DeleteResponse) String() string { func (*DeleteResponse) ProtoMessage() {} func (x *DeleteResponse) ProtoReflect() protoreflect.Message { - mi := &file_unmango_baremetal_v1alpha1_command_proto_msgTypes[5] + mi := &file_unmango_baremetal_v1alpha1_command_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -445,7 +547,7 @@ func (x *DeleteResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteResponse.ProtoReflect.Descriptor instead. func (*DeleteResponse) Descriptor() ([]byte, []int) { - return file_unmango_baremetal_v1alpha1_command_proto_rawDescGZIP(), []int{5} + return file_unmango_baremetal_v1alpha1_command_proto_rawDescGZIP(), []int{7} } func (x *DeleteResponse) GetCommands() []*Operation { @@ -469,7 +571,7 @@ type Operation struct { func (x *Operation) Reset() { *x = Operation{} if protoimpl.UnsafeEnabled { - mi := &file_unmango_baremetal_v1alpha1_command_proto_msgTypes[6] + mi := &file_unmango_baremetal_v1alpha1_command_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -482,7 +584,7 @@ func (x *Operation) String() string { func (*Operation) ProtoMessage() {} func (x *Operation) ProtoReflect() protoreflect.Message { - mi := &file_unmango_baremetal_v1alpha1_command_proto_msgTypes[6] + mi := &file_unmango_baremetal_v1alpha1_command_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -495,7 +597,7 @@ func (x *Operation) ProtoReflect() protoreflect.Message { // Deprecated: Use Operation.ProtoReflect.Descriptor instead. func (*Operation) Descriptor() ([]byte, []int) { - return file_unmango_baremetal_v1alpha1_command_proto_rawDescGZIP(), []int{6} + return file_unmango_baremetal_v1alpha1_command_proto_rawDescGZIP(), []int{8} } func (x *Operation) GetResult() *Result { @@ -539,7 +641,7 @@ type Command struct { func (x *Command) Reset() { *x = Command{} if protoimpl.UnsafeEnabled { - mi := &file_unmango_baremetal_v1alpha1_command_proto_msgTypes[7] + mi := &file_unmango_baremetal_v1alpha1_command_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -552,7 +654,7 @@ func (x *Command) String() string { func (*Command) ProtoMessage() {} func (x *Command) ProtoReflect() protoreflect.Message { - mi := &file_unmango_baremetal_v1alpha1_command_proto_msgTypes[7] + mi := &file_unmango_baremetal_v1alpha1_command_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -565,7 +667,7 @@ func (x *Command) ProtoReflect() protoreflect.Message { // Deprecated: Use Command.ProtoReflect.Descriptor instead. func (*Command) Descriptor() ([]byte, []int) { - return file_unmango_baremetal_v1alpha1_command_proto_rawDescGZIP(), []int{7} + return file_unmango_baremetal_v1alpha1_command_proto_rawDescGZIP(), []int{9} } func (x *Command) GetBin() Bin { @@ -602,7 +704,7 @@ type Result struct { func (x *Result) Reset() { *x = Result{} if protoimpl.UnsafeEnabled { - mi := &file_unmango_baremetal_v1alpha1_command_proto_msgTypes[8] + mi := &file_unmango_baremetal_v1alpha1_command_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -615,7 +717,7 @@ func (x *Result) String() string { func (*Result) ProtoMessage() {} func (x *Result) ProtoReflect() protoreflect.Message { - mi := &file_unmango_baremetal_v1alpha1_command_proto_msgTypes[8] + mi := &file_unmango_baremetal_v1alpha1_command_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -628,7 +730,7 @@ func (x *Result) ProtoReflect() protoreflect.Message { // Deprecated: Use Result.ProtoReflect.Descriptor instead. func (*Result) Descriptor() ([]byte, []int) { - return file_unmango_baremetal_v1alpha1_command_proto_rawDescGZIP(), []int{8} + return file_unmango_baremetal_v1alpha1_command_proto_rawDescGZIP(), []int{10} } func (x *Result) GetExitCode() int32 { @@ -659,177 +761,191 @@ var file_unmango_baremetal_v1alpha1_command_proto_rawDesc = []byte{ 0x74, 0x61, 0x6c, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1a, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x62, 0x61, 0x72, 0x65, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x22, 0x94, 0x02, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, - 0x61, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x75, 0x6e, 0x6d, 0x61, - 0x6e, 0x67, 0x6f, 0x2e, 0x62, 0x61, 0x72, 0x65, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x07, - 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x65, 0x78, 0x70, 0x65, 0x63, - 0x74, 0x5f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, - 0x0d, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x12, 0x5d, - 0x0a, 0x0c, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x5f, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x18, 0x03, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x22, 0x46, 0x0a, 0x0b, 0x45, 0x78, 0x65, 0x63, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x72, 0x67, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x04, 0x61, 0x72, 0x67, 0x73, 0x12, 0x19, 0x0a, 0x05, 0x73, 0x74, 0x64, + 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x05, 0x73, 0x74, 0x64, 0x69, + 0x6e, 0x88, 0x01, 0x01, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x73, 0x74, 0x64, 0x69, 0x6e, 0x22, 0x4a, + 0x0a, 0x0c, 0x45, 0x78, 0x65, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, + 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, + 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x62, 0x61, 0x72, 0x65, 0x6d, 0x65, 0x74, + 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x94, 0x02, 0x0a, 0x0d, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x07, + 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, + 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x62, 0x61, 0x72, 0x65, 0x6d, 0x65, 0x74, 0x61, + 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, + 0x6e, 0x64, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x65, + 0x78, 0x70, 0x65, 0x63, 0x74, 0x5f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x0d, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x64, 0x12, 0x5d, 0x0a, 0x0c, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x5f, 0x6d, 0x6f, 0x76, + 0x65, 0x64, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, + 0x67, 0x6f, 0x2e, 0x62, 0x61, 0x72, 0x65, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x2e, 0x45, 0x78, 0x70, 0x65, 0x63, 0x74, 0x4d, 0x6f, 0x76, 0x65, 0x64, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x4d, 0x6f, 0x76, 0x65, + 0x64, 0x1a, 0x3e, 0x0a, 0x10, 0x45, 0x78, 0x70, 0x65, 0x63, 0x74, 0x4d, 0x6f, 0x76, 0x65, 0x64, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, + 0x01, 0x22, 0x8d, 0x02, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x62, + 0x61, 0x72, 0x65, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, + 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x69, 0x6c, 0x65, + 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, + 0x46, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x5b, 0x0a, 0x0b, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x5f, 0x66, + 0x69, 0x6c, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x75, 0x6e, 0x6d, + 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x62, 0x61, 0x72, 0x65, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x4d, 0x6f, 0x76, 0x65, 0x64, 0x46, 0x69, 0x6c, 0x65, + 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x46, 0x69, 0x6c, + 0x65, 0x73, 0x1a, 0x3d, 0x0a, 0x0f, 0x4d, 0x6f, 0x76, 0x65, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x73, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, + 0x01, 0x22, 0xd7, 0x02, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x62, + 0x61, 0x72, 0x65, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x61, + 0x6e, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x5f, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x65, 0x78, 0x70, 0x65, + 0x63, 0x74, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x12, 0x5d, 0x0a, 0x0c, 0x65, 0x78, 0x70, + 0x65, 0x63, 0x74, 0x5f, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x3a, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x62, 0x61, 0x72, 0x65, 0x6d, 0x65, + 0x74, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x45, 0x78, 0x70, 0x65, 0x63, + 0x74, 0x4d, 0x6f, 0x76, 0x65, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x65, 0x78, 0x70, + 0x65, 0x63, 0x74, 0x4d, 0x6f, 0x76, 0x65, 0x64, 0x12, 0x41, 0x0a, 0x08, 0x70, 0x72, 0x65, 0x76, + 0x69, 0x6f, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x75, 0x6e, 0x6d, + 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x62, 0x61, 0x72, 0x65, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x08, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x1a, 0x3e, 0x0a, 0x10, 0x45, + 0x78, 0x70, 0x65, 0x63, 0x74, 0x4d, 0x6f, 0x76, 0x65, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, + 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, + 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x8d, 0x02, 0x0a, 0x0e, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, + 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, + 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x62, 0x61, 0x72, 0x65, 0x6d, 0x65, 0x74, + 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x12, + 0x5b, 0x0a, 0x0b, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x62, 0x61, 0x72, 0x65, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, - 0x45, 0x78, 0x70, 0x65, 0x63, 0x74, 0x4d, 0x6f, 0x76, 0x65, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, - 0x52, 0x0b, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x4d, 0x6f, 0x76, 0x65, 0x64, 0x1a, 0x3e, 0x0a, - 0x10, 0x45, 0x78, 0x70, 0x65, 0x63, 0x74, 0x4d, 0x6f, 0x76, 0x65, 0x64, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x8d, 0x02, - 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x3a, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x22, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x62, 0x61, 0x72, 0x65, 0x6d, - 0x65, 0x74, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, 0x65, - 0x73, 0x75, 0x6c, 0x74, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x23, 0x0a, 0x0d, - 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x46, 0x69, 0x6c, 0x65, - 0x73, 0x12, 0x5b, 0x0a, 0x0b, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, - 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, - 0x2e, 0x62, 0x61, 0x72, 0x65, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x2e, 0x4d, 0x6f, 0x76, 0x65, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x52, 0x0a, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x1a, 0x3d, - 0x0a, 0x0f, 0x4d, 0x6f, 0x76, 0x65, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xd7, 0x02, - 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x3d, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x2e, 0x4d, 0x6f, 0x76, 0x65, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x52, 0x0a, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x1a, 0x3d, 0x0a, 0x0f, + 0x4d, 0x6f, 0x76, 0x65, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, + 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, + 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xa2, 0x01, 0x0a, 0x0d, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x41, 0x0a, + 0x08, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x25, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x62, 0x61, 0x72, 0x65, 0x6d, 0x65, + 0x74, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, + 0x12, 0x42, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x23, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x62, 0x61, 0x72, 0x65, + 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, + 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x48, 0x00, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, + 0x64, 0x88, 0x01, 0x01, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, + 0x22, 0x53, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x41, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x62, + 0x61, 0x72, 0x65, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x63, 0x6f, 0x6d, + 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x22, 0xc2, 0x02, 0x0a, 0x09, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x3a, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x62, 0x61, + 0x72, 0x65, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, + 0x3d, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x62, 0x61, 0x72, 0x65, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, - 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x25, - 0x0a, 0x0e, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x5f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, - 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x64, 0x12, 0x5d, 0x0a, 0x0c, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x5f, - 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x75, 0x6e, + 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x23, + 0x0a, 0x0d, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, + 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x46, 0x69, + 0x6c, 0x65, 0x73, 0x12, 0x56, 0x0a, 0x0b, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x5f, 0x66, 0x69, 0x6c, + 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, + 0x67, 0x6f, 0x2e, 0x62, 0x61, 0x72, 0x65, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x4d, 0x6f, 0x76, 0x65, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, + 0x0a, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x1a, 0x3d, 0x0a, 0x0f, 0x4d, + 0x6f, 0x76, 0x65, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, + 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x75, 0x0a, 0x07, 0x43, 0x6f, + 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x31, 0x0a, 0x03, 0x62, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x62, 0x61, 0x72, + 0x65, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x42, 0x69, 0x6e, 0x52, 0x03, 0x62, 0x69, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x72, 0x67, 0x73, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x61, 0x72, 0x67, 0x73, 0x12, 0x19, 0x0a, 0x05, + 0x73, 0x74, 0x64, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x05, 0x73, + 0x74, 0x64, 0x69, 0x6e, 0x88, 0x01, 0x01, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x73, 0x74, 0x64, 0x69, + 0x6e, 0x22, 0x55, 0x0a, 0x06, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x65, + 0x78, 0x69, 0x74, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, + 0x65, 0x78, 0x69, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x64, 0x6f, + 0x75, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x64, 0x6f, 0x75, 0x74, + 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x64, 0x65, 0x72, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x73, 0x74, 0x64, 0x65, 0x72, 0x72, 0x2a, 0xa8, 0x01, 0x0a, 0x03, 0x42, 0x69, 0x6e, + 0x12, 0x13, 0x0a, 0x0f, 0x42, 0x49, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, + 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x42, 0x49, 0x4e, 0x5f, 0x54, 0x45, 0x45, + 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x42, 0x49, 0x4e, 0x5f, 0x52, 0x4d, 0x10, 0x02, 0x12, 0x0c, + 0x0a, 0x08, 0x42, 0x49, 0x4e, 0x5f, 0x57, 0x47, 0x45, 0x54, 0x10, 0x03, 0x12, 0x0a, 0x0a, 0x06, + 0x42, 0x49, 0x4e, 0x5f, 0x4d, 0x56, 0x10, 0x04, 0x12, 0x0b, 0x0a, 0x07, 0x42, 0x49, 0x4e, 0x5f, + 0x54, 0x41, 0x52, 0x10, 0x05, 0x12, 0x0d, 0x0a, 0x09, 0x42, 0x49, 0x4e, 0x5f, 0x4d, 0x4b, 0x44, + 0x49, 0x52, 0x10, 0x06, 0x12, 0x0e, 0x0a, 0x0a, 0x42, 0x49, 0x4e, 0x5f, 0x4d, 0x4b, 0x54, 0x45, + 0x4d, 0x50, 0x10, 0x07, 0x12, 0x0d, 0x0a, 0x09, 0x42, 0x49, 0x4e, 0x5f, 0x43, 0x48, 0x4d, 0x4f, + 0x44, 0x10, 0x08, 0x12, 0x0d, 0x0a, 0x09, 0x42, 0x49, 0x4e, 0x5f, 0x54, 0x4f, 0x55, 0x43, 0x48, + 0x10, 0x09, 0x12, 0x0f, 0x0a, 0x0b, 0x42, 0x49, 0x4e, 0x5f, 0x4b, 0x55, 0x42, 0x45, 0x41, 0x44, + 0x4d, 0x10, 0x0a, 0x32, 0x8e, 0x03, 0x0a, 0x0e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x59, 0x0a, 0x04, 0x45, 0x78, 0x65, 0x63, 0x12, 0x27, + 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x62, 0x61, 0x72, 0x65, 0x6d, 0x65, 0x74, + 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, + 0x6f, 0x2e, 0x62, 0x61, 0x72, 0x65, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x5f, 0x0a, 0x06, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0x29, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x62, 0x61, 0x72, 0x65, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x45, 0x78, 0x70, 0x65, 0x63, 0x74, 0x4d, 0x6f, 0x76, - 0x65, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x4d, - 0x6f, 0x76, 0x65, 0x64, 0x12, 0x41, 0x0a, 0x08, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x62, 0x61, 0x72, 0x65, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x70, - 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x1a, 0x3e, 0x0a, 0x10, 0x45, 0x78, 0x70, 0x65, 0x63, - 0x74, 0x4d, 0x6f, 0x76, 0x65, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, - 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x8d, 0x02, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x06, 0x72, 0x65, - 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x75, 0x6e, 0x6d, - 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x62, 0x61, 0x72, 0x65, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x06, - 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x64, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x63, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x5b, 0x0a, 0x0b, 0x6d, - 0x6f, 0x76, 0x65, 0x64, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x3a, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x62, 0x61, 0x72, 0x65, 0x6d, - 0x65, 0x74, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x4d, 0x6f, 0x76, - 0x65, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x6d, 0x6f, - 0x76, 0x65, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x1a, 0x3d, 0x0a, 0x0f, 0x4d, 0x6f, 0x76, 0x65, - 0x64, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, - 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xa2, 0x01, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x41, 0x0a, 0x08, 0x70, 0x72, 0x65, - 0x76, 0x69, 0x6f, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x75, 0x6e, - 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x62, 0x61, 0x72, 0x65, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x08, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x12, 0x42, 0x0a, 0x07, - 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, - 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x62, 0x61, 0x72, 0x65, 0x6d, 0x65, 0x74, 0x61, - 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, - 0x6e, 0x64, 0x48, 0x00, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x88, 0x01, 0x01, - 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x22, 0x53, 0x0a, 0x0e, - 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x41, - 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x25, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x62, 0x61, 0x72, 0x65, 0x6d, - 0x65, 0x74, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4f, 0x70, - 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, - 0x73, 0x22, 0xc2, 0x02, 0x0a, 0x09, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x3a, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x22, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x62, 0x61, 0x72, 0x65, 0x6d, 0x65, - 0x74, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73, - 0x75, 0x6c, 0x74, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x3d, 0x0a, 0x07, 0x63, - 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x75, - 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x62, 0x61, 0x72, 0x65, 0x6d, 0x65, 0x74, 0x61, 0x6c, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, - 0x64, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, - 0x09, 0x52, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x12, - 0x56, 0x0a, 0x0b, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x04, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x62, - 0x61, 0x72, 0x65, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x6f, 0x76, 0x65, - 0x64, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x6d, 0x6f, 0x76, - 0x65, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x1a, 0x3d, 0x0a, 0x0f, 0x4d, 0x6f, 0x76, 0x65, 0x64, - 0x46, 0x69, 0x6c, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x75, 0x0a, 0x07, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, - 0x64, 0x12, 0x31, 0x0a, 0x03, 0x62, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, - 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x62, 0x61, 0x72, 0x65, 0x6d, 0x65, 0x74, - 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x69, 0x6e, 0x52, - 0x03, 0x62, 0x69, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x72, 0x67, 0x73, 0x18, 0x02, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x04, 0x61, 0x72, 0x67, 0x73, 0x12, 0x19, 0x0a, 0x05, 0x73, 0x74, 0x64, 0x69, - 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x05, 0x73, 0x74, 0x64, 0x69, 0x6e, - 0x88, 0x01, 0x01, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x73, 0x74, 0x64, 0x69, 0x6e, 0x22, 0x55, 0x0a, - 0x06, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x78, 0x69, 0x74, 0x5f, - 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x65, 0x78, 0x69, 0x74, - 0x43, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x64, 0x6f, 0x75, 0x74, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x64, 0x6f, 0x75, 0x74, 0x12, 0x16, 0x0a, 0x06, - 0x73, 0x74, 0x64, 0x65, 0x72, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, - 0x64, 0x65, 0x72, 0x72, 0x2a, 0xa8, 0x01, 0x0a, 0x03, 0x42, 0x69, 0x6e, 0x12, 0x13, 0x0a, 0x0f, - 0x42, 0x49, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, - 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x42, 0x49, 0x4e, 0x5f, 0x54, 0x45, 0x45, 0x10, 0x01, 0x12, 0x0a, - 0x0a, 0x06, 0x42, 0x49, 0x4e, 0x5f, 0x52, 0x4d, 0x10, 0x02, 0x12, 0x0c, 0x0a, 0x08, 0x42, 0x49, - 0x4e, 0x5f, 0x57, 0x47, 0x45, 0x54, 0x10, 0x03, 0x12, 0x0a, 0x0a, 0x06, 0x42, 0x49, 0x4e, 0x5f, - 0x4d, 0x56, 0x10, 0x04, 0x12, 0x0b, 0x0a, 0x07, 0x42, 0x49, 0x4e, 0x5f, 0x54, 0x41, 0x52, 0x10, - 0x05, 0x12, 0x0d, 0x0a, 0x09, 0x42, 0x49, 0x4e, 0x5f, 0x4d, 0x4b, 0x44, 0x49, 0x52, 0x10, 0x06, - 0x12, 0x0e, 0x0a, 0x0a, 0x42, 0x49, 0x4e, 0x5f, 0x4d, 0x4b, 0x54, 0x45, 0x4d, 0x50, 0x10, 0x07, - 0x12, 0x0d, 0x0a, 0x09, 0x42, 0x49, 0x4e, 0x5f, 0x43, 0x48, 0x4d, 0x4f, 0x44, 0x10, 0x08, 0x12, - 0x0d, 0x0a, 0x09, 0x42, 0x49, 0x4e, 0x5f, 0x54, 0x4f, 0x55, 0x43, 0x48, 0x10, 0x09, 0x12, 0x0f, - 0x0a, 0x0b, 0x42, 0x49, 0x4e, 0x5f, 0x4b, 0x55, 0x42, 0x45, 0x41, 0x44, 0x4d, 0x10, 0x0a, 0x32, - 0xb3, 0x02, 0x0a, 0x0e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x12, 0x5f, 0x0a, 0x06, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0x29, 0x2e, 0x75, + 0x68, 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x5f, 0x0a, 0x06, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x29, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x62, 0x61, 0x72, 0x65, 0x6d, 0x65, 0x74, 0x61, 0x6c, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x62, 0x61, 0x72, 0x65, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x5f, 0x0a, 0x06, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x29, 0x2e, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x5f, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x29, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x62, 0x61, 0x72, 0x65, 0x6d, 0x65, 0x74, 0x61, - 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x62, 0x61, 0x72, 0x65, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5f, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x29, - 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x62, 0x61, 0x72, 0x65, 0x6d, 0x65, 0x74, - 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x75, 0x6e, 0x6d, 0x61, - 0x6e, 0x67, 0x6f, 0x2e, 0x62, 0x61, 0x72, 0x65, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x91, 0x02, 0x0a, 0x1e, 0x63, 0x6f, 0x6d, 0x2e, 0x75, 0x6e, - 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x62, 0x61, 0x72, 0x65, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x0c, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, - 0x64, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x57, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2f, 0x70, 0x75, 0x6c, - 0x75, 0x6d, 0x69, 0x2d, 0x62, 0x61, 0x72, 0x65, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x2f, 0x67, 0x65, - 0x6e, 0x2f, 0x67, 0x6f, 0x2f, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2f, 0x62, 0x61, 0x72, - 0x65, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, - 0x62, 0x61, 0x72, 0x65, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0xa2, 0x02, 0x03, 0x55, 0x42, 0x58, 0xaa, 0x02, 0x1a, 0x55, 0x6e, 0x6d, 0x61, 0x6e, 0x67, - 0x6f, 0x2e, 0x42, 0x61, 0x72, 0x65, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x2e, 0x56, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x1a, 0x55, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x5c, 0x42, - 0x61, 0x72, 0x65, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0xe2, 0x02, 0x26, 0x55, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x5c, 0x42, 0x61, 0x72, 0x65, - 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x5c, 0x47, - 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1c, 0x55, 0x6e, 0x6d, - 0x61, 0x6e, 0x67, 0x6f, 0x3a, 0x3a, 0x42, 0x61, 0x72, 0x65, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x3a, - 0x3a, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x91, 0x02, 0x0a, 0x1e, 0x63, 0x6f, 0x6d, 0x2e, 0x75, 0x6e, 0x6d, + 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x62, 0x61, 0x72, 0x65, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x0c, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x57, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2f, 0x70, 0x75, 0x6c, 0x75, + 0x6d, 0x69, 0x2d, 0x62, 0x61, 0x72, 0x65, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x2f, 0x67, 0x65, 0x6e, + 0x2f, 0x67, 0x6f, 0x2f, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2f, 0x62, 0x61, 0x72, 0x65, + 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x62, + 0x61, 0x72, 0x65, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0xa2, 0x02, 0x03, 0x55, 0x42, 0x58, 0xaa, 0x02, 0x1a, 0x55, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, + 0x2e, 0x42, 0x61, 0x72, 0x65, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x2e, 0x56, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0xca, 0x02, 0x1a, 0x55, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x5c, 0x42, 0x61, + 0x72, 0x65, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0xe2, 0x02, 0x26, 0x55, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x5c, 0x42, 0x61, 0x72, 0x65, 0x6d, + 0x65, 0x74, 0x61, 0x6c, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x5c, 0x47, 0x50, + 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1c, 0x55, 0x6e, 0x6d, 0x61, + 0x6e, 0x67, 0x6f, 0x3a, 0x3a, 0x42, 0x61, 0x72, 0x65, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x3a, 0x3a, + 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -845,52 +961,57 @@ func file_unmango_baremetal_v1alpha1_command_proto_rawDescGZIP() []byte { } var file_unmango_baremetal_v1alpha1_command_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_unmango_baremetal_v1alpha1_command_proto_msgTypes = make([]protoimpl.MessageInfo, 14) +var file_unmango_baremetal_v1alpha1_command_proto_msgTypes = make([]protoimpl.MessageInfo, 16) var file_unmango_baremetal_v1alpha1_command_proto_goTypes = []any{ (Bin)(0), // 0: unmango.baremetal.v1alpha1.Bin - (*CreateRequest)(nil), // 1: unmango.baremetal.v1alpha1.CreateRequest - (*CreateResponse)(nil), // 2: unmango.baremetal.v1alpha1.CreateResponse - (*UpdateRequest)(nil), // 3: unmango.baremetal.v1alpha1.UpdateRequest - (*UpdateResponse)(nil), // 4: unmango.baremetal.v1alpha1.UpdateResponse - (*DeleteRequest)(nil), // 5: unmango.baremetal.v1alpha1.DeleteRequest - (*DeleteResponse)(nil), // 6: unmango.baremetal.v1alpha1.DeleteResponse - (*Operation)(nil), // 7: unmango.baremetal.v1alpha1.Operation - (*Command)(nil), // 8: unmango.baremetal.v1alpha1.Command - (*Result)(nil), // 9: unmango.baremetal.v1alpha1.Result - nil, // 10: unmango.baremetal.v1alpha1.CreateRequest.ExpectMovedEntry - nil, // 11: unmango.baremetal.v1alpha1.CreateResponse.MovedFilesEntry - nil, // 12: unmango.baremetal.v1alpha1.UpdateRequest.ExpectMovedEntry - nil, // 13: unmango.baremetal.v1alpha1.UpdateResponse.MovedFilesEntry - nil, // 14: unmango.baremetal.v1alpha1.Operation.MovedFilesEntry + (*ExecRequest)(nil), // 1: unmango.baremetal.v1alpha1.ExecRequest + (*ExecResponse)(nil), // 2: unmango.baremetal.v1alpha1.ExecResponse + (*CreateRequest)(nil), // 3: unmango.baremetal.v1alpha1.CreateRequest + (*CreateResponse)(nil), // 4: unmango.baremetal.v1alpha1.CreateResponse + (*UpdateRequest)(nil), // 5: unmango.baremetal.v1alpha1.UpdateRequest + (*UpdateResponse)(nil), // 6: unmango.baremetal.v1alpha1.UpdateResponse + (*DeleteRequest)(nil), // 7: unmango.baremetal.v1alpha1.DeleteRequest + (*DeleteResponse)(nil), // 8: unmango.baremetal.v1alpha1.DeleteResponse + (*Operation)(nil), // 9: unmango.baremetal.v1alpha1.Operation + (*Command)(nil), // 10: unmango.baremetal.v1alpha1.Command + (*Result)(nil), // 11: unmango.baremetal.v1alpha1.Result + nil, // 12: unmango.baremetal.v1alpha1.CreateRequest.ExpectMovedEntry + nil, // 13: unmango.baremetal.v1alpha1.CreateResponse.MovedFilesEntry + nil, // 14: unmango.baremetal.v1alpha1.UpdateRequest.ExpectMovedEntry + nil, // 15: unmango.baremetal.v1alpha1.UpdateResponse.MovedFilesEntry + nil, // 16: unmango.baremetal.v1alpha1.Operation.MovedFilesEntry } var file_unmango_baremetal_v1alpha1_command_proto_depIdxs = []int32{ - 8, // 0: unmango.baremetal.v1alpha1.CreateRequest.command:type_name -> unmango.baremetal.v1alpha1.Command - 10, // 1: unmango.baremetal.v1alpha1.CreateRequest.expect_moved:type_name -> unmango.baremetal.v1alpha1.CreateRequest.ExpectMovedEntry - 9, // 2: unmango.baremetal.v1alpha1.CreateResponse.result:type_name -> unmango.baremetal.v1alpha1.Result - 11, // 3: unmango.baremetal.v1alpha1.CreateResponse.moved_files:type_name -> unmango.baremetal.v1alpha1.CreateResponse.MovedFilesEntry - 8, // 4: unmango.baremetal.v1alpha1.UpdateRequest.command:type_name -> unmango.baremetal.v1alpha1.Command - 12, // 5: unmango.baremetal.v1alpha1.UpdateRequest.expect_moved:type_name -> unmango.baremetal.v1alpha1.UpdateRequest.ExpectMovedEntry - 7, // 6: unmango.baremetal.v1alpha1.UpdateRequest.previous:type_name -> unmango.baremetal.v1alpha1.Operation - 9, // 7: unmango.baremetal.v1alpha1.UpdateResponse.result:type_name -> unmango.baremetal.v1alpha1.Result - 13, // 8: unmango.baremetal.v1alpha1.UpdateResponse.moved_files:type_name -> unmango.baremetal.v1alpha1.UpdateResponse.MovedFilesEntry - 7, // 9: unmango.baremetal.v1alpha1.DeleteRequest.previous:type_name -> unmango.baremetal.v1alpha1.Operation - 8, // 10: unmango.baremetal.v1alpha1.DeleteRequest.command:type_name -> unmango.baremetal.v1alpha1.Command - 7, // 11: unmango.baremetal.v1alpha1.DeleteResponse.commands:type_name -> unmango.baremetal.v1alpha1.Operation - 9, // 12: unmango.baremetal.v1alpha1.Operation.result:type_name -> unmango.baremetal.v1alpha1.Result - 8, // 13: unmango.baremetal.v1alpha1.Operation.command:type_name -> unmango.baremetal.v1alpha1.Command - 14, // 14: unmango.baremetal.v1alpha1.Operation.moved_files:type_name -> unmango.baremetal.v1alpha1.Operation.MovedFilesEntry - 0, // 15: unmango.baremetal.v1alpha1.Command.bin:type_name -> unmango.baremetal.v1alpha1.Bin - 1, // 16: unmango.baremetal.v1alpha1.CommandService.Create:input_type -> unmango.baremetal.v1alpha1.CreateRequest - 3, // 17: unmango.baremetal.v1alpha1.CommandService.Update:input_type -> unmango.baremetal.v1alpha1.UpdateRequest - 5, // 18: unmango.baremetal.v1alpha1.CommandService.Delete:input_type -> unmango.baremetal.v1alpha1.DeleteRequest - 2, // 19: unmango.baremetal.v1alpha1.CommandService.Create:output_type -> unmango.baremetal.v1alpha1.CreateResponse - 4, // 20: unmango.baremetal.v1alpha1.CommandService.Update:output_type -> unmango.baremetal.v1alpha1.UpdateResponse - 6, // 21: unmango.baremetal.v1alpha1.CommandService.Delete:output_type -> unmango.baremetal.v1alpha1.DeleteResponse - 19, // [19:22] is the sub-list for method output_type - 16, // [16:19] is the sub-list for method input_type - 16, // [16:16] is the sub-list for extension type_name - 16, // [16:16] is the sub-list for extension extendee - 0, // [0:16] is the sub-list for field type_name + 11, // 0: unmango.baremetal.v1alpha1.ExecResponse.result:type_name -> unmango.baremetal.v1alpha1.Result + 10, // 1: unmango.baremetal.v1alpha1.CreateRequest.command:type_name -> unmango.baremetal.v1alpha1.Command + 12, // 2: unmango.baremetal.v1alpha1.CreateRequest.expect_moved:type_name -> unmango.baremetal.v1alpha1.CreateRequest.ExpectMovedEntry + 11, // 3: unmango.baremetal.v1alpha1.CreateResponse.result:type_name -> unmango.baremetal.v1alpha1.Result + 13, // 4: unmango.baremetal.v1alpha1.CreateResponse.moved_files:type_name -> unmango.baremetal.v1alpha1.CreateResponse.MovedFilesEntry + 10, // 5: unmango.baremetal.v1alpha1.UpdateRequest.command:type_name -> unmango.baremetal.v1alpha1.Command + 14, // 6: unmango.baremetal.v1alpha1.UpdateRequest.expect_moved:type_name -> unmango.baremetal.v1alpha1.UpdateRequest.ExpectMovedEntry + 9, // 7: unmango.baremetal.v1alpha1.UpdateRequest.previous:type_name -> unmango.baremetal.v1alpha1.Operation + 11, // 8: unmango.baremetal.v1alpha1.UpdateResponse.result:type_name -> unmango.baremetal.v1alpha1.Result + 15, // 9: unmango.baremetal.v1alpha1.UpdateResponse.moved_files:type_name -> unmango.baremetal.v1alpha1.UpdateResponse.MovedFilesEntry + 9, // 10: unmango.baremetal.v1alpha1.DeleteRequest.previous:type_name -> unmango.baremetal.v1alpha1.Operation + 10, // 11: unmango.baremetal.v1alpha1.DeleteRequest.command:type_name -> unmango.baremetal.v1alpha1.Command + 9, // 12: unmango.baremetal.v1alpha1.DeleteResponse.commands:type_name -> unmango.baremetal.v1alpha1.Operation + 11, // 13: unmango.baremetal.v1alpha1.Operation.result:type_name -> unmango.baremetal.v1alpha1.Result + 10, // 14: unmango.baremetal.v1alpha1.Operation.command:type_name -> unmango.baremetal.v1alpha1.Command + 16, // 15: unmango.baremetal.v1alpha1.Operation.moved_files:type_name -> unmango.baremetal.v1alpha1.Operation.MovedFilesEntry + 0, // 16: unmango.baremetal.v1alpha1.Command.bin:type_name -> unmango.baremetal.v1alpha1.Bin + 1, // 17: unmango.baremetal.v1alpha1.CommandService.Exec:input_type -> unmango.baremetal.v1alpha1.ExecRequest + 3, // 18: unmango.baremetal.v1alpha1.CommandService.Create:input_type -> unmango.baremetal.v1alpha1.CreateRequest + 5, // 19: unmango.baremetal.v1alpha1.CommandService.Update:input_type -> unmango.baremetal.v1alpha1.UpdateRequest + 7, // 20: unmango.baremetal.v1alpha1.CommandService.Delete:input_type -> unmango.baremetal.v1alpha1.DeleteRequest + 2, // 21: unmango.baremetal.v1alpha1.CommandService.Exec:output_type -> unmango.baremetal.v1alpha1.ExecResponse + 4, // 22: unmango.baremetal.v1alpha1.CommandService.Create:output_type -> unmango.baremetal.v1alpha1.CreateResponse + 6, // 23: unmango.baremetal.v1alpha1.CommandService.Update:output_type -> unmango.baremetal.v1alpha1.UpdateResponse + 8, // 24: unmango.baremetal.v1alpha1.CommandService.Delete:output_type -> unmango.baremetal.v1alpha1.DeleteResponse + 21, // [21:25] is the sub-list for method output_type + 17, // [17:21] is the sub-list for method input_type + 17, // [17:17] is the sub-list for extension type_name + 17, // [17:17] is the sub-list for extension extendee + 0, // [0:17] is the sub-list for field type_name } func init() { file_unmango_baremetal_v1alpha1_command_proto_init() } @@ -900,7 +1021,7 @@ func file_unmango_baremetal_v1alpha1_command_proto_init() { } if !protoimpl.UnsafeEnabled { file_unmango_baremetal_v1alpha1_command_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*CreateRequest); i { + switch v := v.(*ExecRequest); i { case 0: return &v.state case 1: @@ -912,7 +1033,7 @@ func file_unmango_baremetal_v1alpha1_command_proto_init() { } } file_unmango_baremetal_v1alpha1_command_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*CreateResponse); i { + switch v := v.(*ExecResponse); i { case 0: return &v.state case 1: @@ -924,7 +1045,7 @@ func file_unmango_baremetal_v1alpha1_command_proto_init() { } } file_unmango_baremetal_v1alpha1_command_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*UpdateRequest); i { + switch v := v.(*CreateRequest); i { case 0: return &v.state case 1: @@ -936,7 +1057,7 @@ func file_unmango_baremetal_v1alpha1_command_proto_init() { } } file_unmango_baremetal_v1alpha1_command_proto_msgTypes[3].Exporter = func(v any, i int) any { - switch v := v.(*UpdateResponse); i { + switch v := v.(*CreateResponse); i { case 0: return &v.state case 1: @@ -948,7 +1069,7 @@ func file_unmango_baremetal_v1alpha1_command_proto_init() { } } file_unmango_baremetal_v1alpha1_command_proto_msgTypes[4].Exporter = func(v any, i int) any { - switch v := v.(*DeleteRequest); i { + switch v := v.(*UpdateRequest); i { case 0: return &v.state case 1: @@ -960,7 +1081,7 @@ func file_unmango_baremetal_v1alpha1_command_proto_init() { } } file_unmango_baremetal_v1alpha1_command_proto_msgTypes[5].Exporter = func(v any, i int) any { - switch v := v.(*DeleteResponse); i { + switch v := v.(*UpdateResponse); i { case 0: return &v.state case 1: @@ -972,7 +1093,7 @@ func file_unmango_baremetal_v1alpha1_command_proto_init() { } } file_unmango_baremetal_v1alpha1_command_proto_msgTypes[6].Exporter = func(v any, i int) any { - switch v := v.(*Operation); i { + switch v := v.(*DeleteRequest); i { case 0: return &v.state case 1: @@ -984,7 +1105,7 @@ func file_unmango_baremetal_v1alpha1_command_proto_init() { } } file_unmango_baremetal_v1alpha1_command_proto_msgTypes[7].Exporter = func(v any, i int) any { - switch v := v.(*Command); i { + switch v := v.(*DeleteResponse); i { case 0: return &v.state case 1: @@ -996,6 +1117,30 @@ func file_unmango_baremetal_v1alpha1_command_proto_init() { } } file_unmango_baremetal_v1alpha1_command_proto_msgTypes[8].Exporter = func(v any, i int) any { + switch v := v.(*Operation); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_unmango_baremetal_v1alpha1_command_proto_msgTypes[9].Exporter = func(v any, i int) any { + switch v := v.(*Command); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_unmango_baremetal_v1alpha1_command_proto_msgTypes[10].Exporter = func(v any, i int) any { switch v := v.(*Result); i { case 0: return &v.state @@ -1008,15 +1153,16 @@ func file_unmango_baremetal_v1alpha1_command_proto_init() { } } } - file_unmango_baremetal_v1alpha1_command_proto_msgTypes[4].OneofWrappers = []any{} - file_unmango_baremetal_v1alpha1_command_proto_msgTypes[7].OneofWrappers = []any{} + file_unmango_baremetal_v1alpha1_command_proto_msgTypes[0].OneofWrappers = []any{} + file_unmango_baremetal_v1alpha1_command_proto_msgTypes[6].OneofWrappers = []any{} + file_unmango_baremetal_v1alpha1_command_proto_msgTypes[9].OneofWrappers = []any{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_unmango_baremetal_v1alpha1_command_proto_rawDesc, NumEnums: 1, - NumMessages: 14, + NumMessages: 16, NumExtensions: 0, NumServices: 1, }, diff --git a/gen/go/unmango/baremetal/v1alpha1/command_grpc.pb.go b/gen/go/unmango/baremetal/v1alpha1/command_grpc.pb.go index 84bb95d8..c551b482 100644 --- a/gen/go/unmango/baremetal/v1alpha1/command_grpc.pb.go +++ b/gen/go/unmango/baremetal/v1alpha1/command_grpc.pb.go @@ -19,6 +19,7 @@ import ( const _ = grpc.SupportPackageIsVersion8 const ( + CommandService_Exec_FullMethodName = "/unmango.baremetal.v1alpha1.CommandService/Exec" CommandService_Create_FullMethodName = "/unmango.baremetal.v1alpha1.CommandService/Create" CommandService_Update_FullMethodName = "/unmango.baremetal.v1alpha1.CommandService/Update" CommandService_Delete_FullMethodName = "/unmango.baremetal.v1alpha1.CommandService/Delete" @@ -28,6 +29,7 @@ const ( // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type CommandServiceClient interface { + Exec(ctx context.Context, in *ExecRequest, opts ...grpc.CallOption) (*ExecResponse, error) Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateResponse, error) Update(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*UpdateResponse, error) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) @@ -41,6 +43,16 @@ func NewCommandServiceClient(cc grpc.ClientConnInterface) CommandServiceClient { return &commandServiceClient{cc} } +func (c *commandServiceClient) Exec(ctx context.Context, in *ExecRequest, opts ...grpc.CallOption) (*ExecResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ExecResponse) + err := c.cc.Invoke(ctx, CommandService_Exec_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *commandServiceClient) Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(CreateResponse) @@ -75,6 +87,7 @@ func (c *commandServiceClient) Delete(ctx context.Context, in *DeleteRequest, op // All implementations must embed UnimplementedCommandServiceServer // for forward compatibility type CommandServiceServer interface { + Exec(context.Context, *ExecRequest) (*ExecResponse, error) Create(context.Context, *CreateRequest) (*CreateResponse, error) Update(context.Context, *UpdateRequest) (*UpdateResponse, error) Delete(context.Context, *DeleteRequest) (*DeleteResponse, error) @@ -85,6 +98,9 @@ type CommandServiceServer interface { type UnimplementedCommandServiceServer struct { } +func (UnimplementedCommandServiceServer) Exec(context.Context, *ExecRequest) (*ExecResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Exec not implemented") +} func (UnimplementedCommandServiceServer) Create(context.Context, *CreateRequest) (*CreateResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Create not implemented") } @@ -107,6 +123,24 @@ func RegisterCommandServiceServer(s grpc.ServiceRegistrar, srv CommandServiceSer s.RegisterService(&CommandService_ServiceDesc, srv) } +func _CommandService_Exec_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ExecRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CommandServiceServer).Exec(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: CommandService_Exec_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CommandServiceServer).Exec(ctx, req.(*ExecRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _CommandService_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(CreateRequest) if err := dec(in); err != nil { @@ -168,6 +202,10 @@ var CommandService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "unmango.baremetal.v1alpha1.CommandService", HandlerType: (*CommandServiceServer)(nil), Methods: []grpc.MethodDesc{ + { + MethodName: "Exec", + Handler: _CommandService_Exec_Handler, + }, { MethodName: "Create", Handler: _CommandService_Create_Handler, diff --git a/proto/unmango/baremetal/v1alpha1/command.proto b/proto/unmango/baremetal/v1alpha1/command.proto index 5d58aa81..d976fdc2 100644 --- a/proto/unmango/baremetal/v1alpha1/command.proto +++ b/proto/unmango/baremetal/v1alpha1/command.proto @@ -3,11 +3,21 @@ syntax = "proto3"; package unmango.baremetal.v1alpha1; service CommandService { + rpc Exec(ExecRequest) returns (ExecResponse); rpc Create(CreateRequest) returns (CreateResponse); rpc Update(UpdateRequest) returns (UpdateResponse); rpc Delete(DeleteRequest) returns (DeleteResponse); } +message ExecRequest { + repeated string args = 1; + optional string stdin = 2; +} + +message ExecResponse { + Result result = 1; +} + message CreateRequest { Command command = 1; repeated string expect_created = 2; diff --git a/provider/cmd/provisioner/main.go b/provider/cmd/provisioner/main.go index 7708ba33..43a36b2b 100644 --- a/provider/cmd/provisioner/main.go +++ b/provider/cmd/provisioner/main.go @@ -52,6 +52,7 @@ var rootCmd = &cobra.Command{ p.WithLogger(log), p.WithOptionalCertificates(clientCaFile, certFile, keyFile), p.WithReflection(reflection), + p.WithWhitelist(whitelist), ) log.Info("serving", diff --git a/provider/pkg/provider/command/command.go b/provider/pkg/provider/command/command.go new file mode 100644 index 00000000..c293c69c --- /dev/null +++ b/provider/pkg/provider/command/command.go @@ -0,0 +1,76 @@ +package command + +import ( + "context" + "fmt" + "strings" + + "github.com/pulumi/pulumi-go-provider/infer" + pb "github.com/unmango/pulumi-baremetal/gen/go/unmango/baremetal/v1alpha1" + "github.com/unmango/pulumi-baremetal/provider/pkg/provider/internal/logger" + "github.com/unmango/pulumi-baremetal/provider/pkg/provider/internal/provisioner" +) + +type CommandArgs struct { + Args []string `pulumi:"args"` + Triggers []any `pulumi:"triggers,optional"` +} + +type Command struct{} + +type CommandState struct { + CommandArgs + + ExitCode int `pulumi:"exitCode"` + Stdout string `pulumi:"stdout"` + Stderr string `pulumi:"stderr"` +} + +// Create implements infer.CustomCreate. +func (Command) Create(ctx context.Context, name string, inputs CommandArgs, preview bool) (string, CommandState, error) { + log := logger.FromContext(ctx) + state := CommandState{} + + p, err := provisioner.FromContext(ctx) + if err != nil { + log.Error("Failed creating provisioner") + return name, state, fmt.Errorf("creating provisioner: %w", err) + } + + if preview { + if _, err = p.Ping(ctx, &pb.PingRequest{}); err != nil { + log.WarningStatusf("Failed pinging provisioner: %s", err) + } + + return name, state, nil + } + + display := display(inputs.Args) + log.DebugStatus("Sending exec request to provisioner") + res, err := p.Exec(ctx, &pb.ExecRequest{ + Args: inputs.Args, + }) + if err != nil { + log.Errorf("command:%s %s", display, err) + return name, state, fmt.Errorf("sending exec request: %w", err) + } + + if res.Result.ExitCode > 0 { + log.Error(display) + return name, state, fmt.Errorf("exec failed: %s", res.Result) + } + + state.CommandArgs = inputs + state.ExitCode = int(res.Result.ExitCode) + state.Stdout = res.Result.Stdout + state.Stderr = res.Result.Stderr + + log.InfoStatus(display) + return name, state, nil +} + +var _ = (infer.CustomCreate[CommandArgs, CommandState])((*Command)(nil)) + +func display(args []string) string { + return strings.Join(args, " ") +} diff --git a/provider/pkg/provisioner/command/exec.go b/provider/pkg/provisioner/command/exec.go index ec5c48ae..52dc9715 100644 --- a/provider/pkg/provisioner/command/exec.go +++ b/provider/pkg/provisioner/command/exec.go @@ -17,7 +17,7 @@ import ( // executing a gRPC endpoint from within another endpoint on the same service. // I'm not sure how I want to handle the filesystem expectations yet, so this function exists -// but `Update` and `Delete` will continue to delgate to `Create` for now. +// but `Update` and `Delete` will continue to delegate to `Create` for now. func execute(ctx context.Context, command *pb.Command, log *slog.Logger) (*pb.Result, error) { if command == nil { diff --git a/provider/pkg/provisioner/command/service.go b/provider/pkg/provisioner/command/service.go index ee9d86be..72ced497 100644 --- a/provider/pkg/provisioner/command/service.go +++ b/provider/pkg/provisioner/command/service.go @@ -13,6 +13,7 @@ import ( "strings" pb "github.com/unmango/pulumi-baremetal/gen/go/unmango/baremetal/v1alpha1" + "github.com/unmango/pulumi-baremetal/provider/pkg/command" "github.com/unmango/pulumi-baremetal/provider/pkg/internal/opts" "google.golang.org/grpc" ) @@ -35,21 +36,69 @@ func NewServer(options ...opt) *service { } func WithLogger(logger *slog.Logger) opt { - return opts.Safe[opt](func(s *service) { + return func(s *service) error { s.Log = logger - }) + return nil + } } func WithWhitelist(list []string) opt { - return opts.Safe[opt](func(s *service) { + return func(s *service) error { s.Whitelist = list - }) + return nil + } } func (s *service) Register(server *grpc.Server) { pb.RegisterCommandServiceServer(server, s) } +func (s *service) Exec(ctx context.Context, req *pb.ExecRequest) (*pb.ExecResponse, error) { + log := s.Log.With("op", "exec") + + bin := req.Args[0] + _, err := command.ParseBin(bin) + if err != nil && !slices.Contains(s.Whitelist, bin) { + log.WarnContext(ctx, "refusing to execute command", "bin", bin, "err", err) + return nil, fmt.Errorf("refusing to execute %s %#v", bin, s.Whitelist) + } + + args := req.Args[1:] + log = log.With("bin", bin, "args", args) + log.DebugContext(ctx, "building command") + cmd := exec.CommandContext(ctx, bin, args...) + cmd.Stdin = stdinReader(req.Stdin) + + if cmd.Err != nil { + log.ErrorContext(ctx, "failed building command", "err", cmd.Err) + return nil, fmt.Errorf("failed building command: %w", cmd.Err) + } + + stdout, stderr := &bytes.Buffer{}, &bytes.Buffer{} + cmd.Stdout, cmd.Stderr = stdout, stderr + + log.DebugContext(ctx, "running command", "cmd", cmd.String()) + if err = cmd.Run(); err != nil { + log.WarnContext(ctx, "command failed", "err", err) + } + + if cmd.ProcessState == nil { + return nil, errors.New("failed to start command") + } + + exitCode := cmd.ProcessState.ExitCode() + log.InfoContext(ctx, "finished running command", + "cmd", cmd.String(), + "exit_code", exitCode, + ) + + return &pb.ExecResponse{Result: &pb.Result{ + ExitCode: int32(exitCode), + Stdout: stdout.String(), + Stderr: stderr.String(), + }}, nil +} + func (s *service) Create(ctx context.Context, req *pb.CreateRequest) (res *pb.CreateResponse, err error) { log := s.Log.With("op", "create") createdFiles := make([]string, len(req.ExpectCreated)) diff --git a/provider/provider.go b/provider/provider.go index 961fcd65..6883ed2b 100644 --- a/provider/provider.go +++ b/provider/provider.go @@ -6,6 +6,7 @@ import ( "github.com/pulumi/pulumi-go-provider/middleware/schema" "github.com/pulumi/pulumi/sdk/v3/go/common/tokens" "github.com/unmango/pulumi-baremetal/provider/pkg/provider" + "github.com/unmango/pulumi-baremetal/provider/pkg/provider/command" "github.com/unmango/pulumi-baremetal/provider/pkg/provider/coreutils" "github.com/unmango/pulumi-baremetal/provider/pkg/provider/kubeadm" ) @@ -44,6 +45,7 @@ func Provider() p.Provider { }, Config: infer.Config[provider.Config](), Resources: []infer.InferredResource{ + infer.Resource[command.Command](), infer.Resource[coreutils.Mktemp](), infer.Resource[coreutils.Tar](), infer.Resource[coreutils.Wget](), diff --git a/sdk/dotnet/Command/Command.cs b/sdk/dotnet/Command/Command.cs new file mode 100644 index 00000000..66afc8c0 --- /dev/null +++ b/sdk/dotnet/Command/Command.cs @@ -0,0 +1,98 @@ +// *** WARNING: this file was generated by pulumi. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; +using Pulumi; + +namespace UnMango.Baremetal.Command +{ + [BaremetalResourceType("baremetal:command:Command")] + public partial class Command : global::Pulumi.CustomResource + { + [Output("args")] + public Output> Args { get; private set; } = null!; + + [Output("exitCode")] + public Output ExitCode { get; private set; } = null!; + + [Output("stderr")] + public Output Stderr { get; private set; } = null!; + + [Output("stdout")] + public Output Stdout { get; private set; } = null!; + + [Output("triggers")] + public Output> Triggers { get; private set; } = null!; + + + /// + /// Create a Command resource with the given unique name, arguments, and options. + /// + /// + /// The unique name of the resource + /// The arguments used to populate this resource's properties + /// A bag of options that control this resource's behavior + public Command(string name, CommandArgs args, CustomResourceOptions? options = null) + : base("baremetal:command:Command", name, args ?? new CommandArgs(), MakeResourceOptions(options, "")) + { + } + + private Command(string name, Input id, CustomResourceOptions? options = null) + : base("baremetal:command:Command", name, null, MakeResourceOptions(options, id)) + { + } + + private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input? id) + { + var defaultOptions = new CustomResourceOptions + { + Version = Utilities.Version, + PluginDownloadURL = "github://api.github.com/unmango", + }; + var merged = CustomResourceOptions.Merge(defaultOptions, options); + // Override the ID if one was specified for consistency with other language SDKs. + merged.Id = id ?? merged.Id; + return merged; + } + /// + /// Get an existing Command resource's state with the given name, ID, and optional extra + /// properties used to qualify the lookup. + /// + /// + /// The unique name of the resulting resource. + /// The unique provider ID of the resource to lookup. + /// A bag of options that control this resource's behavior + public static Command Get(string name, Input id, CustomResourceOptions? options = null) + { + return new Command(name, id, options); + } + } + + public sealed class CommandArgs : global::Pulumi.ResourceArgs + { + [Input("args", required: true)] + private InputList? _args; + public InputList Args + { + get => _args ?? (_args = new InputList()); + set => _args = value; + } + + [Input("triggers")] + private InputList? _triggers; + public InputList Triggers + { + get => _triggers ?? (_triggers = new InputList()); + set => _triggers = value; + } + + public CommandArgs() + { + } + public static new CommandArgs Empty => new CommandArgs(); + } +} diff --git a/sdk/dotnet/Command/README.md b/sdk/dotnet/Command/README.md new file mode 100644 index 00000000..e69de29b diff --git a/sdk/go/baremetal/command/command.go b/sdk/go/baremetal/command/command.go new file mode 100644 index 00000000..f195984d --- /dev/null +++ b/sdk/go/baremetal/command/command.go @@ -0,0 +1,151 @@ +// Code generated by pulumi-language-go DO NOT EDIT. +// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** + +package command + +import ( + "context" + "reflect" + + "errors" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + "github.com/pulumi/pulumi/sdk/v3/go/pulumix" + "github.com/unmango/pulumi-baremetal/sdk/go/baremetal/internal" +) + +type Command struct { + pulumi.CustomResourceState + + Args pulumi.StringArrayOutput `pulumi:"args"` + ExitCode pulumi.IntOutput `pulumi:"exitCode"` + Stderr pulumi.StringOutput `pulumi:"stderr"` + Stdout pulumi.StringOutput `pulumi:"stdout"` + Triggers pulumi.ArrayOutput `pulumi:"triggers"` +} + +// NewCommand registers a new resource with the given unique name, arguments, and options. +func NewCommand(ctx *pulumi.Context, + name string, args *CommandArgs, opts ...pulumi.ResourceOption) (*Command, error) { + if args == nil { + return nil, errors.New("missing one or more required arguments") + } + + if args.Args == nil { + return nil, errors.New("invalid value for required argument 'Args'") + } + opts = internal.PkgResourceDefaultOpts(opts) + var resource Command + err := ctx.RegisterResource("baremetal:command:Command", name, args, &resource, opts...) + if err != nil { + return nil, err + } + return &resource, nil +} + +// GetCommand gets an existing Command resource's state with the given name, ID, and optional +// state properties that are used to uniquely qualify the lookup (nil if not required). +func GetCommand(ctx *pulumi.Context, + name string, id pulumi.IDInput, state *CommandState, opts ...pulumi.ResourceOption) (*Command, error) { + var resource Command + err := ctx.ReadResource("baremetal:command:Command", name, id, state, &resource, opts...) + if err != nil { + return nil, err + } + return &resource, nil +} + +// Input properties used for looking up and filtering Command resources. +type commandState struct { +} + +type CommandState struct { +} + +func (CommandState) ElementType() reflect.Type { + return reflect.TypeOf((*commandState)(nil)).Elem() +} + +type commandArgs struct { + Args []string `pulumi:"args"` + Triggers []interface{} `pulumi:"triggers"` +} + +// The set of arguments for constructing a Command resource. +type CommandArgs struct { + Args pulumi.StringArrayInput + Triggers pulumi.ArrayInput +} + +func (CommandArgs) ElementType() reflect.Type { + return reflect.TypeOf((*commandArgs)(nil)).Elem() +} + +type CommandInput interface { + pulumi.Input + + ToCommandOutput() CommandOutput + ToCommandOutputWithContext(ctx context.Context) CommandOutput +} + +func (*Command) ElementType() reflect.Type { + return reflect.TypeOf((**Command)(nil)).Elem() +} + +func (i *Command) ToCommandOutput() CommandOutput { + return i.ToCommandOutputWithContext(context.Background()) +} + +func (i *Command) ToCommandOutputWithContext(ctx context.Context) CommandOutput { + return pulumi.ToOutputWithContext(ctx, i).(CommandOutput) +} + +func (i *Command) ToOutput(ctx context.Context) pulumix.Output[*Command] { + return pulumix.Output[*Command]{ + OutputState: i.ToCommandOutputWithContext(ctx).OutputState, + } +} + +type CommandOutput struct{ *pulumi.OutputState } + +func (CommandOutput) ElementType() reflect.Type { + return reflect.TypeOf((**Command)(nil)).Elem() +} + +func (o CommandOutput) ToCommandOutput() CommandOutput { + return o +} + +func (o CommandOutput) ToCommandOutputWithContext(ctx context.Context) CommandOutput { + return o +} + +func (o CommandOutput) ToOutput(ctx context.Context) pulumix.Output[*Command] { + return pulumix.Output[*Command]{ + OutputState: o.OutputState, + } +} + +func (o CommandOutput) Args() pulumi.StringArrayOutput { + return o.ApplyT(func(v *Command) pulumi.StringArrayOutput { return v.Args }).(pulumi.StringArrayOutput) +} + +func (o CommandOutput) ExitCode() pulumi.IntOutput { + return o.ApplyT(func(v *Command) pulumi.IntOutput { return v.ExitCode }).(pulumi.IntOutput) +} + +func (o CommandOutput) Stderr() pulumi.StringOutput { + return o.ApplyT(func(v *Command) pulumi.StringOutput { return v.Stderr }).(pulumi.StringOutput) +} + +func (o CommandOutput) Stdout() pulumi.StringOutput { + return o.ApplyT(func(v *Command) pulumi.StringOutput { return v.Stdout }).(pulumi.StringOutput) +} + +func (o CommandOutput) Triggers() pulumi.ArrayOutput { + return o.ApplyT(func(v *Command) pulumi.ArrayOutput { return v.Triggers }).(pulumi.ArrayOutput) +} + +func init() { + pulumi.RegisterInputType(reflect.TypeOf((*CommandInput)(nil)).Elem(), &Command{}) + pulumi.RegisterOutputType(CommandOutput{}) +} diff --git a/sdk/go/baremetal/command/init.go b/sdk/go/baremetal/command/init.go new file mode 100644 index 00000000..87717e90 --- /dev/null +++ b/sdk/go/baremetal/command/init.go @@ -0,0 +1,44 @@ +// Code generated by pulumi-language-go DO NOT EDIT. +// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** + +package command + +import ( + "fmt" + + "github.com/blang/semver" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + "github.com/unmango/pulumi-baremetal/sdk/go/baremetal/internal" +) + +type module struct { + version semver.Version +} + +func (m *module) Version() semver.Version { + return m.version +} + +func (m *module) Construct(ctx *pulumi.Context, name, typ, urn string) (r pulumi.Resource, err error) { + switch typ { + case "baremetal:command:Command": + r = &Command{} + default: + return nil, fmt.Errorf("unknown resource type: %s", typ) + } + + err = ctx.RegisterResource(typ, name, nil, r, pulumi.URN_(urn)) + return +} + +func init() { + version, err := internal.PkgVersion() + if err != nil { + version = semver.Version{Major: 1} + } + pulumi.RegisterResourceModule( + "baremetal", + "command", + &module{version}, + ) +} diff --git a/sdk/go/baremetal/x/command/command.go b/sdk/go/baremetal/x/command/command.go new file mode 100644 index 00000000..ae2e36dc --- /dev/null +++ b/sdk/go/baremetal/x/command/command.go @@ -0,0 +1,132 @@ +// Code generated by pulumi-language-go DO NOT EDIT. +// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** + +package command + +import ( + "context" + "reflect" + + "errors" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + "github.com/pulumi/pulumi/sdk/v3/go/pulumix" + "github.com/unmango/pulumi-baremetal/sdk/go/baremetal/internal" +) + +type Command struct { + pulumi.CustomResourceState + + Args pulumix.ArrayOutput[string] `pulumi:"args"` + ExitCode pulumix.Output[int] `pulumi:"exitCode"` + Stderr pulumix.Output[string] `pulumi:"stderr"` + Stdout pulumix.Output[string] `pulumi:"stdout"` + Triggers pulumix.ArrayOutput[any] `pulumi:"triggers"` +} + +// NewCommand registers a new resource with the given unique name, arguments, and options. +func NewCommand(ctx *pulumi.Context, + name string, args *CommandArgs, opts ...pulumi.ResourceOption) (*Command, error) { + if args == nil { + return nil, errors.New("missing one or more required arguments") + } + + if args.Args == nil { + return nil, errors.New("invalid value for required argument 'Args'") + } + opts = internal.PkgResourceDefaultOpts(opts) + var resource Command + err := ctx.RegisterResource("baremetal:command:Command", name, args, &resource, opts...) + if err != nil { + return nil, err + } + return &resource, nil +} + +// GetCommand gets an existing Command resource's state with the given name, ID, and optional +// state properties that are used to uniquely qualify the lookup (nil if not required). +func GetCommand(ctx *pulumi.Context, + name string, id pulumi.IDInput, state *CommandState, opts ...pulumi.ResourceOption) (*Command, error) { + var resource Command + err := ctx.ReadResource("baremetal:command:Command", name, id, state, &resource, opts...) + if err != nil { + return nil, err + } + return &resource, nil +} + +// Input properties used for looking up and filtering Command resources. +type commandState struct { +} + +type CommandState struct { +} + +func (CommandState) ElementType() reflect.Type { + return reflect.TypeOf((*commandState)(nil)).Elem() +} + +type commandArgs struct { + Args []string `pulumi:"args"` + Triggers []interface{} `pulumi:"triggers"` +} + +// The set of arguments for constructing a Command resource. +type CommandArgs struct { + Args pulumix.Input[[]string] + Triggers pulumix.Input[[]any] +} + +func (CommandArgs) ElementType() reflect.Type { + return reflect.TypeOf((*commandArgs)(nil)).Elem() +} + +type CommandOutput struct{ *pulumi.OutputState } + +func (CommandOutput) ElementType() reflect.Type { + return reflect.TypeOf((*Command)(nil)).Elem() +} + +func (o CommandOutput) ToCommandOutput() CommandOutput { + return o +} + +func (o CommandOutput) ToCommandOutputWithContext(ctx context.Context) CommandOutput { + return o +} + +func (o CommandOutput) ToOutput(ctx context.Context) pulumix.Output[Command] { + return pulumix.Output[Command]{ + OutputState: o.OutputState, + } +} + +func (o CommandOutput) Args() pulumix.ArrayOutput[string] { + value := pulumix.Apply[Command](o, func(v Command) pulumix.ArrayOutput[string] { return v.Args }) + unwrapped := pulumix.Flatten[[]string, pulumix.ArrayOutput[string]](value) + return pulumix.ArrayOutput[string]{OutputState: unwrapped.OutputState} +} + +func (o CommandOutput) ExitCode() pulumix.Output[int] { + value := pulumix.Apply[Command](o, func(v Command) pulumix.Output[int] { return v.ExitCode }) + return pulumix.Flatten[int, pulumix.Output[int]](value) +} + +func (o CommandOutput) Stderr() pulumix.Output[string] { + value := pulumix.Apply[Command](o, func(v Command) pulumix.Output[string] { return v.Stderr }) + return pulumix.Flatten[string, pulumix.Output[string]](value) +} + +func (o CommandOutput) Stdout() pulumix.Output[string] { + value := pulumix.Apply[Command](o, func(v Command) pulumix.Output[string] { return v.Stdout }) + return pulumix.Flatten[string, pulumix.Output[string]](value) +} + +func (o CommandOutput) Triggers() pulumix.ArrayOutput[any] { + value := pulumix.Apply[Command](o, func(v Command) pulumix.ArrayOutput[any] { return v.Triggers }) + unwrapped := pulumix.Flatten[[]interface{}, pulumix.ArrayOutput[any]](value) + return pulumix.ArrayOutput[any]{OutputState: unwrapped.OutputState} +} + +func init() { + pulumi.RegisterOutputType(CommandOutput{}) +} diff --git a/sdk/go/baremetal/x/command/init.go b/sdk/go/baremetal/x/command/init.go new file mode 100644 index 00000000..87717e90 --- /dev/null +++ b/sdk/go/baremetal/x/command/init.go @@ -0,0 +1,44 @@ +// Code generated by pulumi-language-go DO NOT EDIT. +// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** + +package command + +import ( + "fmt" + + "github.com/blang/semver" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + "github.com/unmango/pulumi-baremetal/sdk/go/baremetal/internal" +) + +type module struct { + version semver.Version +} + +func (m *module) Version() semver.Version { + return m.version +} + +func (m *module) Construct(ctx *pulumi.Context, name, typ, urn string) (r pulumi.Resource, err error) { + switch typ { + case "baremetal:command:Command": + r = &Command{} + default: + return nil, fmt.Errorf("unknown resource type: %s", typ) + } + + err = ctx.RegisterResource(typ, name, nil, r, pulumi.URN_(urn)) + return +} + +func init() { + version, err := internal.PkgVersion() + if err != nil { + version = semver.Version{Major: 1} + } + pulumi.RegisterResourceModule( + "baremetal", + "command", + &module{version}, + ) +} diff --git a/sdk/nodejs/command/command.ts b/sdk/nodejs/command/command.ts new file mode 100644 index 00000000..afe414a9 --- /dev/null +++ b/sdk/nodejs/command/command.ts @@ -0,0 +1,77 @@ +// *** WARNING: this file was generated by pulumi-language-nodejs. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +import * as pulumi from "@pulumi/pulumi"; +import * as utilities from "../utilities"; + +export class Command extends pulumi.CustomResource { + /** + * Get an existing Command resource's state with the given name, ID, and optional extra + * properties used to qualify the lookup. + * + * @param name The _unique_ name of the resulting resource. + * @param id The _unique_ provider ID of the resource to lookup. + * @param opts Optional settings to control the behavior of the CustomResource. + */ + public static get(name: string, id: pulumi.Input, opts?: pulumi.CustomResourceOptions): Command { + return new Command(name, undefined as any, { ...opts, id: id }); + } + + /** @internal */ + public static readonly __pulumiType = 'baremetal:command:Command'; + + /** + * Returns true if the given object is an instance of Command. This is designed to work even + * when multiple copies of the Pulumi SDK have been loaded into the same process. + */ + public static isInstance(obj: any): obj is Command { + if (obj === undefined || obj === null) { + return false; + } + return obj['__pulumiType'] === Command.__pulumiType; + } + + public readonly args!: pulumi.Output; + public /*out*/ readonly exitCode!: pulumi.Output; + public /*out*/ readonly stderr!: pulumi.Output; + public /*out*/ readonly stdout!: pulumi.Output; + public readonly triggers!: pulumi.Output; + + /** + * Create a Command resource with the given unique name, arguments, and options. + * + * @param name The _unique_ name of the resource. + * @param args The arguments to use to populate this resource's properties. + * @param opts A bag of options that control this resource's behavior. + */ + constructor(name: string, args: CommandArgs, opts?: pulumi.CustomResourceOptions) { + let resourceInputs: pulumi.Inputs = {}; + opts = opts || {}; + if (!opts.id) { + if ((!args || args.args === undefined) && !opts.urn) { + throw new Error("Missing required property 'args'"); + } + resourceInputs["args"] = args ? args.args : undefined; + resourceInputs["triggers"] = args ? args.triggers : undefined; + resourceInputs["exitCode"] = undefined /*out*/; + resourceInputs["stderr"] = undefined /*out*/; + resourceInputs["stdout"] = undefined /*out*/; + } else { + resourceInputs["args"] = undefined /*out*/; + resourceInputs["exitCode"] = undefined /*out*/; + resourceInputs["stderr"] = undefined /*out*/; + resourceInputs["stdout"] = undefined /*out*/; + resourceInputs["triggers"] = undefined /*out*/; + } + opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); + super(Command.__pulumiType, name, resourceInputs, opts); + } +} + +/** + * The set of arguments for constructing a Command resource. + */ +export interface CommandArgs { + args: pulumi.Input[]>; + triggers?: pulumi.Input; +} diff --git a/sdk/nodejs/command/index.ts b/sdk/nodejs/command/index.ts new file mode 100644 index 00000000..c44d099e --- /dev/null +++ b/sdk/nodejs/command/index.ts @@ -0,0 +1,25 @@ +// *** WARNING: this file was generated by pulumi-language-nodejs. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +import * as pulumi from "@pulumi/pulumi"; +import * as utilities from "../utilities"; + +// Export members: +export { CommandArgs } from "./command"; +export type Command = import("./command").Command; +export const Command: typeof import("./command").Command = null as any; +utilities.lazyLoad(exports, ["Command"], () => require("./command")); + + +const _module = { + version: utilities.getVersion(), + construct: (name: string, type: string, urn: string): pulumi.Resource => { + switch (type) { + case "baremetal:command:Command": + return new Command(name, undefined, { urn }) + default: + throw new Error(`unknown resource type ${type}`); + } + }, +}; +pulumi.runtime.registerResourceModule("baremetal", "command", _module) diff --git a/sdk/nodejs/index.ts b/sdk/nodejs/index.ts index a636f191..5247c397 100644 --- a/sdk/nodejs/index.ts +++ b/sdk/nodejs/index.ts @@ -12,12 +12,14 @@ utilities.lazyLoad(exports, ["Provider"], () => require("./provider")); // Export sub-modules: +import * as command from "./command"; import * as config from "./config"; import * as coreutils from "./coreutils"; import * as kubeadm from "./kubeadm"; import * as types from "./types"; export { + command, config, coreutils, kubeadm, diff --git a/sdk/nodejs/tsconfig.json b/sdk/nodejs/tsconfig.json index 0b7e612f..3cc9b85e 100644 --- a/sdk/nodejs/tsconfig.json +++ b/sdk/nodejs/tsconfig.json @@ -13,6 +13,8 @@ "strict": true }, "files": [ + "command/command.ts", + "command/index.ts", "config/index.ts", "config/vars.ts", "coreutils/chmod.ts", diff --git a/sdk/python/unmango_baremetal/__init__.py b/sdk/python/unmango_baremetal/__init__.py index c6ac2baa..2c6e584c 100644 --- a/sdk/python/unmango_baremetal/__init__.py +++ b/sdk/python/unmango_baremetal/__init__.py @@ -9,6 +9,8 @@ # Make subpackages available: if typing.TYPE_CHECKING: + import unmango_baremetal.command as __command + command = __command import unmango_baremetal.config as __config config = __config import unmango_baremetal.coreutils as __coreutils @@ -16,6 +18,7 @@ import unmango_baremetal.kubeadm as __kubeadm kubeadm = __kubeadm else: + command = _utilities.lazy_import('unmango_baremetal.command') config = _utilities.lazy_import('unmango_baremetal.config') coreutils = _utilities.lazy_import('unmango_baremetal.coreutils') kubeadm = _utilities.lazy_import('unmango_baremetal.kubeadm') @@ -23,6 +26,14 @@ _utilities.register( resource_modules=""" [ + { + "pkg": "baremetal", + "mod": "command", + "fqn": "unmango_baremetal.command", + "classes": { + "baremetal:command:Command": "Command" + } + }, { "pkg": "baremetal", "mod": "coreutils", diff --git a/sdk/python/unmango_baremetal/command/__init__.py b/sdk/python/unmango_baremetal/command/__init__.py new file mode 100644 index 00000000..4c8638ab --- /dev/null +++ b/sdk/python/unmango_baremetal/command/__init__.py @@ -0,0 +1,8 @@ +# coding=utf-8 +# *** WARNING: this file was generated by pulumi-language-python. *** +# *** Do not edit by hand unless you're certain you know what you are doing! *** + +from .. import _utilities +import typing +# Export this package's modules as members: +from .command import * diff --git a/sdk/python/unmango_baremetal/command/command.py b/sdk/python/unmango_baremetal/command/command.py new file mode 100644 index 00000000..5adfe951 --- /dev/null +++ b/sdk/python/unmango_baremetal/command/command.py @@ -0,0 +1,152 @@ +# coding=utf-8 +# *** WARNING: this file was generated by pulumi-language-python. *** +# *** Do not edit by hand unless you're certain you know what you are doing! *** + +import copy +import warnings +import pulumi +import pulumi.runtime +from typing import Any, Mapping, Optional, Sequence, Union, overload +from .. import _utilities + +__all__ = ['CommandArgs', 'Command'] + +@pulumi.input_type +class CommandArgs: + def __init__(__self__, *, + args: pulumi.Input[Sequence[pulumi.Input[str]]], + triggers: Optional[pulumi.Input[Sequence[Any]]] = None): + """ + The set of arguments for constructing a Command resource. + """ + pulumi.set(__self__, "args", args) + if triggers is not None: + pulumi.set(__self__, "triggers", triggers) + + @property + @pulumi.getter + def args(self) -> pulumi.Input[Sequence[pulumi.Input[str]]]: + return pulumi.get(self, "args") + + @args.setter + def args(self, value: pulumi.Input[Sequence[pulumi.Input[str]]]): + pulumi.set(self, "args", value) + + @property + @pulumi.getter + def triggers(self) -> Optional[pulumi.Input[Sequence[Any]]]: + return pulumi.get(self, "triggers") + + @triggers.setter + def triggers(self, value: Optional[pulumi.Input[Sequence[Any]]]): + pulumi.set(self, "triggers", value) + + +class Command(pulumi.CustomResource): + @overload + def __init__(__self__, + resource_name: str, + opts: Optional[pulumi.ResourceOptions] = None, + args: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, + triggers: Optional[pulumi.Input[Sequence[Any]]] = None, + __props__=None): + """ + Create a Command resource with the given unique name, props, and options. + :param str resource_name: The name of the resource. + :param pulumi.ResourceOptions opts: Options for the resource. + """ + ... + @overload + def __init__(__self__, + resource_name: str, + args: CommandArgs, + opts: Optional[pulumi.ResourceOptions] = None): + """ + Create a Command resource with the given unique name, props, and options. + :param str resource_name: The name of the resource. + :param CommandArgs args: The arguments to use to populate this resource's properties. + :param pulumi.ResourceOptions opts: Options for the resource. + """ + ... + def __init__(__self__, resource_name: str, *args, **kwargs): + resource_args, opts = _utilities.get_resource_args_opts(CommandArgs, pulumi.ResourceOptions, *args, **kwargs) + if resource_args is not None: + __self__._internal_init(resource_name, opts, **resource_args.__dict__) + else: + __self__._internal_init(resource_name, *args, **kwargs) + + def _internal_init(__self__, + resource_name: str, + opts: Optional[pulumi.ResourceOptions] = None, + args: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, + triggers: Optional[pulumi.Input[Sequence[Any]]] = None, + __props__=None): + opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts) + if not isinstance(opts, pulumi.ResourceOptions): + raise TypeError('Expected resource options to be a ResourceOptions instance') + if opts.id is None: + if __props__ is not None: + raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') + __props__ = CommandArgs.__new__(CommandArgs) + + if args is None and not opts.urn: + raise TypeError("Missing required property 'args'") + __props__.__dict__["args"] = args + __props__.__dict__["triggers"] = triggers + __props__.__dict__["exit_code"] = None + __props__.__dict__["stderr"] = None + __props__.__dict__["stdout"] = None + super(Command, __self__).__init__( + 'baremetal:command:Command', + resource_name, + __props__, + opts) + + @staticmethod + def get(resource_name: str, + id: pulumi.Input[str], + opts: Optional[pulumi.ResourceOptions] = None) -> 'Command': + """ + Get an existing Command resource's state with the given name, id, and optional extra + properties used to qualify the lookup. + + :param str resource_name: The unique name of the resulting resource. + :param pulumi.Input[str] id: The unique provider ID of the resource to lookup. + :param pulumi.ResourceOptions opts: Options for the resource. + """ + opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id)) + + __props__ = CommandArgs.__new__(CommandArgs) + + __props__.__dict__["args"] = None + __props__.__dict__["exit_code"] = None + __props__.__dict__["stderr"] = None + __props__.__dict__["stdout"] = None + __props__.__dict__["triggers"] = None + return Command(resource_name, opts=opts, __props__=__props__) + + @property + @pulumi.getter + def args(self) -> pulumi.Output[Sequence[str]]: + return pulumi.get(self, "args") + + @property + @pulumi.getter(name="exitCode") + def exit_code(self) -> pulumi.Output[int]: + return pulumi.get(self, "exit_code") + + @property + @pulumi.getter + def stderr(self) -> pulumi.Output[str]: + return pulumi.get(self, "stderr") + + @property + @pulumi.getter + def stdout(self) -> pulumi.Output[str]: + return pulumi.get(self, "stdout") + + @property + @pulumi.getter + def triggers(self) -> pulumi.Output[Optional[Sequence[Any]]]: + return pulumi.get(self, "triggers") + diff --git a/tests/command_test.go b/tests/command_test.go new file mode 100644 index 00000000..edb40fe6 --- /dev/null +++ b/tests/command_test.go @@ -0,0 +1,79 @@ +package tests + +import ( + "context" + + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" + . "github.com/unmango/pulumi-baremetal/tests/expect" + + "github.com/pulumi/pulumi-go-provider/integration" + pr "github.com/pulumi/pulumi/sdk/v3/go/common/resource" + "github.com/pulumi/pulumi/sdk/v3/go/common/tokens" +) + +var _ = Describe("Command", func() { + var resource tokens.Type = "baremetal:command:Command" + var server integration.Server + + BeforeEach(func(ctx context.Context) { + server = prepareIntegrationServer(ctx) + }) + + It("should complete a full lifecycle", func(ctx context.Context) { + file := containerPath("chmod.txt") + expectedFile := "/tmp/exec-test.txt" + + By("creating a file to modify") + err := provisioner.WriteFile(ctx, file, []byte("some text")) + Expect(err).NotTo(HaveOccurred()) + + run(server, integration.LifeCycleTest{ + Resource: resource, + Create: integration.Operation{ + Inputs: pr.NewPropertyMapFromMap(map[string]interface{}{ + "args": []string{"mv", file, expectedFile}, + }), + Hook: func(inputs, output pr.PropertyMap) { + Expect(output["stderr"]).To(HavePropertyValue("")) + Expect(output["stdout"]).To(HavePropertyValue("")) + Expect(output["exitCode"]).To(HavePropertyValue(0)) + Expect(output["args"]).To(Equal(inputs["args"])) + Expect(provisioner).To(ContainFile(ctx, expectedFile)) + }, + }, + }) + + _, err = provisioner.Exec(ctx, "touch", "blah") + Expect(err).NotTo(HaveOccurred()) + }) + + It("should execute whitelisted command", func(ctx context.Context) { + run(server, integration.LifeCycleTest{ + Resource: resource, + Create: integration.Operation{ + Inputs: pr.NewPropertyMapFromMap(map[string]interface{}{ + "args": []string{"perl", "--help"}, + }), + Hook: func(inputs, output pr.PropertyMap) { + Expect(output["stderr"]).To(HavePropertyValue("")) + Expect(output["stdout"].V).NotTo(BeEmpty()) + Expect(output["exitCode"]).To(HavePropertyValue(0)) + Expect(output["args"]).To(Equal(inputs["args"])) + }, + }, + }) + }) + + It("should refuse to execute unknown bin", func() { + run(server, integration.LifeCycleTest{ + Resource: resource, + Create: integration.Operation{ + Inputs: pr.NewPropertyMapFromMap(map[string]interface{}{ + "args": []string{"really-hope-this-never-exists"}, + }), + ExpectFailure: true, + }, + }) + }) +}) diff --git a/tests/util/provisioner.go b/tests/util/provisioner.go index 3a923ae6..f5d0ef79 100644 --- a/tests/util/provisioner.go +++ b/tests/util/provisioner.go @@ -69,6 +69,7 @@ func NewProvisioner( "--cert-file", certPath, "--key-file", keyPath, "--verbose", + "--whitelist", "perl", }, ExposedPorts: []string{port}, WaitingFor: wait.ForExposedPort(),