From 5f4ab5a0b39230dcb860d6f8d643a17ee1130ec0 Mon Sep 17 00:00:00 2001 From: Stefan Majer Date: Thu, 4 Jun 2026 13:58:14 +0200 Subject: [PATCH] Machine Condition Command --- doc/index.html | 78 +++++++ .../v2/adminv2connect/machine.connect.go | 34 +++ go/metalstack/admin/v2/machine.pb.go | 195 ++++++++++++++---- go/permissions/servicepermissions.go | 4 + .../v2/adminv2connect/MachineServiceClient.go | 68 ++++++ .../adminv2connect/MachineServiceHandler.go | 68 ++++++ js/metalstack/admin/v2/machine_pb.d.ts | 61 +++++- js/metalstack/admin/v2/machine_pb.js | 12 +- js/metalstack/admin/v2/machine_pb.ts | 71 ++++++- proto/metalstack/admin/v2/machine.proto | 22 ++ python/metalstack/admin/v2/machine_connect.py | 65 ++++++ python/metalstack/admin/v2/machine_pb2.py | 18 +- python/metalstack/admin/v2/machine_pb2.pyi | 16 ++ 13 files changed, 670 insertions(+), 42 deletions(-) diff --git a/doc/index.html b/doc/index.html index 3ccd40b9..5d616ceb 100644 --- a/doc/index.html +++ b/doc/index.html @@ -1432,6 +1432,14 @@

Table of Contents

MMachineServiceListResponse +
  • + MMachineServiceSetStateRequest +
  • + +
  • + MMachineServiceSetStateResponse +
  • + @@ -12507,6 +12515,69 @@

    MachineServiceListRespon +

    MachineServiceSetStateRequest

    +

    MachineServiceSetStateRequest is the request payload for a machine set state request

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeLabelDescription
    uuidstring

    UUID of the machine to set the state to

    statemetalstack.api.v2.MachineState

    State the state of this machine. +If State set to available, description is also cleared.

    descriptionstring

    Description a description why this machine is in the given state

    + + + + + +

    MachineServiceSetStateResponse

    +

    MachineServiceSetStateResponse is the response payload for a machine set state request

    + + + + + + + + + + + + + + + + +
    FieldTypeLabelDescription
    machinemetalstack.api.v2.Machine

    Machine with the changed state.

    + + + + + @@ -12563,6 +12634,13 @@

    MachineService

    GetConsolePassword returns the password to access the serial console of the machine.

    + + SetState + MachineServiceSetStateRequest + MachineServiceSetStateResponse +

    SetState set the state of a machine.

    + + diff --git a/go/metalstack/admin/v2/adminv2connect/machine.connect.go b/go/metalstack/admin/v2/adminv2connect/machine.connect.go index 371b2430..21f6d1fc 100644 --- a/go/metalstack/admin/v2/adminv2connect/machine.connect.go +++ b/go/metalstack/admin/v2/adminv2connect/machine.connect.go @@ -47,6 +47,8 @@ const ( // MachineServiceConsolePasswordProcedure is the fully-qualified name of the MachineService's // ConsolePassword RPC. MachineServiceConsolePasswordProcedure = "/metalstack.admin.v2.MachineService/ConsolePassword" + // MachineServiceSetStateProcedure is the fully-qualified name of the MachineService's SetState RPC. + MachineServiceSetStateProcedure = "/metalstack.admin.v2.MachineService/SetState" ) // MachineServiceClient is a client for the metalstack.admin.v2.MachineService service. @@ -63,6 +65,8 @@ type MachineServiceClient interface { ListBMC(context.Context, *v2.MachineServiceListBMCRequest) (*v2.MachineServiceListBMCResponse, error) // GetConsolePassword returns the password to access the serial console of the machine. ConsolePassword(context.Context, *v2.MachineServiceConsolePasswordRequest) (*v2.MachineServiceConsolePasswordResponse, error) + // SetState set the state of a machine. + SetState(context.Context, *v2.MachineServiceSetStateRequest) (*v2.MachineServiceSetStateResponse, error) } // NewMachineServiceClient constructs a client for the metalstack.admin.v2.MachineService service. @@ -112,6 +116,12 @@ func NewMachineServiceClient(httpClient connect.HTTPClient, baseURL string, opts connect.WithSchema(machineServiceMethods.ByName("ConsolePassword")), connect.WithClientOptions(opts...), ), + setState: connect.NewClient[v2.MachineServiceSetStateRequest, v2.MachineServiceSetStateResponse]( + httpClient, + baseURL+MachineServiceSetStateProcedure, + connect.WithSchema(machineServiceMethods.ByName("SetState")), + connect.WithClientOptions(opts...), + ), } } @@ -123,6 +133,7 @@ type machineServiceClient struct { getBMC *connect.Client[v2.MachineServiceGetBMCRequest, v2.MachineServiceGetBMCResponse] listBMC *connect.Client[v2.MachineServiceListBMCRequest, v2.MachineServiceListBMCResponse] consolePassword *connect.Client[v2.MachineServiceConsolePasswordRequest, v2.MachineServiceConsolePasswordResponse] + setState *connect.Client[v2.MachineServiceSetStateRequest, v2.MachineServiceSetStateResponse] } // Get calls metalstack.admin.v2.MachineService.Get. @@ -179,6 +190,15 @@ func (c *machineServiceClient) ConsolePassword(ctx context.Context, req *v2.Mach return nil, err } +// SetState calls metalstack.admin.v2.MachineService.SetState. +func (c *machineServiceClient) SetState(ctx context.Context, req *v2.MachineServiceSetStateRequest) (*v2.MachineServiceSetStateResponse, error) { + response, err := c.setState.CallUnary(ctx, connect.NewRequest(req)) + if response != nil { + return response.Msg, err + } + return nil, err +} + // MachineServiceHandler is an implementation of the metalstack.admin.v2.MachineService service. type MachineServiceHandler interface { // Returns the machine with the specified UUID. @@ -193,6 +213,8 @@ type MachineServiceHandler interface { ListBMC(context.Context, *v2.MachineServiceListBMCRequest) (*v2.MachineServiceListBMCResponse, error) // GetConsolePassword returns the password to access the serial console of the machine. ConsolePassword(context.Context, *v2.MachineServiceConsolePasswordRequest) (*v2.MachineServiceConsolePasswordResponse, error) + // SetState set the state of a machine. + SetState(context.Context, *v2.MachineServiceSetStateRequest) (*v2.MachineServiceSetStateResponse, error) } // NewMachineServiceHandler builds an HTTP handler from the service implementation. It returns the @@ -238,6 +260,12 @@ func NewMachineServiceHandler(svc MachineServiceHandler, opts ...connect.Handler connect.WithSchema(machineServiceMethods.ByName("ConsolePassword")), connect.WithHandlerOptions(opts...), ) + machineServiceSetStateHandler := connect.NewUnaryHandlerSimple( + MachineServiceSetStateProcedure, + svc.SetState, + connect.WithSchema(machineServiceMethods.ByName("SetState")), + connect.WithHandlerOptions(opts...), + ) return "/metalstack.admin.v2.MachineService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { switch r.URL.Path { case MachineServiceGetProcedure: @@ -252,6 +280,8 @@ func NewMachineServiceHandler(svc MachineServiceHandler, opts ...connect.Handler machineServiceListBMCHandler.ServeHTTP(w, r) case MachineServiceConsolePasswordProcedure: machineServiceConsolePasswordHandler.ServeHTTP(w, r) + case MachineServiceSetStateProcedure: + machineServiceSetStateHandler.ServeHTTP(w, r) default: http.NotFound(w, r) } @@ -284,3 +314,7 @@ func (UnimplementedMachineServiceHandler) ListBMC(context.Context, *v2.MachineSe func (UnimplementedMachineServiceHandler) ConsolePassword(context.Context, *v2.MachineServiceConsolePasswordRequest) (*v2.MachineServiceConsolePasswordResponse, error) { return nil, connect.NewError(connect.CodeUnimplemented, errors.New("metalstack.admin.v2.MachineService.ConsolePassword is not implemented")) } + +func (UnimplementedMachineServiceHandler) SetState(context.Context, *v2.MachineServiceSetStateRequest) (*v2.MachineServiceSetStateResponse, error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("metalstack.admin.v2.MachineService.SetState is not implemented")) +} diff --git a/go/metalstack/admin/v2/machine.pb.go b/go/metalstack/admin/v2/machine.pb.go index fda6a454..52398137 100644 --- a/go/metalstack/admin/v2/machine.pb.go +++ b/go/metalstack/admin/v2/machine.pb.go @@ -613,6 +613,117 @@ func (x *MachineServiceConsolePasswordResponse) GetPassword() string { return "" } +// MachineServiceSetStateRequest is the request payload for a machine set state request +type MachineServiceSetStateRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // UUID of the machine to set the state to + Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` + // State the state of this machine. + // If State set to available, description is also cleared. + State v2.MachineState `protobuf:"varint,2,opt,name=state,proto3,enum=metalstack.api.v2.MachineState" json:"state,omitempty"` + // Description a description why this machine is in the given state + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MachineServiceSetStateRequest) Reset() { + *x = MachineServiceSetStateRequest{} + mi := &file_metalstack_admin_v2_machine_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MachineServiceSetStateRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MachineServiceSetStateRequest) ProtoMessage() {} + +func (x *MachineServiceSetStateRequest) ProtoReflect() protoreflect.Message { + mi := &file_metalstack_admin_v2_machine_proto_msgTypes[12] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MachineServiceSetStateRequest.ProtoReflect.Descriptor instead. +func (*MachineServiceSetStateRequest) Descriptor() ([]byte, []int) { + return file_metalstack_admin_v2_machine_proto_rawDescGZIP(), []int{12} +} + +func (x *MachineServiceSetStateRequest) GetUuid() string { + if x != nil { + return x.Uuid + } + return "" +} + +func (x *MachineServiceSetStateRequest) GetState() v2.MachineState { + if x != nil { + return x.State + } + return v2.MachineState(0) +} + +func (x *MachineServiceSetStateRequest) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +// MachineServiceSetStateResponse is the response payload for a machine set state request +type MachineServiceSetStateResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Machine with the changed state. + Machine *v2.Machine `protobuf:"bytes,1,opt,name=machine,proto3" json:"machine,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MachineServiceSetStateResponse) Reset() { + *x = MachineServiceSetStateResponse{} + mi := &file_metalstack_admin_v2_machine_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MachineServiceSetStateResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MachineServiceSetStateResponse) ProtoMessage() {} + +func (x *MachineServiceSetStateResponse) ProtoReflect() protoreflect.Message { + mi := &file_metalstack_admin_v2_machine_proto_msgTypes[13] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MachineServiceSetStateResponse.ProtoReflect.Descriptor instead. +func (*MachineServiceSetStateResponse) Descriptor() ([]byte, []int) { + return file_metalstack_admin_v2_machine_proto_rawDescGZIP(), []int{13} +} + +func (x *MachineServiceSetStateResponse) GetMachine() *v2.Machine { + if x != nil { + return x.Machine + } + return nil +} + var File_metalstack_admin_v2_machine_proto protoreflect.FileDescriptor const file_metalstack_admin_v2_machine_proto_rawDesc = "" + @@ -654,7 +765,13 @@ const file_metalstack_admin_v2_machine_proto_rawDesc = "" + "\x18\x80\x04R\x06reason\"a\n" + "%MachineServiceConsolePasswordResponse\x12\x1c\n" + "\x04uuid\x18\x01 \x01(\tB\b\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12\x1a\n" + - "\bpassword\x18\x02 \x01(\tR\bpassword2\x8e\x06\n" + + "\bpassword\x18\x02 \x01(\tR\bpassword\"\xad\x01\n" + + "\x1dMachineServiceSetStateRequest\x12\x1c\n" + + "\x04uuid\x18\x01 \x01(\tB\b\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12?\n" + + "\x05state\x18\x02 \x01(\x0e2\x1f.metalstack.api.v2.MachineStateB\b\xbaH\x05\x82\x01\x02\x10\x01R\x05state\x12-\n" + + "\vdescription\x18\x03 \x01(\tB\v\xbaH\br\x06ȳ\xae\xb1\x02\x01R\vdescription\"V\n" + + "\x1eMachineServiceSetStateResponse\x124\n" + + "\amachine\x18\x01 \x01(\v2\x1a.metalstack.api.v2.MachineR\amachine2\x8e\a\n" + "\x0eMachineService\x12p\n" + "\x03Get\x12-.metalstack.admin.v2.MachineServiceGetRequest\x1a..metalstack.admin.v2.MachineServiceGetResponse\"\n" + "\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x02\x12s\n" + @@ -667,7 +784,8 @@ const file_metalstack_admin_v2_machine_proto_rawDesc = "" + "\aListBMC\x121.metalstack.admin.v2.MachineServiceListBMCRequest\x1a2.metalstack.admin.v2.MachineServiceListBMCResponse\"\n" + "\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01\x12\x94\x01\n" + "\x0fConsolePassword\x129.metalstack.admin.v2.MachineServiceConsolePasswordRequest\x1a:.metalstack.admin.v2.MachineServiceConsolePasswordResponse\"\n" + - "\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01B\xd0\x01\n" + + "\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01\x12~\n" + + "\bSetState\x122.metalstack.admin.v2.MachineServiceSetStateRequest\x1a3.metalstack.admin.v2.MachineServiceSetStateResponse\"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01B\xd0\x01\n" + "\x17com.metalstack.admin.v2B\fMachineProtoP\x01Z9github.com/metal-stack/api/go/metalstack/admin/v2;adminv2\xa2\x02\x03MAX\xaa\x02\x13Metalstack.Admin.V2\xca\x02\x13Metalstack\\Admin\\V2\xe2\x02\x1fMetalstack\\Admin\\V2\\GPBMetadata\xea\x02\x15Metalstack::Admin::V2b\x06proto3" var ( @@ -682,7 +800,7 @@ func file_metalstack_admin_v2_machine_proto_rawDescGZIP() []byte { return file_metalstack_admin_v2_machine_proto_rawDescData } -var file_metalstack_admin_v2_machine_proto_msgTypes = make([]protoimpl.MessageInfo, 13) +var file_metalstack_admin_v2_machine_proto_msgTypes = make([]protoimpl.MessageInfo, 15) var file_metalstack_admin_v2_machine_proto_goTypes = []any{ (*MachineServiceGetRequest)(nil), // 0: metalstack.admin.v2.MachineServiceGetRequest (*MachineServiceGetResponse)(nil), // 1: metalstack.admin.v2.MachineServiceGetResponse @@ -696,39 +814,46 @@ var file_metalstack_admin_v2_machine_proto_goTypes = []any{ (*MachineServiceListBMCResponse)(nil), // 9: metalstack.admin.v2.MachineServiceListBMCResponse (*MachineServiceConsolePasswordRequest)(nil), // 10: metalstack.admin.v2.MachineServiceConsolePasswordRequest (*MachineServiceConsolePasswordResponse)(nil), // 11: metalstack.admin.v2.MachineServiceConsolePasswordResponse - nil, // 12: metalstack.admin.v2.MachineServiceListBMCResponse.BmcReportsEntry - (*v2.Machine)(nil), // 13: metalstack.api.v2.Machine - (*v2.MachineQuery)(nil), // 14: metalstack.api.v2.MachineQuery - (v2.MachineBMCCommand)(0), // 15: metalstack.api.v2.MachineBMCCommand - (*v2.MachineBMCReport)(nil), // 16: metalstack.api.v2.MachineBMCReport - (*v2.MachineBMCQuery)(nil), // 17: metalstack.api.v2.MachineBMCQuery + (*MachineServiceSetStateRequest)(nil), // 12: metalstack.admin.v2.MachineServiceSetStateRequest + (*MachineServiceSetStateResponse)(nil), // 13: metalstack.admin.v2.MachineServiceSetStateResponse + nil, // 14: metalstack.admin.v2.MachineServiceListBMCResponse.BmcReportsEntry + (*v2.Machine)(nil), // 15: metalstack.api.v2.Machine + (*v2.MachineQuery)(nil), // 16: metalstack.api.v2.MachineQuery + (v2.MachineBMCCommand)(0), // 17: metalstack.api.v2.MachineBMCCommand + (*v2.MachineBMCReport)(nil), // 18: metalstack.api.v2.MachineBMCReport + (*v2.MachineBMCQuery)(nil), // 19: metalstack.api.v2.MachineBMCQuery + (v2.MachineState)(0), // 20: metalstack.api.v2.MachineState } var file_metalstack_admin_v2_machine_proto_depIdxs = []int32{ - 13, // 0: metalstack.admin.v2.MachineServiceGetResponse.machine:type_name -> metalstack.api.v2.Machine - 14, // 1: metalstack.admin.v2.MachineServiceListRequest.query:type_name -> metalstack.api.v2.MachineQuery - 13, // 2: metalstack.admin.v2.MachineServiceListResponse.machines:type_name -> metalstack.api.v2.Machine - 15, // 3: metalstack.admin.v2.MachineServiceBMCCommandRequest.command:type_name -> metalstack.api.v2.MachineBMCCommand - 16, // 4: metalstack.admin.v2.MachineServiceGetBMCResponse.bmc:type_name -> metalstack.api.v2.MachineBMCReport - 17, // 5: metalstack.admin.v2.MachineServiceListBMCRequest.query:type_name -> metalstack.api.v2.MachineBMCQuery - 12, // 6: metalstack.admin.v2.MachineServiceListBMCResponse.bmc_reports:type_name -> metalstack.admin.v2.MachineServiceListBMCResponse.BmcReportsEntry - 16, // 7: metalstack.admin.v2.MachineServiceListBMCResponse.BmcReportsEntry.value:type_name -> metalstack.api.v2.MachineBMCReport - 0, // 8: metalstack.admin.v2.MachineService.Get:input_type -> metalstack.admin.v2.MachineServiceGetRequest - 2, // 9: metalstack.admin.v2.MachineService.List:input_type -> metalstack.admin.v2.MachineServiceListRequest - 4, // 10: metalstack.admin.v2.MachineService.BMCCommand:input_type -> metalstack.admin.v2.MachineServiceBMCCommandRequest - 6, // 11: metalstack.admin.v2.MachineService.GetBMC:input_type -> metalstack.admin.v2.MachineServiceGetBMCRequest - 8, // 12: metalstack.admin.v2.MachineService.ListBMC:input_type -> metalstack.admin.v2.MachineServiceListBMCRequest - 10, // 13: metalstack.admin.v2.MachineService.ConsolePassword:input_type -> metalstack.admin.v2.MachineServiceConsolePasswordRequest - 1, // 14: metalstack.admin.v2.MachineService.Get:output_type -> metalstack.admin.v2.MachineServiceGetResponse - 3, // 15: metalstack.admin.v2.MachineService.List:output_type -> metalstack.admin.v2.MachineServiceListResponse - 5, // 16: metalstack.admin.v2.MachineService.BMCCommand:output_type -> metalstack.admin.v2.MachineServiceBMCCommandResponse - 7, // 17: metalstack.admin.v2.MachineService.GetBMC:output_type -> metalstack.admin.v2.MachineServiceGetBMCResponse - 9, // 18: metalstack.admin.v2.MachineService.ListBMC:output_type -> metalstack.admin.v2.MachineServiceListBMCResponse - 11, // 19: metalstack.admin.v2.MachineService.ConsolePassword:output_type -> metalstack.admin.v2.MachineServiceConsolePasswordResponse - 14, // [14:20] is the sub-list for method output_type - 8, // [8:14] is the sub-list for method input_type - 8, // [8:8] is the sub-list for extension type_name - 8, // [8:8] is the sub-list for extension extendee - 0, // [0:8] is the sub-list for field type_name + 15, // 0: metalstack.admin.v2.MachineServiceGetResponse.machine:type_name -> metalstack.api.v2.Machine + 16, // 1: metalstack.admin.v2.MachineServiceListRequest.query:type_name -> metalstack.api.v2.MachineQuery + 15, // 2: metalstack.admin.v2.MachineServiceListResponse.machines:type_name -> metalstack.api.v2.Machine + 17, // 3: metalstack.admin.v2.MachineServiceBMCCommandRequest.command:type_name -> metalstack.api.v2.MachineBMCCommand + 18, // 4: metalstack.admin.v2.MachineServiceGetBMCResponse.bmc:type_name -> metalstack.api.v2.MachineBMCReport + 19, // 5: metalstack.admin.v2.MachineServiceListBMCRequest.query:type_name -> metalstack.api.v2.MachineBMCQuery + 14, // 6: metalstack.admin.v2.MachineServiceListBMCResponse.bmc_reports:type_name -> metalstack.admin.v2.MachineServiceListBMCResponse.BmcReportsEntry + 20, // 7: metalstack.admin.v2.MachineServiceSetStateRequest.state:type_name -> metalstack.api.v2.MachineState + 15, // 8: metalstack.admin.v2.MachineServiceSetStateResponse.machine:type_name -> metalstack.api.v2.Machine + 18, // 9: metalstack.admin.v2.MachineServiceListBMCResponse.BmcReportsEntry.value:type_name -> metalstack.api.v2.MachineBMCReport + 0, // 10: metalstack.admin.v2.MachineService.Get:input_type -> metalstack.admin.v2.MachineServiceGetRequest + 2, // 11: metalstack.admin.v2.MachineService.List:input_type -> metalstack.admin.v2.MachineServiceListRequest + 4, // 12: metalstack.admin.v2.MachineService.BMCCommand:input_type -> metalstack.admin.v2.MachineServiceBMCCommandRequest + 6, // 13: metalstack.admin.v2.MachineService.GetBMC:input_type -> metalstack.admin.v2.MachineServiceGetBMCRequest + 8, // 14: metalstack.admin.v2.MachineService.ListBMC:input_type -> metalstack.admin.v2.MachineServiceListBMCRequest + 10, // 15: metalstack.admin.v2.MachineService.ConsolePassword:input_type -> metalstack.admin.v2.MachineServiceConsolePasswordRequest + 12, // 16: metalstack.admin.v2.MachineService.SetState:input_type -> metalstack.admin.v2.MachineServiceSetStateRequest + 1, // 17: metalstack.admin.v2.MachineService.Get:output_type -> metalstack.admin.v2.MachineServiceGetResponse + 3, // 18: metalstack.admin.v2.MachineService.List:output_type -> metalstack.admin.v2.MachineServiceListResponse + 5, // 19: metalstack.admin.v2.MachineService.BMCCommand:output_type -> metalstack.admin.v2.MachineServiceBMCCommandResponse + 7, // 20: metalstack.admin.v2.MachineService.GetBMC:output_type -> metalstack.admin.v2.MachineServiceGetBMCResponse + 9, // 21: metalstack.admin.v2.MachineService.ListBMC:output_type -> metalstack.admin.v2.MachineServiceListBMCResponse + 11, // 22: metalstack.admin.v2.MachineService.ConsolePassword:output_type -> metalstack.admin.v2.MachineServiceConsolePasswordResponse + 13, // 23: metalstack.admin.v2.MachineService.SetState:output_type -> metalstack.admin.v2.MachineServiceSetStateResponse + 17, // [17:24] is the sub-list for method output_type + 10, // [10:17] is the sub-list for method input_type + 10, // [10:10] is the sub-list for extension type_name + 10, // [10:10] is the sub-list for extension extendee + 0, // [0:10] is the sub-list for field type_name } func init() { file_metalstack_admin_v2_machine_proto_init() } @@ -743,7 +868,7 @@ func file_metalstack_admin_v2_machine_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_metalstack_admin_v2_machine_proto_rawDesc), len(file_metalstack_admin_v2_machine_proto_rawDesc)), NumEnums: 0, - NumMessages: 13, + NumMessages: 15, NumExtensions: 0, NumServices: 1, }, diff --git a/go/permissions/servicepermissions.go b/go/permissions/servicepermissions.go index 58b5cab9..0b943673 100755 --- a/go/permissions/servicepermissions.go +++ b/go/permissions/servicepermissions.go @@ -74,6 +74,7 @@ func GetServicePermissions() *ServicePermissions { "/metalstack.admin.v2.MachineService/GetBMC", "/metalstack.admin.v2.MachineService/ListBMC", "/metalstack.admin.v2.MachineService/ConsolePassword", + "/metalstack.admin.v2.MachineService/SetState", "/metalstack.admin.v2.NetworkService/Get", "/metalstack.admin.v2.NetworkService/Create", "/metalstack.admin.v2.NetworkService/Update", @@ -292,6 +293,7 @@ func GetServicePermissions() *ServicePermissions { "/metalstack.admin.v2.MachineService/GetBMC": true, "/metalstack.admin.v2.MachineService/List": true, "/metalstack.admin.v2.MachineService/ListBMC": true, + "/metalstack.admin.v2.MachineService/SetState": true, "/metalstack.admin.v2.NetworkService/Create": true, "/metalstack.admin.v2.NetworkService/Delete": true, "/metalstack.admin.v2.NetworkService/Get": true, @@ -472,6 +474,7 @@ func GetServicePermissions() *ServicePermissions { "/metalstack.admin.v2.MachineService/GetBMC": true, "/metalstack.admin.v2.MachineService/List": true, "/metalstack.admin.v2.MachineService/ListBMC": true, + "/metalstack.admin.v2.MachineService/SetState": true, "/metalstack.admin.v2.NetworkService/Create": true, "/metalstack.admin.v2.NetworkService/Delete": true, "/metalstack.admin.v2.NetworkService/Get": true, @@ -598,6 +601,7 @@ func GetServicePermissions() *ServicePermissions { "/metalstack.admin.v2.MachineService/GetBMC": true, "/metalstack.admin.v2.MachineService/List": false, "/metalstack.admin.v2.MachineService/ListBMC": true, + "/metalstack.admin.v2.MachineService/SetState": true, "/metalstack.admin.v2.NetworkService/Create": true, "/metalstack.admin.v2.NetworkService/Delete": true, "/metalstack.admin.v2.NetworkService/Get": false, diff --git a/go/tests/mocks/metalstack/admin/v2/adminv2connect/MachineServiceClient.go b/go/tests/mocks/metalstack/admin/v2/adminv2connect/MachineServiceClient.go index 364451bf..d901fb77 100644 --- a/go/tests/mocks/metalstack/admin/v2/adminv2connect/MachineServiceClient.go +++ b/go/tests/mocks/metalstack/admin/v2/adminv2connect/MachineServiceClient.go @@ -445,3 +445,71 @@ func (_c *MachineServiceClient_ListBMC_Call) RunAndReturn(run func(context1 cont _c.Call.Return(run) return _c } + +// SetState provides a mock function for the type MachineServiceClient +func (_mock *MachineServiceClient) SetState(context1 context.Context, machineServiceSetStateRequest *adminv2.MachineServiceSetStateRequest) (*adminv2.MachineServiceSetStateResponse, error) { + ret := _mock.Called(context1, machineServiceSetStateRequest) + + if len(ret) == 0 { + panic("no return value specified for SetState") + } + + var r0 *adminv2.MachineServiceSetStateResponse + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *adminv2.MachineServiceSetStateRequest) (*adminv2.MachineServiceSetStateResponse, error)); ok { + return returnFunc(context1, machineServiceSetStateRequest) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, *adminv2.MachineServiceSetStateRequest) *adminv2.MachineServiceSetStateResponse); ok { + r0 = returnFunc(context1, machineServiceSetStateRequest) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*adminv2.MachineServiceSetStateResponse) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, *adminv2.MachineServiceSetStateRequest) error); ok { + r1 = returnFunc(context1, machineServiceSetStateRequest) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MachineServiceClient_SetState_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetState' +type MachineServiceClient_SetState_Call struct { + *mock.Call +} + +// SetState is a helper method to define mock.On call +// - context1 context.Context +// - machineServiceSetStateRequest *adminv2.MachineServiceSetStateRequest +func (_e *MachineServiceClient_Expecter) SetState(context1 interface{}, machineServiceSetStateRequest interface{}) *MachineServiceClient_SetState_Call { + return &MachineServiceClient_SetState_Call{Call: _e.mock.On("SetState", context1, machineServiceSetStateRequest)} +} + +func (_c *MachineServiceClient_SetState_Call) Run(run func(context1 context.Context, machineServiceSetStateRequest *adminv2.MachineServiceSetStateRequest)) *MachineServiceClient_SetState_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *adminv2.MachineServiceSetStateRequest + if args[1] != nil { + arg1 = args[1].(*adminv2.MachineServiceSetStateRequest) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MachineServiceClient_SetState_Call) Return(machineServiceSetStateResponse *adminv2.MachineServiceSetStateResponse, err error) *MachineServiceClient_SetState_Call { + _c.Call.Return(machineServiceSetStateResponse, err) + return _c +} + +func (_c *MachineServiceClient_SetState_Call) RunAndReturn(run func(context1 context.Context, machineServiceSetStateRequest *adminv2.MachineServiceSetStateRequest) (*adminv2.MachineServiceSetStateResponse, error)) *MachineServiceClient_SetState_Call { + _c.Call.Return(run) + return _c +} diff --git a/go/tests/mocks/metalstack/admin/v2/adminv2connect/MachineServiceHandler.go b/go/tests/mocks/metalstack/admin/v2/adminv2connect/MachineServiceHandler.go index b3acf610..87558441 100644 --- a/go/tests/mocks/metalstack/admin/v2/adminv2connect/MachineServiceHandler.go +++ b/go/tests/mocks/metalstack/admin/v2/adminv2connect/MachineServiceHandler.go @@ -445,3 +445,71 @@ func (_c *MachineServiceHandler_ListBMC_Call) RunAndReturn(run func(context1 con _c.Call.Return(run) return _c } + +// SetState provides a mock function for the type MachineServiceHandler +func (_mock *MachineServiceHandler) SetState(context1 context.Context, machineServiceSetStateRequest *adminv2.MachineServiceSetStateRequest) (*adminv2.MachineServiceSetStateResponse, error) { + ret := _mock.Called(context1, machineServiceSetStateRequest) + + if len(ret) == 0 { + panic("no return value specified for SetState") + } + + var r0 *adminv2.MachineServiceSetStateResponse + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *adminv2.MachineServiceSetStateRequest) (*adminv2.MachineServiceSetStateResponse, error)); ok { + return returnFunc(context1, machineServiceSetStateRequest) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, *adminv2.MachineServiceSetStateRequest) *adminv2.MachineServiceSetStateResponse); ok { + r0 = returnFunc(context1, machineServiceSetStateRequest) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*adminv2.MachineServiceSetStateResponse) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, *adminv2.MachineServiceSetStateRequest) error); ok { + r1 = returnFunc(context1, machineServiceSetStateRequest) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MachineServiceHandler_SetState_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetState' +type MachineServiceHandler_SetState_Call struct { + *mock.Call +} + +// SetState is a helper method to define mock.On call +// - context1 context.Context +// - machineServiceSetStateRequest *adminv2.MachineServiceSetStateRequest +func (_e *MachineServiceHandler_Expecter) SetState(context1 interface{}, machineServiceSetStateRequest interface{}) *MachineServiceHandler_SetState_Call { + return &MachineServiceHandler_SetState_Call{Call: _e.mock.On("SetState", context1, machineServiceSetStateRequest)} +} + +func (_c *MachineServiceHandler_SetState_Call) Run(run func(context1 context.Context, machineServiceSetStateRequest *adminv2.MachineServiceSetStateRequest)) *MachineServiceHandler_SetState_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *adminv2.MachineServiceSetStateRequest + if args[1] != nil { + arg1 = args[1].(*adminv2.MachineServiceSetStateRequest) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MachineServiceHandler_SetState_Call) Return(machineServiceSetStateResponse *adminv2.MachineServiceSetStateResponse, err error) *MachineServiceHandler_SetState_Call { + _c.Call.Return(machineServiceSetStateResponse, err) + return _c +} + +func (_c *MachineServiceHandler_SetState_Call) RunAndReturn(run func(context1 context.Context, machineServiceSetStateRequest *adminv2.MachineServiceSetStateRequest) (*adminv2.MachineServiceSetStateResponse, error)) *MachineServiceHandler_SetState_Call { + _c.Call.Return(run) + return _c +} diff --git a/js/metalstack/admin/v2/machine_pb.d.ts b/js/metalstack/admin/v2/machine_pb.d.ts index ae88180d..38442baf 100644 --- a/js/metalstack/admin/v2/machine_pb.d.ts +++ b/js/metalstack/admin/v2/machine_pb.d.ts @@ -1,5 +1,5 @@ import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2"; -import type { Machine, MachineBMCCommand, MachineBMCQuery, MachineBMCReport, MachineQuery } from "../../api/v2/machine_pb"; +import type { Machine, MachineBMCCommand, MachineBMCQuery, MachineBMCReport, MachineQuery, MachineState } from "../../api/v2/machine_pb"; import type { Message } from "@bufbuild/protobuf"; /** * Describes the file metalstack/admin/v2/machine.proto. @@ -248,6 +248,55 @@ export type MachineServiceConsolePasswordResponse = Message<"metalstack.admin.v2 * Use `create(MachineServiceConsolePasswordResponseSchema)` to create a new message. */ export declare const MachineServiceConsolePasswordResponseSchema: GenMessage; +/** + * MachineServiceSetStateRequest is the request payload for a machine set state request + * + * @generated from message metalstack.admin.v2.MachineServiceSetStateRequest + */ +export type MachineServiceSetStateRequest = Message<"metalstack.admin.v2.MachineServiceSetStateRequest"> & { + /** + * UUID of the machine to set the state to + * + * @generated from field: string uuid = 1; + */ + uuid: string; + /** + * State the state of this machine. + * If State set to available, description is also cleared. + * + * @generated from field: metalstack.api.v2.MachineState state = 2; + */ + state: MachineState; + /** + * Description a description why this machine is in the given state + * + * @generated from field: string description = 3; + */ + description: string; +}; +/** + * Describes the message metalstack.admin.v2.MachineServiceSetStateRequest. + * Use `create(MachineServiceSetStateRequestSchema)` to create a new message. + */ +export declare const MachineServiceSetStateRequestSchema: GenMessage; +/** + * MachineServiceSetStateResponse is the response payload for a machine set state request + * + * @generated from message metalstack.admin.v2.MachineServiceSetStateResponse + */ +export type MachineServiceSetStateResponse = Message<"metalstack.admin.v2.MachineServiceSetStateResponse"> & { + /** + * Machine with the changed state. + * + * @generated from field: metalstack.api.v2.Machine machine = 1; + */ + machine?: Machine | undefined; +}; +/** + * Describes the message metalstack.admin.v2.MachineServiceSetStateResponse. + * Use `create(MachineServiceSetStateResponseSchema)` to create a new message. + */ +export declare const MachineServiceSetStateResponseSchema: GenMessage; /** * MachineService provides machine lifecycle management operations. * @@ -314,4 +363,14 @@ export declare const MachineService: GenService<{ input: typeof MachineServiceConsolePasswordRequestSchema; output: typeof MachineServiceConsolePasswordResponseSchema; }; + /** + * SetState set the state of a machine. + * + * @generated from rpc metalstack.admin.v2.MachineService.SetState + */ + setState: { + methodKind: "unary"; + input: typeof MachineServiceSetStateRequestSchema; + output: typeof MachineServiceSetStateResponseSchema; + }; }>; diff --git a/js/metalstack/admin/v2/machine_pb.js b/js/metalstack/admin/v2/machine_pb.js index 01255878..8670db50 100644 --- a/js/metalstack/admin/v2/machine_pb.js +++ b/js/metalstack/admin/v2/machine_pb.js @@ -9,7 +9,7 @@ import { file_metalstack_api_v2_predefined_rules } from "../../api/v2/predefined /** * Describes the file metalstack/admin/v2/machine.proto. */ -export const file_metalstack_admin_v2_machine = /*@__PURE__*/ fileDesc("CiFtZXRhbHN0YWNrL2FkbW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VTZXJ2aWNlR2V0Qk1DUmVxdWVzdBoxLm1ldGFsc3RhY2suYWRtaW4udjIuTWFjaGluZVNlcnZpY2VHZXRCTUNSZXNwb25zZSIK0vMYAgEC4PMYARJ8CgdMaXN0Qk1DEjEubWV0YWxzdGFjay5hZG1pbi52Mi5NYWNoaW5lU2VydmljZUxpc3RCTUNSZXF1ZXN0GjIubWV0YWxzdGFjay5hZG1pbi52Mi5NYWNoaW5lU2VydmljZUxpc3RCTUNSZXNwb25zZSIK0vMYAgEC4PMYARKUAQoPQ29uc29sZVBhc3N3b3JkEjkubWV0YWxzdGFjay5hZG1pbi52Mi5NYWNoaW5lU2VydmljZUNvbnNvbGVQYXNzd29yZFJlcXVlc3QaOi5tZXRhbHN0YWNrLmFkbWluLnYyLk1hY2hpbmVTZXJ2aWNlQ29uc29sZVBhc3N3b3JkUmVzcG9uc2UiCtLzGAIBAuDzGAFC0AEKF2NvbS5tZXRhbHN0YWNrLmFkbWluLnYyQgxNYWNoaW5lUHJvdG9QAVo5Z2l0aHViLmNvbS9tZXRhbC1zdGFjay9hcGkvZ28vbWV0YWxzdGFjay9hZG1pbi92MjthZG1pbnYyogIDTUFYqgITTWV0YWxzdGFjay5BZG1pbi5WMsoCE01ldGFsc3RhY2tcQWRtaW5cVjLiAh9NZXRhbHN0YWNrXEFkbWluXFYyXEdQQk1ldGFkYXRh6gIVTWV0YWxzdGFjazo6QWRtaW46OlYyYgZwcm90bzM", [file_buf_validate_validate, file_metalstack_api_v2_common, file_metalstack_api_v2_machine, file_metalstack_api_v2_predefined_rules]); +export const file_metalstack_admin_v2_machine = /*@__PURE__*/ fileDesc("CiFtZXRhbHN0YWNrL2FkbWluL3YyL21hY2hpbmUucHJvdG8SE21ldGFsc3RhY2suYWRtaW4udjIiMgoYTWFjaGluZVNlcnZpY2VHZXRSZXF1ZXN0EhYKBHV1aWQYASABKAlCCLpIBXIDsAEBIkgKGU1hY2hpbmVTZXJ2aWNlR2V0UmVzcG9uc2USKwoHbWF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YyYgZwcm90bzM", [file_buf_validate_validate, file_metalstack_api_v2_common, file_metalstack_api_v2_machine, file_metalstack_api_v2_predefined_rules]); /** * Describes the message metalstack.admin.v2.MachineServiceGetRequest. * Use `create(MachineServiceGetRequestSchema)` to create a new message. @@ -70,6 +70,16 @@ export const MachineServiceConsolePasswordRequestSchema = /*@__PURE__*/ messageD * Use `create(MachineServiceConsolePasswordResponseSchema)` to create a new message. */ export const MachineServiceConsolePasswordResponseSchema = /*@__PURE__*/ messageDesc(file_metalstack_admin_v2_machine, 11); +/** + * Describes the message metalstack.admin.v2.MachineServiceSetStateRequest. + * Use `create(MachineServiceSetStateRequestSchema)` to create a new message. + */ +export const MachineServiceSetStateRequestSchema = /*@__PURE__*/ messageDesc(file_metalstack_admin_v2_machine, 12); +/** + * Describes the message metalstack.admin.v2.MachineServiceSetStateResponse. + * Use `create(MachineServiceSetStateResponseSchema)` to create a new message. + */ +export const MachineServiceSetStateResponseSchema = /*@__PURE__*/ messageDesc(file_metalstack_admin_v2_machine, 13); /** * MachineService provides machine lifecycle management operations. * diff --git a/js/metalstack/admin/v2/machine_pb.ts b/js/metalstack/admin/v2/machine_pb.ts index 2aadf756..84f6b57e 100644 --- a/js/metalstack/admin/v2/machine_pb.ts +++ b/js/metalstack/admin/v2/machine_pb.ts @@ -6,7 +6,7 @@ import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegen import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2"; import { file_buf_validate_validate } from "../../../buf/validate/validate_pb"; import { file_metalstack_api_v2_common } from "../../api/v2/common_pb"; -import type { Machine, MachineBMCCommand, MachineBMCQuery, MachineBMCReport, MachineQuery } from "../../api/v2/machine_pb"; +import type { Machine, MachineBMCCommand, MachineBMCQuery, MachineBMCReport, MachineQuery, MachineState } from "../../api/v2/machine_pb"; import { file_metalstack_api_v2_machine } from "../../api/v2/machine_pb"; import { file_metalstack_api_v2_predefined_rules } from "../../api/v2/predefined_rules_pb"; import type { Message } from "@bufbuild/protobuf"; @@ -15,7 +15,7 @@ import type { Message } from "@bufbuild/protobuf"; * Describes the file metalstack/admin/v2/machine.proto. */ export const file_metalstack_admin_v2_machine: GenFile = /*@__PURE__*/ - fileDesc("CiFtZXRhbHN0YWNrL2FkbWluL3YyL21hY2hpbmUucHJvdG8SE21ldGFsc3RhY2suYWRtaW4udjIiMgoYTWFjaGluZVNlcnZpY2VHZXRSZXF1ZXN0EhYKBHV1aWQYASABKAlCCLpIBXIDsAEBIkgKGU1hY2hpbmVTZXJ2aWNlR2V0UmVzcG9uc2USKwoHbWFjaGluZRgBIAEoCzIaLm1ldGFsc3RhY2suYXBpLnYyLk1hY2hpbmUifgoZTWFjaGluZVNlcnZpY2VMaXN0UmVxdWVzdBIuCgVxdWVyeRgBIAEoCzIfLm1ldGFsc3RhY2suYXBpLnYyLk1hY2hpbmVRdWVyeRIjCglwYXJ0aXRpb24YAiABKAlCC7pICHIG0LOusQIBSACIAQFCDAoKX3BhcnRpdGlvbiJKChpNYWNoaW5lU2VydmljZUxpc3RSZXNwb25zZRIsCghtYWNoaW5lcxgBIAMoCzIaLm1ldGFsc3RhY2suYXBpLnYyLk1hY2hpbmUiegofTWFjaGluZVNlcnZpY2VCTUNDb21tYW5kUmVxdWVzdBIWCgR1dWlkGAEgASgJQgi6SAVyA7ABARI/Cgdjb21tYW5kGAIgASgOMiQubWV0YWxzdGFjay5hcGkudjIuTWFjaGluZUJNQ0NvbW1hbmRCCLpIBYIBAhABIiIKIE1hY2hpbmVTZXJ2aWNlQk1DQ29tbWFuZFJlc3BvbnNlIjUKG01hY2hpbmVTZXJ2aWNlR2V0Qk1DUmVxdWVzdBIWCgR1dWlkGAEgASgJQgi6SAVyA7ABASJoChxNYWNoaW5lU2VydmljZUdldEJNQ1Jlc3BvbnNlEhYKBHV1aWQYASABKAlCCLpIBXIDsAEBEjAKA2JtYxgCIAEoCzIjLm1ldGFsc3RhY2suYXBpLnYyLk1hY2hpbmVCTUNSZXBvcn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VxdWVzdBo1Lm1ldGFsc3RhY2suYWRtaW4udjIuTWFjaGluZVNlcnZpY2VCTUNDb21tYW5kUmVzcG9uc2UiCdLzGAEB4PMYARJ5CgZHZXRCTUMSMC5tZXRhbHN0YWNrLmFkbWluLnYyLk1hY2hpbmVTZXJ2aWNlR2V0Qk1DUmVxdWVzdBoxLm1ldGFsc3RhY2suYWRtaW4udjIuTWFjaGluZVNlcnZpY2VHZXRCTUNSZXNwb25zZSIK0vMYAgEC4PMYARJ8CgdMaXN0Qk1DEjEubWV0YWxzdGFjay5hZG1pbi52Mi5NYWNoaW5lU2VydmljZUxpc3RCTUNSZXF1ZXN0GjIubWV0YWxzdGFjay5hZG1pbi52Mi5NYWNoaW5lU2VydmljZUxpc3RCTUNSZXNwb25zZSIK0vMYAgEC4PMYARKUAQoPQ29uc29sZVBhc3N3b3JkEjkubWV0YWxzdGFjay5hZG1pbi52Mi5NYWNoaW5lU2VydmljZUNvbnNvbGVQYXNzd29yZFJlcXVlc3QaOi5tZXRhbHN0YWNrLmFkbWluLnYyLk1hY2hpbmVTZXJ2aWNlQ29uc29sZVBhc3N3b3JkUmVzcG9uc2UiCtLzGAIBAuDzGAFC0AEKF2NvbS5tZXRhbHN0YWNrLmFkbWluLnYyQgxNYWNoaW5lUHJvdG9QAVo5Z2l0aHViLmNvbS9tZXRhbC1zdGFjay9hcGkvZ28vbWV0YWxzdGFjay9hZG1pbi92MjthZG1pbnYyogIDTUFYqgITTWV0YWxzdGFjay5BZG1pbi5WMsoCE01ldGFsc3RhY2tcQWRtaW5cVjLiAh9NZXRhbHN0YWNrXEFkbWluXFYyXEdQQk1ldGFkYXRh6gIVTWV0YWxzdGFjazo6QWRtaW46OlYyYgZwcm90bzM", [file_buf_validate_validate, file_metalstack_api_v2_common, file_metalstack_api_v2_machine, file_metalstack_api_v2_predefined_rules]); + fileDesc("CiFtZXRhbHN0YWNrL2FkbWluL3YyL21hY2hpbmUucHJvdG8SE21ldGFsc3RhY2suYWRtaW4udj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Fjay5BZG1pbi5WMsoCE01ldGFsc3RhY2tcQWRtaW5cVjLiAh9NZXRhbHN0YWNrXEFkbWluXFYyXEdQQk1ldGFkYXRh6gIVTWV0YWxzdGFjazo6QWRtaW46OlYyYgZwcm90bzM", [file_buf_validate_validate, file_metalstack_api_v2_common, file_metalstack_api_v2_machine, file_metalstack_api_v2_predefined_rules]); /** * MachineServiceGetRequest is the request payload for a machine get request @@ -300,6 +300,63 @@ export type MachineServiceConsolePasswordResponse = Message<"metalstack.admin.v2 export const MachineServiceConsolePasswordResponseSchema: GenMessage = /*@__PURE__*/ messageDesc(file_metalstack_admin_v2_machine, 11); +/** + * MachineServiceSetStateRequest is the request payload for a machine set state request + * + * @generated from message metalstack.admin.v2.MachineServiceSetStateRequest + */ +export type MachineServiceSetStateRequest = Message<"metalstack.admin.v2.MachineServiceSetStateRequest"> & { + /** + * UUID of the machine to set the state to + * + * @generated from field: string uuid = 1; + */ + uuid: string; + + /** + * State the state of this machine. + * If State set to available, description is also cleared. + * + * @generated from field: metalstack.api.v2.MachineState state = 2; + */ + state: MachineState; + + /** + * Description a description why this machine is in the given state + * + * @generated from field: string description = 3; + */ + description: string; +}; + +/** + * Describes the message metalstack.admin.v2.MachineServiceSetStateRequest. + * Use `create(MachineServiceSetStateRequestSchema)` to create a new message. + */ +export const MachineServiceSetStateRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_metalstack_admin_v2_machine, 12); + +/** + * MachineServiceSetStateResponse is the response payload for a machine set state request + * + * @generated from message metalstack.admin.v2.MachineServiceSetStateResponse + */ +export type MachineServiceSetStateResponse = Message<"metalstack.admin.v2.MachineServiceSetStateResponse"> & { + /** + * Machine with the changed state. + * + * @generated from field: metalstack.api.v2.Machine machine = 1; + */ + machine?: Machine | undefined; +}; + +/** + * Describes the message metalstack.admin.v2.MachineServiceSetStateResponse. + * Use `create(MachineServiceSetStateResponseSchema)` to create a new message. + */ +export const MachineServiceSetStateResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_metalstack_admin_v2_machine, 13); + /** * MachineService provides machine lifecycle management operations. * @@ -366,6 +423,16 @@ export const MachineService: GenService<{ input: typeof MachineServiceConsolePasswordRequestSchema; output: typeof MachineServiceConsolePasswordResponseSchema; }, + /** + * SetState set the state of a machine. + * + * @generated from rpc metalstack.admin.v2.MachineService.SetState + */ + setState: { + methodKind: "unary"; + input: typeof MachineServiceSetStateRequestSchema; + output: typeof MachineServiceSetStateResponseSchema; + }, }> = /*@__PURE__*/ serviceDesc(file_metalstack_admin_v2_machine, 0); diff --git a/proto/metalstack/admin/v2/machine.proto b/proto/metalstack/admin/v2/machine.proto index a04726c1..57d77fd4 100644 --- a/proto/metalstack/admin/v2/machine.proto +++ b/proto/metalstack/admin/v2/machine.proto @@ -44,6 +44,11 @@ service MachineService { option (metalstack.api.v2.admin_roles) = ADMIN_ROLE_VIEWER; option (metalstack.api.v2.auditing) = AUDITING_INCLUDED; } + // SetState set the state of a machine. + rpc SetState(MachineServiceSetStateRequest) returns (MachineServiceSetStateResponse) { + option (metalstack.api.v2.admin_roles) = ADMIN_ROLE_EDITOR; + option (metalstack.api.v2.auditing) = AUDITING_INCLUDED; + } } // ------------------------ Service Messages ---------------------------------- @@ -135,3 +140,20 @@ message MachineServiceConsolePasswordResponse { // Password to access the console string password = 2; } + +// MachineServiceSetStateRequest is the request payload for a machine set state request +message MachineServiceSetStateRequest { + // UUID of the machine to set the state to + string uuid = 1 [(buf.validate.field).string.uuid = true]; + // State the state of this machine. + // If State set to available, description is also cleared. + metalstack.api.v2.MachineState state = 2 [(buf.validate.field).enum.defined_only = true]; + // Description a description why this machine is in the given state + string description = 3 [(buf.validate.field).string.(metalstack.api.v2.is_description) = true]; +} + +// MachineServiceSetStateResponse is the response payload for a machine set state request +message MachineServiceSetStateResponse { + // Machine with the changed state. + metalstack.api.v2.Machine machine = 1; +} diff --git a/python/metalstack/admin/v2/machine_connect.py b/python/metalstack/admin/v2/machine_connect.py index 5d425ff0..ad393d76 100644 --- a/python/metalstack/admin/v2/machine_connect.py +++ b/python/metalstack/admin/v2/machine_connect.py @@ -36,6 +36,9 @@ async def list_b_m_c(self, request: metalstack_dot_admin_dot_v2_dot_machine__pb2 async def console_password(self, request: metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceConsolePasswordRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceConsolePasswordResponse: raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def set_state(self, request: metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceSetStateRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceSetStateResponse: + raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + class MachineServiceASGIApplication(ConnectASGIApplication[MachineService]): def __init__(self, service: MachineService | AsyncGenerator[MachineService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: @@ -102,6 +105,16 @@ def __init__(self, service: MachineService | AsyncGenerator[MachineService], *, ), function=svc.console_password, ), + "/metalstack.admin.v2.MachineService/SetState": Endpoint.unary( + method=MethodInfo( + name="SetState", + service_name="metalstack.admin.v2.MachineService", + input=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceSetStateRequest, + output=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceSetStateResponse, + idempotency_level=IdempotencyLevel.UNKNOWN, + ), + function=svc.set_state, + ), }, interceptors=interceptors, read_max_bytes=read_max_bytes, @@ -236,6 +249,26 @@ async def console_password( timeout_ms=timeout_ms, ) + async def set_state( + self, + request: metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceSetStateRequest, + *, + headers: Headers | Mapping[str, str] | None = None, + timeout_ms: int | None = None, + ) -> metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceSetStateResponse: + return await self.execute_unary( + request=request, + method=MethodInfo( + name="SetState", + service_name="metalstack.admin.v2.MachineService", + input=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceSetStateRequest, + output=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceSetStateResponse, + idempotency_level=IdempotencyLevel.UNKNOWN, + ), + headers=headers, + timeout_ms=timeout_ms, + ) + @@ -253,6 +286,8 @@ def list_b_m_c(self, request: metalstack_dot_admin_dot_v2_dot_machine__pb2.Machi raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") def console_password(self, request: metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceConsolePasswordRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceConsolePasswordResponse: raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + def set_state(self, request: metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceSetStateRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceSetStateResponse: + raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") class MachineServiceWSGIApplication(ConnectWSGIApplication): @@ -319,6 +354,16 @@ def __init__(self, service: MachineServiceSync, interceptors: Iterable[Intercept ), function=service.console_password, ), + "/metalstack.admin.v2.MachineService/SetState": EndpointSync.unary( + method=MethodInfo( + name="SetState", + service_name="metalstack.admin.v2.MachineService", + input=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceSetStateRequest, + output=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceSetStateResponse, + idempotency_level=IdempotencyLevel.UNKNOWN, + ), + function=service.set_state, + ), }, interceptors=interceptors, read_max_bytes=read_max_bytes, @@ -453,4 +498,24 @@ def console_password( timeout_ms=timeout_ms, ) + def set_state( + self, + request: metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceSetStateRequest, + *, + headers: Headers | Mapping[str, str] | None = None, + timeout_ms: int | None = None, + ) -> metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceSetStateResponse: + return self.execute_unary( + request=request, + method=MethodInfo( + name="SetState", + service_name="metalstack.admin.v2.MachineService", + input=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceSetStateRequest, + output=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceSetStateResponse, + idempotency_level=IdempotencyLevel.UNKNOWN, + ), + headers=headers, + timeout_ms=timeout_ms, + ) + diff --git a/python/metalstack/admin/v2/machine_pb2.py b/python/metalstack/admin/v2/machine_pb2.py index 1291814c..6b7e1163 100644 --- a/python/metalstack/admin/v2/machine_pb2.py +++ b/python/metalstack/admin/v2/machine_pb2.py @@ -28,7 +28,7 @@ from metalstack.api.v2 import predefined_rules_pb2 as metalstack_dot_api_dot_v2_dot_predefined__rules__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n!metalstack/admin/v2/machine.proto\x12\x13metalstack.admin.v2\x1a\x1b\x62uf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a\x1fmetalstack/api/v2/machine.proto\x1a(metalstack/api/v2/predefined_rules.proto\"8\n\x18MachineServiceGetRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\"Q\n\x19MachineServiceGetResponse\x12\x34\n\x07machine\x18\x01 \x01(\x0b\x32\x1a.metalstack.api.v2.MachineR\x07machine\"\x90\x01\n\x19MachineServiceListRequest\x12\x35\n\x05query\x18\x01 \x01(\x0b\x32\x1f.metalstack.api.v2.MachineQueryR\x05query\x12.\n\tpartition\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\xd0\xb3\xae\xb1\x02\x01H\x00R\tpartition\x88\x01\x01\x42\x0c\n\n_partition\"T\n\x1aMachineServiceListResponse\x12\x36\n\x08machines\x18\x01 \x03(\x0b\x32\x1a.metalstack.api.v2.MachineR\x08machines\"\x89\x01\n\x1fMachineServiceBMCCommandRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12H\n\x07\x63ommand\x18\x02 \x01(\x0e\x32$.metalstack.api.v2.MachineBMCCommandB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x07\x63ommand\"\"\n MachineServiceBMCCommandResponse\";\n\x1bMachineServiceGetBMCRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\"s\n\x1cMachineServiceGetBMCResponse\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12\x35\n\x03\x62mc\x18\x02 \x01(\x0b\x32#.metalstack.api.v2.MachineBMCReportR\x03\x62mc\"X\n\x1cMachineServiceListBMCRequest\x12\x38\n\x05query\x18\x01 \x01(\x0b\x32\".metalstack.api.v2.MachineBMCQueryR\x05query\"\xf7\x01\n\x1dMachineServiceListBMCResponse\x12r\n\x0b\x62mc_reports\x18\x01 \x03(\x0b\x32\x42.metalstack.admin.v2.MachineServiceListBMCResponse.BmcReportsEntryB\r\xbaH\n\x9a\x01\x07\"\x05r\x03\xb0\x01\x01R\nbmcReports\x1a\x62\n\x0f\x42mcReportsEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x39\n\x05value\x18\x02 \x01(\x0b\x32#.metalstack.api.v2.MachineBMCReportR\x05value:\x02\x38\x01\"h\n$MachineServiceConsolePasswordRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12\"\n\x06reason\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\n\x18\x80\x04R\x06reason\"a\n%MachineServiceConsolePasswordResponse\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12\x1a\n\x08password\x18\x02 \x01(\tR\x08password2\x8e\x06\n\x0eMachineService\x12p\n\x03Get\x12-.metalstack.admin.v2.MachineServiceGetRequest\x1a..metalstack.admin.v2.MachineServiceGetResponse\"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x02\x12s\n\x04List\x12..metalstack.admin.v2.MachineServiceListRequest\x1a/.metalstack.admin.v2.MachineServiceListResponse\"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x02\x12\x84\x01\n\nBMCCommand\x12\x34.metalstack.admin.v2.MachineServiceBMCCommandRequest\x1a\x35.metalstack.admin.v2.MachineServiceBMCCommandResponse\"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12y\n\x06GetBMC\x12\x30.metalstack.admin.v2.MachineServiceGetBMCRequest\x1a\x31.metalstack.admin.v2.MachineServiceGetBMCResponse\"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01\x12|\n\x07ListBMC\x12\x31.metalstack.admin.v2.MachineServiceListBMCRequest\x1a\x32.metalstack.admin.v2.MachineServiceListBMCResponse\"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01\x12\x94\x01\n\x0f\x43onsolePassword\x12\x39.metalstack.admin.v2.MachineServiceConsolePasswordRequest\x1a:.metalstack.admin.v2.MachineServiceConsolePasswordResponse\"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01\x42\xd0\x01\n\x17\x63om.metalstack.admin.v2B\x0cMachineProtoP\x01Z9github.com/metal-stack/api/go/metalstack/admin/v2;adminv2\xa2\x02\x03MAX\xaa\x02\x13Metalstack.Admin.V2\xca\x02\x13Metalstack\\Admin\\V2\xe2\x02\x1fMetalstack\\Admin\\V2\\GPBMetadata\xea\x02\x15Metalstack::Admin::V2b\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n!metalstack/admin/v2/machine.proto\x12\x13metalstack.admin.v2\x1a\x1b\x62uf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a\x1fmetalstack/api/v2/machine.proto\x1a(metalstack/api/v2/predefined_rules.proto\"8\n\x18MachineServiceGetRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\"Q\n\x19MachineServiceGetResponse\x12\x34\n\x07machine\x18\x01 \x01(\x0b\x32\x1a.metalstack.api.v2.MachineR\x07machine\"\x90\x01\n\x19MachineServiceListRequest\x12\x35\n\x05query\x18\x01 \x01(\x0b\x32\x1f.metalstack.api.v2.MachineQueryR\x05query\x12.\n\tpartition\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\xd0\xb3\xae\xb1\x02\x01H\x00R\tpartition\x88\x01\x01\x42\x0c\n\n_partition\"T\n\x1aMachineServiceListResponse\x12\x36\n\x08machines\x18\x01 \x03(\x0b\x32\x1a.metalstack.api.v2.MachineR\x08machines\"\x89\x01\n\x1fMachineServiceBMCCommandRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12H\n\x07\x63ommand\x18\x02 \x01(\x0e\x32$.metalstack.api.v2.MachineBMCCommandB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x07\x63ommand\"\"\n MachineServiceBMCCommandResponse\";\n\x1bMachineServiceGetBMCRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\"s\n\x1cMachineServiceGetBMCResponse\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12\x35\n\x03\x62mc\x18\x02 \x01(\x0b\x32#.metalstack.api.v2.MachineBMCReportR\x03\x62mc\"X\n\x1cMachineServiceListBMCRequest\x12\x38\n\x05query\x18\x01 \x01(\x0b\x32\".metalstack.api.v2.MachineBMCQueryR\x05query\"\xf7\x01\n\x1dMachineServiceListBMCResponse\x12r\n\x0b\x62mc_reports\x18\x01 \x03(\x0b\x32\x42.metalstack.admin.v2.MachineServiceListBMCResponse.BmcReportsEntryB\r\xbaH\n\x9a\x01\x07\"\x05r\x03\xb0\x01\x01R\nbmcReports\x1a\x62\n\x0f\x42mcReportsEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x39\n\x05value\x18\x02 \x01(\x0b\x32#.metalstack.api.v2.MachineBMCReportR\x05value:\x02\x38\x01\"h\n$MachineServiceConsolePasswordRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12\"\n\x06reason\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\n\x18\x80\x04R\x06reason\"a\n%MachineServiceConsolePasswordResponse\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12\x1a\n\x08password\x18\x02 \x01(\tR\x08password\"\xad\x01\n\x1dMachineServiceSetStateRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12?\n\x05state\x18\x02 \x01(\x0e\x32\x1f.metalstack.api.v2.MachineStateB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x05state\x12-\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01R\x0b\x64\x65scription\"V\n\x1eMachineServiceSetStateResponse\x12\x34\n\x07machine\x18\x01 \x01(\x0b\x32\x1a.metalstack.api.v2.MachineR\x07machine2\x8e\x07\n\x0eMachineService\x12p\n\x03Get\x12-.metalstack.admin.v2.MachineServiceGetRequest\x1a..metalstack.admin.v2.MachineServiceGetResponse\"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x02\x12s\n\x04List\x12..metalstack.admin.v2.MachineServiceListRequest\x1a/.metalstack.admin.v2.MachineServiceListResponse\"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x02\x12\x84\x01\n\nBMCCommand\x12\x34.metalstack.admin.v2.MachineServiceBMCCommandRequest\x1a\x35.metalstack.admin.v2.MachineServiceBMCCommandResponse\"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12y\n\x06GetBMC\x12\x30.metalstack.admin.v2.MachineServiceGetBMCRequest\x1a\x31.metalstack.admin.v2.MachineServiceGetBMCResponse\"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01\x12|\n\x07ListBMC\x12\x31.metalstack.admin.v2.MachineServiceListBMCRequest\x1a\x32.metalstack.admin.v2.MachineServiceListBMCResponse\"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01\x12\x94\x01\n\x0f\x43onsolePassword\x12\x39.metalstack.admin.v2.MachineServiceConsolePasswordRequest\x1a:.metalstack.admin.v2.MachineServiceConsolePasswordResponse\"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01\x12~\n\x08SetState\x12\x32.metalstack.admin.v2.MachineServiceSetStateRequest\x1a\x33.metalstack.admin.v2.MachineServiceSetStateResponse\"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x42\xd0\x01\n\x17\x63om.metalstack.admin.v2B\x0cMachineProtoP\x01Z9github.com/metal-stack/api/go/metalstack/admin/v2;adminv2\xa2\x02\x03MAX\xaa\x02\x13Metalstack.Admin.V2\xca\x02\x13Metalstack\\Admin\\V2\xe2\x02\x1fMetalstack\\Admin\\V2\\GPBMetadata\xea\x02\x15Metalstack::Admin::V2b\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -58,6 +58,12 @@ _globals['_MACHINESERVICECONSOLEPASSWORDREQUEST'].fields_by_name['reason']._serialized_options = b'\272H\007r\005\020\n\030\200\004' _globals['_MACHINESERVICECONSOLEPASSWORDRESPONSE'].fields_by_name['uuid']._loaded_options = None _globals['_MACHINESERVICECONSOLEPASSWORDRESPONSE'].fields_by_name['uuid']._serialized_options = b'\272H\005r\003\260\001\001' + _globals['_MACHINESERVICESETSTATEREQUEST'].fields_by_name['uuid']._loaded_options = None + _globals['_MACHINESERVICESETSTATEREQUEST'].fields_by_name['uuid']._serialized_options = b'\272H\005r\003\260\001\001' + _globals['_MACHINESERVICESETSTATEREQUEST'].fields_by_name['state']._loaded_options = None + _globals['_MACHINESERVICESETSTATEREQUEST'].fields_by_name['state']._serialized_options = b'\272H\005\202\001\002\020\001' + _globals['_MACHINESERVICESETSTATEREQUEST'].fields_by_name['description']._loaded_options = None + _globals['_MACHINESERVICESETSTATEREQUEST'].fields_by_name['description']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' _globals['_MACHINESERVICE'].methods_by_name['Get']._loaded_options = None _globals['_MACHINESERVICE'].methods_by_name['Get']._serialized_options = b'\322\363\030\002\001\002\340\363\030\002' _globals['_MACHINESERVICE'].methods_by_name['List']._loaded_options = None @@ -70,6 +76,8 @@ _globals['_MACHINESERVICE'].methods_by_name['ListBMC']._serialized_options = b'\322\363\030\002\001\002\340\363\030\001' _globals['_MACHINESERVICE'].methods_by_name['ConsolePassword']._loaded_options = None _globals['_MACHINESERVICE'].methods_by_name['ConsolePassword']._serialized_options = b'\322\363\030\002\001\002\340\363\030\001' + _globals['_MACHINESERVICE'].methods_by_name['SetState']._loaded_options = None + _globals['_MACHINESERVICE'].methods_by_name['SetState']._serialized_options = b'\322\363\030\001\001\340\363\030\001' _globals['_MACHINESERVICEGETREQUEST']._serialized_start=194 _globals['_MACHINESERVICEGETREQUEST']._serialized_end=250 _globals['_MACHINESERVICEGETRESPONSE']._serialized_start=252 @@ -96,6 +104,10 @@ _globals['_MACHINESERVICECONSOLEPASSWORDREQUEST']._serialized_end=1366 _globals['_MACHINESERVICECONSOLEPASSWORDRESPONSE']._serialized_start=1368 _globals['_MACHINESERVICECONSOLEPASSWORDRESPONSE']._serialized_end=1465 - _globals['_MACHINESERVICE']._serialized_start=1468 - _globals['_MACHINESERVICE']._serialized_end=2250 + _globals['_MACHINESERVICESETSTATEREQUEST']._serialized_start=1468 + _globals['_MACHINESERVICESETSTATEREQUEST']._serialized_end=1641 + _globals['_MACHINESERVICESETSTATERESPONSE']._serialized_start=1643 + _globals['_MACHINESERVICESETSTATERESPONSE']._serialized_end=1729 + _globals['_MACHINESERVICE']._serialized_start=1732 + _globals['_MACHINESERVICE']._serialized_end=2642 # @@protoc_insertion_point(module_scope) diff --git a/python/metalstack/admin/v2/machine_pb2.pyi b/python/metalstack/admin/v2/machine_pb2.pyi index a6c23712..f9ed95cc 100644 --- a/python/metalstack/admin/v2/machine_pb2.pyi +++ b/python/metalstack/admin/v2/machine_pb2.pyi @@ -96,3 +96,19 @@ class MachineServiceConsolePasswordResponse(_message.Message): uuid: str password: str def __init__(self, uuid: _Optional[str] = ..., password: _Optional[str] = ...) -> None: ... + +class MachineServiceSetStateRequest(_message.Message): + __slots__ = ("uuid", "state", "description") + UUID_FIELD_NUMBER: _ClassVar[int] + STATE_FIELD_NUMBER: _ClassVar[int] + DESCRIPTION_FIELD_NUMBER: _ClassVar[int] + uuid: str + state: _machine_pb2.MachineState + description: str + def __init__(self, uuid: _Optional[str] = ..., state: _Optional[_Union[_machine_pb2.MachineState, str]] = ..., description: _Optional[str] = ...) -> None: ... + +class MachineServiceSetStateResponse(_message.Message): + __slots__ = ("machine",) + MACHINE_FIELD_NUMBER: _ClassVar[int] + machine: _machine_pb2.Machine + def __init__(self, machine: _Optional[_Union[_machine_pb2.Machine, _Mapping]] = ...) -> None: ...