From 4cdbf9310efbda91a4d378e0688f829b26e23ebc Mon Sep 17 00:00:00 2001 From: Stefan Majer Date: Sat, 7 Jun 2025 14:35:32 +0200 Subject: [PATCH 01/27] Boot Services --- doc/index.html | 1113 ++++++++++ generate/Makefile | 2 +- generate/generate.go | 11 + generate/go_servicepermissions.tpl | 30 + go.mod | 10 +- go.sum | 20 +- go/client/client.go | 12 +- go/metalstack/api/v2/common.pb.go | 161 +- go/metalstack/infra/v2/boot.pb.go | 1785 +++++++++++++++++ .../infra/v2/infrav2connect/boot.connect.go | 292 +++ go/permissions/permissions.go | 3 + go/permissions/servicepermissions.go | 64 +- go/tests/api_scopes_test.go | 36 +- go/tests/mock_clients.go | 15 +- go/tests/mocks/client/Adminv2.go | 2 +- go/tests/mocks/client/Apiv2.go | 2 +- go/tests/mocks/client/Client.go | 2 +- go/tests/mocks/client/Infrav2.go | 22 +- .../adminv2connect/FilesystemServiceClient.go | 2 +- .../FilesystemServiceHandler.go | 2 +- .../v2/adminv2connect/IPServiceClient.go | 2 +- .../v2/adminv2connect/IPServiceHandler.go | 2 +- .../v2/adminv2connect/ImageServiceClient.go | 2 +- .../v2/adminv2connect/ImageServiceHandler.go | 2 +- .../v2/adminv2connect/NetworkServiceClient.go | 2 +- .../adminv2connect/NetworkServiceHandler.go | 2 +- .../adminv2connect/PartitionServiceClient.go | 2 +- .../adminv2connect/PartitionServiceHandler.go | 2 +- .../v2/adminv2connect/TenantServiceClient.go | 2 +- .../v2/adminv2connect/TenantServiceHandler.go | 2 +- .../v2/adminv2connect/TokenServiceClient.go | 2 +- .../v2/adminv2connect/TokenServiceHandler.go | 2 +- .../apiv2connect/FilesystemServiceClient.go | 2 +- .../apiv2connect/FilesystemServiceHandler.go | 2 +- .../v2/apiv2connect/HealthServiceClient.go | 2 +- .../v2/apiv2connect/HealthServiceHandler.go | 2 +- .../api/v2/apiv2connect/IPServiceClient.go | 2 +- .../api/v2/apiv2connect/IPServiceHandler.go | 2 +- .../api/v2/apiv2connect/ImageServiceClient.go | 2 +- .../v2/apiv2connect/ImageServiceHandler.go | 2 +- .../v2/apiv2connect/MethodServiceClient.go | 2 +- .../v2/apiv2connect/MethodServiceHandler.go | 2 +- .../v2/apiv2connect/NetworkServiceClient.go | 2 +- .../v2/apiv2connect/NetworkServiceHandler.go | 2 +- .../v2/apiv2connect/PartitionServiceClient.go | 2 +- .../apiv2connect/PartitionServiceHandler.go | 2 +- .../v2/apiv2connect/ProjectServiceClient.go | 2 +- .../v2/apiv2connect/ProjectServiceHandler.go | 2 +- .../v2/apiv2connect/TenantServiceClient.go | 2 +- .../v2/apiv2connect/TenantServiceHandler.go | 2 +- .../api/v2/apiv2connect/TokenServiceClient.go | 2 +- .../v2/apiv2connect/TokenServiceHandler.go | 2 +- .../api/v2/apiv2connect/UserServiceClient.go | 2 +- .../api/v2/apiv2connect/UserServiceHandler.go | 2 +- .../v2/apiv2connect/VersionServiceClient.go | 2 +- .../v2/apiv2connect/VersionServiceHandler.go | 2 +- .../v2/infrav2connect/BMCServiceClient.go | 2 +- .../v2/infrav2connect/BMCServiceHandler.go | 2 +- .../v2/infrav2connect/BootServiceClient.go | 242 +++ .../v2/infrav2connect/BootServiceHandler.go | 230 +++ proto/metalstack/api/v2/common.proto | 12 + proto/metalstack/infra/v2/boot.proto | 295 +++ 62 files changed, 4328 insertions(+), 113 deletions(-) create mode 100644 go/metalstack/infra/v2/boot.pb.go create mode 100644 go/metalstack/infra/v2/infrav2connect/boot.connect.go create mode 100644 go/tests/mocks/metalstack/infra/v2/infrav2connect/BootServiceClient.go create mode 100644 go/tests/mocks/metalstack/infra/v2/infrav2connect/BootServiceHandler.go create mode 100644 proto/metalstack/infra/v2/boot.proto diff --git a/doc/index.html b/doc/index.html index b0223a0a..77376174 100644 --- a/doc/index.html +++ b/doc/index.html @@ -211,6 +211,10 @@

Table of Contents

EInfraRole +
  • + EMachineRole +
  • +
  • EProjectRole
  • @@ -252,6 +256,10 @@

    Table of Contents

    XFile-level Extensions +
  • + XFile-level Extensions +
  • + @@ -1416,6 +1424,113 @@

    Table of Contents

    + +
  • + metalstack/infra/v2/boot.proto + +
  • +
  • Scalar Value Types
  • @@ -1681,6 +1796,35 @@

    InfraRole

    +

    MachineRole

    +

    MachineRole specifies what role a microservice needs to call this machine service

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameNumberDescription
    MACHINE_ROLE_UNSPECIFIED0

    MACHINE_ROLE_UNSPECIFIED is not specified

    MACHINE_ROLE_EDITOR1

    MACHINE_ROLE_EDITOR a microservice needs at least editor role to call this method

    MACHINE_ROLE_VIEWER2

    MACHINE_ROLE_VIEWER a microservice needs at least viewer role to call this method

    +

    ProjectRole

    ProjectRole specifies what role a logged in user needs to call this project scoped service

    @@ -1829,6 +1973,14 @@

    File-level Extensions

    + + + + + + + + @@ -10145,6 +10297,967 @@

    BMCService

    + +
    +

    metalstack/infra/v2/boot.proto

    Top +
    +

    + + +

    BootInfo

    +

    BootInfo contains calculated values of a allocation

    + + +

    InfraRoles are used to define which infra role a microservice must provide to call this method

    machine_rolesMachineRole.google.protobuf.MethodOptions51006

    MachineRole are used to define which infra role a microservice must provide to call this method

    project_roles ProjectRole
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeLabelDescription
    image_idstring

    Image which is going to be installed

    primary_diskstring

    PrimaryDisk the machine boots from

    os_partitionstring

    OSPartition where the operating system is stored

    initrdstring

    Initrd the name of the initial ram disk

    cmdlinestring

    Cmdline of the kernel

    kernelstring

    Kernel to boot from

    bootloader_idstring

    BootloadID which is used to boot

    + + + + + +

    BootServiceAbortReinstallRequest

    +

    BootServiceAbortReinstallRequest is called if the reinstallation failed and must aborted

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

    UUID of this machine

    primary_disk_wipedbool

    PrimaryDiskWiped is set to true if the primary disk was wiped

    + + + + + +

    BootServiceAbortReinstallResponse

    +

    BootServiceAbortReinstallResponse response if a reinstall abort command was called

    + + + + + + + + + + + + + + + + +
    FieldTypeLabelDescription
    boot_infoBootInfo

    BootInfo contains details to the boot

    + + + + + +

    BootServiceBootRequest

    +

    BootServiceBootRequest is called to get specified parameters to boot a machine with the given mac

    + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeLabelDescription
    macstring

    Mac address of the machein

    partition_idstring

    Partition where this machine is located

    + + + + + +

    BootServiceBootResponse

    +

    BootServiceBootResponse contains additional infos which are required to boot a machine

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeLabelDescription
    kernelstring

    Kernel is the url to the linux kernel to boot

    init_ram_disksstringrepeated

    Initial ram disk is the url to the initial ram disk to boot

    cmdlinestringoptional

    CMDLine contains kernel command line parameters to boot

    + + + + + +

    BootServiceDhcpRequest

    +

    BootServiceDhcpRequest is called once a machine issues a dhcp request

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

    UUID of the machine

    + + + + + +

    BootServiceDhcpResponse

    +

    BootServiceDhcpResponse contains the response to a dhcp request

    + + + + + +

    BootServiceRegisterRequest

    +

    BootServiceRegisterRequest is called from metal-hammer to register a machine with as much hardware details as possible

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

    UUID of this machine

    hardwareMachineHardware

    Hardware details of this machine

    biosMachineBIOS

    Bios details of this machine

    ipmiMachineIPMI

    IPMI details of this machine

    tagsstringrepeated

    Tags of this machine

    metal_hammer_versionstring

    MetalHammer version this machine was bootet into

    partition_idstring

    Partition where this machine is located

    + + + + + +

    BootServiceRegisterResponse

    +

    BootServiceRegisterResponse response to a BootServiceRegisterResponse request

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

    UUID of this machine

    sizestring

    Size is the calculated size from given hardware details

    partition_idstring

    Partition of this machine

    + + + + + +

    BootServiceReportRequest

    +

    BootServiceReportRequest is sent from metal-hammer to the api to report the outcome of the register

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

    UUID of the machine to boot

    console_passwordstring

    Console_Password

    boot_infoBootInfo

    BootInfo contains all details which are the result of registration and allocation

    successbool

    Success is set to true of the allocation succeeded

    messagestring

    Message contains additional information if installation failed

    + + + + + +

    BootServiceReportResponse

    +

    BootServiceReportRequest is the response to a BootServiceReportRequest

    + + + + + +

    BootServiceSuperUserPasswordRequest

    +

    BootServiceSuperUserPasswordRequest this call returns the password for the machine superuser

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

    UUID of this machine

    + + + + + +

    BootServiceSuperUserPasswordResponse

    +

    BootServiceSuperUserPasswordResponse the super user password is returned

    + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeLabelDescription
    feature_disabledbool

    FeatureDisable FIXME

    super_user_passwordstring

    SuperUserPassword is the password of the superuser on the ipmi device

    + + + + + +

    BootServiceWaitRequest

    +

    BootServiceWaitRequest is called when a machine was registered and is waiting for allocation

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

    UUID of this machine

    + + + + + +

    BootServiceWaitResponse

    +

    BootServiceWaitResponse response to a wait request

    + + + + + +

    MachineBIOS

    +

    MachineBIOS describes details of the machine bios

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeLabelDescription
    versionstring

    Version of the bios

    vendorstring

    Vendor of the bios

    datestring

    Date of the bios

    + + + + + +

    MachineBlockDevice

    +

    MachineBlockDevice defines a disk built into a machine

    + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeLabelDescription
    namestring

    Name of this device

    sizeuint64

    Size in bytes of this device

    + + + + + +

    MachineCPU

    +

    MachineCPU describes a physical CPU

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeLabelDescription
    vendorstring

    Vendor of this cpu

    modelstring

    Model of this cpu

    coresuint32

    Cores in this cpu

    threadsuint32

    Threads total in this cpu

    + + + + + +

    MachineFRU

    +

    MachineFRU describes details to the machine which are required in case of a necessary replacement

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeLabelDescription
    chassis_part_numberstringoptional

    ChassisPartNumber is the part number of the machine chassis

    chassis_part_serialstringoptional

    ChassisPartSerial is the serial number of the machine chassis

    board_mfgstringoptional

    BoardMFG is the short description of the mainboard

    board_mfg_serialstringoptional

    BoardSerial is the serial number of the mainboard

    board_part_numberstringoptional

    BoardPartNumber is the part number of the mainboard

    product_manufacturerstringoptional

    ProductManufacturer is the manufacturer of the machine

    product_part_numberstringoptional

    ProductPartNumber is the part number of the machine

    product_serialstringoptional

    ProductSerial is the serial number of the machine

    + + + + + +

    MachineGPU

    +

    MachineGPU describes a physical GPU

    + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeLabelDescription
    vendorstring

    Vendor of this gpu

    modelstring

    Model of this gpu

    + + + + + +

    MachineHardware

    +

    MachineHardware contains hardware details of this machine

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeLabelDescription
    memoryuint64

    Memory in bytes

    disksMachineBlockDevicerepeated

    Disks which are built into this machine

    nicsMachineNicrepeated

    Nics are network interface cards built into this machein

    cpusMachineCPUrepeated

    CPUs in this machine

    gpusMachineGPUrepeated

    GPUs in this machine

    + + + + + +

    MachineIPMI

    +

    MachineIPMI describe details of the ipmi or out of band device

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeLabelDescription
    addressstring

    Address of this ipmi device from outside

    macstring

    Mac address of the network interface of this ipmi device

    userstring

    User of this ipmi device

    passwordstring

    Password of this ipmi device

    interfacestring

    Interface of this ipmi device

    fruMachineFRU

    FRU field replaceable unit details for this machine

    bmc_versionstring

    BMCVersion of this ipmi device

    power_statestring

    PowerState of this machine

    + + + + + +

    MachineNic

    +

    MachineNIC describes a network interface card

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeLabelDescription
    macstring

    Mac address of this network card

    namestring

    Name in the os of this network card, e.g. eth0

    vendorstring

    Vendor of this network card

    modelstring

    Model of this network card

    speeduint64

    Speed in bits/second of this network card

    neighborsMachineNicrepeated

    Neighbors connected to this network card

    hostnamestring

    Hostname FIXME clarify usage

    identifierstring

    Identifier of this network card

    + + + + + + + + + + + +

    BootService

    +

    BootService is used for all boot related requests, either pixiecore or metal-hammer

    Pixiecore

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Method NameRequest TypeResponse TypeDescription
    DhcpBootServiceDhcpRequestBootServiceDhcpResponse

    Dhcp is the first dhcp request (option 97). A ProvisioningEventPXEBooting is fired

    BootBootServiceBootRequestBootServiceBootResponse

    Boot is called from pixie once the machine got the first dhcp response and ipxie asks for subsequent kernel and initrd

    SuperUserPasswordBootServiceSuperUserPasswordRequestBootServiceSuperUserPasswordResponse

    SuperUserPassword metal-hammer takes the configured root password for the bmc from metal-api and configure the bmc accordingly

    RegisterBootServiceRegisterRequestBootServiceRegisterResponse

    Register is called from metal-hammer after hardware inventory is finished, tells metal-api all glory details about that machine

    WaitBootServiceWaitRequestBootServiceWaitResponse stream

    Wait is a hanging call that waits until the machine gets allocated by a user

    ReportBootServiceReportRequestBootServiceReportResponse

    Report tells metal-api installation was either successful or failed

    AbortReinstallBootServiceAbortReinstallRequestBootServiceAbortReinstallResponse

    If reinstall failed and tell metal-api to restore to previous state

    + + +

    Scalar Value Types

    diff --git a/generate/Makefile b/generate/Makefile index f53bf05e..cc648420 100644 --- a/generate/Makefile +++ b/generate/Makefile @@ -17,4 +17,4 @@ go-mocks: --user $$(id -u):$$(id -g) \ -w /work \ -v $(PWD):/work \ - vektra/mockery:v2.53.0 --keeptree --inpackage --dir go --output go/tests/mocks --all --log-level debug + vektra/mockery:v2.53.4 --keeptree --inpackage --dir go --output go/tests/mocks --all --log-level debug diff --git a/generate/generate.go b/generate/generate.go index b1559d41..a3ef04a5 100644 --- a/generate/generate.go +++ b/generate/generate.go @@ -90,6 +90,7 @@ func servicePermissions(root string) (*permissions.ServicePermissions, error) { roles = permissions.Roles{ Admin: permissions.Admin{}, Infra: permissions.Infra{}, + Machine: permissions.Machine{}, Tenant: permissions.Tenant{}, Project: permissions.Project{}, } @@ -103,6 +104,7 @@ func servicePermissions(root string) (*permissions.ServicePermissions, error) { Self: map[string]bool{}, Admin: map[string]bool{}, Infra: map[string]bool{}, + Machine: map[string]bool{}, Tenant: map[string]bool{}, Project: map[string]bool{}, } @@ -182,6 +184,15 @@ func servicePermissions(root string) (*permissions.ServicePermissions, error) { visibility.Infra[methodName] = true case v1.InfraRole_INFRA_ROLE_UNSPECIFIED.String(): // noop + // Machine + case v1.MachineRole_MACHINE_ROLE_EDITOR.String(): + roles.Infra[v1.MachineRole_MACHINE_ROLE_EDITOR.String()] = append(roles.Admin[v1.MachineRole_MACHINE_ROLE_EDITOR.String()], methodName) + visibility.Machine[methodName] = true + case v1.MachineRole_MACHINE_ROLE_VIEWER.String(): + roles.Infra[v1.MachineRole_MACHINE_ROLE_VIEWER.String()] = append(roles.Admin[v1.MachineRole_MACHINE_ROLE_VIEWER.String()], methodName) + visibility.Machine[methodName] = true + case v1.MachineRole_MACHINE_ROLE_UNSPECIFIED.String(): + // noop // Visibility case v1.Visibility_VISIBILITY_PUBLIC.String(): visibility.Public[methodName] = true diff --git a/generate/go_servicepermissions.tpl b/generate/go_servicepermissions.tpl index 1f3914f9..ac0ea35b 100644 --- a/generate/go_servicepermissions.tpl +++ b/generate/go_servicepermissions.tpl @@ -34,6 +34,15 @@ func GetServicePermissions() *ServicePermissions { }, {{- end }} }, + Machine: Machine{ + {{- range $role, $methods := .Roles.Infra }} + "{{ $role }}": []string{ + {{- range $method := $methods }} + "{{ $method }}", + {{- end }} + }, + {{- end }} + }, Tenant: Tenant{ {{- range $role, $methods := .Roles.Tenant }} "{{ $role }}": []string{ @@ -77,6 +86,11 @@ func GetServicePermissions() *ServicePermissions { Infra: map[string]bool{ {{- range $key, $value := .Visibility.Infra }} "{{ $key }}": {{ $value }} , +{{- end }} + }, + Machine: map[string]bool{ +{{- range $key, $value := .Visibility.Machine }} + "{{ $key }}": {{ $value }} , {{- end }} }, Tenant: map[string]bool{ @@ -118,6 +132,11 @@ func IsInfraScope(req connect.AnyRequest) bool { return ok } +func IsMachineScope(req connect.AnyRequest) bool { + _, ok := GetServicePermissions().Visibility.Machine[req.Spec().Procedure] + return ok +} + func IsTenantScope(req connect.AnyRequest) bool { _, ok := GetServicePermissions().Visibility.Tenant[req.Spec().Procedure] return ok @@ -153,4 +172,15 @@ func GetProjectFromRequest(req connect.AnyRequest) (string, bool) { return rq.GetProject(), true } return "", false +} + +func GetMachineIdFromRequest(req connect.AnyRequest) (string, bool) { + if !IsMachineScope(req) { + return "", false + } + switch rq := req.Any().(type) { + case interface{ GetUuid() string }: + return rq.GetUuid(), true + } + return "", false } \ No newline at end of file diff --git a/go.mod b/go.mod index c2210c42..e9721dd3 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/metal-stack/api go 1.24.0 require ( - buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.6-20250425153114-8976f5be98c1.1 + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.6-20250603165357-b52ab10f4468.1 buf.build/go/protovalidate v0.12.0 connectrpc.com/connect v1.18.1 github.com/bufbuild/protocompile v0.14.1 @@ -24,10 +24,10 @@ require ( github.com/pmezard/go-difflib v1.0.0 // indirect github.com/stoewer/go-strcase v1.3.0 // indirect github.com/stretchr/objx v0.5.2 // indirect - golang.org/x/exp v0.0.0-20250506013437-ce4c2cf36ca6 // indirect - golang.org/x/text v0.25.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20250505200425-f936aa4a68b2 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20250505200425-f936aa4a68b2 // indirect + golang.org/x/exp v0.0.0-20250606033433-dcc06ee1d476 // indirect + golang.org/x/text v0.26.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20250603155806-513f23925822 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20250603155806-513f23925822 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 834d7d4e..0380136c 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.6-20250425153114-8976f5be98c1.1 h1:YhMSc48s25kr7kv31Z8vf7sPUIq5YJva9z1mn/hAt0M= -buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.6-20250425153114-8976f5be98c1.1/go.mod h1:avRlCjnFzl98VPaeCtJ24RrV/wwHFzB8sWXhj26+n/U= +buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.6-20250603165357-b52ab10f4468.1 h1:uwSqFkn8DDTzNlaV9TxgSXY5OCaNdb4rH+Axd2FujkE= +buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.6-20250603165357-b52ab10f4468.1/go.mod h1:avRlCjnFzl98VPaeCtJ24RrV/wwHFzB8sWXhj26+n/U= buf.build/go/protovalidate v0.12.0 h1:4GKJotbspQjRCcqZMGVSuC8SjwZ/FmgtSuKDpKUTZew= buf.build/go/protovalidate v0.12.0/go.mod h1:q3PFfbzI05LeqxSwq+begW2syjy2Z6hLxZSkP1OH/D0= cel.dev/expr v0.24.0 h1:56OvJKSH3hDGL0ml5uSxZmz3/3Pq4tJ+fb1unVLAFcY= @@ -48,16 +48,16 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -golang.org/x/exp v0.0.0-20250506013437-ce4c2cf36ca6 h1:y5zboxd6LQAqYIhHnB48p0ByQ/GnQx2BE33L8BOHQkI= -golang.org/x/exp v0.0.0-20250506013437-ce4c2cf36ca6/go.mod h1:U6Lno4MTRCDY+Ba7aCcauB9T60gsv5s4ralQzP72ZoQ= +golang.org/x/exp v0.0.0-20250606033433-dcc06ee1d476 h1:bsqhLWFR6G6xiQcb+JoGqdKdRU6WzPWmK8E0jxTjzo4= +golang.org/x/exp v0.0.0-20250606033433-dcc06ee1d476/go.mod h1:3//PLf8L/X+8b4vuAfHzxeRUl04Adcb341+IGKfnqS8= golang.org/x/net v0.37.0 h1:1zLorHbz+LYj7MQlSf1+2tPIIgibq2eL5xkrGk6f+2c= golang.org/x/net v0.37.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8= -golang.org/x/text v0.25.0 h1:qVyWApTSYLk/drJRO5mDlNYskwQznZmkpV2c8q9zls4= -golang.org/x/text v0.25.0/go.mod h1:WEdwpYrmk1qmdHvhkSTNPm3app7v4rsT8F2UD6+VHIA= -google.golang.org/genproto/googleapis/api v0.0.0-20250505200425-f936aa4a68b2 h1:vPV0tzlsK6EzEDHNNH5sa7Hs9bd7iXR7B1tSiPepkV0= -google.golang.org/genproto/googleapis/api v0.0.0-20250505200425-f936aa4a68b2/go.mod h1:pKLAc5OolXC3ViWGI62vvC0n10CpwAtRcTNCFwTKBEw= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250505200425-f936aa4a68b2 h1:IqsN8hx+lWLqlN+Sc3DoMy/watjofWiU8sRFgQ8fhKM= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250505200425-f936aa4a68b2/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A= +golang.org/x/text v0.26.0 h1:P42AVeLghgTYr4+xUnTRKDMqpar+PtX7KWuNQL21L8M= +golang.org/x/text v0.26.0/go.mod h1:QK15LZJUUQVJxhz7wXgxSy/CJaTFjd0G+YLonydOVQA= +google.golang.org/genproto/googleapis/api v0.0.0-20250603155806-513f23925822 h1:oWVWY3NzT7KJppx2UKhKmzPq4SRe0LdCijVRwvGeikY= +google.golang.org/genproto/googleapis/api v0.0.0-20250603155806-513f23925822/go.mod h1:h3c4v36UTKzUiuaOKQ6gr3S+0hovBtUrXzTG/i3+XEc= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250603155806-513f23925822 h1:fc6jSaCT0vBduLYZHYrBBNY4dsWuvgyff9noRNDdBeE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250603155806-513f23925822/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A= google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY= google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/go/client/client.go b/go/client/client.go index 77bb4cc3..dfa9358b 100755 --- a/go/client/client.go +++ b/go/client/client.go @@ -70,10 +70,12 @@ type ( Infrav2 interface { BMC() infrav2connect.BMCServiceClient + Boot() infrav2connect.BootServiceClient } infrav2 struct { - bmcservice infrav2connect.BMCServiceClient + bmcservice infrav2connect.BMCServiceClient + bootservice infrav2connect.BootServiceClient } ) @@ -256,6 +258,11 @@ func (c client) Infrav2() Infrav2 { c.config.BaseURL, compress.WithAll(compress.LevelBalanced), ), + bootservice: infrav2connect.NewBootServiceClient( + c.config.HttpClient(), + c.config.BaseURL, + compress.WithAll(compress.LevelBalanced), + ), } return a } @@ -263,3 +270,6 @@ func (c client) Infrav2() Infrav2 { func (c *infrav2) BMC() infrav2connect.BMCServiceClient { return c.bmcservice } +func (c *infrav2) Boot() infrav2connect.BootServiceClient { + return c.bootservice +} diff --git a/go/metalstack/api/v2/common.pb.go b/go/metalstack/api/v2/common.pb.go index 2ca1eed0..0ee274ce 100644 --- a/go/metalstack/api/v2/common.pb.go +++ b/go/metalstack/api/v2/common.pb.go @@ -250,6 +250,59 @@ func (InfraRole) EnumDescriptor() ([]byte, []int) { return file_metalstack_api_v2_common_proto_rawDescGZIP(), []int{3} } +// MachineRole specifies what role a microservice needs to call this machine service +type MachineRole int32 + +const ( + // MACHINE_ROLE_UNSPECIFIED is not specified + MachineRole_MACHINE_ROLE_UNSPECIFIED MachineRole = 0 + // MACHINE_ROLE_EDITOR a microservice needs at least editor role to call this method + MachineRole_MACHINE_ROLE_EDITOR MachineRole = 1 + // MACHINE_ROLE_VIEWER a microservice needs at least viewer role to call this method + MachineRole_MACHINE_ROLE_VIEWER MachineRole = 2 +) + +// Enum value maps for MachineRole. +var ( + MachineRole_name = map[int32]string{ + 0: "MACHINE_ROLE_UNSPECIFIED", + 1: "MACHINE_ROLE_EDITOR", + 2: "MACHINE_ROLE_VIEWER", + } + MachineRole_value = map[string]int32{ + "MACHINE_ROLE_UNSPECIFIED": 0, + "MACHINE_ROLE_EDITOR": 1, + "MACHINE_ROLE_VIEWER": 2, + } +) + +func (x MachineRole) Enum() *MachineRole { + p := new(MachineRole) + *p = x + return p +} + +func (x MachineRole) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (MachineRole) Descriptor() protoreflect.EnumDescriptor { + return file_metalstack_api_v2_common_proto_enumTypes[4].Descriptor() +} + +func (MachineRole) Type() protoreflect.EnumType { + return &file_metalstack_api_v2_common_proto_enumTypes[4] +} + +func (x MachineRole) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use MachineRole.Descriptor instead. +func (MachineRole) EnumDescriptor() ([]byte, []int) { + return file_metalstack_api_v2_common_proto_rawDescGZIP(), []int{4} +} + // Visibility of a method type Visibility int32 @@ -287,11 +340,11 @@ func (x Visibility) String() string { } func (Visibility) Descriptor() protoreflect.EnumDescriptor { - return file_metalstack_api_v2_common_proto_enumTypes[4].Descriptor() + return file_metalstack_api_v2_common_proto_enumTypes[5].Descriptor() } func (Visibility) Type() protoreflect.EnumType { - return &file_metalstack_api_v2_common_proto_enumTypes[4] + return &file_metalstack_api_v2_common_proto_enumTypes[5] } func (x Visibility) Number() protoreflect.EnumNumber { @@ -300,7 +353,7 @@ func (x Visibility) Number() protoreflect.EnumNumber { // Deprecated: Use Visibility.Descriptor instead. func (Visibility) EnumDescriptor() ([]byte, []int) { - return file_metalstack_api_v2_common_proto_rawDescGZIP(), []int{4} + return file_metalstack_api_v2_common_proto_rawDescGZIP(), []int{5} } // Auditing option specified per service method @@ -342,11 +395,11 @@ func (x Auditing) String() string { } func (Auditing) Descriptor() protoreflect.EnumDescriptor { - return file_metalstack_api_v2_common_proto_enumTypes[5].Descriptor() + return file_metalstack_api_v2_common_proto_enumTypes[6].Descriptor() } func (Auditing) Type() protoreflect.EnumType { - return &file_metalstack_api_v2_common_proto_enumTypes[5] + return &file_metalstack_api_v2_common_proto_enumTypes[6] } func (x Auditing) Number() protoreflect.EnumNumber { @@ -355,7 +408,7 @@ func (x Auditing) Number() protoreflect.EnumNumber { // Deprecated: Use Auditing.Descriptor instead. func (Auditing) EnumDescriptor() ([]byte, []int) { - return file_metalstack_api_v2_common_proto_rawDescGZIP(), []int{5} + return file_metalstack_api_v2_common_proto_rawDescGZIP(), []int{6} } // Paging defines paging for methods with a lot of results @@ -638,6 +691,14 @@ var file_metalstack_api_v2_common_proto_extTypes = []protoimpl.ExtensionInfo{ Tag: "varint,51005,rep,packed,name=infra_roles,enum=metalstack.api.v2.InfraRole", Filename: "metalstack/api/v2/common.proto", }, + { + ExtendedType: (*descriptorpb.MethodOptions)(nil), + ExtensionType: ([]MachineRole)(nil), + Field: 51006, + Name: "metalstack.api.v2.machine_roles", + Tag: "varint,51006,rep,packed,name=machine_roles,enum=metalstack.api.v2.MachineRole", + Filename: "metalstack/api/v2/common.proto", + }, { ExtendedType: (*descriptorpb.EnumValueOptions)(nil), ExtensionType: (*string)(nil), @@ -674,6 +735,10 @@ var ( // // repeated metalstack.api.v2.InfraRole infra_roles = 51005; E_InfraRoles = &file_metalstack_api_v2_common_proto_extTypes[5] + // MachineRole are used to define which infra role a microservice must provide to call this method + // + // repeated metalstack.api.v2.MachineRole machine_roles = 51006; + E_MachineRoles = &file_metalstack_api_v2_common_proto_extTypes[6] ) // Extension fields to descriptorpb.EnumValueOptions. @@ -681,7 +746,7 @@ var ( // StringValue which can be set to a enum // // optional string enum_string_value = 52000; - E_EnumStringValue = &file_metalstack_api_v2_common_proto_extTypes[6] + E_EnumStringValue = &file_metalstack_api_v2_common_proto_extTypes[7] ) var File_metalstack_api_v2_common_proto protoreflect.FileDescriptor @@ -732,7 +797,11 @@ const file_metalstack_api_v2_common_proto_rawDesc = "" + "\tInfraRole\x12\x1a\n" + "\x16INFRA_ROLE_UNSPECIFIED\x10\x00\x12\x15\n" + "\x11INFRA_ROLE_EDITOR\x10\x01\x12\x15\n" + - "\x11INFRA_ROLE_VIEWER\x10\x02*T\n" + + "\x11INFRA_ROLE_VIEWER\x10\x02*]\n" + + "\vMachineRole\x12\x1c\n" + + "\x18MACHINE_ROLE_UNSPECIFIED\x10\x00\x12\x17\n" + + "\x13MACHINE_ROLE_EDITOR\x10\x01\x12\x17\n" + + "\x13MACHINE_ROLE_VIEWER\x10\x02*T\n" + "\n" + "Visibility\x12\x1a\n" + "\x16VISIBILITY_UNSPECIFIED\x10\x00\x12\x15\n" + @@ -751,7 +820,8 @@ const file_metalstack_api_v2_common_proto_rawDesc = "" + "visibility:Y\n" + "\bauditing\x12\x1e.google.protobuf.MethodOptions\x18\xbc\x8e\x03 \x01(\x0e2\x1b.metalstack.api.v2.AuditingR\bauditing:_\n" + "\vinfra_roles\x12\x1e.google.protobuf.MethodOptions\x18\xbd\x8e\x03 \x03(\x0e2\x1c.metalstack.api.v2.InfraRoleR\n" + - "infraRoles:O\n" + + "infraRoles:e\n" + + "\rmachine_roles\x12\x1e.google.protobuf.MethodOptions\x18\xbe\x8e\x03 \x03(\x0e2\x1e.metalstack.api.v2.MachineRoleR\fmachineRoles:O\n" + "\x11enum_string_value\x12!.google.protobuf.EnumValueOptions\x18\xa0\x96\x03 \x01(\tR\x0fenumStringValueB\xc1\x01\n" + "\x15com.metalstack.api.v2B\vCommonProtoP\x01Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\xa2\x02\x03MAX\xaa\x02\x11Metalstack.Api.V2\xca\x02\x11Metalstack\\Api\\V2\xe2\x02\x1dMetalstack\\Api\\V2\\GPBMetadata\xea\x02\x13Metalstack::Api::V2b\x06proto3" @@ -767,47 +837,50 @@ func file_metalstack_api_v2_common_proto_rawDescGZIP() []byte { return file_metalstack_api_v2_common_proto_rawDescData } -var file_metalstack_api_v2_common_proto_enumTypes = make([]protoimpl.EnumInfo, 6) +var file_metalstack_api_v2_common_proto_enumTypes = make([]protoimpl.EnumInfo, 7) var file_metalstack_api_v2_common_proto_msgTypes = make([]protoimpl.MessageInfo, 5) var file_metalstack_api_v2_common_proto_goTypes = []any{ (TenantRole)(0), // 0: metalstack.api.v2.TenantRole (ProjectRole)(0), // 1: metalstack.api.v2.ProjectRole (AdminRole)(0), // 2: metalstack.api.v2.AdminRole (InfraRole)(0), // 3: metalstack.api.v2.InfraRole - (Visibility)(0), // 4: metalstack.api.v2.Visibility - (Auditing)(0), // 5: metalstack.api.v2.Auditing - (*Paging)(nil), // 6: metalstack.api.v2.Paging - (*Labels)(nil), // 7: metalstack.api.v2.Labels - (*Meta)(nil), // 8: metalstack.api.v2.Meta - (*UpdateLabels)(nil), // 9: metalstack.api.v2.UpdateLabels - nil, // 10: metalstack.api.v2.Labels.LabelsEntry - (*timestamppb.Timestamp)(nil), // 11: google.protobuf.Timestamp - (*descriptorpb.MethodOptions)(nil), // 12: google.protobuf.MethodOptions - (*descriptorpb.EnumValueOptions)(nil), // 13: google.protobuf.EnumValueOptions + (MachineRole)(0), // 4: metalstack.api.v2.MachineRole + (Visibility)(0), // 5: metalstack.api.v2.Visibility + (Auditing)(0), // 6: metalstack.api.v2.Auditing + (*Paging)(nil), // 7: metalstack.api.v2.Paging + (*Labels)(nil), // 8: metalstack.api.v2.Labels + (*Meta)(nil), // 9: metalstack.api.v2.Meta + (*UpdateLabels)(nil), // 10: metalstack.api.v2.UpdateLabels + nil, // 11: metalstack.api.v2.Labels.LabelsEntry + (*timestamppb.Timestamp)(nil), // 12: google.protobuf.Timestamp + (*descriptorpb.MethodOptions)(nil), // 13: google.protobuf.MethodOptions + (*descriptorpb.EnumValueOptions)(nil), // 14: google.protobuf.EnumValueOptions } var file_metalstack_api_v2_common_proto_depIdxs = []int32{ - 10, // 0: metalstack.api.v2.Labels.labels:type_name -> metalstack.api.v2.Labels.LabelsEntry - 7, // 1: metalstack.api.v2.Meta.labels:type_name -> metalstack.api.v2.Labels - 11, // 2: metalstack.api.v2.Meta.created_at:type_name -> google.protobuf.Timestamp - 11, // 3: metalstack.api.v2.Meta.updated_at:type_name -> google.protobuf.Timestamp - 7, // 4: metalstack.api.v2.UpdateLabels.update:type_name -> metalstack.api.v2.Labels - 12, // 5: metalstack.api.v2.tenant_roles:extendee -> google.protobuf.MethodOptions - 12, // 6: metalstack.api.v2.project_roles:extendee -> google.protobuf.MethodOptions - 12, // 7: metalstack.api.v2.admin_roles:extendee -> google.protobuf.MethodOptions - 12, // 8: metalstack.api.v2.visibility:extendee -> google.protobuf.MethodOptions - 12, // 9: metalstack.api.v2.auditing:extendee -> google.protobuf.MethodOptions - 12, // 10: metalstack.api.v2.infra_roles:extendee -> google.protobuf.MethodOptions - 13, // 11: metalstack.api.v2.enum_string_value:extendee -> google.protobuf.EnumValueOptions - 0, // 12: metalstack.api.v2.tenant_roles:type_name -> metalstack.api.v2.TenantRole - 1, // 13: metalstack.api.v2.project_roles:type_name -> metalstack.api.v2.ProjectRole - 2, // 14: metalstack.api.v2.admin_roles:type_name -> metalstack.api.v2.AdminRole - 4, // 15: metalstack.api.v2.visibility:type_name -> metalstack.api.v2.Visibility - 5, // 16: metalstack.api.v2.auditing:type_name -> metalstack.api.v2.Auditing - 3, // 17: metalstack.api.v2.infra_roles:type_name -> metalstack.api.v2.InfraRole - 18, // [18:18] is the sub-list for method output_type - 18, // [18:18] is the sub-list for method input_type - 12, // [12:18] is the sub-list for extension type_name - 5, // [5:12] is the sub-list for extension extendee + 11, // 0: metalstack.api.v2.Labels.labels:type_name -> metalstack.api.v2.Labels.LabelsEntry + 8, // 1: metalstack.api.v2.Meta.labels:type_name -> metalstack.api.v2.Labels + 12, // 2: metalstack.api.v2.Meta.created_at:type_name -> google.protobuf.Timestamp + 12, // 3: metalstack.api.v2.Meta.updated_at:type_name -> google.protobuf.Timestamp + 8, // 4: metalstack.api.v2.UpdateLabels.update:type_name -> metalstack.api.v2.Labels + 13, // 5: metalstack.api.v2.tenant_roles:extendee -> google.protobuf.MethodOptions + 13, // 6: metalstack.api.v2.project_roles:extendee -> google.protobuf.MethodOptions + 13, // 7: metalstack.api.v2.admin_roles:extendee -> google.protobuf.MethodOptions + 13, // 8: metalstack.api.v2.visibility:extendee -> google.protobuf.MethodOptions + 13, // 9: metalstack.api.v2.auditing:extendee -> google.protobuf.MethodOptions + 13, // 10: metalstack.api.v2.infra_roles:extendee -> google.protobuf.MethodOptions + 13, // 11: metalstack.api.v2.machine_roles:extendee -> google.protobuf.MethodOptions + 14, // 12: metalstack.api.v2.enum_string_value:extendee -> google.protobuf.EnumValueOptions + 0, // 13: metalstack.api.v2.tenant_roles:type_name -> metalstack.api.v2.TenantRole + 1, // 14: metalstack.api.v2.project_roles:type_name -> metalstack.api.v2.ProjectRole + 2, // 15: metalstack.api.v2.admin_roles:type_name -> metalstack.api.v2.AdminRole + 5, // 16: metalstack.api.v2.visibility:type_name -> metalstack.api.v2.Visibility + 6, // 17: metalstack.api.v2.auditing:type_name -> metalstack.api.v2.Auditing + 3, // 18: metalstack.api.v2.infra_roles:type_name -> metalstack.api.v2.InfraRole + 4, // 19: metalstack.api.v2.machine_roles:type_name -> metalstack.api.v2.MachineRole + 20, // [20:20] is the sub-list for method output_type + 20, // [20:20] is the sub-list for method input_type + 13, // [13:20] is the sub-list for extension type_name + 5, // [5:13] is the sub-list for extension extendee 0, // [0:5] is the sub-list for field type_name } @@ -823,9 +896,9 @@ func file_metalstack_api_v2_common_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_metalstack_api_v2_common_proto_rawDesc), len(file_metalstack_api_v2_common_proto_rawDesc)), - NumEnums: 6, + NumEnums: 7, NumMessages: 5, - NumExtensions: 7, + NumExtensions: 8, NumServices: 0, }, GoTypes: file_metalstack_api_v2_common_proto_goTypes, diff --git a/go/metalstack/infra/v2/boot.pb.go b/go/metalstack/infra/v2/boot.pb.go new file mode 100644 index 00000000..db308f52 --- /dev/null +++ b/go/metalstack/infra/v2/boot.pb.go @@ -0,0 +1,1785 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.6 +// protoc (unknown) +// source: metalstack/infra/v2/boot.proto + +package infrav2 + +import ( + _ "github.com/metal-stack/api/go/metalstack/api/v2" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// BootServiceDhcpRequest is called once a machine issues a dhcp request +type BootServiceDhcpRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // UUID of the machine + Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BootServiceDhcpRequest) Reset() { + *x = BootServiceDhcpRequest{} + mi := &file_metalstack_infra_v2_boot_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BootServiceDhcpRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BootServiceDhcpRequest) ProtoMessage() {} + +func (x *BootServiceDhcpRequest) ProtoReflect() protoreflect.Message { + mi := &file_metalstack_infra_v2_boot_proto_msgTypes[0] + 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 BootServiceDhcpRequest.ProtoReflect.Descriptor instead. +func (*BootServiceDhcpRequest) Descriptor() ([]byte, []int) { + return file_metalstack_infra_v2_boot_proto_rawDescGZIP(), []int{0} +} + +func (x *BootServiceDhcpRequest) GetUuid() string { + if x != nil { + return x.Uuid + } + return "" +} + +// BootServiceDhcpResponse contains the response to a dhcp request +type BootServiceDhcpResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BootServiceDhcpResponse) Reset() { + *x = BootServiceDhcpResponse{} + mi := &file_metalstack_infra_v2_boot_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BootServiceDhcpResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BootServiceDhcpResponse) ProtoMessage() {} + +func (x *BootServiceDhcpResponse) ProtoReflect() protoreflect.Message { + mi := &file_metalstack_infra_v2_boot_proto_msgTypes[1] + 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 BootServiceDhcpResponse.ProtoReflect.Descriptor instead. +func (*BootServiceDhcpResponse) Descriptor() ([]byte, []int) { + return file_metalstack_infra_v2_boot_proto_rawDescGZIP(), []int{1} +} + +// BootServiceBootRequest is called to get specified parameters to boot a machine with the given mac +type BootServiceBootRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Mac address of the machein + Mac string `protobuf:"bytes,1,opt,name=mac,proto3" json:"mac,omitempty"` + // Partition where this machine is located + PartitionId string `protobuf:"bytes,2,opt,name=partition_id,json=partitionId,proto3" json:"partition_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BootServiceBootRequest) Reset() { + *x = BootServiceBootRequest{} + mi := &file_metalstack_infra_v2_boot_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BootServiceBootRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BootServiceBootRequest) ProtoMessage() {} + +func (x *BootServiceBootRequest) ProtoReflect() protoreflect.Message { + mi := &file_metalstack_infra_v2_boot_proto_msgTypes[2] + 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 BootServiceBootRequest.ProtoReflect.Descriptor instead. +func (*BootServiceBootRequest) Descriptor() ([]byte, []int) { + return file_metalstack_infra_v2_boot_proto_rawDescGZIP(), []int{2} +} + +func (x *BootServiceBootRequest) GetMac() string { + if x != nil { + return x.Mac + } + return "" +} + +func (x *BootServiceBootRequest) GetPartitionId() string { + if x != nil { + return x.PartitionId + } + return "" +} + +// BootServiceBootResponse contains additional infos which are required to boot a machine +type BootServiceBootResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Kernel is the url to the linux kernel to boot + Kernel string `protobuf:"bytes,1,opt,name=kernel,proto3" json:"kernel,omitempty"` + // Initial ram disk is the url to the initial ram disk to boot + InitRamDisks []string `protobuf:"bytes,2,rep,name=init_ram_disks,json=initRamDisks,proto3" json:"init_ram_disks,omitempty"` + // CMDLine contains kernel command line parameters to boot + Cmdline *string `protobuf:"bytes,3,opt,name=cmdline,proto3,oneof" json:"cmdline,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BootServiceBootResponse) Reset() { + *x = BootServiceBootResponse{} + mi := &file_metalstack_infra_v2_boot_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BootServiceBootResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BootServiceBootResponse) ProtoMessage() {} + +func (x *BootServiceBootResponse) ProtoReflect() protoreflect.Message { + mi := &file_metalstack_infra_v2_boot_proto_msgTypes[3] + 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 BootServiceBootResponse.ProtoReflect.Descriptor instead. +func (*BootServiceBootResponse) Descriptor() ([]byte, []int) { + return file_metalstack_infra_v2_boot_proto_rawDescGZIP(), []int{3} +} + +func (x *BootServiceBootResponse) GetKernel() string { + if x != nil { + return x.Kernel + } + return "" +} + +func (x *BootServiceBootResponse) GetInitRamDisks() []string { + if x != nil { + return x.InitRamDisks + } + return nil +} + +func (x *BootServiceBootResponse) GetCmdline() string { + if x != nil && x.Cmdline != nil { + return *x.Cmdline + } + return "" +} + +// BootServiceRegisterRequest is called from metal-hammer to register a machine with as much hardware details as possible +type BootServiceRegisterRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // UUID of this machine + Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` + // Hardware details of this machine + Hardware *MachineHardware `protobuf:"bytes,2,opt,name=hardware,proto3" json:"hardware,omitempty"` + // Bios details of this machine + Bios *MachineBIOS `protobuf:"bytes,3,opt,name=bios,proto3" json:"bios,omitempty"` + // IPMI details of this machine + Ipmi *MachineIPMI `protobuf:"bytes,4,opt,name=ipmi,proto3" json:"ipmi,omitempty"` + // Tags of this machine + Tags []string `protobuf:"bytes,5,rep,name=tags,proto3" json:"tags,omitempty"` + // MetalHammer version this machine was bootet into + MetalHammerVersion string `protobuf:"bytes,6,opt,name=metal_hammer_version,json=metalHammerVersion,proto3" json:"metal_hammer_version,omitempty"` + // Partition where this machine is located + PartitionId string `protobuf:"bytes,7,opt,name=partition_id,json=partitionId,proto3" json:"partition_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BootServiceRegisterRequest) Reset() { + *x = BootServiceRegisterRequest{} + mi := &file_metalstack_infra_v2_boot_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BootServiceRegisterRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BootServiceRegisterRequest) ProtoMessage() {} + +func (x *BootServiceRegisterRequest) ProtoReflect() protoreflect.Message { + mi := &file_metalstack_infra_v2_boot_proto_msgTypes[4] + 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 BootServiceRegisterRequest.ProtoReflect.Descriptor instead. +func (*BootServiceRegisterRequest) Descriptor() ([]byte, []int) { + return file_metalstack_infra_v2_boot_proto_rawDescGZIP(), []int{4} +} + +func (x *BootServiceRegisterRequest) GetUuid() string { + if x != nil { + return x.Uuid + } + return "" +} + +func (x *BootServiceRegisterRequest) GetHardware() *MachineHardware { + if x != nil { + return x.Hardware + } + return nil +} + +func (x *BootServiceRegisterRequest) GetBios() *MachineBIOS { + if x != nil { + return x.Bios + } + return nil +} + +func (x *BootServiceRegisterRequest) GetIpmi() *MachineIPMI { + if x != nil { + return x.Ipmi + } + return nil +} + +func (x *BootServiceRegisterRequest) GetTags() []string { + if x != nil { + return x.Tags + } + return nil +} + +func (x *BootServiceRegisterRequest) GetMetalHammerVersion() string { + if x != nil { + return x.MetalHammerVersion + } + return "" +} + +func (x *BootServiceRegisterRequest) GetPartitionId() string { + if x != nil { + return x.PartitionId + } + return "" +} + +// BootServiceRegisterResponse response to a BootServiceRegisterResponse request +type BootServiceRegisterResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // UUID of this machine + Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` + // Size is the calculated size from given hardware details + Size string `protobuf:"bytes,2,opt,name=size,proto3" json:"size,omitempty"` + // Partition of this machine + PartitionId string `protobuf:"bytes,3,opt,name=partition_id,json=partitionId,proto3" json:"partition_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BootServiceRegisterResponse) Reset() { + *x = BootServiceRegisterResponse{} + mi := &file_metalstack_infra_v2_boot_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BootServiceRegisterResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BootServiceRegisterResponse) ProtoMessage() {} + +func (x *BootServiceRegisterResponse) ProtoReflect() protoreflect.Message { + mi := &file_metalstack_infra_v2_boot_proto_msgTypes[5] + 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 BootServiceRegisterResponse.ProtoReflect.Descriptor instead. +func (*BootServiceRegisterResponse) Descriptor() ([]byte, []int) { + return file_metalstack_infra_v2_boot_proto_rawDescGZIP(), []int{5} +} + +func (x *BootServiceRegisterResponse) GetUuid() string { + if x != nil { + return x.Uuid + } + return "" +} + +func (x *BootServiceRegisterResponse) GetSize() string { + if x != nil { + return x.Size + } + return "" +} + +func (x *BootServiceRegisterResponse) GetPartitionId() string { + if x != nil { + return x.PartitionId + } + return "" +} + +// BootServiceWaitRequest is called when a machine was registered and is waiting for allocation +type BootServiceWaitRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // UUID of this machine + Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BootServiceWaitRequest) Reset() { + *x = BootServiceWaitRequest{} + mi := &file_metalstack_infra_v2_boot_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BootServiceWaitRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BootServiceWaitRequest) ProtoMessage() {} + +func (x *BootServiceWaitRequest) ProtoReflect() protoreflect.Message { + mi := &file_metalstack_infra_v2_boot_proto_msgTypes[6] + 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 BootServiceWaitRequest.ProtoReflect.Descriptor instead. +func (*BootServiceWaitRequest) Descriptor() ([]byte, []int) { + return file_metalstack_infra_v2_boot_proto_rawDescGZIP(), []int{6} +} + +func (x *BootServiceWaitRequest) GetUuid() string { + if x != nil { + return x.Uuid + } + return "" +} + +// BootServiceWaitResponse response to a wait request +type BootServiceWaitResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BootServiceWaitResponse) Reset() { + *x = BootServiceWaitResponse{} + mi := &file_metalstack_infra_v2_boot_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BootServiceWaitResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BootServiceWaitResponse) ProtoMessage() {} + +func (x *BootServiceWaitResponse) ProtoReflect() protoreflect.Message { + mi := &file_metalstack_infra_v2_boot_proto_msgTypes[7] + 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 BootServiceWaitResponse.ProtoReflect.Descriptor instead. +func (*BootServiceWaitResponse) Descriptor() ([]byte, []int) { + return file_metalstack_infra_v2_boot_proto_rawDescGZIP(), []int{7} +} + +// MachineHardware contains hardware details of this machine +type MachineHardware struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Memory in bytes + Memory uint64 `protobuf:"varint,1,opt,name=memory,proto3" json:"memory,omitempty"` + // Disks which are built into this machine + Disks []*MachineBlockDevice `protobuf:"bytes,3,rep,name=disks,proto3" json:"disks,omitempty"` + // Nics are network interface cards built into this machein + Nics []*MachineNic `protobuf:"bytes,4,rep,name=nics,proto3" json:"nics,omitempty"` + // CPUs in this machine + Cpus []*MachineCPU `protobuf:"bytes,5,rep,name=cpus,proto3" json:"cpus,omitempty"` + // GPUs in this machine + Gpus []*MachineGPU `protobuf:"bytes,6,rep,name=gpus,proto3" json:"gpus,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MachineHardware) Reset() { + *x = MachineHardware{} + mi := &file_metalstack_infra_v2_boot_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MachineHardware) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MachineHardware) ProtoMessage() {} + +func (x *MachineHardware) ProtoReflect() protoreflect.Message { + mi := &file_metalstack_infra_v2_boot_proto_msgTypes[8] + 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 MachineHardware.ProtoReflect.Descriptor instead. +func (*MachineHardware) Descriptor() ([]byte, []int) { + return file_metalstack_infra_v2_boot_proto_rawDescGZIP(), []int{8} +} + +func (x *MachineHardware) GetMemory() uint64 { + if x != nil { + return x.Memory + } + return 0 +} + +func (x *MachineHardware) GetDisks() []*MachineBlockDevice { + if x != nil { + return x.Disks + } + return nil +} + +func (x *MachineHardware) GetNics() []*MachineNic { + if x != nil { + return x.Nics + } + return nil +} + +func (x *MachineHardware) GetCpus() []*MachineCPU { + if x != nil { + return x.Cpus + } + return nil +} + +func (x *MachineHardware) GetGpus() []*MachineGPU { + if x != nil { + return x.Gpus + } + return nil +} + +// MachineCPU describes a physical CPU +type MachineCPU struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Vendor of this cpu + Vendor string `protobuf:"bytes,1,opt,name=vendor,proto3" json:"vendor,omitempty"` + // Model of this cpu + Model string `protobuf:"bytes,2,opt,name=model,proto3" json:"model,omitempty"` + // Cores in this cpu + Cores uint32 `protobuf:"varint,3,opt,name=cores,proto3" json:"cores,omitempty"` + // Threads total in this cpu + Threads uint32 `protobuf:"varint,4,opt,name=threads,proto3" json:"threads,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MachineCPU) Reset() { + *x = MachineCPU{} + mi := &file_metalstack_infra_v2_boot_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MachineCPU) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MachineCPU) ProtoMessage() {} + +func (x *MachineCPU) ProtoReflect() protoreflect.Message { + mi := &file_metalstack_infra_v2_boot_proto_msgTypes[9] + 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 MachineCPU.ProtoReflect.Descriptor instead. +func (*MachineCPU) Descriptor() ([]byte, []int) { + return file_metalstack_infra_v2_boot_proto_rawDescGZIP(), []int{9} +} + +func (x *MachineCPU) GetVendor() string { + if x != nil { + return x.Vendor + } + return "" +} + +func (x *MachineCPU) GetModel() string { + if x != nil { + return x.Model + } + return "" +} + +func (x *MachineCPU) GetCores() uint32 { + if x != nil { + return x.Cores + } + return 0 +} + +func (x *MachineCPU) GetThreads() uint32 { + if x != nil { + return x.Threads + } + return 0 +} + +// MachineGPU describes a physical GPU +type MachineGPU struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Vendor of this gpu + Vendor string `protobuf:"bytes,1,opt,name=vendor,proto3" json:"vendor,omitempty"` + // Model of this gpu + Model string `protobuf:"bytes,2,opt,name=model,proto3" json:"model,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MachineGPU) Reset() { + *x = MachineGPU{} + mi := &file_metalstack_infra_v2_boot_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MachineGPU) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MachineGPU) ProtoMessage() {} + +func (x *MachineGPU) ProtoReflect() protoreflect.Message { + mi := &file_metalstack_infra_v2_boot_proto_msgTypes[10] + 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 MachineGPU.ProtoReflect.Descriptor instead. +func (*MachineGPU) Descriptor() ([]byte, []int) { + return file_metalstack_infra_v2_boot_proto_rawDescGZIP(), []int{10} +} + +func (x *MachineGPU) GetVendor() string { + if x != nil { + return x.Vendor + } + return "" +} + +func (x *MachineGPU) GetModel() string { + if x != nil { + return x.Model + } + return "" +} + +// MachineNIC describes a network interface card +type MachineNic struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Mac address of this network card + Mac string `protobuf:"bytes,1,opt,name=mac,proto3" json:"mac,omitempty"` + // Name in the os of this network card, e.g. eth0 + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + // Vendor of this network card + Vendor string `protobuf:"bytes,3,opt,name=vendor,proto3" json:"vendor,omitempty"` + // Model of this network card + Model string `protobuf:"bytes,4,opt,name=model,proto3" json:"model,omitempty"` + // Speed in bits/second of this network card + Speed uint64 `protobuf:"varint,5,opt,name=speed,proto3" json:"speed,omitempty"` + // Neighbors connected to this network card + Neighbors []*MachineNic `protobuf:"bytes,6,rep,name=neighbors,proto3" json:"neighbors,omitempty"` + // Hostname FIXME clarify usage + Hostname string `protobuf:"bytes,7,opt,name=hostname,proto3" json:"hostname,omitempty"` + // Identifier of this network card + Identifier string `protobuf:"bytes,8,opt,name=identifier,proto3" json:"identifier,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MachineNic) Reset() { + *x = MachineNic{} + mi := &file_metalstack_infra_v2_boot_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MachineNic) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MachineNic) ProtoMessage() {} + +func (x *MachineNic) ProtoReflect() protoreflect.Message { + mi := &file_metalstack_infra_v2_boot_proto_msgTypes[11] + 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 MachineNic.ProtoReflect.Descriptor instead. +func (*MachineNic) Descriptor() ([]byte, []int) { + return file_metalstack_infra_v2_boot_proto_rawDescGZIP(), []int{11} +} + +func (x *MachineNic) GetMac() string { + if x != nil { + return x.Mac + } + return "" +} + +func (x *MachineNic) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *MachineNic) GetVendor() string { + if x != nil { + return x.Vendor + } + return "" +} + +func (x *MachineNic) GetModel() string { + if x != nil { + return x.Model + } + return "" +} + +func (x *MachineNic) GetSpeed() uint64 { + if x != nil { + return x.Speed + } + return 0 +} + +func (x *MachineNic) GetNeighbors() []*MachineNic { + if x != nil { + return x.Neighbors + } + return nil +} + +func (x *MachineNic) GetHostname() string { + if x != nil { + return x.Hostname + } + return "" +} + +func (x *MachineNic) GetIdentifier() string { + if x != nil { + return x.Identifier + } + return "" +} + +// MachineBlockDevice defines a disk built into a machine +type MachineBlockDevice struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Name of this device + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // Size in bytes of this device + Size uint64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MachineBlockDevice) Reset() { + *x = MachineBlockDevice{} + mi := &file_metalstack_infra_v2_boot_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MachineBlockDevice) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MachineBlockDevice) ProtoMessage() {} + +func (x *MachineBlockDevice) ProtoReflect() protoreflect.Message { + mi := &file_metalstack_infra_v2_boot_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 MachineBlockDevice.ProtoReflect.Descriptor instead. +func (*MachineBlockDevice) Descriptor() ([]byte, []int) { + return file_metalstack_infra_v2_boot_proto_rawDescGZIP(), []int{12} +} + +func (x *MachineBlockDevice) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *MachineBlockDevice) GetSize() uint64 { + if x != nil { + return x.Size + } + return 0 +} + +// MachineBIOS describes details of the machine bios +type MachineBIOS struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Version of the bios + Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` + // Vendor of the bios + Vendor string `protobuf:"bytes,2,opt,name=vendor,proto3" json:"vendor,omitempty"` + // Date of the bios + Date string `protobuf:"bytes,3,opt,name=date,proto3" json:"date,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MachineBIOS) Reset() { + *x = MachineBIOS{} + mi := &file_metalstack_infra_v2_boot_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MachineBIOS) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MachineBIOS) ProtoMessage() {} + +func (x *MachineBIOS) ProtoReflect() protoreflect.Message { + mi := &file_metalstack_infra_v2_boot_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 MachineBIOS.ProtoReflect.Descriptor instead. +func (*MachineBIOS) Descriptor() ([]byte, []int) { + return file_metalstack_infra_v2_boot_proto_rawDescGZIP(), []int{13} +} + +func (x *MachineBIOS) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *MachineBIOS) GetVendor() string { + if x != nil { + return x.Vendor + } + return "" +} + +func (x *MachineBIOS) GetDate() string { + if x != nil { + return x.Date + } + return "" +} + +// MachineIPMI describe details of the ipmi or out of band device +type MachineIPMI struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Address of this ipmi device from outside + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + // Mac address of the network interface of this ipmi device + Mac string `protobuf:"bytes,2,opt,name=mac,proto3" json:"mac,omitempty"` + // User of this ipmi device + User string `protobuf:"bytes,3,opt,name=user,proto3" json:"user,omitempty"` + // Password of this ipmi device + Password string `protobuf:"bytes,4,opt,name=password,proto3" json:"password,omitempty"` + // Interface of this ipmi device + Interface string `protobuf:"bytes,5,opt,name=interface,proto3" json:"interface,omitempty"` + // FRU field replaceable unit details for this machine + Fru *MachineFRU `protobuf:"bytes,6,opt,name=fru,proto3" json:"fru,omitempty"` + // BMCVersion of this ipmi device + BmcVersion string `protobuf:"bytes,7,opt,name=bmc_version,json=bmcVersion,proto3" json:"bmc_version,omitempty"` + // PowerState of this machine + PowerState string `protobuf:"bytes,8,opt,name=power_state,json=powerState,proto3" json:"power_state,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MachineIPMI) Reset() { + *x = MachineIPMI{} + mi := &file_metalstack_infra_v2_boot_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MachineIPMI) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MachineIPMI) ProtoMessage() {} + +func (x *MachineIPMI) ProtoReflect() protoreflect.Message { + mi := &file_metalstack_infra_v2_boot_proto_msgTypes[14] + 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 MachineIPMI.ProtoReflect.Descriptor instead. +func (*MachineIPMI) Descriptor() ([]byte, []int) { + return file_metalstack_infra_v2_boot_proto_rawDescGZIP(), []int{14} +} + +func (x *MachineIPMI) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +func (x *MachineIPMI) GetMac() string { + if x != nil { + return x.Mac + } + return "" +} + +func (x *MachineIPMI) GetUser() string { + if x != nil { + return x.User + } + return "" +} + +func (x *MachineIPMI) GetPassword() string { + if x != nil { + return x.Password + } + return "" +} + +func (x *MachineIPMI) GetInterface() string { + if x != nil { + return x.Interface + } + return "" +} + +func (x *MachineIPMI) GetFru() *MachineFRU { + if x != nil { + return x.Fru + } + return nil +} + +func (x *MachineIPMI) GetBmcVersion() string { + if x != nil { + return x.BmcVersion + } + return "" +} + +func (x *MachineIPMI) GetPowerState() string { + if x != nil { + return x.PowerState + } + return "" +} + +// MachineFRU describes details to the machine which are required in case of a necessary replacement +type MachineFRU struct { + state protoimpl.MessageState `protogen:"open.v1"` + // ChassisPartNumber is the part number of the machine chassis + ChassisPartNumber *string `protobuf:"bytes,1,opt,name=chassis_part_number,json=chassisPartNumber,proto3,oneof" json:"chassis_part_number,omitempty"` + // ChassisPartSerial is the serial number of the machine chassis + ChassisPartSerial *string `protobuf:"bytes,2,opt,name=chassis_part_serial,json=chassisPartSerial,proto3,oneof" json:"chassis_part_serial,omitempty"` + // BoardMFG is the short description of the mainboard + BoardMfg *string `protobuf:"bytes,3,opt,name=board_mfg,json=boardMfg,proto3,oneof" json:"board_mfg,omitempty"` + // BoardSerial is the serial number of the mainboard + BoardMfgSerial *string `protobuf:"bytes,4,opt,name=board_mfg_serial,json=boardMfgSerial,proto3,oneof" json:"board_mfg_serial,omitempty"` + // BoardPartNumber is the part number of the mainboard + BoardPartNumber *string `protobuf:"bytes,5,opt,name=board_part_number,json=boardPartNumber,proto3,oneof" json:"board_part_number,omitempty"` + // ProductManufacturer is the manufacturer of the machine + ProductManufacturer *string `protobuf:"bytes,6,opt,name=product_manufacturer,json=productManufacturer,proto3,oneof" json:"product_manufacturer,omitempty"` + // ProductPartNumber is the part number of the machine + ProductPartNumber *string `protobuf:"bytes,7,opt,name=product_part_number,json=productPartNumber,proto3,oneof" json:"product_part_number,omitempty"` + // ProductSerial is the serial number of the machine + ProductSerial *string `protobuf:"bytes,8,opt,name=product_serial,json=productSerial,proto3,oneof" json:"product_serial,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MachineFRU) Reset() { + *x = MachineFRU{} + mi := &file_metalstack_infra_v2_boot_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MachineFRU) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MachineFRU) ProtoMessage() {} + +func (x *MachineFRU) ProtoReflect() protoreflect.Message { + mi := &file_metalstack_infra_v2_boot_proto_msgTypes[15] + 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 MachineFRU.ProtoReflect.Descriptor instead. +func (*MachineFRU) Descriptor() ([]byte, []int) { + return file_metalstack_infra_v2_boot_proto_rawDescGZIP(), []int{15} +} + +func (x *MachineFRU) GetChassisPartNumber() string { + if x != nil && x.ChassisPartNumber != nil { + return *x.ChassisPartNumber + } + return "" +} + +func (x *MachineFRU) GetChassisPartSerial() string { + if x != nil && x.ChassisPartSerial != nil { + return *x.ChassisPartSerial + } + return "" +} + +func (x *MachineFRU) GetBoardMfg() string { + if x != nil && x.BoardMfg != nil { + return *x.BoardMfg + } + return "" +} + +func (x *MachineFRU) GetBoardMfgSerial() string { + if x != nil && x.BoardMfgSerial != nil { + return *x.BoardMfgSerial + } + return "" +} + +func (x *MachineFRU) GetBoardPartNumber() string { + if x != nil && x.BoardPartNumber != nil { + return *x.BoardPartNumber + } + return "" +} + +func (x *MachineFRU) GetProductManufacturer() string { + if x != nil && x.ProductManufacturer != nil { + return *x.ProductManufacturer + } + return "" +} + +func (x *MachineFRU) GetProductPartNumber() string { + if x != nil && x.ProductPartNumber != nil { + return *x.ProductPartNumber + } + return "" +} + +func (x *MachineFRU) GetProductSerial() string { + if x != nil && x.ProductSerial != nil { + return *x.ProductSerial + } + return "" +} + +// BootServiceReportRequest is sent from metal-hammer to the api to report the outcome of the register +type BootServiceReportRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // UUID of the machine to boot + Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` + // Console_Password + ConsolePassword string `protobuf:"bytes,2,opt,name=console_password,json=consolePassword,proto3" json:"console_password,omitempty"` + // BootInfo contains all details which are the result of registration and allocation + BootInfo *BootInfo `protobuf:"bytes,3,opt,name=boot_info,json=bootInfo,proto3" json:"boot_info,omitempty"` + // Success is set to true of the allocation succeeded + Success bool `protobuf:"varint,4,opt,name=success,proto3" json:"success,omitempty"` + // Message contains additional information if installation failed + Message string `protobuf:"bytes,5,opt,name=message,proto3" json:"message,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BootServiceReportRequest) Reset() { + *x = BootServiceReportRequest{} + mi := &file_metalstack_infra_v2_boot_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BootServiceReportRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BootServiceReportRequest) ProtoMessage() {} + +func (x *BootServiceReportRequest) ProtoReflect() protoreflect.Message { + mi := &file_metalstack_infra_v2_boot_proto_msgTypes[16] + 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 BootServiceReportRequest.ProtoReflect.Descriptor instead. +func (*BootServiceReportRequest) Descriptor() ([]byte, []int) { + return file_metalstack_infra_v2_boot_proto_rawDescGZIP(), []int{16} +} + +func (x *BootServiceReportRequest) GetUuid() string { + if x != nil { + return x.Uuid + } + return "" +} + +func (x *BootServiceReportRequest) GetConsolePassword() string { + if x != nil { + return x.ConsolePassword + } + return "" +} + +func (x *BootServiceReportRequest) GetBootInfo() *BootInfo { + if x != nil { + return x.BootInfo + } + return nil +} + +func (x *BootServiceReportRequest) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +func (x *BootServiceReportRequest) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +// BootServiceReportRequest is the response to a BootServiceReportRequest +type BootServiceReportResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BootServiceReportResponse) Reset() { + *x = BootServiceReportResponse{} + mi := &file_metalstack_infra_v2_boot_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BootServiceReportResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BootServiceReportResponse) ProtoMessage() {} + +func (x *BootServiceReportResponse) ProtoReflect() protoreflect.Message { + mi := &file_metalstack_infra_v2_boot_proto_msgTypes[17] + 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 BootServiceReportResponse.ProtoReflect.Descriptor instead. +func (*BootServiceReportResponse) Descriptor() ([]byte, []int) { + return file_metalstack_infra_v2_boot_proto_rawDescGZIP(), []int{17} +} + +// BootInfo contains calculated values of a allocation +type BootInfo struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Image which is going to be installed + ImageId string `protobuf:"bytes,1,opt,name=image_id,json=imageId,proto3" json:"image_id,omitempty"` + // PrimaryDisk the machine boots from + PrimaryDisk string `protobuf:"bytes,2,opt,name=primary_disk,json=primaryDisk,proto3" json:"primary_disk,omitempty"` + // OSPartition where the operating system is stored + OsPartition string `protobuf:"bytes,3,opt,name=os_partition,json=osPartition,proto3" json:"os_partition,omitempty"` + // Initrd the name of the initial ram disk + Initrd string `protobuf:"bytes,4,opt,name=initrd,proto3" json:"initrd,omitempty"` + // Cmdline of the kernel + Cmdline string `protobuf:"bytes,5,opt,name=cmdline,proto3" json:"cmdline,omitempty"` + // Kernel to boot from + Kernel string `protobuf:"bytes,6,opt,name=kernel,proto3" json:"kernel,omitempty"` + // BootloadID which is used to boot + BootloaderId string `protobuf:"bytes,8,opt,name=bootloader_id,json=bootloaderId,proto3" json:"bootloader_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BootInfo) Reset() { + *x = BootInfo{} + mi := &file_metalstack_infra_v2_boot_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BootInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BootInfo) ProtoMessage() {} + +func (x *BootInfo) ProtoReflect() protoreflect.Message { + mi := &file_metalstack_infra_v2_boot_proto_msgTypes[18] + 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 BootInfo.ProtoReflect.Descriptor instead. +func (*BootInfo) Descriptor() ([]byte, []int) { + return file_metalstack_infra_v2_boot_proto_rawDescGZIP(), []int{18} +} + +func (x *BootInfo) GetImageId() string { + if x != nil { + return x.ImageId + } + return "" +} + +func (x *BootInfo) GetPrimaryDisk() string { + if x != nil { + return x.PrimaryDisk + } + return "" +} + +func (x *BootInfo) GetOsPartition() string { + if x != nil { + return x.OsPartition + } + return "" +} + +func (x *BootInfo) GetInitrd() string { + if x != nil { + return x.Initrd + } + return "" +} + +func (x *BootInfo) GetCmdline() string { + if x != nil { + return x.Cmdline + } + return "" +} + +func (x *BootInfo) GetKernel() string { + if x != nil { + return x.Kernel + } + return "" +} + +func (x *BootInfo) GetBootloaderId() string { + if x != nil { + return x.BootloaderId + } + return "" +} + +// BootServiceAbortReinstallRequest is called if the reinstallation failed and must aborted +type BootServiceAbortReinstallRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // UUID of this machine + Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` + // PrimaryDiskWiped is set to true if the primary disk was wiped + PrimaryDiskWiped bool `protobuf:"varint,2,opt,name=primary_disk_wiped,json=primaryDiskWiped,proto3" json:"primary_disk_wiped,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BootServiceAbortReinstallRequest) Reset() { + *x = BootServiceAbortReinstallRequest{} + mi := &file_metalstack_infra_v2_boot_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BootServiceAbortReinstallRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BootServiceAbortReinstallRequest) ProtoMessage() {} + +func (x *BootServiceAbortReinstallRequest) ProtoReflect() protoreflect.Message { + mi := &file_metalstack_infra_v2_boot_proto_msgTypes[19] + 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 BootServiceAbortReinstallRequest.ProtoReflect.Descriptor instead. +func (*BootServiceAbortReinstallRequest) Descriptor() ([]byte, []int) { + return file_metalstack_infra_v2_boot_proto_rawDescGZIP(), []int{19} +} + +func (x *BootServiceAbortReinstallRequest) GetUuid() string { + if x != nil { + return x.Uuid + } + return "" +} + +func (x *BootServiceAbortReinstallRequest) GetPrimaryDiskWiped() bool { + if x != nil { + return x.PrimaryDiskWiped + } + return false +} + +// BootServiceAbortReinstallResponse response if a reinstall abort command was called +type BootServiceAbortReinstallResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // BootInfo contains details to the boot + BootInfo *BootInfo `protobuf:"bytes,1,opt,name=boot_info,json=bootInfo,proto3" json:"boot_info,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BootServiceAbortReinstallResponse) Reset() { + *x = BootServiceAbortReinstallResponse{} + mi := &file_metalstack_infra_v2_boot_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BootServiceAbortReinstallResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BootServiceAbortReinstallResponse) ProtoMessage() {} + +func (x *BootServiceAbortReinstallResponse) ProtoReflect() protoreflect.Message { + mi := &file_metalstack_infra_v2_boot_proto_msgTypes[20] + 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 BootServiceAbortReinstallResponse.ProtoReflect.Descriptor instead. +func (*BootServiceAbortReinstallResponse) Descriptor() ([]byte, []int) { + return file_metalstack_infra_v2_boot_proto_rawDescGZIP(), []int{20} +} + +func (x *BootServiceAbortReinstallResponse) GetBootInfo() *BootInfo { + if x != nil { + return x.BootInfo + } + return nil +} + +// BootServiceSuperUserPasswordRequest this call returns the password for the machine superuser +type BootServiceSuperUserPasswordRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // UUID of this machine + Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BootServiceSuperUserPasswordRequest) Reset() { + *x = BootServiceSuperUserPasswordRequest{} + mi := &file_metalstack_infra_v2_boot_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BootServiceSuperUserPasswordRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BootServiceSuperUserPasswordRequest) ProtoMessage() {} + +func (x *BootServiceSuperUserPasswordRequest) ProtoReflect() protoreflect.Message { + mi := &file_metalstack_infra_v2_boot_proto_msgTypes[21] + 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 BootServiceSuperUserPasswordRequest.ProtoReflect.Descriptor instead. +func (*BootServiceSuperUserPasswordRequest) Descriptor() ([]byte, []int) { + return file_metalstack_infra_v2_boot_proto_rawDescGZIP(), []int{21} +} + +func (x *BootServiceSuperUserPasswordRequest) GetUuid() string { + if x != nil { + return x.Uuid + } + return "" +} + +// BootServiceSuperUserPasswordResponse the super user password is returned +type BootServiceSuperUserPasswordResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // FeatureDisable FIXME + FeatureDisabled bool `protobuf:"varint,1,opt,name=feature_disabled,json=featureDisabled,proto3" json:"feature_disabled,omitempty"` + // SuperUserPassword is the password of the superuser on the ipmi device + SuperUserPassword string `protobuf:"bytes,2,opt,name=super_user_password,json=superUserPassword,proto3" json:"super_user_password,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BootServiceSuperUserPasswordResponse) Reset() { + *x = BootServiceSuperUserPasswordResponse{} + mi := &file_metalstack_infra_v2_boot_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BootServiceSuperUserPasswordResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BootServiceSuperUserPasswordResponse) ProtoMessage() {} + +func (x *BootServiceSuperUserPasswordResponse) ProtoReflect() protoreflect.Message { + mi := &file_metalstack_infra_v2_boot_proto_msgTypes[22] + 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 BootServiceSuperUserPasswordResponse.ProtoReflect.Descriptor instead. +func (*BootServiceSuperUserPasswordResponse) Descriptor() ([]byte, []int) { + return file_metalstack_infra_v2_boot_proto_rawDescGZIP(), []int{22} +} + +func (x *BootServiceSuperUserPasswordResponse) GetFeatureDisabled() bool { + if x != nil { + return x.FeatureDisabled + } + return false +} + +func (x *BootServiceSuperUserPasswordResponse) GetSuperUserPassword() string { + if x != nil { + return x.SuperUserPassword + } + return "" +} + +var File_metalstack_infra_v2_boot_proto protoreflect.FileDescriptor + +const file_metalstack_infra_v2_boot_proto_rawDesc = "" + + "\n" + + "\x1emetalstack/infra/v2/boot.proto\x12\x13metalstack.infra.v2\x1a\x1emetalstack/api/v2/common.proto\",\n" + + "\x16BootServiceDhcpRequest\x12\x12\n" + + "\x04uuid\x18\x01 \x01(\tR\x04uuid\"\x19\n" + + "\x17BootServiceDhcpResponse\"M\n" + + "\x16BootServiceBootRequest\x12\x10\n" + + "\x03mac\x18\x01 \x01(\tR\x03mac\x12!\n" + + "\fpartition_id\x18\x02 \x01(\tR\vpartitionId\"\x82\x01\n" + + "\x17BootServiceBootResponse\x12\x16\n" + + "\x06kernel\x18\x01 \x01(\tR\x06kernel\x12$\n" + + "\x0einit_ram_disks\x18\x02 \x03(\tR\finitRamDisks\x12\x1d\n" + + "\acmdline\x18\x03 \x01(\tH\x00R\acmdline\x88\x01\x01B\n" + + "\n" + + "\b_cmdline\"\xc7\x02\n" + + "\x1aBootServiceRegisterRequest\x12\x12\n" + + "\x04uuid\x18\x01 \x01(\tR\x04uuid\x12@\n" + + "\bhardware\x18\x02 \x01(\v2$.metalstack.infra.v2.MachineHardwareR\bhardware\x124\n" + + "\x04bios\x18\x03 \x01(\v2 .metalstack.infra.v2.MachineBIOSR\x04bios\x124\n" + + "\x04ipmi\x18\x04 \x01(\v2 .metalstack.infra.v2.MachineIPMIR\x04ipmi\x12\x12\n" + + "\x04tags\x18\x05 \x03(\tR\x04tags\x120\n" + + "\x14metal_hammer_version\x18\x06 \x01(\tR\x12metalHammerVersion\x12!\n" + + "\fpartition_id\x18\a \x01(\tR\vpartitionId\"h\n" + + "\x1bBootServiceRegisterResponse\x12\x12\n" + + "\x04uuid\x18\x01 \x01(\tR\x04uuid\x12\x12\n" + + "\x04size\x18\x02 \x01(\tR\x04size\x12!\n" + + "\fpartition_id\x18\x03 \x01(\tR\vpartitionId\",\n" + + "\x16BootServiceWaitRequest\x12\x12\n" + + "\x04uuid\x18\x01 \x01(\tR\x04uuid\"\x19\n" + + "\x17BootServiceWaitResponse\"\x87\x02\n" + + "\x0fMachineHardware\x12\x16\n" + + "\x06memory\x18\x01 \x01(\x04R\x06memory\x12=\n" + + "\x05disks\x18\x03 \x03(\v2'.metalstack.infra.v2.MachineBlockDeviceR\x05disks\x123\n" + + "\x04nics\x18\x04 \x03(\v2\x1f.metalstack.infra.v2.MachineNicR\x04nics\x123\n" + + "\x04cpus\x18\x05 \x03(\v2\x1f.metalstack.infra.v2.MachineCPUR\x04cpus\x123\n" + + "\x04gpus\x18\x06 \x03(\v2\x1f.metalstack.infra.v2.MachineGPUR\x04gpus\"j\n" + + "\n" + + "MachineCPU\x12\x16\n" + + "\x06vendor\x18\x01 \x01(\tR\x06vendor\x12\x14\n" + + "\x05model\x18\x02 \x01(\tR\x05model\x12\x14\n" + + "\x05cores\x18\x03 \x01(\rR\x05cores\x12\x18\n" + + "\athreads\x18\x04 \x01(\rR\athreads\":\n" + + "\n" + + "MachineGPU\x12\x16\n" + + "\x06vendor\x18\x01 \x01(\tR\x06vendor\x12\x14\n" + + "\x05model\x18\x02 \x01(\tR\x05model\"\xf1\x01\n" + + "\n" + + "MachineNic\x12\x10\n" + + "\x03mac\x18\x01 \x01(\tR\x03mac\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12\x16\n" + + "\x06vendor\x18\x03 \x01(\tR\x06vendor\x12\x14\n" + + "\x05model\x18\x04 \x01(\tR\x05model\x12\x14\n" + + "\x05speed\x18\x05 \x01(\x04R\x05speed\x12=\n" + + "\tneighbors\x18\x06 \x03(\v2\x1f.metalstack.infra.v2.MachineNicR\tneighbors\x12\x1a\n" + + "\bhostname\x18\a \x01(\tR\bhostname\x12\x1e\n" + + "\n" + + "identifier\x18\b \x01(\tR\n" + + "identifier\"<\n" + + "\x12MachineBlockDevice\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12\x12\n" + + "\x04size\x18\x02 \x01(\x04R\x04size\"S\n" + + "\vMachineBIOS\x12\x18\n" + + "\aversion\x18\x01 \x01(\tR\aversion\x12\x16\n" + + "\x06vendor\x18\x02 \x01(\tR\x06vendor\x12\x12\n" + + "\x04date\x18\x03 \x01(\tR\x04date\"\xfc\x01\n" + + "\vMachineIPMI\x12\x18\n" + + "\aaddress\x18\x01 \x01(\tR\aaddress\x12\x10\n" + + "\x03mac\x18\x02 \x01(\tR\x03mac\x12\x12\n" + + "\x04user\x18\x03 \x01(\tR\x04user\x12\x1a\n" + + "\bpassword\x18\x04 \x01(\tR\bpassword\x12\x1c\n" + + "\tinterface\x18\x05 \x01(\tR\tinterface\x121\n" + + "\x03fru\x18\x06 \x01(\v2\x1f.metalstack.infra.v2.MachineFRUR\x03fru\x12\x1f\n" + + "\vbmc_version\x18\a \x01(\tR\n" + + "bmcVersion\x12\x1f\n" + + "\vpower_state\x18\b \x01(\tR\n" + + "powerState\"\xbe\x04\n" + + "\n" + + "MachineFRU\x123\n" + + "\x13chassis_part_number\x18\x01 \x01(\tH\x00R\x11chassisPartNumber\x88\x01\x01\x123\n" + + "\x13chassis_part_serial\x18\x02 \x01(\tH\x01R\x11chassisPartSerial\x88\x01\x01\x12 \n" + + "\tboard_mfg\x18\x03 \x01(\tH\x02R\bboardMfg\x88\x01\x01\x12-\n" + + "\x10board_mfg_serial\x18\x04 \x01(\tH\x03R\x0eboardMfgSerial\x88\x01\x01\x12/\n" + + "\x11board_part_number\x18\x05 \x01(\tH\x04R\x0fboardPartNumber\x88\x01\x01\x126\n" + + "\x14product_manufacturer\x18\x06 \x01(\tH\x05R\x13productManufacturer\x88\x01\x01\x123\n" + + "\x13product_part_number\x18\a \x01(\tH\x06R\x11productPartNumber\x88\x01\x01\x12*\n" + + "\x0eproduct_serial\x18\b \x01(\tH\aR\rproductSerial\x88\x01\x01B\x16\n" + + "\x14_chassis_part_numberB\x16\n" + + "\x14_chassis_part_serialB\f\n" + + "\n" + + "_board_mfgB\x13\n" + + "\x11_board_mfg_serialB\x14\n" + + "\x12_board_part_numberB\x17\n" + + "\x15_product_manufacturerB\x16\n" + + "\x14_product_part_numberB\x11\n" + + "\x0f_product_serial\"\xc9\x01\n" + + "\x18BootServiceReportRequest\x12\x12\n" + + "\x04uuid\x18\x01 \x01(\tR\x04uuid\x12)\n" + + "\x10console_password\x18\x02 \x01(\tR\x0fconsolePassword\x12:\n" + + "\tboot_info\x18\x03 \x01(\v2\x1d.metalstack.infra.v2.BootInfoR\bbootInfo\x12\x18\n" + + "\asuccess\x18\x04 \x01(\bR\asuccess\x12\x18\n" + + "\amessage\x18\x05 \x01(\tR\amessage\"\x1b\n" + + "\x19BootServiceReportResponse\"\xda\x01\n" + + "\bBootInfo\x12\x19\n" + + "\bimage_id\x18\x01 \x01(\tR\aimageId\x12!\n" + + "\fprimary_disk\x18\x02 \x01(\tR\vprimaryDisk\x12!\n" + + "\fos_partition\x18\x03 \x01(\tR\vosPartition\x12\x16\n" + + "\x06initrd\x18\x04 \x01(\tR\x06initrd\x12\x18\n" + + "\acmdline\x18\x05 \x01(\tR\acmdline\x12\x16\n" + + "\x06kernel\x18\x06 \x01(\tR\x06kernel\x12#\n" + + "\rbootloader_id\x18\b \x01(\tR\fbootloaderId\"d\n" + + " BootServiceAbortReinstallRequest\x12\x12\n" + + "\x04uuid\x18\x01 \x01(\tR\x04uuid\x12,\n" + + "\x12primary_disk_wiped\x18\x02 \x01(\bR\x10primaryDiskWiped\"_\n" + + "!BootServiceAbortReinstallResponse\x12:\n" + + "\tboot_info\x18\x01 \x01(\v2\x1d.metalstack.infra.v2.BootInfoR\bbootInfo\"9\n" + + "#BootServiceSuperUserPasswordRequest\x12\x12\n" + + "\x04uuid\x18\x01 \x01(\tR\x04uuid\"\x81\x01\n" + + "$BootServiceSuperUserPasswordResponse\x12)\n" + + "\x10feature_disabled\x18\x01 \x01(\bR\x0ffeatureDisabled\x12.\n" + + "\x13super_user_password\x18\x02 \x01(\tR\x11superUserPassword2\xf1\x06\n" + + "\vBootService\x12m\n" + + "\x04Dhcp\x12+.metalstack.infra.v2.BootServiceDhcpRequest\x1a,.metalstack.infra.v2.BootServiceDhcpResponse\"\n" + + "\xe0\xf3\x18\x02\xea\xf3\x18\x02\x01\x02\x12m\n" + + "\x04Boot\x12+.metalstack.infra.v2.BootServiceBootRequest\x1a,.metalstack.infra.v2.BootServiceBootResponse\"\n" + + "\xe0\xf3\x18\x02\xea\xf3\x18\x02\x01\x02\x12\x94\x01\n" + + "\x11SuperUserPassword\x128.metalstack.infra.v2.BootServiceSuperUserPasswordRequest\x1a9.metalstack.infra.v2.BootServiceSuperUserPasswordResponse\"\n" + + "\xe0\xf3\x18\x02\xf2\xf3\x18\x02\x01\x02\x12y\n" + + "\bRegister\x12/.metalstack.infra.v2.BootServiceRegisterRequest\x1a0.metalstack.infra.v2.BootServiceRegisterResponse\"\n" + + "\xe0\xf3\x18\x02\xf2\xf3\x18\x02\x01\x02\x12o\n" + + "\x04Wait\x12+.metalstack.infra.v2.BootServiceWaitRequest\x1a,.metalstack.infra.v2.BootServiceWaitResponse\"\n" + + "\xe0\xf3\x18\x02\xf2\xf3\x18\x02\x01\x020\x01\x12s\n" + + "\x06Report\x12-.metalstack.infra.v2.BootServiceReportRequest\x1a..metalstack.infra.v2.BootServiceReportResponse\"\n" + + "\xe0\xf3\x18\x02\xf2\xf3\x18\x02\x01\x02\x12\x8b\x01\n" + + "\x0eAbortReinstall\x125.metalstack.infra.v2.BootServiceAbortReinstallRequest\x1a6.metalstack.infra.v2.BootServiceAbortReinstallResponse\"\n" + + "\xe0\xf3\x18\x02\xf2\xf3\x18\x02\x01\x02B\xcd\x01\n" + + "\x17com.metalstack.infra.v2B\tBootProtoP\x01Z9github.com/metal-stack/api/go/metalstack/infra/v2;infrav2\xa2\x02\x03MIX\xaa\x02\x13Metalstack.Infra.V2\xca\x02\x13Metalstack\\Infra\\V2\xe2\x02\x1fMetalstack\\Infra\\V2\\GPBMetadata\xea\x02\x15Metalstack::Infra::V2b\x06proto3" + +var ( + file_metalstack_infra_v2_boot_proto_rawDescOnce sync.Once + file_metalstack_infra_v2_boot_proto_rawDescData []byte +) + +func file_metalstack_infra_v2_boot_proto_rawDescGZIP() []byte { + file_metalstack_infra_v2_boot_proto_rawDescOnce.Do(func() { + file_metalstack_infra_v2_boot_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_metalstack_infra_v2_boot_proto_rawDesc), len(file_metalstack_infra_v2_boot_proto_rawDesc))) + }) + return file_metalstack_infra_v2_boot_proto_rawDescData +} + +var file_metalstack_infra_v2_boot_proto_msgTypes = make([]protoimpl.MessageInfo, 23) +var file_metalstack_infra_v2_boot_proto_goTypes = []any{ + (*BootServiceDhcpRequest)(nil), // 0: metalstack.infra.v2.BootServiceDhcpRequest + (*BootServiceDhcpResponse)(nil), // 1: metalstack.infra.v2.BootServiceDhcpResponse + (*BootServiceBootRequest)(nil), // 2: metalstack.infra.v2.BootServiceBootRequest + (*BootServiceBootResponse)(nil), // 3: metalstack.infra.v2.BootServiceBootResponse + (*BootServiceRegisterRequest)(nil), // 4: metalstack.infra.v2.BootServiceRegisterRequest + (*BootServiceRegisterResponse)(nil), // 5: metalstack.infra.v2.BootServiceRegisterResponse + (*BootServiceWaitRequest)(nil), // 6: metalstack.infra.v2.BootServiceWaitRequest + (*BootServiceWaitResponse)(nil), // 7: metalstack.infra.v2.BootServiceWaitResponse + (*MachineHardware)(nil), // 8: metalstack.infra.v2.MachineHardware + (*MachineCPU)(nil), // 9: metalstack.infra.v2.MachineCPU + (*MachineGPU)(nil), // 10: metalstack.infra.v2.MachineGPU + (*MachineNic)(nil), // 11: metalstack.infra.v2.MachineNic + (*MachineBlockDevice)(nil), // 12: metalstack.infra.v2.MachineBlockDevice + (*MachineBIOS)(nil), // 13: metalstack.infra.v2.MachineBIOS + (*MachineIPMI)(nil), // 14: metalstack.infra.v2.MachineIPMI + (*MachineFRU)(nil), // 15: metalstack.infra.v2.MachineFRU + (*BootServiceReportRequest)(nil), // 16: metalstack.infra.v2.BootServiceReportRequest + (*BootServiceReportResponse)(nil), // 17: metalstack.infra.v2.BootServiceReportResponse + (*BootInfo)(nil), // 18: metalstack.infra.v2.BootInfo + (*BootServiceAbortReinstallRequest)(nil), // 19: metalstack.infra.v2.BootServiceAbortReinstallRequest + (*BootServiceAbortReinstallResponse)(nil), // 20: metalstack.infra.v2.BootServiceAbortReinstallResponse + (*BootServiceSuperUserPasswordRequest)(nil), // 21: metalstack.infra.v2.BootServiceSuperUserPasswordRequest + (*BootServiceSuperUserPasswordResponse)(nil), // 22: metalstack.infra.v2.BootServiceSuperUserPasswordResponse +} +var file_metalstack_infra_v2_boot_proto_depIdxs = []int32{ + 8, // 0: metalstack.infra.v2.BootServiceRegisterRequest.hardware:type_name -> metalstack.infra.v2.MachineHardware + 13, // 1: metalstack.infra.v2.BootServiceRegisterRequest.bios:type_name -> metalstack.infra.v2.MachineBIOS + 14, // 2: metalstack.infra.v2.BootServiceRegisterRequest.ipmi:type_name -> metalstack.infra.v2.MachineIPMI + 12, // 3: metalstack.infra.v2.MachineHardware.disks:type_name -> metalstack.infra.v2.MachineBlockDevice + 11, // 4: metalstack.infra.v2.MachineHardware.nics:type_name -> metalstack.infra.v2.MachineNic + 9, // 5: metalstack.infra.v2.MachineHardware.cpus:type_name -> metalstack.infra.v2.MachineCPU + 10, // 6: metalstack.infra.v2.MachineHardware.gpus:type_name -> metalstack.infra.v2.MachineGPU + 11, // 7: metalstack.infra.v2.MachineNic.neighbors:type_name -> metalstack.infra.v2.MachineNic + 15, // 8: metalstack.infra.v2.MachineIPMI.fru:type_name -> metalstack.infra.v2.MachineFRU + 18, // 9: metalstack.infra.v2.BootServiceReportRequest.boot_info:type_name -> metalstack.infra.v2.BootInfo + 18, // 10: metalstack.infra.v2.BootServiceAbortReinstallResponse.boot_info:type_name -> metalstack.infra.v2.BootInfo + 0, // 11: metalstack.infra.v2.BootService.Dhcp:input_type -> metalstack.infra.v2.BootServiceDhcpRequest + 2, // 12: metalstack.infra.v2.BootService.Boot:input_type -> metalstack.infra.v2.BootServiceBootRequest + 21, // 13: metalstack.infra.v2.BootService.SuperUserPassword:input_type -> metalstack.infra.v2.BootServiceSuperUserPasswordRequest + 4, // 14: metalstack.infra.v2.BootService.Register:input_type -> metalstack.infra.v2.BootServiceRegisterRequest + 6, // 15: metalstack.infra.v2.BootService.Wait:input_type -> metalstack.infra.v2.BootServiceWaitRequest + 16, // 16: metalstack.infra.v2.BootService.Report:input_type -> metalstack.infra.v2.BootServiceReportRequest + 19, // 17: metalstack.infra.v2.BootService.AbortReinstall:input_type -> metalstack.infra.v2.BootServiceAbortReinstallRequest + 1, // 18: metalstack.infra.v2.BootService.Dhcp:output_type -> metalstack.infra.v2.BootServiceDhcpResponse + 3, // 19: metalstack.infra.v2.BootService.Boot:output_type -> metalstack.infra.v2.BootServiceBootResponse + 22, // 20: metalstack.infra.v2.BootService.SuperUserPassword:output_type -> metalstack.infra.v2.BootServiceSuperUserPasswordResponse + 5, // 21: metalstack.infra.v2.BootService.Register:output_type -> metalstack.infra.v2.BootServiceRegisterResponse + 7, // 22: metalstack.infra.v2.BootService.Wait:output_type -> metalstack.infra.v2.BootServiceWaitResponse + 17, // 23: metalstack.infra.v2.BootService.Report:output_type -> metalstack.infra.v2.BootServiceReportResponse + 20, // 24: metalstack.infra.v2.BootService.AbortReinstall:output_type -> metalstack.infra.v2.BootServiceAbortReinstallResponse + 18, // [18:25] is the sub-list for method output_type + 11, // [11:18] is the sub-list for method input_type + 11, // [11:11] is the sub-list for extension type_name + 11, // [11:11] is the sub-list for extension extendee + 0, // [0:11] is the sub-list for field type_name +} + +func init() { file_metalstack_infra_v2_boot_proto_init() } +func file_metalstack_infra_v2_boot_proto_init() { + if File_metalstack_infra_v2_boot_proto != nil { + return + } + file_metalstack_infra_v2_boot_proto_msgTypes[3].OneofWrappers = []any{} + file_metalstack_infra_v2_boot_proto_msgTypes[15].OneofWrappers = []any{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_metalstack_infra_v2_boot_proto_rawDesc), len(file_metalstack_infra_v2_boot_proto_rawDesc)), + NumEnums: 0, + NumMessages: 23, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_metalstack_infra_v2_boot_proto_goTypes, + DependencyIndexes: file_metalstack_infra_v2_boot_proto_depIdxs, + MessageInfos: file_metalstack_infra_v2_boot_proto_msgTypes, + }.Build() + File_metalstack_infra_v2_boot_proto = out.File + file_metalstack_infra_v2_boot_proto_goTypes = nil + file_metalstack_infra_v2_boot_proto_depIdxs = nil +} diff --git a/go/metalstack/infra/v2/infrav2connect/boot.connect.go b/go/metalstack/infra/v2/infrav2connect/boot.connect.go new file mode 100644 index 00000000..fe65511b --- /dev/null +++ b/go/metalstack/infra/v2/infrav2connect/boot.connect.go @@ -0,0 +1,292 @@ +// Code generated by protoc-gen-connect-go. DO NOT EDIT. +// +// Source: metalstack/infra/v2/boot.proto + +package infrav2connect + +import ( + connect "connectrpc.com/connect" + context "context" + errors "errors" + v2 "github.com/metal-stack/api/go/metalstack/infra/v2" + http "net/http" + strings "strings" +) + +// This is a compile-time assertion to ensure that this generated file and the connect package are +// compatible. If you get a compiler error that this constant is not defined, this code was +// generated with a version of connect newer than the one compiled into your binary. You can fix the +// problem by either regenerating this code with an older version of connect or updating the connect +// version compiled into your binary. +const _ = connect.IsAtLeastVersion1_13_0 + +const ( + // BootServiceName is the fully-qualified name of the BootService service. + BootServiceName = "metalstack.infra.v2.BootService" +) + +// These constants are the fully-qualified names of the RPCs defined in this package. They're +// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route. +// +// Note that these are different from the fully-qualified method names used by +// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to +// reflection-formatted method names, remove the leading slash and convert the remaining slash to a +// period. +const ( + // BootServiceDhcpProcedure is the fully-qualified name of the BootService's Dhcp RPC. + BootServiceDhcpProcedure = "/metalstack.infra.v2.BootService/Dhcp" + // BootServiceBootProcedure is the fully-qualified name of the BootService's Boot RPC. + BootServiceBootProcedure = "/metalstack.infra.v2.BootService/Boot" + // BootServiceSuperUserPasswordProcedure is the fully-qualified name of the BootService's + // SuperUserPassword RPC. + BootServiceSuperUserPasswordProcedure = "/metalstack.infra.v2.BootService/SuperUserPassword" + // BootServiceRegisterProcedure is the fully-qualified name of the BootService's Register RPC. + BootServiceRegisterProcedure = "/metalstack.infra.v2.BootService/Register" + // BootServiceWaitProcedure is the fully-qualified name of the BootService's Wait RPC. + BootServiceWaitProcedure = "/metalstack.infra.v2.BootService/Wait" + // BootServiceReportProcedure is the fully-qualified name of the BootService's Report RPC. + BootServiceReportProcedure = "/metalstack.infra.v2.BootService/Report" + // BootServiceAbortReinstallProcedure is the fully-qualified name of the BootService's + // AbortReinstall RPC. + BootServiceAbortReinstallProcedure = "/metalstack.infra.v2.BootService/AbortReinstall" +) + +// BootServiceClient is a client for the metalstack.infra.v2.BootService service. +type BootServiceClient interface { + // Dhcp is the first dhcp request (option 97). A ProvisioningEventPXEBooting is fired + Dhcp(context.Context, *connect.Request[v2.BootServiceDhcpRequest]) (*connect.Response[v2.BootServiceDhcpResponse], error) + // Boot is called from pixie once the machine got the first dhcp response and ipxie asks for subsequent kernel and initrd + Boot(context.Context, *connect.Request[v2.BootServiceBootRequest]) (*connect.Response[v2.BootServiceBootResponse], error) + // SuperUserPassword metal-hammer takes the configured root password for the bmc from metal-api and configure the bmc accordingly + SuperUserPassword(context.Context, *connect.Request[v2.BootServiceSuperUserPasswordRequest]) (*connect.Response[v2.BootServiceSuperUserPasswordResponse], error) + // Register is called from metal-hammer after hardware inventory is finished, tells metal-api all glory details about that machine + Register(context.Context, *connect.Request[v2.BootServiceRegisterRequest]) (*connect.Response[v2.BootServiceRegisterResponse], error) + // Wait is a hanging call that waits until the machine gets allocated by a user + Wait(context.Context, *connect.Request[v2.BootServiceWaitRequest]) (*connect.ServerStreamForClient[v2.BootServiceWaitResponse], error) + // Report tells metal-api installation was either successful or failed + Report(context.Context, *connect.Request[v2.BootServiceReportRequest]) (*connect.Response[v2.BootServiceReportResponse], error) + // If reinstall failed and tell metal-api to restore to previous state + AbortReinstall(context.Context, *connect.Request[v2.BootServiceAbortReinstallRequest]) (*connect.Response[v2.BootServiceAbortReinstallResponse], error) +} + +// NewBootServiceClient constructs a client for the metalstack.infra.v2.BootService service. By +// default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, +// and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the +// connect.WithGRPC() or connect.WithGRPCWeb() options. +// +// The URL supplied here should be the base URL for the Connect or gRPC server (for example, +// http://api.acme.com or https://acme.com/grpc). +func NewBootServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) BootServiceClient { + baseURL = strings.TrimRight(baseURL, "/") + bootServiceMethods := v2.File_metalstack_infra_v2_boot_proto.Services().ByName("BootService").Methods() + return &bootServiceClient{ + dhcp: connect.NewClient[v2.BootServiceDhcpRequest, v2.BootServiceDhcpResponse]( + httpClient, + baseURL+BootServiceDhcpProcedure, + connect.WithSchema(bootServiceMethods.ByName("Dhcp")), + connect.WithClientOptions(opts...), + ), + boot: connect.NewClient[v2.BootServiceBootRequest, v2.BootServiceBootResponse]( + httpClient, + baseURL+BootServiceBootProcedure, + connect.WithSchema(bootServiceMethods.ByName("Boot")), + connect.WithClientOptions(opts...), + ), + superUserPassword: connect.NewClient[v2.BootServiceSuperUserPasswordRequest, v2.BootServiceSuperUserPasswordResponse]( + httpClient, + baseURL+BootServiceSuperUserPasswordProcedure, + connect.WithSchema(bootServiceMethods.ByName("SuperUserPassword")), + connect.WithClientOptions(opts...), + ), + register: connect.NewClient[v2.BootServiceRegisterRequest, v2.BootServiceRegisterResponse]( + httpClient, + baseURL+BootServiceRegisterProcedure, + connect.WithSchema(bootServiceMethods.ByName("Register")), + connect.WithClientOptions(opts...), + ), + wait: connect.NewClient[v2.BootServiceWaitRequest, v2.BootServiceWaitResponse]( + httpClient, + baseURL+BootServiceWaitProcedure, + connect.WithSchema(bootServiceMethods.ByName("Wait")), + connect.WithClientOptions(opts...), + ), + report: connect.NewClient[v2.BootServiceReportRequest, v2.BootServiceReportResponse]( + httpClient, + baseURL+BootServiceReportProcedure, + connect.WithSchema(bootServiceMethods.ByName("Report")), + connect.WithClientOptions(opts...), + ), + abortReinstall: connect.NewClient[v2.BootServiceAbortReinstallRequest, v2.BootServiceAbortReinstallResponse]( + httpClient, + baseURL+BootServiceAbortReinstallProcedure, + connect.WithSchema(bootServiceMethods.ByName("AbortReinstall")), + connect.WithClientOptions(opts...), + ), + } +} + +// bootServiceClient implements BootServiceClient. +type bootServiceClient struct { + dhcp *connect.Client[v2.BootServiceDhcpRequest, v2.BootServiceDhcpResponse] + boot *connect.Client[v2.BootServiceBootRequest, v2.BootServiceBootResponse] + superUserPassword *connect.Client[v2.BootServiceSuperUserPasswordRequest, v2.BootServiceSuperUserPasswordResponse] + register *connect.Client[v2.BootServiceRegisterRequest, v2.BootServiceRegisterResponse] + wait *connect.Client[v2.BootServiceWaitRequest, v2.BootServiceWaitResponse] + report *connect.Client[v2.BootServiceReportRequest, v2.BootServiceReportResponse] + abortReinstall *connect.Client[v2.BootServiceAbortReinstallRequest, v2.BootServiceAbortReinstallResponse] +} + +// Dhcp calls metalstack.infra.v2.BootService.Dhcp. +func (c *bootServiceClient) Dhcp(ctx context.Context, req *connect.Request[v2.BootServiceDhcpRequest]) (*connect.Response[v2.BootServiceDhcpResponse], error) { + return c.dhcp.CallUnary(ctx, req) +} + +// Boot calls metalstack.infra.v2.BootService.Boot. +func (c *bootServiceClient) Boot(ctx context.Context, req *connect.Request[v2.BootServiceBootRequest]) (*connect.Response[v2.BootServiceBootResponse], error) { + return c.boot.CallUnary(ctx, req) +} + +// SuperUserPassword calls metalstack.infra.v2.BootService.SuperUserPassword. +func (c *bootServiceClient) SuperUserPassword(ctx context.Context, req *connect.Request[v2.BootServiceSuperUserPasswordRequest]) (*connect.Response[v2.BootServiceSuperUserPasswordResponse], error) { + return c.superUserPassword.CallUnary(ctx, req) +} + +// Register calls metalstack.infra.v2.BootService.Register. +func (c *bootServiceClient) Register(ctx context.Context, req *connect.Request[v2.BootServiceRegisterRequest]) (*connect.Response[v2.BootServiceRegisterResponse], error) { + return c.register.CallUnary(ctx, req) +} + +// Wait calls metalstack.infra.v2.BootService.Wait. +func (c *bootServiceClient) Wait(ctx context.Context, req *connect.Request[v2.BootServiceWaitRequest]) (*connect.ServerStreamForClient[v2.BootServiceWaitResponse], error) { + return c.wait.CallServerStream(ctx, req) +} + +// Report calls metalstack.infra.v2.BootService.Report. +func (c *bootServiceClient) Report(ctx context.Context, req *connect.Request[v2.BootServiceReportRequest]) (*connect.Response[v2.BootServiceReportResponse], error) { + return c.report.CallUnary(ctx, req) +} + +// AbortReinstall calls metalstack.infra.v2.BootService.AbortReinstall. +func (c *bootServiceClient) AbortReinstall(ctx context.Context, req *connect.Request[v2.BootServiceAbortReinstallRequest]) (*connect.Response[v2.BootServiceAbortReinstallResponse], error) { + return c.abortReinstall.CallUnary(ctx, req) +} + +// BootServiceHandler is an implementation of the metalstack.infra.v2.BootService service. +type BootServiceHandler interface { + // Dhcp is the first dhcp request (option 97). A ProvisioningEventPXEBooting is fired + Dhcp(context.Context, *connect.Request[v2.BootServiceDhcpRequest]) (*connect.Response[v2.BootServiceDhcpResponse], error) + // Boot is called from pixie once the machine got the first dhcp response and ipxie asks for subsequent kernel and initrd + Boot(context.Context, *connect.Request[v2.BootServiceBootRequest]) (*connect.Response[v2.BootServiceBootResponse], error) + // SuperUserPassword metal-hammer takes the configured root password for the bmc from metal-api and configure the bmc accordingly + SuperUserPassword(context.Context, *connect.Request[v2.BootServiceSuperUserPasswordRequest]) (*connect.Response[v2.BootServiceSuperUserPasswordResponse], error) + // Register is called from metal-hammer after hardware inventory is finished, tells metal-api all glory details about that machine + Register(context.Context, *connect.Request[v2.BootServiceRegisterRequest]) (*connect.Response[v2.BootServiceRegisterResponse], error) + // Wait is a hanging call that waits until the machine gets allocated by a user + Wait(context.Context, *connect.Request[v2.BootServiceWaitRequest], *connect.ServerStream[v2.BootServiceWaitResponse]) error + // Report tells metal-api installation was either successful or failed + Report(context.Context, *connect.Request[v2.BootServiceReportRequest]) (*connect.Response[v2.BootServiceReportResponse], error) + // If reinstall failed and tell metal-api to restore to previous state + AbortReinstall(context.Context, *connect.Request[v2.BootServiceAbortReinstallRequest]) (*connect.Response[v2.BootServiceAbortReinstallResponse], error) +} + +// NewBootServiceHandler builds an HTTP handler from the service implementation. It returns the path +// on which to mount the handler and the handler itself. +// +// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf +// and JSON codecs. They also support gzip compression. +func NewBootServiceHandler(svc BootServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { + bootServiceMethods := v2.File_metalstack_infra_v2_boot_proto.Services().ByName("BootService").Methods() + bootServiceDhcpHandler := connect.NewUnaryHandler( + BootServiceDhcpProcedure, + svc.Dhcp, + connect.WithSchema(bootServiceMethods.ByName("Dhcp")), + connect.WithHandlerOptions(opts...), + ) + bootServiceBootHandler := connect.NewUnaryHandler( + BootServiceBootProcedure, + svc.Boot, + connect.WithSchema(bootServiceMethods.ByName("Boot")), + connect.WithHandlerOptions(opts...), + ) + bootServiceSuperUserPasswordHandler := connect.NewUnaryHandler( + BootServiceSuperUserPasswordProcedure, + svc.SuperUserPassword, + connect.WithSchema(bootServiceMethods.ByName("SuperUserPassword")), + connect.WithHandlerOptions(opts...), + ) + bootServiceRegisterHandler := connect.NewUnaryHandler( + BootServiceRegisterProcedure, + svc.Register, + connect.WithSchema(bootServiceMethods.ByName("Register")), + connect.WithHandlerOptions(opts...), + ) + bootServiceWaitHandler := connect.NewServerStreamHandler( + BootServiceWaitProcedure, + svc.Wait, + connect.WithSchema(bootServiceMethods.ByName("Wait")), + connect.WithHandlerOptions(opts...), + ) + bootServiceReportHandler := connect.NewUnaryHandler( + BootServiceReportProcedure, + svc.Report, + connect.WithSchema(bootServiceMethods.ByName("Report")), + connect.WithHandlerOptions(opts...), + ) + bootServiceAbortReinstallHandler := connect.NewUnaryHandler( + BootServiceAbortReinstallProcedure, + svc.AbortReinstall, + connect.WithSchema(bootServiceMethods.ByName("AbortReinstall")), + connect.WithHandlerOptions(opts...), + ) + return "/metalstack.infra.v2.BootService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + switch r.URL.Path { + case BootServiceDhcpProcedure: + bootServiceDhcpHandler.ServeHTTP(w, r) + case BootServiceBootProcedure: + bootServiceBootHandler.ServeHTTP(w, r) + case BootServiceSuperUserPasswordProcedure: + bootServiceSuperUserPasswordHandler.ServeHTTP(w, r) + case BootServiceRegisterProcedure: + bootServiceRegisterHandler.ServeHTTP(w, r) + case BootServiceWaitProcedure: + bootServiceWaitHandler.ServeHTTP(w, r) + case BootServiceReportProcedure: + bootServiceReportHandler.ServeHTTP(w, r) + case BootServiceAbortReinstallProcedure: + bootServiceAbortReinstallHandler.ServeHTTP(w, r) + default: + http.NotFound(w, r) + } + }) +} + +// UnimplementedBootServiceHandler returns CodeUnimplemented from all methods. +type UnimplementedBootServiceHandler struct{} + +func (UnimplementedBootServiceHandler) Dhcp(context.Context, *connect.Request[v2.BootServiceDhcpRequest]) (*connect.Response[v2.BootServiceDhcpResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("metalstack.infra.v2.BootService.Dhcp is not implemented")) +} + +func (UnimplementedBootServiceHandler) Boot(context.Context, *connect.Request[v2.BootServiceBootRequest]) (*connect.Response[v2.BootServiceBootResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("metalstack.infra.v2.BootService.Boot is not implemented")) +} + +func (UnimplementedBootServiceHandler) SuperUserPassword(context.Context, *connect.Request[v2.BootServiceSuperUserPasswordRequest]) (*connect.Response[v2.BootServiceSuperUserPasswordResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("metalstack.infra.v2.BootService.SuperUserPassword is not implemented")) +} + +func (UnimplementedBootServiceHandler) Register(context.Context, *connect.Request[v2.BootServiceRegisterRequest]) (*connect.Response[v2.BootServiceRegisterResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("metalstack.infra.v2.BootService.Register is not implemented")) +} + +func (UnimplementedBootServiceHandler) Wait(context.Context, *connect.Request[v2.BootServiceWaitRequest], *connect.ServerStream[v2.BootServiceWaitResponse]) error { + return connect.NewError(connect.CodeUnimplemented, errors.New("metalstack.infra.v2.BootService.Wait is not implemented")) +} + +func (UnimplementedBootServiceHandler) Report(context.Context, *connect.Request[v2.BootServiceReportRequest]) (*connect.Response[v2.BootServiceReportResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("metalstack.infra.v2.BootService.Report is not implemented")) +} + +func (UnimplementedBootServiceHandler) AbortReinstall(context.Context, *connect.Request[v2.BootServiceAbortReinstallRequest]) (*connect.Response[v2.BootServiceAbortReinstallResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("metalstack.infra.v2.BootService.AbortReinstall is not implemented")) +} diff --git a/go/permissions/permissions.go b/go/permissions/permissions.go index c12d57b5..d15ed1a8 100644 --- a/go/permissions/permissions.go +++ b/go/permissions/permissions.go @@ -19,6 +19,7 @@ type ( Admin map[string][]string Infra map[string][]string + Machine map[string][]string Tenant map[string][]string Project map[string][]string ) @@ -27,6 +28,7 @@ type ( type Roles struct { Admin Admin `json:"admin,omitempty"` Infra Infra `json:"infra,omitempty"` + Machine Machine `json:"Machine,omitempty"` Tenant Tenant `json:"tenant,omitempty"` Project Project `json:"project,omitempty"` } @@ -36,6 +38,7 @@ type Visibility struct { Self map[string]bool `json:"self,omitempty"` Admin map[string]bool `json:"admin,omitempty"` Infra map[string]bool `json:"infra,omitempty"` + Machine map[string]bool `json:"machine,omitempty"` Tenant map[string]bool `json:"tenant,omitempty"` Project map[string]bool `json:"project,omitempty"` } diff --git a/go/permissions/servicepermissions.go b/go/permissions/servicepermissions.go index 19738234..dcf4ff56 100755 --- a/go/permissions/servicepermissions.go +++ b/go/permissions/servicepermissions.go @@ -27,6 +27,7 @@ func GetServices() []string { "metalstack.api.v2.UserService", "metalstack.api.v2.VersionService", "metalstack.infra.v2.BMCService", + "metalstack.infra.v2.BootService", } } @@ -71,10 +72,30 @@ func GetServicePermissions() *ServicePermissions { }, Infra: Infra{ "INFRA_ROLE_EDITOR": []string{ - "/metalstack.infra.v2.BMCService/UpdateBMCInfo", + "/metalstack.infra.v2.BootService/Boot", }, "INFRA_ROLE_VIEWER": []string{ - "/metalstack.infra.v2.BMCService/UpdateBMCInfo", + "/metalstack.infra.v2.BootService/Boot", + }, + "MACHINE_ROLE_EDITOR": []string{ + "/metalstack.infra.v2.BootService/AbortReinstall", + }, + "MACHINE_ROLE_VIEWER": []string{ + "/metalstack.infra.v2.BootService/AbortReinstall", + }, + }, + Machine: Machine{ + "INFRA_ROLE_EDITOR": []string{ + "/metalstack.infra.v2.BootService/Boot", + }, + "INFRA_ROLE_VIEWER": []string{ + "/metalstack.infra.v2.BootService/Boot", + }, + "MACHINE_ROLE_EDITOR": []string{ + "/metalstack.infra.v2.BootService/AbortReinstall", + }, + "MACHINE_ROLE_VIEWER": []string{ + "/metalstack.infra.v2.BootService/AbortReinstall", }, }, Tenant: Tenant{ @@ -227,6 +248,13 @@ func GetServicePermissions() *ServicePermissions { "/metalstack.api.v2.UserService/Get": true, "/metalstack.api.v2.VersionService/Get": true, "/metalstack.infra.v2.BMCService/UpdateBMCInfo": true, + "/metalstack.infra.v2.BootService/AbortReinstall": true, + "/metalstack.infra.v2.BootService/Boot": true, + "/metalstack.infra.v2.BootService/Dhcp": true, + "/metalstack.infra.v2.BootService/Register": true, + "/metalstack.infra.v2.BootService/Report": true, + "/metalstack.infra.v2.BootService/SuperUserPassword": true, + "/metalstack.infra.v2.BootService/Wait": true, }, Visibility: Visibility{ Public: map[string]bool{ @@ -287,6 +315,15 @@ func GetServicePermissions() *ServicePermissions { }, Infra: map[string]bool{ "/metalstack.infra.v2.BMCService/UpdateBMCInfo": true, + "/metalstack.infra.v2.BootService/Boot": true, + "/metalstack.infra.v2.BootService/Dhcp": true, + }, + Machine: map[string]bool{ + "/metalstack.infra.v2.BootService/AbortReinstall": true, + "/metalstack.infra.v2.BootService/Register": true, + "/metalstack.infra.v2.BootService/Report": true, + "/metalstack.infra.v2.BootService/SuperUserPassword": true, + "/metalstack.infra.v2.BootService/Wait": true, }, Tenant: map[string]bool{ "/metalstack.api.v2.ProjectService/Create": true, @@ -399,6 +436,13 @@ func GetServicePermissions() *ServicePermissions { "/metalstack.api.v2.UserService/Get": true, "/metalstack.api.v2.VersionService/Get": false, "/metalstack.infra.v2.BMCService/UpdateBMCInfo": false, + "/metalstack.infra.v2.BootService/AbortReinstall": false, + "/metalstack.infra.v2.BootService/Boot": false, + "/metalstack.infra.v2.BootService/Dhcp": false, + "/metalstack.infra.v2.BootService/Register": false, + "/metalstack.infra.v2.BootService/Report": false, + "/metalstack.infra.v2.BootService/SuperUserPassword": false, + "/metalstack.infra.v2.BootService/Wait": false, }, } } @@ -423,6 +467,11 @@ func IsInfraScope(req connect.AnyRequest) bool { return ok } +func IsMachineScope(req connect.AnyRequest) bool { + _, ok := GetServicePermissions().Visibility.Machine[req.Spec().Procedure] + return ok +} + func IsTenantScope(req connect.AnyRequest) bool { _, ok := GetServicePermissions().Visibility.Tenant[req.Spec().Procedure] return ok @@ -459,3 +508,14 @@ func GetProjectFromRequest(req connect.AnyRequest) (string, bool) { } return "", false } + +func GetMachineIdFromRequest(req connect.AnyRequest) (string, bool) { + if !IsMachineScope(req) { + return "", false + } + switch rq := req.Any().(type) { + case interface{ GetUuid() string }: + return rq.GetUuid(), true + } + return "", false +} diff --git a/go/tests/api_scopes_test.go b/go/tests/api_scopes_test.go index 0ef34319..fe77c901 100644 --- a/go/tests/api_scopes_test.go +++ b/go/tests/api_scopes_test.go @@ -20,6 +20,7 @@ type ( project struct{} admin struct{} infra struct{} + machine struct{} visibility struct{} ) @@ -57,6 +58,14 @@ func (infra) Get(methodOpts []*descriptorpb.UninterpretedOption) (scopes []strin return } +func (machine) Get(methodOpts []*descriptorpb.UninterpretedOption) (scopes []string) { + scopes = getScopes(methodOpts, []string{ + v2.MachineRole_MACHINE_ROLE_EDITOR.String(), + v2.MachineRole_MACHINE_ROLE_VIEWER.String(), + }) + return +} + func (visibility) Get(methodOpts []*descriptorpb.UninterpretedOption) (scopes []string) { scopes = getScopes(methodOpts, []string{ v2.Visibility_VISIBILITY_PUBLIC.String(), @@ -110,10 +119,10 @@ func Test_APIScopes(t *testing.T) { errs := errors.Join( errors.New("api service method: \"/metalstack.api.v2.WrongProjectService/Get\" has apiv2.ProjectRole but request payload \"WrongProjectServiceGetRequest\" does not have a project field"), - errors.New("api service method: \"/metalstack.api.v2.WrongProjectService/List\" has no scope defined. one scope needs to be defined though. use one of the following scopes: [apiv2.AdminRole apiv2.InfraRole apiv2.ProjectRole apiv2.TenantRole apiv2.Visibility]"), + errors.New("api service method: \"/metalstack.api.v2.WrongProjectService/List\" has no scope defined. one scope needs to be defined though. use one of the following scopes: [apiv2.AdminRole apiv2.InfraRole apiv2.MachineRole apiv2.ProjectRole apiv2.TenantRole apiv2.Visibility]"), errors.New("api service method: \"/metalstack.api.v2.WrongProjectService/Update\" can not have apiv2.AdminRole ([ADMIN_ROLE_VIEWER]) and apiv2.ProjectRole ([PROJECT_ROLE_OWNER]) at the same time. only one scope is allowed."), errors.New("api service method: \"/metalstack.api.v2.WrongProjectService/Delete\" can not have apiv2.AdminRole ([ADMIN_ROLE_VIEWER]) and apiv2.Visibility ([VISIBILITY_PUBLIC]) at the same time. only one scope is allowed."), - errors.New("api service method: \"/metalstack.api.v2.WrongProjectService/Charge\" has no scope defined. one scope needs to be defined though. use one of the following scopes: [apiv2.AdminRole apiv2.InfraRole apiv2.ProjectRole apiv2.TenantRole apiv2.Visibility]"), + errors.New("api service method: \"/metalstack.api.v2.WrongProjectService/Charge\" has no scope defined. one scope needs to be defined though. use one of the following scopes: [apiv2.AdminRole apiv2.InfraRole apiv2.MachineRole apiv2.ProjectRole apiv2.TenantRole apiv2.Visibility]"), ) require.Equal(t, err, errs) @@ -125,17 +134,19 @@ func validateProto(root string) error { pr v2.ProjectRole ar v2.AdminRole ir v2.InfraRole + mr v2.MachineRole vr v2.Visibility trs = fmt.Sprintf("%T", tr) prs = fmt.Sprintf("%T", pr) ars = fmt.Sprintf("%T", ar) irs = fmt.Sprintf("%T", ir) + mrs = fmt.Sprintf("%T", mr) vrs = fmt.Sprintf("%T", vr) // add all *rs from above here scopeKeys = []string{ - trs, prs, ars, irs, vrs, + trs, prs, ars, irs, mrs, vrs, } ) slices.Sort(scopeKeys) @@ -161,6 +172,7 @@ func validateProto(root string) error { prs: project{}.Get(methodOpts), ars: admin{}.Get(methodOpts), irs: infra{}.Get(methodOpts), + mrs: machine{}.Get(methodOpts), vrs: visibility{}.Get(methodOpts), } allScopeNames = func() (names []string) { @@ -201,6 +213,24 @@ func validateProto(root string) error { errs = append(errs, fmt.Errorf("api service method: %q has %s but request payload %q does not have a project field", methodName, prs, projectRequest)) } } + if name == mrs && len(s) > 0 { + machineIdFound := false + machineRequest := "" + for _, mt := range fd.GetMessageType() { + if mt.GetName() != method.GetInputType() { + continue + } + for _, field := range mt.GetField() { + if field.GetName() == "uuid" { + machineIdFound = true + } + } + machineRequest = mt.GetName() + } + if !machineIdFound { + errs = append(errs, fmt.Errorf("api service method: %q has %s but request payload %q does not have a uuid field", methodName, mrs, machineRequest)) + } + } } if methodScope == "" { diff --git a/go/tests/mock_clients.go b/go/tests/mock_clients.go index 63f4732c..7dd7d090 100755 --- a/go/tests/mock_clients.go +++ b/go/tests/mock_clients.go @@ -80,11 +80,13 @@ type ( Version func(m *mock.Mock) } infrav2 struct { - bmcservice *infrav2mocks.BMCServiceClient + bmcservice *infrav2mocks.BMCServiceClient + bootservice *infrav2mocks.BootServiceClient } Infrav2MockFns struct { - BMC func(m *mock.Mock) + BMC func(m *mock.Mock) + Boot func(m *mock.Mock) } ) @@ -281,13 +283,17 @@ func (w wrapper) Infrav2(fns *Infrav2MockFns) *infrav2 { func newinfrav2(t *testing.T, fns *Infrav2MockFns) *infrav2 { a := &infrav2{ - bmcservice: infrav2mocks.NewBMCServiceClient(t), + bmcservice: infrav2mocks.NewBMCServiceClient(t), + bootservice: infrav2mocks.NewBootServiceClient(t), } if fns != nil { if fns.BMC != nil { fns.BMC(&a.bmcservice.Mock) } + if fns.Boot != nil { + fns.Boot(&a.bootservice.Mock) + } } @@ -297,3 +303,6 @@ func newinfrav2(t *testing.T, fns *Infrav2MockFns) *infrav2 { func (c *infrav2) BMC() infrav2connect.BMCServiceClient { return c.bmcservice } +func (c *infrav2) Boot() infrav2connect.BootServiceClient { + return c.bootservice +} diff --git a/go/tests/mocks/client/Adminv2.go b/go/tests/mocks/client/Adminv2.go index 03a39196..f79fdf15 100644 --- a/go/tests/mocks/client/Adminv2.go +++ b/go/tests/mocks/client/Adminv2.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.53.0. DO NOT EDIT. +// Code generated by mockery v2.53.4. DO NOT EDIT. package client diff --git a/go/tests/mocks/client/Apiv2.go b/go/tests/mocks/client/Apiv2.go index 31fc82ad..afd82fb4 100644 --- a/go/tests/mocks/client/Apiv2.go +++ b/go/tests/mocks/client/Apiv2.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.53.0. DO NOT EDIT. +// Code generated by mockery v2.53.4. DO NOT EDIT. package client diff --git a/go/tests/mocks/client/Client.go b/go/tests/mocks/client/Client.go index 295b1d45..1a766683 100644 --- a/go/tests/mocks/client/Client.go +++ b/go/tests/mocks/client/Client.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.53.0. DO NOT EDIT. +// Code generated by mockery v2.53.4. DO NOT EDIT. package client diff --git a/go/tests/mocks/client/Infrav2.go b/go/tests/mocks/client/Infrav2.go index c46330fb..0b35dc15 100644 --- a/go/tests/mocks/client/Infrav2.go +++ b/go/tests/mocks/client/Infrav2.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.53.0. DO NOT EDIT. +// Code generated by mockery v2.53.4. DO NOT EDIT. package client @@ -32,6 +32,26 @@ func (_m *Infrav2) BMC() infrav2connect.BMCServiceClient { return r0 } +// Boot provides a mock function with no fields +func (_m *Infrav2) Boot() infrav2connect.BootServiceClient { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Boot") + } + + var r0 infrav2connect.BootServiceClient + if rf, ok := ret.Get(0).(func() infrav2connect.BootServiceClient); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(infrav2connect.BootServiceClient) + } + } + + return r0 +} + // NewInfrav2 creates a new instance of Infrav2. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewInfrav2(t interface { diff --git a/go/tests/mocks/metalstack/admin/v2/adminv2connect/FilesystemServiceClient.go b/go/tests/mocks/metalstack/admin/v2/adminv2connect/FilesystemServiceClient.go index b91984b1..c3efbdcf 100644 --- a/go/tests/mocks/metalstack/admin/v2/adminv2connect/FilesystemServiceClient.go +++ b/go/tests/mocks/metalstack/admin/v2/adminv2connect/FilesystemServiceClient.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.53.0. DO NOT EDIT. +// Code generated by mockery v2.53.4. DO NOT EDIT. package adminv2connect diff --git a/go/tests/mocks/metalstack/admin/v2/adminv2connect/FilesystemServiceHandler.go b/go/tests/mocks/metalstack/admin/v2/adminv2connect/FilesystemServiceHandler.go index af6eb88a..da04fcd7 100644 --- a/go/tests/mocks/metalstack/admin/v2/adminv2connect/FilesystemServiceHandler.go +++ b/go/tests/mocks/metalstack/admin/v2/adminv2connect/FilesystemServiceHandler.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.53.0. DO NOT EDIT. +// Code generated by mockery v2.53.4. DO NOT EDIT. package adminv2connect diff --git a/go/tests/mocks/metalstack/admin/v2/adminv2connect/IPServiceClient.go b/go/tests/mocks/metalstack/admin/v2/adminv2connect/IPServiceClient.go index cc86963e..150584a0 100644 --- a/go/tests/mocks/metalstack/admin/v2/adminv2connect/IPServiceClient.go +++ b/go/tests/mocks/metalstack/admin/v2/adminv2connect/IPServiceClient.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.53.0. DO NOT EDIT. +// Code generated by mockery v2.53.4. DO NOT EDIT. package adminv2connect diff --git a/go/tests/mocks/metalstack/admin/v2/adminv2connect/IPServiceHandler.go b/go/tests/mocks/metalstack/admin/v2/adminv2connect/IPServiceHandler.go index 50dfe203..08fc6223 100644 --- a/go/tests/mocks/metalstack/admin/v2/adminv2connect/IPServiceHandler.go +++ b/go/tests/mocks/metalstack/admin/v2/adminv2connect/IPServiceHandler.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.53.0. DO NOT EDIT. +// Code generated by mockery v2.53.4. DO NOT EDIT. package adminv2connect diff --git a/go/tests/mocks/metalstack/admin/v2/adminv2connect/ImageServiceClient.go b/go/tests/mocks/metalstack/admin/v2/adminv2connect/ImageServiceClient.go index 2a16e9fb..872f4c3d 100644 --- a/go/tests/mocks/metalstack/admin/v2/adminv2connect/ImageServiceClient.go +++ b/go/tests/mocks/metalstack/admin/v2/adminv2connect/ImageServiceClient.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.53.0. DO NOT EDIT. +// Code generated by mockery v2.53.4. DO NOT EDIT. package adminv2connect diff --git a/go/tests/mocks/metalstack/admin/v2/adminv2connect/ImageServiceHandler.go b/go/tests/mocks/metalstack/admin/v2/adminv2connect/ImageServiceHandler.go index 884ce158..a8706cdd 100644 --- a/go/tests/mocks/metalstack/admin/v2/adminv2connect/ImageServiceHandler.go +++ b/go/tests/mocks/metalstack/admin/v2/adminv2connect/ImageServiceHandler.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.53.0. DO NOT EDIT. +// Code generated by mockery v2.53.4. DO NOT EDIT. package adminv2connect diff --git a/go/tests/mocks/metalstack/admin/v2/adminv2connect/NetworkServiceClient.go b/go/tests/mocks/metalstack/admin/v2/adminv2connect/NetworkServiceClient.go index 82473888..5e643404 100644 --- a/go/tests/mocks/metalstack/admin/v2/adminv2connect/NetworkServiceClient.go +++ b/go/tests/mocks/metalstack/admin/v2/adminv2connect/NetworkServiceClient.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.53.0. DO NOT EDIT. +// Code generated by mockery v2.53.4. DO NOT EDIT. package adminv2connect diff --git a/go/tests/mocks/metalstack/admin/v2/adminv2connect/NetworkServiceHandler.go b/go/tests/mocks/metalstack/admin/v2/adminv2connect/NetworkServiceHandler.go index 11144f0b..1a31a64a 100644 --- a/go/tests/mocks/metalstack/admin/v2/adminv2connect/NetworkServiceHandler.go +++ b/go/tests/mocks/metalstack/admin/v2/adminv2connect/NetworkServiceHandler.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.53.0. DO NOT EDIT. +// Code generated by mockery v2.53.4. DO NOT EDIT. package adminv2connect diff --git a/go/tests/mocks/metalstack/admin/v2/adminv2connect/PartitionServiceClient.go b/go/tests/mocks/metalstack/admin/v2/adminv2connect/PartitionServiceClient.go index efc581d1..5ab21770 100644 --- a/go/tests/mocks/metalstack/admin/v2/adminv2connect/PartitionServiceClient.go +++ b/go/tests/mocks/metalstack/admin/v2/adminv2connect/PartitionServiceClient.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.53.0. DO NOT EDIT. +// Code generated by mockery v2.53.4. DO NOT EDIT. package adminv2connect diff --git a/go/tests/mocks/metalstack/admin/v2/adminv2connect/PartitionServiceHandler.go b/go/tests/mocks/metalstack/admin/v2/adminv2connect/PartitionServiceHandler.go index 30e8d5a2..261fc47c 100644 --- a/go/tests/mocks/metalstack/admin/v2/adminv2connect/PartitionServiceHandler.go +++ b/go/tests/mocks/metalstack/admin/v2/adminv2connect/PartitionServiceHandler.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.53.0. DO NOT EDIT. +// Code generated by mockery v2.53.4. DO NOT EDIT. package adminv2connect diff --git a/go/tests/mocks/metalstack/admin/v2/adminv2connect/TenantServiceClient.go b/go/tests/mocks/metalstack/admin/v2/adminv2connect/TenantServiceClient.go index 8654f67f..de2aa2dc 100644 --- a/go/tests/mocks/metalstack/admin/v2/adminv2connect/TenantServiceClient.go +++ b/go/tests/mocks/metalstack/admin/v2/adminv2connect/TenantServiceClient.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.53.0. DO NOT EDIT. +// Code generated by mockery v2.53.4. DO NOT EDIT. package adminv2connect diff --git a/go/tests/mocks/metalstack/admin/v2/adminv2connect/TenantServiceHandler.go b/go/tests/mocks/metalstack/admin/v2/adminv2connect/TenantServiceHandler.go index dc40c140..743fe688 100644 --- a/go/tests/mocks/metalstack/admin/v2/adminv2connect/TenantServiceHandler.go +++ b/go/tests/mocks/metalstack/admin/v2/adminv2connect/TenantServiceHandler.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.53.0. DO NOT EDIT. +// Code generated by mockery v2.53.4. DO NOT EDIT. package adminv2connect diff --git a/go/tests/mocks/metalstack/admin/v2/adminv2connect/TokenServiceClient.go b/go/tests/mocks/metalstack/admin/v2/adminv2connect/TokenServiceClient.go index 44a810c3..e89a8672 100644 --- a/go/tests/mocks/metalstack/admin/v2/adminv2connect/TokenServiceClient.go +++ b/go/tests/mocks/metalstack/admin/v2/adminv2connect/TokenServiceClient.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.53.0. DO NOT EDIT. +// Code generated by mockery v2.53.4. DO NOT EDIT. package adminv2connect diff --git a/go/tests/mocks/metalstack/admin/v2/adminv2connect/TokenServiceHandler.go b/go/tests/mocks/metalstack/admin/v2/adminv2connect/TokenServiceHandler.go index 113369f8..d5c252a6 100644 --- a/go/tests/mocks/metalstack/admin/v2/adminv2connect/TokenServiceHandler.go +++ b/go/tests/mocks/metalstack/admin/v2/adminv2connect/TokenServiceHandler.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.53.0. DO NOT EDIT. +// Code generated by mockery v2.53.4. DO NOT EDIT. package adminv2connect diff --git a/go/tests/mocks/metalstack/api/v2/apiv2connect/FilesystemServiceClient.go b/go/tests/mocks/metalstack/api/v2/apiv2connect/FilesystemServiceClient.go index 5729b305..9fa5eb45 100644 --- a/go/tests/mocks/metalstack/api/v2/apiv2connect/FilesystemServiceClient.go +++ b/go/tests/mocks/metalstack/api/v2/apiv2connect/FilesystemServiceClient.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.53.0. DO NOT EDIT. +// Code generated by mockery v2.53.4. DO NOT EDIT. package apiv2connect diff --git a/go/tests/mocks/metalstack/api/v2/apiv2connect/FilesystemServiceHandler.go b/go/tests/mocks/metalstack/api/v2/apiv2connect/FilesystemServiceHandler.go index 2a92a750..d058ebd9 100644 --- a/go/tests/mocks/metalstack/api/v2/apiv2connect/FilesystemServiceHandler.go +++ b/go/tests/mocks/metalstack/api/v2/apiv2connect/FilesystemServiceHandler.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.53.0. DO NOT EDIT. +// Code generated by mockery v2.53.4. DO NOT EDIT. package apiv2connect diff --git a/go/tests/mocks/metalstack/api/v2/apiv2connect/HealthServiceClient.go b/go/tests/mocks/metalstack/api/v2/apiv2connect/HealthServiceClient.go index d197e3b3..c50f3004 100644 --- a/go/tests/mocks/metalstack/api/v2/apiv2connect/HealthServiceClient.go +++ b/go/tests/mocks/metalstack/api/v2/apiv2connect/HealthServiceClient.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.53.0. DO NOT EDIT. +// Code generated by mockery v2.53.4. DO NOT EDIT. package apiv2connect diff --git a/go/tests/mocks/metalstack/api/v2/apiv2connect/HealthServiceHandler.go b/go/tests/mocks/metalstack/api/v2/apiv2connect/HealthServiceHandler.go index 1d970b79..557e22d8 100644 --- a/go/tests/mocks/metalstack/api/v2/apiv2connect/HealthServiceHandler.go +++ b/go/tests/mocks/metalstack/api/v2/apiv2connect/HealthServiceHandler.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.53.0. DO NOT EDIT. +// Code generated by mockery v2.53.4. DO NOT EDIT. package apiv2connect diff --git a/go/tests/mocks/metalstack/api/v2/apiv2connect/IPServiceClient.go b/go/tests/mocks/metalstack/api/v2/apiv2connect/IPServiceClient.go index 98e21ffb..175594aa 100644 --- a/go/tests/mocks/metalstack/api/v2/apiv2connect/IPServiceClient.go +++ b/go/tests/mocks/metalstack/api/v2/apiv2connect/IPServiceClient.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.53.0. DO NOT EDIT. +// Code generated by mockery v2.53.4. DO NOT EDIT. package apiv2connect diff --git a/go/tests/mocks/metalstack/api/v2/apiv2connect/IPServiceHandler.go b/go/tests/mocks/metalstack/api/v2/apiv2connect/IPServiceHandler.go index 51a48baa..eed6df02 100644 --- a/go/tests/mocks/metalstack/api/v2/apiv2connect/IPServiceHandler.go +++ b/go/tests/mocks/metalstack/api/v2/apiv2connect/IPServiceHandler.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.53.0. DO NOT EDIT. +// Code generated by mockery v2.53.4. DO NOT EDIT. package apiv2connect diff --git a/go/tests/mocks/metalstack/api/v2/apiv2connect/ImageServiceClient.go b/go/tests/mocks/metalstack/api/v2/apiv2connect/ImageServiceClient.go index 143fde35..58474168 100644 --- a/go/tests/mocks/metalstack/api/v2/apiv2connect/ImageServiceClient.go +++ b/go/tests/mocks/metalstack/api/v2/apiv2connect/ImageServiceClient.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.53.0. DO NOT EDIT. +// Code generated by mockery v2.53.4. DO NOT EDIT. package apiv2connect diff --git a/go/tests/mocks/metalstack/api/v2/apiv2connect/ImageServiceHandler.go b/go/tests/mocks/metalstack/api/v2/apiv2connect/ImageServiceHandler.go index 1456f3ea..516de5a0 100644 --- a/go/tests/mocks/metalstack/api/v2/apiv2connect/ImageServiceHandler.go +++ b/go/tests/mocks/metalstack/api/v2/apiv2connect/ImageServiceHandler.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.53.0. DO NOT EDIT. +// Code generated by mockery v2.53.4. DO NOT EDIT. package apiv2connect diff --git a/go/tests/mocks/metalstack/api/v2/apiv2connect/MethodServiceClient.go b/go/tests/mocks/metalstack/api/v2/apiv2connect/MethodServiceClient.go index 2c90f81a..4e7380e2 100644 --- a/go/tests/mocks/metalstack/api/v2/apiv2connect/MethodServiceClient.go +++ b/go/tests/mocks/metalstack/api/v2/apiv2connect/MethodServiceClient.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.53.0. DO NOT EDIT. +// Code generated by mockery v2.53.4. DO NOT EDIT. package apiv2connect diff --git a/go/tests/mocks/metalstack/api/v2/apiv2connect/MethodServiceHandler.go b/go/tests/mocks/metalstack/api/v2/apiv2connect/MethodServiceHandler.go index 42444802..ecd6b220 100644 --- a/go/tests/mocks/metalstack/api/v2/apiv2connect/MethodServiceHandler.go +++ b/go/tests/mocks/metalstack/api/v2/apiv2connect/MethodServiceHandler.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.53.0. DO NOT EDIT. +// Code generated by mockery v2.53.4. DO NOT EDIT. package apiv2connect diff --git a/go/tests/mocks/metalstack/api/v2/apiv2connect/NetworkServiceClient.go b/go/tests/mocks/metalstack/api/v2/apiv2connect/NetworkServiceClient.go index fa234474..55d0da54 100644 --- a/go/tests/mocks/metalstack/api/v2/apiv2connect/NetworkServiceClient.go +++ b/go/tests/mocks/metalstack/api/v2/apiv2connect/NetworkServiceClient.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.53.0. DO NOT EDIT. +// Code generated by mockery v2.53.4. DO NOT EDIT. package apiv2connect diff --git a/go/tests/mocks/metalstack/api/v2/apiv2connect/NetworkServiceHandler.go b/go/tests/mocks/metalstack/api/v2/apiv2connect/NetworkServiceHandler.go index da2e6c55..4ad91b0a 100644 --- a/go/tests/mocks/metalstack/api/v2/apiv2connect/NetworkServiceHandler.go +++ b/go/tests/mocks/metalstack/api/v2/apiv2connect/NetworkServiceHandler.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.53.0. DO NOT EDIT. +// Code generated by mockery v2.53.4. DO NOT EDIT. package apiv2connect diff --git a/go/tests/mocks/metalstack/api/v2/apiv2connect/PartitionServiceClient.go b/go/tests/mocks/metalstack/api/v2/apiv2connect/PartitionServiceClient.go index 78ff78de..159152c3 100644 --- a/go/tests/mocks/metalstack/api/v2/apiv2connect/PartitionServiceClient.go +++ b/go/tests/mocks/metalstack/api/v2/apiv2connect/PartitionServiceClient.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.53.0. DO NOT EDIT. +// Code generated by mockery v2.53.4. DO NOT EDIT. package apiv2connect diff --git a/go/tests/mocks/metalstack/api/v2/apiv2connect/PartitionServiceHandler.go b/go/tests/mocks/metalstack/api/v2/apiv2connect/PartitionServiceHandler.go index 7bcf7a32..b721808f 100644 --- a/go/tests/mocks/metalstack/api/v2/apiv2connect/PartitionServiceHandler.go +++ b/go/tests/mocks/metalstack/api/v2/apiv2connect/PartitionServiceHandler.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.53.0. DO NOT EDIT. +// Code generated by mockery v2.53.4. DO NOT EDIT. package apiv2connect diff --git a/go/tests/mocks/metalstack/api/v2/apiv2connect/ProjectServiceClient.go b/go/tests/mocks/metalstack/api/v2/apiv2connect/ProjectServiceClient.go index aaebef4e..a7a5fce2 100644 --- a/go/tests/mocks/metalstack/api/v2/apiv2connect/ProjectServiceClient.go +++ b/go/tests/mocks/metalstack/api/v2/apiv2connect/ProjectServiceClient.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.53.0. DO NOT EDIT. +// Code generated by mockery v2.53.4. DO NOT EDIT. package apiv2connect diff --git a/go/tests/mocks/metalstack/api/v2/apiv2connect/ProjectServiceHandler.go b/go/tests/mocks/metalstack/api/v2/apiv2connect/ProjectServiceHandler.go index b8ee45bb..503647af 100644 --- a/go/tests/mocks/metalstack/api/v2/apiv2connect/ProjectServiceHandler.go +++ b/go/tests/mocks/metalstack/api/v2/apiv2connect/ProjectServiceHandler.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.53.0. DO NOT EDIT. +// Code generated by mockery v2.53.4. DO NOT EDIT. package apiv2connect diff --git a/go/tests/mocks/metalstack/api/v2/apiv2connect/TenantServiceClient.go b/go/tests/mocks/metalstack/api/v2/apiv2connect/TenantServiceClient.go index d9774840..aa3de7c8 100644 --- a/go/tests/mocks/metalstack/api/v2/apiv2connect/TenantServiceClient.go +++ b/go/tests/mocks/metalstack/api/v2/apiv2connect/TenantServiceClient.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.53.0. DO NOT EDIT. +// Code generated by mockery v2.53.4. DO NOT EDIT. package apiv2connect diff --git a/go/tests/mocks/metalstack/api/v2/apiv2connect/TenantServiceHandler.go b/go/tests/mocks/metalstack/api/v2/apiv2connect/TenantServiceHandler.go index 8d4339fe..ef75156e 100644 --- a/go/tests/mocks/metalstack/api/v2/apiv2connect/TenantServiceHandler.go +++ b/go/tests/mocks/metalstack/api/v2/apiv2connect/TenantServiceHandler.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.53.0. DO NOT EDIT. +// Code generated by mockery v2.53.4. DO NOT EDIT. package apiv2connect diff --git a/go/tests/mocks/metalstack/api/v2/apiv2connect/TokenServiceClient.go b/go/tests/mocks/metalstack/api/v2/apiv2connect/TokenServiceClient.go index 43aa9f98..b8209264 100644 --- a/go/tests/mocks/metalstack/api/v2/apiv2connect/TokenServiceClient.go +++ b/go/tests/mocks/metalstack/api/v2/apiv2connect/TokenServiceClient.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.53.0. DO NOT EDIT. +// Code generated by mockery v2.53.4. DO NOT EDIT. package apiv2connect diff --git a/go/tests/mocks/metalstack/api/v2/apiv2connect/TokenServiceHandler.go b/go/tests/mocks/metalstack/api/v2/apiv2connect/TokenServiceHandler.go index c39d9940..443b13df 100644 --- a/go/tests/mocks/metalstack/api/v2/apiv2connect/TokenServiceHandler.go +++ b/go/tests/mocks/metalstack/api/v2/apiv2connect/TokenServiceHandler.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.53.0. DO NOT EDIT. +// Code generated by mockery v2.53.4. DO NOT EDIT. package apiv2connect diff --git a/go/tests/mocks/metalstack/api/v2/apiv2connect/UserServiceClient.go b/go/tests/mocks/metalstack/api/v2/apiv2connect/UserServiceClient.go index aebf3e77..8dd1bda6 100644 --- a/go/tests/mocks/metalstack/api/v2/apiv2connect/UserServiceClient.go +++ b/go/tests/mocks/metalstack/api/v2/apiv2connect/UserServiceClient.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.53.0. DO NOT EDIT. +// Code generated by mockery v2.53.4. DO NOT EDIT. package apiv2connect diff --git a/go/tests/mocks/metalstack/api/v2/apiv2connect/UserServiceHandler.go b/go/tests/mocks/metalstack/api/v2/apiv2connect/UserServiceHandler.go index 34e000fe..98840f6d 100644 --- a/go/tests/mocks/metalstack/api/v2/apiv2connect/UserServiceHandler.go +++ b/go/tests/mocks/metalstack/api/v2/apiv2connect/UserServiceHandler.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.53.0. DO NOT EDIT. +// Code generated by mockery v2.53.4. DO NOT EDIT. package apiv2connect diff --git a/go/tests/mocks/metalstack/api/v2/apiv2connect/VersionServiceClient.go b/go/tests/mocks/metalstack/api/v2/apiv2connect/VersionServiceClient.go index 8a8c9b5e..91f4f45f 100644 --- a/go/tests/mocks/metalstack/api/v2/apiv2connect/VersionServiceClient.go +++ b/go/tests/mocks/metalstack/api/v2/apiv2connect/VersionServiceClient.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.53.0. DO NOT EDIT. +// Code generated by mockery v2.53.4. DO NOT EDIT. package apiv2connect diff --git a/go/tests/mocks/metalstack/api/v2/apiv2connect/VersionServiceHandler.go b/go/tests/mocks/metalstack/api/v2/apiv2connect/VersionServiceHandler.go index a6e73276..5ffce0c5 100644 --- a/go/tests/mocks/metalstack/api/v2/apiv2connect/VersionServiceHandler.go +++ b/go/tests/mocks/metalstack/api/v2/apiv2connect/VersionServiceHandler.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.53.0. DO NOT EDIT. +// Code generated by mockery v2.53.4. DO NOT EDIT. package apiv2connect diff --git a/go/tests/mocks/metalstack/infra/v2/infrav2connect/BMCServiceClient.go b/go/tests/mocks/metalstack/infra/v2/infrav2connect/BMCServiceClient.go index 6a85a979..75280ce2 100644 --- a/go/tests/mocks/metalstack/infra/v2/infrav2connect/BMCServiceClient.go +++ b/go/tests/mocks/metalstack/infra/v2/infrav2connect/BMCServiceClient.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.53.0. DO NOT EDIT. +// Code generated by mockery v2.53.4. DO NOT EDIT. package infrav2connect diff --git a/go/tests/mocks/metalstack/infra/v2/infrav2connect/BMCServiceHandler.go b/go/tests/mocks/metalstack/infra/v2/infrav2connect/BMCServiceHandler.go index a3f3adc0..e04e5675 100644 --- a/go/tests/mocks/metalstack/infra/v2/infrav2connect/BMCServiceHandler.go +++ b/go/tests/mocks/metalstack/infra/v2/infrav2connect/BMCServiceHandler.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.53.0. DO NOT EDIT. +// Code generated by mockery v2.53.4. DO NOT EDIT. package infrav2connect diff --git a/go/tests/mocks/metalstack/infra/v2/infrav2connect/BootServiceClient.go b/go/tests/mocks/metalstack/infra/v2/infrav2connect/BootServiceClient.go new file mode 100644 index 00000000..6f68f31c --- /dev/null +++ b/go/tests/mocks/metalstack/infra/v2/infrav2connect/BootServiceClient.go @@ -0,0 +1,242 @@ +// Code generated by mockery v2.53.4. DO NOT EDIT. + +package infrav2connect + +import ( + context "context" + + connect "connectrpc.com/connect" + + infrav2 "github.com/metal-stack/api/go/metalstack/infra/v2" + + mock "github.com/stretchr/testify/mock" +) + +// BootServiceClient is an autogenerated mock type for the BootServiceClient type +type BootServiceClient struct { + mock.Mock +} + +// AbortReinstall provides a mock function with given fields: _a0, _a1 +func (_m *BootServiceClient) AbortReinstall(_a0 context.Context, _a1 *connect.Request[infrav2.BootServiceAbortReinstallRequest]) (*connect.Response[infrav2.BootServiceAbortReinstallResponse], error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for AbortReinstall") + } + + var r0 *connect.Response[infrav2.BootServiceAbortReinstallResponse] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.BootServiceAbortReinstallRequest]) (*connect.Response[infrav2.BootServiceAbortReinstallResponse], error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.BootServiceAbortReinstallRequest]) *connect.Response[infrav2.BootServiceAbortReinstallResponse]); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.Response[infrav2.BootServiceAbortReinstallResponse]) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[infrav2.BootServiceAbortReinstallRequest]) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Boot provides a mock function with given fields: _a0, _a1 +func (_m *BootServiceClient) Boot(_a0 context.Context, _a1 *connect.Request[infrav2.BootServiceBootRequest]) (*connect.Response[infrav2.BootServiceBootResponse], error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for Boot") + } + + var r0 *connect.Response[infrav2.BootServiceBootResponse] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.BootServiceBootRequest]) (*connect.Response[infrav2.BootServiceBootResponse], error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.BootServiceBootRequest]) *connect.Response[infrav2.BootServiceBootResponse]); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.Response[infrav2.BootServiceBootResponse]) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[infrav2.BootServiceBootRequest]) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Dhcp provides a mock function with given fields: _a0, _a1 +func (_m *BootServiceClient) Dhcp(_a0 context.Context, _a1 *connect.Request[infrav2.BootServiceDhcpRequest]) (*connect.Response[infrav2.BootServiceDhcpResponse], error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for Dhcp") + } + + var r0 *connect.Response[infrav2.BootServiceDhcpResponse] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.BootServiceDhcpRequest]) (*connect.Response[infrav2.BootServiceDhcpResponse], error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.BootServiceDhcpRequest]) *connect.Response[infrav2.BootServiceDhcpResponse]); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.Response[infrav2.BootServiceDhcpResponse]) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[infrav2.BootServiceDhcpRequest]) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Register provides a mock function with given fields: _a0, _a1 +func (_m *BootServiceClient) Register(_a0 context.Context, _a1 *connect.Request[infrav2.BootServiceRegisterRequest]) (*connect.Response[infrav2.BootServiceRegisterResponse], error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for Register") + } + + var r0 *connect.Response[infrav2.BootServiceRegisterResponse] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.BootServiceRegisterRequest]) (*connect.Response[infrav2.BootServiceRegisterResponse], error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.BootServiceRegisterRequest]) *connect.Response[infrav2.BootServiceRegisterResponse]); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.Response[infrav2.BootServiceRegisterResponse]) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[infrav2.BootServiceRegisterRequest]) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Report provides a mock function with given fields: _a0, _a1 +func (_m *BootServiceClient) Report(_a0 context.Context, _a1 *connect.Request[infrav2.BootServiceReportRequest]) (*connect.Response[infrav2.BootServiceReportResponse], error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for Report") + } + + var r0 *connect.Response[infrav2.BootServiceReportResponse] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.BootServiceReportRequest]) (*connect.Response[infrav2.BootServiceReportResponse], error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.BootServiceReportRequest]) *connect.Response[infrav2.BootServiceReportResponse]); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.Response[infrav2.BootServiceReportResponse]) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[infrav2.BootServiceReportRequest]) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// SuperUserPassword provides a mock function with given fields: _a0, _a1 +func (_m *BootServiceClient) SuperUserPassword(_a0 context.Context, _a1 *connect.Request[infrav2.BootServiceSuperUserPasswordRequest]) (*connect.Response[infrav2.BootServiceSuperUserPasswordResponse], error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for SuperUserPassword") + } + + var r0 *connect.Response[infrav2.BootServiceSuperUserPasswordResponse] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.BootServiceSuperUserPasswordRequest]) (*connect.Response[infrav2.BootServiceSuperUserPasswordResponse], error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.BootServiceSuperUserPasswordRequest]) *connect.Response[infrav2.BootServiceSuperUserPasswordResponse]); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.Response[infrav2.BootServiceSuperUserPasswordResponse]) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[infrav2.BootServiceSuperUserPasswordRequest]) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Wait provides a mock function with given fields: _a0, _a1 +func (_m *BootServiceClient) Wait(_a0 context.Context, _a1 *connect.Request[infrav2.BootServiceWaitRequest]) (*connect.ServerStreamForClient[infrav2.BootServiceWaitResponse], error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for Wait") + } + + var r0 *connect.ServerStreamForClient[infrav2.BootServiceWaitResponse] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.BootServiceWaitRequest]) (*connect.ServerStreamForClient[infrav2.BootServiceWaitResponse], error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.BootServiceWaitRequest]) *connect.ServerStreamForClient[infrav2.BootServiceWaitResponse]); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.ServerStreamForClient[infrav2.BootServiceWaitResponse]) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[infrav2.BootServiceWaitRequest]) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// NewBootServiceClient creates a new instance of BootServiceClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewBootServiceClient(t interface { + mock.TestingT + Cleanup(func()) +}) *BootServiceClient { + mock := &BootServiceClient{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/go/tests/mocks/metalstack/infra/v2/infrav2connect/BootServiceHandler.go b/go/tests/mocks/metalstack/infra/v2/infrav2connect/BootServiceHandler.go new file mode 100644 index 00000000..e664abf2 --- /dev/null +++ b/go/tests/mocks/metalstack/infra/v2/infrav2connect/BootServiceHandler.go @@ -0,0 +1,230 @@ +// Code generated by mockery v2.53.4. DO NOT EDIT. + +package infrav2connect + +import ( + context "context" + + connect "connectrpc.com/connect" + + infrav2 "github.com/metal-stack/api/go/metalstack/infra/v2" + + mock "github.com/stretchr/testify/mock" +) + +// BootServiceHandler is an autogenerated mock type for the BootServiceHandler type +type BootServiceHandler struct { + mock.Mock +} + +// AbortReinstall provides a mock function with given fields: _a0, _a1 +func (_m *BootServiceHandler) AbortReinstall(_a0 context.Context, _a1 *connect.Request[infrav2.BootServiceAbortReinstallRequest]) (*connect.Response[infrav2.BootServiceAbortReinstallResponse], error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for AbortReinstall") + } + + var r0 *connect.Response[infrav2.BootServiceAbortReinstallResponse] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.BootServiceAbortReinstallRequest]) (*connect.Response[infrav2.BootServiceAbortReinstallResponse], error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.BootServiceAbortReinstallRequest]) *connect.Response[infrav2.BootServiceAbortReinstallResponse]); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.Response[infrav2.BootServiceAbortReinstallResponse]) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[infrav2.BootServiceAbortReinstallRequest]) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Boot provides a mock function with given fields: _a0, _a1 +func (_m *BootServiceHandler) Boot(_a0 context.Context, _a1 *connect.Request[infrav2.BootServiceBootRequest]) (*connect.Response[infrav2.BootServiceBootResponse], error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for Boot") + } + + var r0 *connect.Response[infrav2.BootServiceBootResponse] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.BootServiceBootRequest]) (*connect.Response[infrav2.BootServiceBootResponse], error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.BootServiceBootRequest]) *connect.Response[infrav2.BootServiceBootResponse]); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.Response[infrav2.BootServiceBootResponse]) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[infrav2.BootServiceBootRequest]) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Dhcp provides a mock function with given fields: _a0, _a1 +func (_m *BootServiceHandler) Dhcp(_a0 context.Context, _a1 *connect.Request[infrav2.BootServiceDhcpRequest]) (*connect.Response[infrav2.BootServiceDhcpResponse], error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for Dhcp") + } + + var r0 *connect.Response[infrav2.BootServiceDhcpResponse] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.BootServiceDhcpRequest]) (*connect.Response[infrav2.BootServiceDhcpResponse], error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.BootServiceDhcpRequest]) *connect.Response[infrav2.BootServiceDhcpResponse]); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.Response[infrav2.BootServiceDhcpResponse]) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[infrav2.BootServiceDhcpRequest]) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Register provides a mock function with given fields: _a0, _a1 +func (_m *BootServiceHandler) Register(_a0 context.Context, _a1 *connect.Request[infrav2.BootServiceRegisterRequest]) (*connect.Response[infrav2.BootServiceRegisterResponse], error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for Register") + } + + var r0 *connect.Response[infrav2.BootServiceRegisterResponse] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.BootServiceRegisterRequest]) (*connect.Response[infrav2.BootServiceRegisterResponse], error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.BootServiceRegisterRequest]) *connect.Response[infrav2.BootServiceRegisterResponse]); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.Response[infrav2.BootServiceRegisterResponse]) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[infrav2.BootServiceRegisterRequest]) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Report provides a mock function with given fields: _a0, _a1 +func (_m *BootServiceHandler) Report(_a0 context.Context, _a1 *connect.Request[infrav2.BootServiceReportRequest]) (*connect.Response[infrav2.BootServiceReportResponse], error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for Report") + } + + var r0 *connect.Response[infrav2.BootServiceReportResponse] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.BootServiceReportRequest]) (*connect.Response[infrav2.BootServiceReportResponse], error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.BootServiceReportRequest]) *connect.Response[infrav2.BootServiceReportResponse]); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.Response[infrav2.BootServiceReportResponse]) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[infrav2.BootServiceReportRequest]) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// SuperUserPassword provides a mock function with given fields: _a0, _a1 +func (_m *BootServiceHandler) SuperUserPassword(_a0 context.Context, _a1 *connect.Request[infrav2.BootServiceSuperUserPasswordRequest]) (*connect.Response[infrav2.BootServiceSuperUserPasswordResponse], error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for SuperUserPassword") + } + + var r0 *connect.Response[infrav2.BootServiceSuperUserPasswordResponse] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.BootServiceSuperUserPasswordRequest]) (*connect.Response[infrav2.BootServiceSuperUserPasswordResponse], error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.BootServiceSuperUserPasswordRequest]) *connect.Response[infrav2.BootServiceSuperUserPasswordResponse]); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.Response[infrav2.BootServiceSuperUserPasswordResponse]) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[infrav2.BootServiceSuperUserPasswordRequest]) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Wait provides a mock function with given fields: _a0, _a1, _a2 +func (_m *BootServiceHandler) Wait(_a0 context.Context, _a1 *connect.Request[infrav2.BootServiceWaitRequest], _a2 *connect.ServerStream[infrav2.BootServiceWaitResponse]) error { + ret := _m.Called(_a0, _a1, _a2) + + if len(ret) == 0 { + panic("no return value specified for Wait") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.BootServiceWaitRequest], *connect.ServerStream[infrav2.BootServiceWaitResponse]) error); ok { + r0 = rf(_a0, _a1, _a2) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// NewBootServiceHandler creates a new instance of BootServiceHandler. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewBootServiceHandler(t interface { + mock.TestingT + Cleanup(func()) +}) *BootServiceHandler { + mock := &BootServiceHandler{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/proto/metalstack/api/v2/common.proto b/proto/metalstack/api/v2/common.proto index a3841d86..3549e2d8 100644 --- a/proto/metalstack/api/v2/common.proto +++ b/proto/metalstack/api/v2/common.proto @@ -54,6 +54,16 @@ enum InfraRole { INFRA_ROLE_VIEWER = 2; } +// MachineRole specifies what role a microservice needs to call this machine service +enum MachineRole { + // MACHINE_ROLE_UNSPECIFIED is not specified + MACHINE_ROLE_UNSPECIFIED = 0; + // MACHINE_ROLE_EDITOR a microservice needs at least editor role to call this method + MACHINE_ROLE_EDITOR = 1; + // MACHINE_ROLE_VIEWER a microservice needs at least viewer role to call this method + MACHINE_ROLE_VIEWER = 2; +} + // Visibility of a method enum Visibility { // VISIBILITY_UNSPECIFIED is not defined @@ -90,6 +100,8 @@ extend google.protobuf.MethodOptions { Auditing auditing = 51004; // InfraRoles are used to define which infra role a microservice must provide to call this method repeated InfraRole infra_roles = 51005; + // MachineRole are used to define which infra role a microservice must provide to call this method + repeated MachineRole machine_roles = 51006; } // EnumValueOptions, can be accessed with go/enum/GetFormatStringValue diff --git a/proto/metalstack/infra/v2/boot.proto b/proto/metalstack/infra/v2/boot.proto new file mode 100644 index 00000000..aff1d5e9 --- /dev/null +++ b/proto/metalstack/infra/v2/boot.proto @@ -0,0 +1,295 @@ +syntax = "proto3"; + +package metalstack.infra.v2; + +import "metalstack/api/v2/common.proto"; + +// BootService is used for all boot related requests, either pixiecore or metal-hammer +service BootService { + // Pixiecore + + // Dhcp is the first dhcp request (option 97). A ProvisioningEventPXEBooting is fired + rpc Dhcp(BootServiceDhcpRequest) returns (BootServiceDhcpResponse) { + option (metalstack.api.v2.infra_roles) = INFRA_ROLE_EDITOR; + option (metalstack.api.v2.infra_roles) = INFRA_ROLE_VIEWER; + option (metalstack.api.v2.auditing) = AUDITING_EXCLUDED; + } + // Boot is called from pixie once the machine got the first dhcp response and ipxie asks for subsequent kernel and initrd + rpc Boot(BootServiceBootRequest) returns (BootServiceBootResponse) { + option (metalstack.api.v2.infra_roles) = INFRA_ROLE_EDITOR; + option (metalstack.api.v2.infra_roles) = INFRA_ROLE_VIEWER; + option (metalstack.api.v2.auditing) = AUDITING_EXCLUDED; + } + + // Metal Hammer + + // SuperUserPassword metal-hammer takes the configured root password for the bmc from metal-api and configure the bmc accordingly + rpc SuperUserPassword(BootServiceSuperUserPasswordRequest) returns (BootServiceSuperUserPasswordResponse) { + option (metalstack.api.v2.machine_roles) = MACHINE_ROLE_EDITOR; + option (metalstack.api.v2.machine_roles) = MACHINE_ROLE_VIEWER; + option (metalstack.api.v2.auditing) = AUDITING_EXCLUDED; + } + // Register is called from metal-hammer after hardware inventory is finished, tells metal-api all glory details about that machine + rpc Register(BootServiceRegisterRequest) returns (BootServiceRegisterResponse) { + option (metalstack.api.v2.machine_roles) = MACHINE_ROLE_EDITOR; + option (metalstack.api.v2.machine_roles) = MACHINE_ROLE_VIEWER; + option (metalstack.api.v2.auditing) = AUDITING_EXCLUDED; + } + // Wait is a hanging call that waits until the machine gets allocated by a user + rpc Wait(BootServiceWaitRequest) returns (stream BootServiceWaitResponse) { + option (metalstack.api.v2.machine_roles) = MACHINE_ROLE_EDITOR; + option (metalstack.api.v2.machine_roles) = MACHINE_ROLE_VIEWER; + option (metalstack.api.v2.auditing) = AUDITING_EXCLUDED; + } + // Report tells metal-api installation was either successful or failed + rpc Report(BootServiceReportRequest) returns (BootServiceReportResponse) { + option (metalstack.api.v2.machine_roles) = MACHINE_ROLE_EDITOR; + option (metalstack.api.v2.machine_roles) = MACHINE_ROLE_VIEWER; + option (metalstack.api.v2.auditing) = AUDITING_EXCLUDED; + } + // If reinstall failed and tell metal-api to restore to previous state + rpc AbortReinstall(BootServiceAbortReinstallRequest) returns (BootServiceAbortReinstallResponse) { + option (metalstack.api.v2.machine_roles) = MACHINE_ROLE_EDITOR; + option (metalstack.api.v2.machine_roles) = MACHINE_ROLE_VIEWER; + option (metalstack.api.v2.auditing) = AUDITING_EXCLUDED; + } +} + +// BootServiceDhcpRequest is called once a machine issues a dhcp request +message BootServiceDhcpRequest { + // UUID of the machine + string uuid = 1; +} + +// BootServiceDhcpResponse contains the response to a dhcp request +message BootServiceDhcpResponse {} + +// BootServiceBootRequest is called to get specified parameters to boot a machine with the given mac +message BootServiceBootRequest { + // Mac address of the machein + string mac = 1; + // Partition where this machine is located + string partition_id = 2; +} + +// BootServiceBootResponse contains additional infos which are required to boot a machine +message BootServiceBootResponse { + // Kernel is the url to the linux kernel to boot + string kernel = 1; + // Initial ram disk is the url to the initial ram disk to boot + repeated string init_ram_disks = 2; + // CMDLine contains kernel command line parameters to boot + optional string cmdline = 3; +} + +// BootServiceRegisterRequest is called from metal-hammer to register a machine with as much hardware details as possible +message BootServiceRegisterRequest { + // UUID of this machine + string uuid = 1; + // Hardware details of this machine + MachineHardware hardware = 2; + // Bios details of this machine + MachineBIOS bios = 3; + // IPMI details of this machine + MachineIPMI ipmi = 4; + // Tags of this machine + repeated string tags = 5; + // MetalHammer version this machine was bootet into + string metal_hammer_version = 6; + // Partition where this machine is located + string partition_id = 7; +} + +// BootServiceRegisterResponse response to a BootServiceRegisterResponse request +message BootServiceRegisterResponse { + // UUID of this machine + string uuid = 1; + // Size is the calculated size from given hardware details + string size = 2; + // Partition of this machine + string partition_id = 3; +} + +// BootServiceWaitRequest is called when a machine was registered and is waiting for allocation +message BootServiceWaitRequest { + // UUID of this machine + string uuid = 1; +} + +// BootServiceWaitResponse response to a wait request +message BootServiceWaitResponse {} + +// MachineHardware contains hardware details of this machine +message MachineHardware { + // Memory in bytes + uint64 memory = 1; + // Disks which are built into this machine + repeated MachineBlockDevice disks = 3; + // Nics are network interface cards built into this machein + repeated MachineNic nics = 4; + // CPUs in this machine + repeated MachineCPU cpus = 5; + // GPUs in this machine + repeated MachineGPU gpus = 6; +} + +// MachineCPU describes a physical CPU +message MachineCPU { + // Vendor of this cpu + string vendor = 1; + // Model of this cpu + string model = 2; + // Cores in this cpu + uint32 cores = 3; + // Threads total in this cpu + uint32 threads = 4; +} + +// MachineGPU describes a physical GPU +message MachineGPU { + // Vendor of this gpu + string vendor = 1; + // Model of this gpu + string model = 2; +} + +// MachineNIC describes a network interface card +message MachineNic { + // Mac address of this network card + string mac = 1; + // Name in the os of this network card, e.g. eth0 + string name = 2; + // Vendor of this network card + string vendor = 3; + // Model of this network card + string model = 4; + // Speed in bits/second of this network card + uint64 speed = 5; + // Neighbors connected to this network card + repeated MachineNic neighbors = 6; + // Hostname FIXME clarify usage + string hostname = 7; + // Identifier of this network card + string identifier = 8; +} + +// MachineBlockDevice defines a disk built into a machine +message MachineBlockDevice { + // Name of this device + string name = 1; + // Size in bytes of this device + uint64 size = 2; +} + +// MachineBIOS describes details of the machine bios +message MachineBIOS { + // Version of the bios + string version = 1; + // Vendor of the bios + string vendor = 2; + // Date of the bios + string date = 3; +} + +// MachineIPMI describe details of the ipmi or out of band device +message MachineIPMI { + // Address of this ipmi device from outside + string address = 1; + // Mac address of the network interface of this ipmi device + string mac = 2; + // User of this ipmi device + string user = 3; + // Password of this ipmi device + string password = 4; + // Interface of this ipmi device + string interface = 5; + // FRU field replaceable unit details for this machine + MachineFRU fru = 6; + // BMCVersion of this ipmi device + string bmc_version = 7; + // PowerState of this machine + string power_state = 8; +} + +// MachineFRU describes details to the machine which are required in case of a necessary replacement +message MachineFRU { + // ChassisPartNumber is the part number of the machine chassis + optional string chassis_part_number = 1; + // ChassisPartSerial is the serial number of the machine chassis + optional string chassis_part_serial = 2; + // BoardMFG is the short description of the mainboard + optional string board_mfg = 3; + // BoardSerial is the serial number of the mainboard + optional string board_mfg_serial = 4; + // BoardPartNumber is the part number of the mainboard + optional string board_part_number = 5; + // ProductManufacturer is the manufacturer of the machine + optional string product_manufacturer = 6; + // ProductPartNumber is the part number of the machine + optional string product_part_number = 7; + // ProductSerial is the serial number of the machine + optional string product_serial = 8; +} + +// BootServiceReportRequest is sent from metal-hammer to the api to report the outcome of the register +message BootServiceReportRequest { + // UUID of the machine to boot + string uuid = 1; + // Console_Password + string console_password = 2; + // BootInfo contains all details which are the result of registration and allocation + BootInfo boot_info = 3; + // Success is set to true of the allocation succeeded + bool success = 4; + // Message contains additional information if installation failed + string message = 5; +} + +// BootServiceReportRequest is the response to a BootServiceReportRequest +message BootServiceReportResponse {} + +// BootInfo contains calculated values of a allocation +message BootInfo { + // Image which is going to be installed + string image_id = 1; + // PrimaryDisk the machine boots from + string primary_disk = 2; + // OSPartition where the operating system is stored + string os_partition = 3; + // Initrd the name of the initial ram disk + string initrd = 4; + // Cmdline of the kernel + string cmdline = 5; + // Kernel to boot from + string kernel = 6; + // BootloadID which is used to boot + string bootloader_id = 8; +} + +// BootServiceAbortReinstallRequest is called if the reinstallation failed and must aborted +message BootServiceAbortReinstallRequest { + // UUID of this machine + string uuid = 1; + // PrimaryDiskWiped is set to true if the primary disk was wiped + bool primary_disk_wiped = 2; +} + +// BootServiceAbortReinstallResponse response if a reinstall abort command was called +message BootServiceAbortReinstallResponse { + // BootInfo contains details to the boot + BootInfo boot_info = 1; +} + +// BootServiceSuperUserPasswordRequest this call returns the password for the machine superuser +message BootServiceSuperUserPasswordRequest { + // UUID of this machine + string uuid = 1; +} + +// BootServiceSuperUserPasswordResponse the super user password is returned +message BootServiceSuperUserPasswordResponse { + // FeatureDisable FIXME + bool feature_disabled = 1; + // SuperUserPassword is the password of the superuser on the ipmi device + string super_user_password = 2; +} From a2d18bd2cc833c5c9fa8d8762a3ca6b61108a9f8 Mon Sep 17 00:00:00 2001 From: Stefan Majer Date: Sun, 8 Jun 2025 09:23:43 +0200 Subject: [PATCH 02/27] Add required machine service endpoint --- proto/metalstack/infra/v2/boot.proto | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/proto/metalstack/infra/v2/boot.proto b/proto/metalstack/infra/v2/boot.proto index aff1d5e9..0a7c6a0e 100644 --- a/proto/metalstack/infra/v2/boot.proto +++ b/proto/metalstack/infra/v2/boot.proto @@ -41,6 +41,10 @@ service BootService { option (metalstack.api.v2.machine_roles) = MACHINE_ROLE_VIEWER; option (metalstack.api.v2.auditing) = AUDITING_EXCLUDED; } + + // FIXME after wait finished a MachineServiceGetRequest is required which must be possible with a machine_role_viewer + // This should be part of machine.proto + // Report tells metal-api installation was either successful or failed rpc Report(BootServiceReportRequest) returns (BootServiceReportResponse) { option (metalstack.api.v2.machine_roles) = MACHINE_ROLE_EDITOR; From 1acf70c49bd7dbc797a861bd00536ee2a5eb00ef Mon Sep 17 00:00:00 2001 From: Stefan Majer Date: Wed, 18 Jun 2025 10:10:37 +0200 Subject: [PATCH 03/27] Tenant Tests --- go/tests/api_scopes_test.go | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/go/tests/api_scopes_test.go b/go/tests/api_scopes_test.go index fe77c901..1dd74d08 100644 --- a/go/tests/api_scopes_test.go +++ b/go/tests/api_scopes_test.go @@ -118,6 +118,7 @@ func Test_APIScopes(t *testing.T) { err = validateProto("./testproto") errs := errors.Join( + errors.New("api service method: \"/metalstack.api.v2.WrongProjectService/Add\" has apiv2.TenantRole but request payload \"WrongProjectServiceAddRequest\" does not have a login field"), errors.New("api service method: \"/metalstack.api.v2.WrongProjectService/Get\" has apiv2.ProjectRole but request payload \"WrongProjectServiceGetRequest\" does not have a project field"), errors.New("api service method: \"/metalstack.api.v2.WrongProjectService/List\" has no scope defined. one scope needs to be defined though. use one of the following scopes: [apiv2.AdminRole apiv2.InfraRole apiv2.MachineRole apiv2.ProjectRole apiv2.TenantRole apiv2.Visibility]"), errors.New("api service method: \"/metalstack.api.v2.WrongProjectService/Update\" can not have apiv2.AdminRole ([ADMIN_ROLE_VIEWER]) and apiv2.ProjectRole ([PROJECT_ROLE_OWNER]) at the same time. only one scope is allowed."), @@ -213,7 +214,25 @@ func validateProto(root string) error { errs = append(errs, fmt.Errorf("api service method: %q has %s but request payload %q does not have a project field", methodName, prs, projectRequest)) } } - if name == mrs && len(s) > 0 { + if name == trs { + tenantFound := false + tenantRequest := "" + for _, mt := range fd.GetMessageType() { + if mt.GetName() != method.GetInputType() { + continue + } + for _, field := range mt.GetField() { + if field.GetName() == "login" { + tenantFound = true + } + } + tenantRequest = mt.GetName() + } + if !tenantFound { + errs = append(errs, fmt.Errorf("api service method: %q has %s but request payload %q does not have a login field", methodName, trs, tenantRequest)) + } + } + if name == mrs { machineIdFound := false machineRequest := "" for _, mt := range fd.GetMessageType() { From 619093a43fd3356e0b54172db2d079360c11891e Mon Sep 17 00:00:00 2001 From: Stefan Majer Date: Wed, 18 Jun 2025 10:15:33 +0200 Subject: [PATCH 04/27] Merge main --- proto/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto/Makefile b/proto/Makefile index e2c1c190..ad06b4f3 100644 --- a/proto/Makefile +++ b/proto/Makefile @@ -1,5 +1,5 @@ MAKEFLAGS += --no-print-directory -BUF_VERSION := 1.54.0 +BUF_VERSION := 1.55.1 _buf: docker run --rm \ From ffca5afdc24917b168932d13203e0babdec02c1c Mon Sep 17 00:00:00 2001 From: Stefan Majer Date: Mon, 23 Jun 2025 07:19:25 +0200 Subject: [PATCH 05/27] Update deps --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index a8632392..710f10e2 100644 --- a/go.mod +++ b/go.mod @@ -22,9 +22,9 @@ require ( github.com/klauspost/compress v1.18.0 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/stoewer/go-strcase v1.3.0 // indirect + github.com/stoewer/go-strcase v1.3.1 // indirect github.com/stretchr/objx v0.5.2 // indirect - golang.org/x/exp v0.0.0-20250606033433-dcc06ee1d476 // indirect + golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b // indirect golang.org/x/text v0.26.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20250603155806-513f23925822 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20250603155806-513f23925822 // indirect diff --git a/go.sum b/go.sum index f5385e29..e1f9decc 100644 --- a/go.sum +++ b/go.sum @@ -36,8 +36,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/stoewer/go-strcase v1.3.0 h1:g0eASXYtp+yvN9fK8sH94oCIk0fau9uV1/ZdJ0AVEzs= -github.com/stoewer/go-strcase v1.3.0/go.mod h1:fAH5hQ5pehh+j3nZfvwdk2RgEgQjAoM8wodgtPmh1xo= +github.com/stoewer/go-strcase v1.3.1 h1:iS0MdW+kVTxgMoE1LAZyMiYJFKlOzLooE4MxjirtkAs= +github.com/stoewer/go-strcase v1.3.1/go.mod h1:fAH5hQ5pehh+j3nZfvwdk2RgEgQjAoM8wodgtPmh1xo= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= @@ -48,8 +48,8 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -golang.org/x/exp v0.0.0-20250606033433-dcc06ee1d476 h1:bsqhLWFR6G6xiQcb+JoGqdKdRU6WzPWmK8E0jxTjzo4= -golang.org/x/exp v0.0.0-20250606033433-dcc06ee1d476/go.mod h1:3//PLf8L/X+8b4vuAfHzxeRUl04Adcb341+IGKfnqS8= +golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b h1:M2rDM6z3Fhozi9O7NWsxAkg/yqS/lQJ6PmkyIV3YP+o= +golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b/go.mod h1:3//PLf8L/X+8b4vuAfHzxeRUl04Adcb341+IGKfnqS8= golang.org/x/net v0.37.0 h1:1zLorHbz+LYj7MQlSf1+2tPIIgibq2eL5xkrGk6f+2c= golang.org/x/net v0.37.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8= golang.org/x/text v0.26.0 h1:P42AVeLghgTYr4+xUnTRKDMqpar+PtX7KWuNQL21L8M= From f9409a49dc7f66104eccd2c333fd9c4fcf05c82e Mon Sep 17 00:00:00 2001 From: Stefan Majer Date: Thu, 10 Jul 2025 21:53:11 +0200 Subject: [PATCH 06/27] Merge main --- python/metalstack/api/v2/common_pb2.py | 12 +- python/metalstack/api/v2/common_pb2.pyi | 11 + python/metalstack/infra/v2/boot_connecpy.py | 438 ++++++++++++++++++++ python/metalstack/infra/v2/boot_pb2.py | 98 +++++ python/metalstack/infra/v2/boot_pb2.pyi | 250 +++++++++++ python/metalstack/infra/v2/boot_pb2_grpc.py | 353 ++++++++++++++++ 6 files changed, 1157 insertions(+), 5 deletions(-) create mode 100644 python/metalstack/infra/v2/boot_connecpy.py create mode 100644 python/metalstack/infra/v2/boot_pb2.py create mode 100644 python/metalstack/infra/v2/boot_pb2.pyi create mode 100644 python/metalstack/infra/v2/boot_pb2_grpc.py diff --git a/python/metalstack/api/v2/common_pb2.py b/python/metalstack/api/v2/common_pb2.py index b803779b..58a750fb 100644 --- a/python/metalstack/api/v2/common_pb2.py +++ b/python/metalstack/api/v2/common_pb2.py @@ -27,7 +27,7 @@ from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1emetalstack/api/v2/common.proto\x12\x11metalstack.api.v2\x1a\x1b\x62uf/validate/validate.proto\x1a google/protobuf/descriptor.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"O\n\x06Paging\x12\x17\n\x04page\x18\x01 \x01(\x04H\x00R\x04page\x88\x01\x01\x12\x19\n\x05\x63ount\x18\x02 \x01(\x04H\x01R\x05\x63ount\x88\x01\x01\x42\x07\n\x05_pageB\x08\n\x06_count\"\x9c\x01\n\x06Labels\x12W\n\x06labels\x18\x01 \x03(\x0b\x32%.metalstack.api.v2.Labels.LabelsEntryB\x18\xbaH\x15\x9a\x01\x12\"\x07r\x05\x10\x01\x18\x80\x02*\x07r\x05\x10\x00\x18\x80\x02R\x06labels\x1a\x39\n\x0bLabelsEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value:\x02\x38\x01\"\xfd\x01\n\x04Meta\x12\x36\n\x06labels\x18\x01 \x01(\x0b\x32\x19.metalstack.api.v2.LabelsH\x00R\x06labels\x88\x01\x01\x12\x39\n\ncreated_at\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\tcreatedAt\x12\x39\n\nupdated_at\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\tupdatedAt\x12-\n\ngeneration\x18\x04 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01H\x01R\ngeneration\x88\x01\x01\x42\t\n\x07_labelsB\r\n\x0b_generation\"Y\n\x0cUpdateLabels\x12\x31\n\x06update\x18\x01 \x01(\x0b\x32\x19.metalstack.api.v2.LabelsR\x06update\x12\x16\n\x06remove\x18\x02 \x03(\tR\x06remove*\x87\x01\n\nTenantRole\x12\x1b\n\x17TENANT_ROLE_UNSPECIFIED\x10\x00\x12\x15\n\x11TENANT_ROLE_OWNER\x10\x01\x12\x16\n\x12TENANT_ROLE_EDITOR\x10\x02\x12\x16\n\x12TENANT_ROLE_VIEWER\x10\x03\x12\x15\n\x11TENANT_ROLE_GUEST\x10\x04*u\n\x0bProjectRole\x12\x1c\n\x18PROJECT_ROLE_UNSPECIFIED\x10\x00\x12\x16\n\x12PROJECT_ROLE_OWNER\x10\x01\x12\x17\n\x13PROJECT_ROLE_EDITOR\x10\x02\x12\x17\n\x13PROJECT_ROLE_VIEWER\x10\x03*U\n\tAdminRole\x12\x1a\n\x16\x41\x44MIN_ROLE_UNSPECIFIED\x10\x00\x12\x15\n\x11\x41\x44MIN_ROLE_EDITOR\x10\x01\x12\x15\n\x11\x41\x44MIN_ROLE_VIEWER\x10\x02*U\n\tInfraRole\x12\x1a\n\x16INFRA_ROLE_UNSPECIFIED\x10\x00\x12\x15\n\x11INFRA_ROLE_EDITOR\x10\x01\x12\x15\n\x11INFRA_ROLE_VIEWER\x10\x02*T\n\nVisibility\x12\x1a\n\x16VISIBILITY_UNSPECIFIED\x10\x00\x12\x15\n\x11VISIBILITY_PUBLIC\x10\x01\x12\x13\n\x0fVISIBILITY_SELF\x10\x03*R\n\x08\x41uditing\x12\x18\n\x14\x41UDITING_UNSPECIFIED\x10\x00\x12\x15\n\x11\x41UDITING_INCLUDED\x10\x01\x12\x15\n\x11\x41UDITING_EXCLUDED\x10\x02:b\n\x0ctenant_roles\x12\x1e.google.protobuf.MethodOptions\x18\xb8\x8e\x03 \x03(\x0e\x32\x1d.metalstack.api.v2.TenantRoleR\x0btenantRoles:e\n\rproject_roles\x12\x1e.google.protobuf.MethodOptions\x18\xb9\x8e\x03 \x03(\x0e\x32\x1e.metalstack.api.v2.ProjectRoleR\x0cprojectRoles:_\n\x0b\x61\x64min_roles\x12\x1e.google.protobuf.MethodOptions\x18\xba\x8e\x03 \x03(\x0e\x32\x1c.metalstack.api.v2.AdminRoleR\nadminRoles:_\n\nvisibility\x12\x1e.google.protobuf.MethodOptions\x18\xbb\x8e\x03 \x01(\x0e\x32\x1d.metalstack.api.v2.VisibilityR\nvisibility:Y\n\x08\x61uditing\x12\x1e.google.protobuf.MethodOptions\x18\xbc\x8e\x03 \x01(\x0e\x32\x1b.metalstack.api.v2.AuditingR\x08\x61uditing:_\n\x0binfra_roles\x12\x1e.google.protobuf.MethodOptions\x18\xbd\x8e\x03 \x03(\x0e\x32\x1c.metalstack.api.v2.InfraRoleR\ninfraRoles:O\n\x11\x65num_string_value\x12!.google.protobuf.EnumValueOptions\x18\xa0\x96\x03 \x01(\tR\x0f\x65numStringValueB\xc1\x01\n\x15\x63om.metalstack.api.v2B\x0b\x43ommonProtoP\x01Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\xa2\x02\x03MAX\xaa\x02\x11Metalstack.Api.V2\xca\x02\x11Metalstack\\Api\\V2\xe2\x02\x1dMetalstack\\Api\\V2\\GPBMetadata\xea\x02\x13Metalstack::Api::V2b\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1emetalstack/api/v2/common.proto\x12\x11metalstack.api.v2\x1a\x1b\x62uf/validate/validate.proto\x1a google/protobuf/descriptor.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"O\n\x06Paging\x12\x17\n\x04page\x18\x01 \x01(\x04H\x00R\x04page\x88\x01\x01\x12\x19\n\x05\x63ount\x18\x02 \x01(\x04H\x01R\x05\x63ount\x88\x01\x01\x42\x07\n\x05_pageB\x08\n\x06_count\"\x9c\x01\n\x06Labels\x12W\n\x06labels\x18\x01 \x03(\x0b\x32%.metalstack.api.v2.Labels.LabelsEntryB\x18\xbaH\x15\x9a\x01\x12\"\x07r\x05\x10\x01\x18\x80\x02*\x07r\x05\x10\x00\x18\x80\x02R\x06labels\x1a\x39\n\x0bLabelsEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value:\x02\x38\x01\"\xfd\x01\n\x04Meta\x12\x36\n\x06labels\x18\x01 \x01(\x0b\x32\x19.metalstack.api.v2.LabelsH\x00R\x06labels\x88\x01\x01\x12\x39\n\ncreated_at\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\tcreatedAt\x12\x39\n\nupdated_at\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\tupdatedAt\x12-\n\ngeneration\x18\x04 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01H\x01R\ngeneration\x88\x01\x01\x42\t\n\x07_labelsB\r\n\x0b_generation\"Y\n\x0cUpdateLabels\x12\x31\n\x06update\x18\x01 \x01(\x0b\x32\x19.metalstack.api.v2.LabelsR\x06update\x12\x16\n\x06remove\x18\x02 \x03(\tR\x06remove*\x87\x01\n\nTenantRole\x12\x1b\n\x17TENANT_ROLE_UNSPECIFIED\x10\x00\x12\x15\n\x11TENANT_ROLE_OWNER\x10\x01\x12\x16\n\x12TENANT_ROLE_EDITOR\x10\x02\x12\x16\n\x12TENANT_ROLE_VIEWER\x10\x03\x12\x15\n\x11TENANT_ROLE_GUEST\x10\x04*u\n\x0bProjectRole\x12\x1c\n\x18PROJECT_ROLE_UNSPECIFIED\x10\x00\x12\x16\n\x12PROJECT_ROLE_OWNER\x10\x01\x12\x17\n\x13PROJECT_ROLE_EDITOR\x10\x02\x12\x17\n\x13PROJECT_ROLE_VIEWER\x10\x03*U\n\tAdminRole\x12\x1a\n\x16\x41\x44MIN_ROLE_UNSPECIFIED\x10\x00\x12\x15\n\x11\x41\x44MIN_ROLE_EDITOR\x10\x01\x12\x15\n\x11\x41\x44MIN_ROLE_VIEWER\x10\x02*U\n\tInfraRole\x12\x1a\n\x16INFRA_ROLE_UNSPECIFIED\x10\x00\x12\x15\n\x11INFRA_ROLE_EDITOR\x10\x01\x12\x15\n\x11INFRA_ROLE_VIEWER\x10\x02*]\n\x0bMachineRole\x12\x1c\n\x18MACHINE_ROLE_UNSPECIFIED\x10\x00\x12\x17\n\x13MACHINE_ROLE_EDITOR\x10\x01\x12\x17\n\x13MACHINE_ROLE_VIEWER\x10\x02*T\n\nVisibility\x12\x1a\n\x16VISIBILITY_UNSPECIFIED\x10\x00\x12\x15\n\x11VISIBILITY_PUBLIC\x10\x01\x12\x13\n\x0fVISIBILITY_SELF\x10\x03*R\n\x08\x41uditing\x12\x18\n\x14\x41UDITING_UNSPECIFIED\x10\x00\x12\x15\n\x11\x41UDITING_INCLUDED\x10\x01\x12\x15\n\x11\x41UDITING_EXCLUDED\x10\x02:b\n\x0ctenant_roles\x12\x1e.google.protobuf.MethodOptions\x18\xb8\x8e\x03 \x03(\x0e\x32\x1d.metalstack.api.v2.TenantRoleR\x0btenantRoles:e\n\rproject_roles\x12\x1e.google.protobuf.MethodOptions\x18\xb9\x8e\x03 \x03(\x0e\x32\x1e.metalstack.api.v2.ProjectRoleR\x0cprojectRoles:_\n\x0b\x61\x64min_roles\x12\x1e.google.protobuf.MethodOptions\x18\xba\x8e\x03 \x03(\x0e\x32\x1c.metalstack.api.v2.AdminRoleR\nadminRoles:_\n\nvisibility\x12\x1e.google.protobuf.MethodOptions\x18\xbb\x8e\x03 \x01(\x0e\x32\x1d.metalstack.api.v2.VisibilityR\nvisibility:Y\n\x08\x61uditing\x12\x1e.google.protobuf.MethodOptions\x18\xbc\x8e\x03 \x01(\x0e\x32\x1b.metalstack.api.v2.AuditingR\x08\x61uditing:_\n\x0binfra_roles\x12\x1e.google.protobuf.MethodOptions\x18\xbd\x8e\x03 \x03(\x0e\x32\x1c.metalstack.api.v2.InfraRoleR\ninfraRoles:e\n\rmachine_roles\x12\x1e.google.protobuf.MethodOptions\x18\xbe\x8e\x03 \x03(\x0e\x32\x1e.metalstack.api.v2.MachineRoleR\x0cmachineRoles:O\n\x11\x65num_string_value\x12!.google.protobuf.EnumValueOptions\x18\xa0\x96\x03 \x01(\tR\x0f\x65numStringValueB\xc1\x01\n\x15\x63om.metalstack.api.v2B\x0b\x43ommonProtoP\x01Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\xa2\x02\x03MAX\xaa\x02\x11Metalstack.Api.V2\xca\x02\x11Metalstack\\Api\\V2\xe2\x02\x1dMetalstack\\Api\\V2\\GPBMetadata\xea\x02\x13Metalstack::Api::V2b\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -49,10 +49,12 @@ _globals['_ADMINROLE']._serialized_end=1078 _globals['_INFRAROLE']._serialized_start=1080 _globals['_INFRAROLE']._serialized_end=1165 - _globals['_VISIBILITY']._serialized_start=1167 - _globals['_VISIBILITY']._serialized_end=1251 - _globals['_AUDITING']._serialized_start=1253 - _globals['_AUDITING']._serialized_end=1335 + _globals['_MACHINEROLE']._serialized_start=1167 + _globals['_MACHINEROLE']._serialized_end=1260 + _globals['_VISIBILITY']._serialized_start=1262 + _globals['_VISIBILITY']._serialized_end=1346 + _globals['_AUDITING']._serialized_start=1348 + _globals['_AUDITING']._serialized_end=1430 _globals['_PAGING']._serialized_start=149 _globals['_PAGING']._serialized_end=228 _globals['_LABELS']._serialized_start=231 diff --git a/python/metalstack/api/v2/common_pb2.pyi b/python/metalstack/api/v2/common_pb2.pyi index eb0ac29e..ef072096 100644 --- a/python/metalstack/api/v2/common_pb2.pyi +++ b/python/metalstack/api/v2/common_pb2.pyi @@ -39,6 +39,12 @@ class InfraRole(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): INFRA_ROLE_EDITOR: _ClassVar[InfraRole] INFRA_ROLE_VIEWER: _ClassVar[InfraRole] +class MachineRole(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): + __slots__ = () + MACHINE_ROLE_UNSPECIFIED: _ClassVar[MachineRole] + MACHINE_ROLE_EDITOR: _ClassVar[MachineRole] + MACHINE_ROLE_VIEWER: _ClassVar[MachineRole] + class Visibility(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): __slots__ = () VISIBILITY_UNSPECIFIED: _ClassVar[Visibility] @@ -65,6 +71,9 @@ ADMIN_ROLE_VIEWER: AdminRole INFRA_ROLE_UNSPECIFIED: InfraRole INFRA_ROLE_EDITOR: InfraRole INFRA_ROLE_VIEWER: InfraRole +MACHINE_ROLE_UNSPECIFIED: MachineRole +MACHINE_ROLE_EDITOR: MachineRole +MACHINE_ROLE_VIEWER: MachineRole VISIBILITY_UNSPECIFIED: Visibility VISIBILITY_PUBLIC: Visibility VISIBILITY_SELF: Visibility @@ -83,6 +92,8 @@ AUDITING_FIELD_NUMBER: _ClassVar[int] auditing: _descriptor.FieldDescriptor INFRA_ROLES_FIELD_NUMBER: _ClassVar[int] infra_roles: _descriptor.FieldDescriptor +MACHINE_ROLES_FIELD_NUMBER: _ClassVar[int] +machine_roles: _descriptor.FieldDescriptor ENUM_STRING_VALUE_FIELD_NUMBER: _ClassVar[int] enum_string_value: _descriptor.FieldDescriptor diff --git a/python/metalstack/infra/v2/boot_connecpy.py b/python/metalstack/infra/v2/boot_connecpy.py new file mode 100644 index 00000000..ce841cd1 --- /dev/null +++ b/python/metalstack/infra/v2/boot_connecpy.py @@ -0,0 +1,438 @@ +# -*- coding: utf-8 -*- +# Generated by https://github.com/i2y/connecpy/protoc-gen-connecpy. DO NOT EDIT! +# source: metalstack/infra/v2/boot.proto + +from typing import Optional, Protocol, Union + +import httpx + +from connecpy.async_client import AsyncConnecpyClient +from connecpy.base import Endpoint +from connecpy.server import ConnecpyServer +from connecpy.client import ConnecpyClient +from connecpy.context import ClientContext, ServiceContext +import metalstack.infra.v2.boot_pb2 as metalstack_dot_infra_dot_v2_dot_boot__pb2 + + +class BootService(Protocol): + async def Dhcp(self, req: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpRequest, ctx: ServiceContext) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpResponse: ... + async def Boot(self, req: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootRequest, ctx: ServiceContext) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootResponse: ... + async def SuperUserPassword(self, req: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordRequest, ctx: ServiceContext) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordResponse: ... + async def Register(self, req: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterRequest, ctx: ServiceContext) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterResponse: ... + async def Wait(self, req: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitRequest, ctx: ServiceContext) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitResponse: ... + async def Report(self, req: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceReportRequest, ctx: ServiceContext) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceReportResponse: ... + async def AbortReinstall(self, req: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceAbortReinstallRequest, ctx: ServiceContext) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceAbortReinstallResponse: ... + + +class BootServiceServer(ConnecpyServer): + def __init__(self, *, service: BootService, server_path_prefix=""): + super().__init__() + self._prefix = f"{server_path_prefix}/metalstack.infra.v2.BootService" + self._endpoints = { + "Dhcp": Endpoint[metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpRequest, metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpResponse]( + service_name="BootService", + name="Dhcp", + function=getattr(service, "Dhcp"), + input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpRequest, + output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpResponse, + allowed_methods=("POST",), + ), + "Boot": Endpoint[metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootRequest, metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootResponse]( + service_name="BootService", + name="Boot", + function=getattr(service, "Boot"), + input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootRequest, + output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootResponse, + allowed_methods=("POST",), + ), + "SuperUserPassword": Endpoint[metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordRequest, metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordResponse]( + service_name="BootService", + name="SuperUserPassword", + function=getattr(service, "SuperUserPassword"), + input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordRequest, + output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordResponse, + allowed_methods=("POST",), + ), + "Register": Endpoint[metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterRequest, metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterResponse]( + service_name="BootService", + name="Register", + function=getattr(service, "Register"), + input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterRequest, + output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterResponse, + allowed_methods=("POST",), + ), + "Wait": Endpoint[metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitRequest, metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitResponse]( + service_name="BootService", + name="Wait", + function=getattr(service, "Wait"), + input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitRequest, + output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitResponse, + allowed_methods=("POST",), + ), + "Report": Endpoint[metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceReportRequest, metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceReportResponse]( + service_name="BootService", + name="Report", + function=getattr(service, "Report"), + input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceReportRequest, + output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceReportResponse, + allowed_methods=("POST",), + ), + "AbortReinstall": Endpoint[metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceAbortReinstallRequest, metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceAbortReinstallResponse]( + service_name="BootService", + name="AbortReinstall", + function=getattr(service, "AbortReinstall"), + input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceAbortReinstallRequest, + output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceAbortReinstallResponse, + allowed_methods=("POST",), + ), + } + + def serviceName(self): + return "metalstack.infra.v2.BootService" + + +class BootServiceSync(Protocol): + def Dhcp(self, req: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpRequest, ctx: ServiceContext) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpResponse: ... + def Boot(self, req: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootRequest, ctx: ServiceContext) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootResponse: ... + def SuperUserPassword(self, req: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordRequest, ctx: ServiceContext) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordResponse: ... + def Register(self, req: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterRequest, ctx: ServiceContext) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterResponse: ... + def Wait(self, req: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitRequest, ctx: ServiceContext) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitResponse: ... + def Report(self, req: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceReportRequest, ctx: ServiceContext) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceReportResponse: ... + def AbortReinstall(self, req: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceAbortReinstallRequest, ctx: ServiceContext) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceAbortReinstallResponse: ... + + +class BootServiceServerSync(ConnecpyServer): + def __init__(self, *, service: BootServiceSync, server_path_prefix=""): + super().__init__() + self._prefix = f"{server_path_prefix}/metalstack.infra.v2.BootService" + self._endpoints = { + "Dhcp": Endpoint[metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpRequest, metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpResponse]( + service_name="BootService", + name="Dhcp", + function=getattr(service, "Dhcp"), + input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpRequest, + output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpResponse, + allowed_methods=("POST",), + ), + "Boot": Endpoint[metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootRequest, metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootResponse]( + service_name="BootService", + name="Boot", + function=getattr(service, "Boot"), + input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootRequest, + output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootResponse, + allowed_methods=("POST",), + ), + "SuperUserPassword": Endpoint[metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordRequest, metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordResponse]( + service_name="BootService", + name="SuperUserPassword", + function=getattr(service, "SuperUserPassword"), + input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordRequest, + output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordResponse, + allowed_methods=("POST",), + ), + "Register": Endpoint[metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterRequest, metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterResponse]( + service_name="BootService", + name="Register", + function=getattr(service, "Register"), + input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterRequest, + output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterResponse, + allowed_methods=("POST",), + ), + "Wait": Endpoint[metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitRequest, metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitResponse]( + service_name="BootService", + name="Wait", + function=getattr(service, "Wait"), + input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitRequest, + output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitResponse, + allowed_methods=("POST",), + ), + "Report": Endpoint[metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceReportRequest, metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceReportResponse]( + service_name="BootService", + name="Report", + function=getattr(service, "Report"), + input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceReportRequest, + output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceReportResponse, + allowed_methods=("POST",), + ), + "AbortReinstall": Endpoint[metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceAbortReinstallRequest, metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceAbortReinstallResponse]( + service_name="BootService", + name="AbortReinstall", + function=getattr(service, "AbortReinstall"), + input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceAbortReinstallRequest, + output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceAbortReinstallResponse, + allowed_methods=("POST",), + ), + } + + def serviceName(self): + return "metalstack.infra.v2.BootService" + + +class BootServiceClient(ConnecpyClient): + def Dhcp( + self, + request: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpRequest, + *, + ctx: Optional[ClientContext] = None, + server_path_prefix: str = "", + **kwargs, + ) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpResponse: + method = "POST" + return self._make_request( + url=f"{server_path_prefix}/metalstack.infra.v2.BootService/Dhcp", + ctx=ctx, + request=request, + response_class=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpResponse, + method=method, + **kwargs, + ) + + def Boot( + self, + request: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootRequest, + *, + ctx: Optional[ClientContext] = None, + server_path_prefix: str = "", + **kwargs, + ) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootResponse: + method = "POST" + return self._make_request( + url=f"{server_path_prefix}/metalstack.infra.v2.BootService/Boot", + ctx=ctx, + request=request, + response_class=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootResponse, + method=method, + **kwargs, + ) + + def SuperUserPassword( + self, + request: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordRequest, + *, + ctx: Optional[ClientContext] = None, + server_path_prefix: str = "", + **kwargs, + ) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordResponse: + method = "POST" + return self._make_request( + url=f"{server_path_prefix}/metalstack.infra.v2.BootService/SuperUserPassword", + ctx=ctx, + request=request, + response_class=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordResponse, + method=method, + **kwargs, + ) + + def Register( + self, + request: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterRequest, + *, + ctx: Optional[ClientContext] = None, + server_path_prefix: str = "", + **kwargs, + ) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterResponse: + method = "POST" + return self._make_request( + url=f"{server_path_prefix}/metalstack.infra.v2.BootService/Register", + ctx=ctx, + request=request, + response_class=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterResponse, + method=method, + **kwargs, + ) + + def Wait( + self, + request: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitRequest, + *, + ctx: Optional[ClientContext] = None, + server_path_prefix: str = "", + **kwargs, + ) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitResponse: + method = "POST" + return self._make_request( + url=f"{server_path_prefix}/metalstack.infra.v2.BootService/Wait", + ctx=ctx, + request=request, + response_class=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitResponse, + method=method, + **kwargs, + ) + + def Report( + self, + request: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceReportRequest, + *, + ctx: Optional[ClientContext] = None, + server_path_prefix: str = "", + **kwargs, + ) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceReportResponse: + method = "POST" + return self._make_request( + url=f"{server_path_prefix}/metalstack.infra.v2.BootService/Report", + ctx=ctx, + request=request, + response_class=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceReportResponse, + method=method, + **kwargs, + ) + + def AbortReinstall( + self, + request: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceAbortReinstallRequest, + *, + ctx: Optional[ClientContext] = None, + server_path_prefix: str = "", + **kwargs, + ) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceAbortReinstallResponse: + method = "POST" + return self._make_request( + url=f"{server_path_prefix}/metalstack.infra.v2.BootService/AbortReinstall", + ctx=ctx, + request=request, + response_class=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceAbortReinstallResponse, + method=method, + **kwargs, + ) + + +class AsyncBootServiceClient(AsyncConnecpyClient): + async def Dhcp( + self, + request: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpRequest, + *, + ctx: Optional[ClientContext] = None, + server_path_prefix: str = "", + session: Union[httpx.AsyncClient, None] = None, + **kwargs, + ) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpResponse: + method = "POST" + return await self._make_request( + url=f"{server_path_prefix}/metalstack.infra.v2.BootService/Dhcp", + ctx=ctx, + request=request, + response_class=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpResponse, + method=method, + session=session, + **kwargs, + ) + + async def Boot( + self, + request: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootRequest, + *, + ctx: Optional[ClientContext] = None, + server_path_prefix: str = "", + session: Union[httpx.AsyncClient, None] = None, + **kwargs, + ) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootResponse: + method = "POST" + return await self._make_request( + url=f"{server_path_prefix}/metalstack.infra.v2.BootService/Boot", + ctx=ctx, + request=request, + response_class=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootResponse, + method=method, + session=session, + **kwargs, + ) + + async def SuperUserPassword( + self, + request: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordRequest, + *, + ctx: Optional[ClientContext] = None, + server_path_prefix: str = "", + session: Union[httpx.AsyncClient, None] = None, + **kwargs, + ) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordResponse: + method = "POST" + return await self._make_request( + url=f"{server_path_prefix}/metalstack.infra.v2.BootService/SuperUserPassword", + ctx=ctx, + request=request, + response_class=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordResponse, + method=method, + session=session, + **kwargs, + ) + + async def Register( + self, + request: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterRequest, + *, + ctx: Optional[ClientContext] = None, + server_path_prefix: str = "", + session: Union[httpx.AsyncClient, None] = None, + **kwargs, + ) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterResponse: + method = "POST" + return await self._make_request( + url=f"{server_path_prefix}/metalstack.infra.v2.BootService/Register", + ctx=ctx, + request=request, + response_class=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterResponse, + method=method, + session=session, + **kwargs, + ) + + async def Wait( + self, + request: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitRequest, + *, + ctx: Optional[ClientContext] = None, + server_path_prefix: str = "", + session: Union[httpx.AsyncClient, None] = None, + **kwargs, + ) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitResponse: + method = "POST" + return await self._make_request( + url=f"{server_path_prefix}/metalstack.infra.v2.BootService/Wait", + ctx=ctx, + request=request, + response_class=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitResponse, + method=method, + session=session, + **kwargs, + ) + + async def Report( + self, + request: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceReportRequest, + *, + ctx: Optional[ClientContext] = None, + server_path_prefix: str = "", + session: Union[httpx.AsyncClient, None] = None, + **kwargs, + ) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceReportResponse: + method = "POST" + return await self._make_request( + url=f"{server_path_prefix}/metalstack.infra.v2.BootService/Report", + ctx=ctx, + request=request, + response_class=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceReportResponse, + method=method, + session=session, + **kwargs, + ) + + async def AbortReinstall( + self, + request: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceAbortReinstallRequest, + *, + ctx: Optional[ClientContext] = None, + server_path_prefix: str = "", + session: Union[httpx.AsyncClient, None] = None, + **kwargs, + ) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceAbortReinstallResponse: + method = "POST" + return await self._make_request( + url=f"{server_path_prefix}/metalstack.infra.v2.BootService/AbortReinstall", + ctx=ctx, + request=request, + response_class=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceAbortReinstallResponse, + method=method, + session=session, + **kwargs, + ) diff --git a/python/metalstack/infra/v2/boot_pb2.py b/python/metalstack/infra/v2/boot_pb2.py new file mode 100644 index 00000000..9ff977a6 --- /dev/null +++ b/python/metalstack/infra/v2/boot_pb2.py @@ -0,0 +1,98 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: metalstack/infra/v2/boot.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'metalstack/infra/v2/boot.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from metalstack.api.v2 import common_pb2 as metalstack_dot_api_dot_v2_dot_common__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1emetalstack/infra/v2/boot.proto\x12\x13metalstack.infra.v2\x1a\x1emetalstack/api/v2/common.proto\",\n\x16\x42ootServiceDhcpRequest\x12\x12\n\x04uuid\x18\x01 \x01(\tR\x04uuid\"\x19\n\x17\x42ootServiceDhcpResponse\"M\n\x16\x42ootServiceBootRequest\x12\x10\n\x03mac\x18\x01 \x01(\tR\x03mac\x12!\n\x0cpartition_id\x18\x02 \x01(\tR\x0bpartitionId\"\x82\x01\n\x17\x42ootServiceBootResponse\x12\x16\n\x06kernel\x18\x01 \x01(\tR\x06kernel\x12$\n\x0einit_ram_disks\x18\x02 \x03(\tR\x0cinitRamDisks\x12\x1d\n\x07\x63mdline\x18\x03 \x01(\tH\x00R\x07\x63mdline\x88\x01\x01\x42\n\n\x08_cmdline\"\xc7\x02\n\x1a\x42ootServiceRegisterRequest\x12\x12\n\x04uuid\x18\x01 \x01(\tR\x04uuid\x12@\n\x08hardware\x18\x02 \x01(\x0b\x32$.metalstack.infra.v2.MachineHardwareR\x08hardware\x12\x34\n\x04\x62ios\x18\x03 \x01(\x0b\x32 .metalstack.infra.v2.MachineBIOSR\x04\x62ios\x12\x34\n\x04ipmi\x18\x04 \x01(\x0b\x32 .metalstack.infra.v2.MachineIPMIR\x04ipmi\x12\x12\n\x04tags\x18\x05 \x03(\tR\x04tags\x12\x30\n\x14metal_hammer_version\x18\x06 \x01(\tR\x12metalHammerVersion\x12!\n\x0cpartition_id\x18\x07 \x01(\tR\x0bpartitionId\"h\n\x1b\x42ootServiceRegisterResponse\x12\x12\n\x04uuid\x18\x01 \x01(\tR\x04uuid\x12\x12\n\x04size\x18\x02 \x01(\tR\x04size\x12!\n\x0cpartition_id\x18\x03 \x01(\tR\x0bpartitionId\",\n\x16\x42ootServiceWaitRequest\x12\x12\n\x04uuid\x18\x01 \x01(\tR\x04uuid\"\x19\n\x17\x42ootServiceWaitResponse\"\x87\x02\n\x0fMachineHardware\x12\x16\n\x06memory\x18\x01 \x01(\x04R\x06memory\x12=\n\x05\x64isks\x18\x03 \x03(\x0b\x32\'.metalstack.infra.v2.MachineBlockDeviceR\x05\x64isks\x12\x33\n\x04nics\x18\x04 \x03(\x0b\x32\x1f.metalstack.infra.v2.MachineNicR\x04nics\x12\x33\n\x04\x63pus\x18\x05 \x03(\x0b\x32\x1f.metalstack.infra.v2.MachineCPUR\x04\x63pus\x12\x33\n\x04gpus\x18\x06 \x03(\x0b\x32\x1f.metalstack.infra.v2.MachineGPUR\x04gpus\"j\n\nMachineCPU\x12\x16\n\x06vendor\x18\x01 \x01(\tR\x06vendor\x12\x14\n\x05model\x18\x02 \x01(\tR\x05model\x12\x14\n\x05\x63ores\x18\x03 \x01(\rR\x05\x63ores\x12\x18\n\x07threads\x18\x04 \x01(\rR\x07threads\":\n\nMachineGPU\x12\x16\n\x06vendor\x18\x01 \x01(\tR\x06vendor\x12\x14\n\x05model\x18\x02 \x01(\tR\x05model\"\xf1\x01\n\nMachineNic\x12\x10\n\x03mac\x18\x01 \x01(\tR\x03mac\x12\x12\n\x04name\x18\x02 \x01(\tR\x04name\x12\x16\n\x06vendor\x18\x03 \x01(\tR\x06vendor\x12\x14\n\x05model\x18\x04 \x01(\tR\x05model\x12\x14\n\x05speed\x18\x05 \x01(\x04R\x05speed\x12=\n\tneighbors\x18\x06 \x03(\x0b\x32\x1f.metalstack.infra.v2.MachineNicR\tneighbors\x12\x1a\n\x08hostname\x18\x07 \x01(\tR\x08hostname\x12\x1e\n\nidentifier\x18\x08 \x01(\tR\nidentifier\"<\n\x12MachineBlockDevice\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x12\n\x04size\x18\x02 \x01(\x04R\x04size\"S\n\x0bMachineBIOS\x12\x18\n\x07version\x18\x01 \x01(\tR\x07version\x12\x16\n\x06vendor\x18\x02 \x01(\tR\x06vendor\x12\x12\n\x04\x64\x61te\x18\x03 \x01(\tR\x04\x64\x61te\"\xfc\x01\n\x0bMachineIPMI\x12\x18\n\x07\x61\x64\x64ress\x18\x01 \x01(\tR\x07\x61\x64\x64ress\x12\x10\n\x03mac\x18\x02 \x01(\tR\x03mac\x12\x12\n\x04user\x18\x03 \x01(\tR\x04user\x12\x1a\n\x08password\x18\x04 \x01(\tR\x08password\x12\x1c\n\tinterface\x18\x05 \x01(\tR\tinterface\x12\x31\n\x03\x66ru\x18\x06 \x01(\x0b\x32\x1f.metalstack.infra.v2.MachineFRUR\x03\x66ru\x12\x1f\n\x0b\x62mc_version\x18\x07 \x01(\tR\nbmcVersion\x12\x1f\n\x0bpower_state\x18\x08 \x01(\tR\npowerState\"\xbe\x04\n\nMachineFRU\x12\x33\n\x13\x63hassis_part_number\x18\x01 \x01(\tH\x00R\x11\x63hassisPartNumber\x88\x01\x01\x12\x33\n\x13\x63hassis_part_serial\x18\x02 \x01(\tH\x01R\x11\x63hassisPartSerial\x88\x01\x01\x12 \n\tboard_mfg\x18\x03 \x01(\tH\x02R\x08\x62oardMfg\x88\x01\x01\x12-\n\x10\x62oard_mfg_serial\x18\x04 \x01(\tH\x03R\x0e\x62oardMfgSerial\x88\x01\x01\x12/\n\x11\x62oard_part_number\x18\x05 \x01(\tH\x04R\x0f\x62oardPartNumber\x88\x01\x01\x12\x36\n\x14product_manufacturer\x18\x06 \x01(\tH\x05R\x13productManufacturer\x88\x01\x01\x12\x33\n\x13product_part_number\x18\x07 \x01(\tH\x06R\x11productPartNumber\x88\x01\x01\x12*\n\x0eproduct_serial\x18\x08 \x01(\tH\x07R\rproductSerial\x88\x01\x01\x42\x16\n\x14_chassis_part_numberB\x16\n\x14_chassis_part_serialB\x0c\n\n_board_mfgB\x13\n\x11_board_mfg_serialB\x14\n\x12_board_part_numberB\x17\n\x15_product_manufacturerB\x16\n\x14_product_part_numberB\x11\n\x0f_product_serial\"\xc9\x01\n\x18\x42ootServiceReportRequest\x12\x12\n\x04uuid\x18\x01 \x01(\tR\x04uuid\x12)\n\x10\x63onsole_password\x18\x02 \x01(\tR\x0f\x63onsolePassword\x12:\n\tboot_info\x18\x03 \x01(\x0b\x32\x1d.metalstack.infra.v2.BootInfoR\x08\x62ootInfo\x12\x18\n\x07success\x18\x04 \x01(\x08R\x07success\x12\x18\n\x07message\x18\x05 \x01(\tR\x07message\"\x1b\n\x19\x42ootServiceReportResponse\"\xda\x01\n\x08\x42ootInfo\x12\x19\n\x08image_id\x18\x01 \x01(\tR\x07imageId\x12!\n\x0cprimary_disk\x18\x02 \x01(\tR\x0bprimaryDisk\x12!\n\x0cos_partition\x18\x03 \x01(\tR\x0bosPartition\x12\x16\n\x06initrd\x18\x04 \x01(\tR\x06initrd\x12\x18\n\x07\x63mdline\x18\x05 \x01(\tR\x07\x63mdline\x12\x16\n\x06kernel\x18\x06 \x01(\tR\x06kernel\x12#\n\rbootloader_id\x18\x08 \x01(\tR\x0c\x62ootloaderId\"d\n BootServiceAbortReinstallRequest\x12\x12\n\x04uuid\x18\x01 \x01(\tR\x04uuid\x12,\n\x12primary_disk_wiped\x18\x02 \x01(\x08R\x10primaryDiskWiped\"_\n!BootServiceAbortReinstallResponse\x12:\n\tboot_info\x18\x01 \x01(\x0b\x32\x1d.metalstack.infra.v2.BootInfoR\x08\x62ootInfo\"9\n#BootServiceSuperUserPasswordRequest\x12\x12\n\x04uuid\x18\x01 \x01(\tR\x04uuid\"\x81\x01\n$BootServiceSuperUserPasswordResponse\x12)\n\x10\x66\x65\x61ture_disabled\x18\x01 \x01(\x08R\x0f\x66\x65\x61tureDisabled\x12.\n\x13super_user_password\x18\x02 \x01(\tR\x11superUserPassword2\xf1\x06\n\x0b\x42ootService\x12m\n\x04\x44hcp\x12+.metalstack.infra.v2.BootServiceDhcpRequest\x1a,.metalstack.infra.v2.BootServiceDhcpResponse\"\n\xe0\xf3\x18\x02\xea\xf3\x18\x02\x01\x02\x12m\n\x04\x42oot\x12+.metalstack.infra.v2.BootServiceBootRequest\x1a,.metalstack.infra.v2.BootServiceBootResponse\"\n\xe0\xf3\x18\x02\xea\xf3\x18\x02\x01\x02\x12\x94\x01\n\x11SuperUserPassword\x12\x38.metalstack.infra.v2.BootServiceSuperUserPasswordRequest\x1a\x39.metalstack.infra.v2.BootServiceSuperUserPasswordResponse\"\n\xe0\xf3\x18\x02\xf2\xf3\x18\x02\x01\x02\x12y\n\x08Register\x12/.metalstack.infra.v2.BootServiceRegisterRequest\x1a\x30.metalstack.infra.v2.BootServiceRegisterResponse\"\n\xe0\xf3\x18\x02\xf2\xf3\x18\x02\x01\x02\x12o\n\x04Wait\x12+.metalstack.infra.v2.BootServiceWaitRequest\x1a,.metalstack.infra.v2.BootServiceWaitResponse\"\n\xe0\xf3\x18\x02\xf2\xf3\x18\x02\x01\x02\x30\x01\x12s\n\x06Report\x12-.metalstack.infra.v2.BootServiceReportRequest\x1a..metalstack.infra.v2.BootServiceReportResponse\"\n\xe0\xf3\x18\x02\xf2\xf3\x18\x02\x01\x02\x12\x8b\x01\n\x0e\x41\x62ortReinstall\x12\x35.metalstack.infra.v2.BootServiceAbortReinstallRequest\x1a\x36.metalstack.infra.v2.BootServiceAbortReinstallResponse\"\n\xe0\xf3\x18\x02\xf2\xf3\x18\x02\x01\x02\x42\xcd\x01\n\x17\x63om.metalstack.infra.v2B\tBootProtoP\x01Z9github.com/metal-stack/api/go/metalstack/infra/v2;infrav2\xa2\x02\x03MIX\xaa\x02\x13Metalstack.Infra.V2\xca\x02\x13Metalstack\\Infra\\V2\xe2\x02\x1fMetalstack\\Infra\\V2\\GPBMetadata\xea\x02\x15Metalstack::Infra::V2b\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'metalstack.infra.v2.boot_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\027com.metalstack.infra.v2B\tBootProtoP\001Z9github.com/metal-stack/api/go/metalstack/infra/v2;infrav2\242\002\003MIX\252\002\023Metalstack.Infra.V2\312\002\023Metalstack\\Infra\\V2\342\002\037Metalstack\\Infra\\V2\\GPBMetadata\352\002\025Metalstack::Infra::V2' + _globals['_BOOTSERVICE'].methods_by_name['Dhcp']._loaded_options = None + _globals['_BOOTSERVICE'].methods_by_name['Dhcp']._serialized_options = b'\340\363\030\002\352\363\030\002\001\002' + _globals['_BOOTSERVICE'].methods_by_name['Boot']._loaded_options = None + _globals['_BOOTSERVICE'].methods_by_name['Boot']._serialized_options = b'\340\363\030\002\352\363\030\002\001\002' + _globals['_BOOTSERVICE'].methods_by_name['SuperUserPassword']._loaded_options = None + _globals['_BOOTSERVICE'].methods_by_name['SuperUserPassword']._serialized_options = b'\340\363\030\002\362\363\030\002\001\002' + _globals['_BOOTSERVICE'].methods_by_name['Register']._loaded_options = None + _globals['_BOOTSERVICE'].methods_by_name['Register']._serialized_options = b'\340\363\030\002\362\363\030\002\001\002' + _globals['_BOOTSERVICE'].methods_by_name['Wait']._loaded_options = None + _globals['_BOOTSERVICE'].methods_by_name['Wait']._serialized_options = b'\340\363\030\002\362\363\030\002\001\002' + _globals['_BOOTSERVICE'].methods_by_name['Report']._loaded_options = None + _globals['_BOOTSERVICE'].methods_by_name['Report']._serialized_options = b'\340\363\030\002\362\363\030\002\001\002' + _globals['_BOOTSERVICE'].methods_by_name['AbortReinstall']._loaded_options = None + _globals['_BOOTSERVICE'].methods_by_name['AbortReinstall']._serialized_options = b'\340\363\030\002\362\363\030\002\001\002' + _globals['_BOOTSERVICEDHCPREQUEST']._serialized_start=87 + _globals['_BOOTSERVICEDHCPREQUEST']._serialized_end=131 + _globals['_BOOTSERVICEDHCPRESPONSE']._serialized_start=133 + _globals['_BOOTSERVICEDHCPRESPONSE']._serialized_end=158 + _globals['_BOOTSERVICEBOOTREQUEST']._serialized_start=160 + _globals['_BOOTSERVICEBOOTREQUEST']._serialized_end=237 + _globals['_BOOTSERVICEBOOTRESPONSE']._serialized_start=240 + _globals['_BOOTSERVICEBOOTRESPONSE']._serialized_end=370 + _globals['_BOOTSERVICEREGISTERREQUEST']._serialized_start=373 + _globals['_BOOTSERVICEREGISTERREQUEST']._serialized_end=700 + _globals['_BOOTSERVICEREGISTERRESPONSE']._serialized_start=702 + _globals['_BOOTSERVICEREGISTERRESPONSE']._serialized_end=806 + _globals['_BOOTSERVICEWAITREQUEST']._serialized_start=808 + _globals['_BOOTSERVICEWAITREQUEST']._serialized_end=852 + _globals['_BOOTSERVICEWAITRESPONSE']._serialized_start=854 + _globals['_BOOTSERVICEWAITRESPONSE']._serialized_end=879 + _globals['_MACHINEHARDWARE']._serialized_start=882 + _globals['_MACHINEHARDWARE']._serialized_end=1145 + _globals['_MACHINECPU']._serialized_start=1147 + _globals['_MACHINECPU']._serialized_end=1253 + _globals['_MACHINEGPU']._serialized_start=1255 + _globals['_MACHINEGPU']._serialized_end=1313 + _globals['_MACHINENIC']._serialized_start=1316 + _globals['_MACHINENIC']._serialized_end=1557 + _globals['_MACHINEBLOCKDEVICE']._serialized_start=1559 + _globals['_MACHINEBLOCKDEVICE']._serialized_end=1619 + _globals['_MACHINEBIOS']._serialized_start=1621 + _globals['_MACHINEBIOS']._serialized_end=1704 + _globals['_MACHINEIPMI']._serialized_start=1707 + _globals['_MACHINEIPMI']._serialized_end=1959 + _globals['_MACHINEFRU']._serialized_start=1962 + _globals['_MACHINEFRU']._serialized_end=2536 + _globals['_BOOTSERVICEREPORTREQUEST']._serialized_start=2539 + _globals['_BOOTSERVICEREPORTREQUEST']._serialized_end=2740 + _globals['_BOOTSERVICEREPORTRESPONSE']._serialized_start=2742 + _globals['_BOOTSERVICEREPORTRESPONSE']._serialized_end=2769 + _globals['_BOOTINFO']._serialized_start=2772 + _globals['_BOOTINFO']._serialized_end=2990 + _globals['_BOOTSERVICEABORTREINSTALLREQUEST']._serialized_start=2992 + _globals['_BOOTSERVICEABORTREINSTALLREQUEST']._serialized_end=3092 + _globals['_BOOTSERVICEABORTREINSTALLRESPONSE']._serialized_start=3094 + _globals['_BOOTSERVICEABORTREINSTALLRESPONSE']._serialized_end=3189 + _globals['_BOOTSERVICESUPERUSERPASSWORDREQUEST']._serialized_start=3191 + _globals['_BOOTSERVICESUPERUSERPASSWORDREQUEST']._serialized_end=3248 + _globals['_BOOTSERVICESUPERUSERPASSWORDRESPONSE']._serialized_start=3251 + _globals['_BOOTSERVICESUPERUSERPASSWORDRESPONSE']._serialized_end=3380 + _globals['_BOOTSERVICE']._serialized_start=3383 + _globals['_BOOTSERVICE']._serialized_end=4264 +# @@protoc_insertion_point(module_scope) diff --git a/python/metalstack/infra/v2/boot_pb2.pyi b/python/metalstack/infra/v2/boot_pb2.pyi new file mode 100644 index 00000000..d1be8831 --- /dev/null +++ b/python/metalstack/infra/v2/boot_pb2.pyi @@ -0,0 +1,250 @@ +from metalstack.api.v2 import common_pb2 as _common_pb2 +from google.protobuf.internal import containers as _containers +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from collections.abc import Iterable as _Iterable, Mapping as _Mapping +from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union + +DESCRIPTOR: _descriptor.FileDescriptor + +class BootServiceDhcpRequest(_message.Message): + __slots__ = ("uuid",) + UUID_FIELD_NUMBER: _ClassVar[int] + uuid: str + def __init__(self, uuid: _Optional[str] = ...) -> None: ... + +class BootServiceDhcpResponse(_message.Message): + __slots__ = () + def __init__(self) -> None: ... + +class BootServiceBootRequest(_message.Message): + __slots__ = ("mac", "partition_id") + MAC_FIELD_NUMBER: _ClassVar[int] + PARTITION_ID_FIELD_NUMBER: _ClassVar[int] + mac: str + partition_id: str + def __init__(self, mac: _Optional[str] = ..., partition_id: _Optional[str] = ...) -> None: ... + +class BootServiceBootResponse(_message.Message): + __slots__ = ("kernel", "init_ram_disks", "cmdline") + KERNEL_FIELD_NUMBER: _ClassVar[int] + INIT_RAM_DISKS_FIELD_NUMBER: _ClassVar[int] + CMDLINE_FIELD_NUMBER: _ClassVar[int] + kernel: str + init_ram_disks: _containers.RepeatedScalarFieldContainer[str] + cmdline: str + def __init__(self, kernel: _Optional[str] = ..., init_ram_disks: _Optional[_Iterable[str]] = ..., cmdline: _Optional[str] = ...) -> None: ... + +class BootServiceRegisterRequest(_message.Message): + __slots__ = ("uuid", "hardware", "bios", "ipmi", "tags", "metal_hammer_version", "partition_id") + UUID_FIELD_NUMBER: _ClassVar[int] + HARDWARE_FIELD_NUMBER: _ClassVar[int] + BIOS_FIELD_NUMBER: _ClassVar[int] + IPMI_FIELD_NUMBER: _ClassVar[int] + TAGS_FIELD_NUMBER: _ClassVar[int] + METAL_HAMMER_VERSION_FIELD_NUMBER: _ClassVar[int] + PARTITION_ID_FIELD_NUMBER: _ClassVar[int] + uuid: str + hardware: MachineHardware + bios: MachineBIOS + ipmi: MachineIPMI + tags: _containers.RepeatedScalarFieldContainer[str] + metal_hammer_version: str + partition_id: str + def __init__(self, uuid: _Optional[str] = ..., hardware: _Optional[_Union[MachineHardware, _Mapping]] = ..., bios: _Optional[_Union[MachineBIOS, _Mapping]] = ..., ipmi: _Optional[_Union[MachineIPMI, _Mapping]] = ..., tags: _Optional[_Iterable[str]] = ..., metal_hammer_version: _Optional[str] = ..., partition_id: _Optional[str] = ...) -> None: ... + +class BootServiceRegisterResponse(_message.Message): + __slots__ = ("uuid", "size", "partition_id") + UUID_FIELD_NUMBER: _ClassVar[int] + SIZE_FIELD_NUMBER: _ClassVar[int] + PARTITION_ID_FIELD_NUMBER: _ClassVar[int] + uuid: str + size: str + partition_id: str + def __init__(self, uuid: _Optional[str] = ..., size: _Optional[str] = ..., partition_id: _Optional[str] = ...) -> None: ... + +class BootServiceWaitRequest(_message.Message): + __slots__ = ("uuid",) + UUID_FIELD_NUMBER: _ClassVar[int] + uuid: str + def __init__(self, uuid: _Optional[str] = ...) -> None: ... + +class BootServiceWaitResponse(_message.Message): + __slots__ = () + def __init__(self) -> None: ... + +class MachineHardware(_message.Message): + __slots__ = ("memory", "disks", "nics", "cpus", "gpus") + MEMORY_FIELD_NUMBER: _ClassVar[int] + DISKS_FIELD_NUMBER: _ClassVar[int] + NICS_FIELD_NUMBER: _ClassVar[int] + CPUS_FIELD_NUMBER: _ClassVar[int] + GPUS_FIELD_NUMBER: _ClassVar[int] + memory: int + disks: _containers.RepeatedCompositeFieldContainer[MachineBlockDevice] + nics: _containers.RepeatedCompositeFieldContainer[MachineNic] + cpus: _containers.RepeatedCompositeFieldContainer[MachineCPU] + gpus: _containers.RepeatedCompositeFieldContainer[MachineGPU] + def __init__(self, memory: _Optional[int] = ..., disks: _Optional[_Iterable[_Union[MachineBlockDevice, _Mapping]]] = ..., nics: _Optional[_Iterable[_Union[MachineNic, _Mapping]]] = ..., cpus: _Optional[_Iterable[_Union[MachineCPU, _Mapping]]] = ..., gpus: _Optional[_Iterable[_Union[MachineGPU, _Mapping]]] = ...) -> None: ... + +class MachineCPU(_message.Message): + __slots__ = ("vendor", "model", "cores", "threads") + VENDOR_FIELD_NUMBER: _ClassVar[int] + MODEL_FIELD_NUMBER: _ClassVar[int] + CORES_FIELD_NUMBER: _ClassVar[int] + THREADS_FIELD_NUMBER: _ClassVar[int] + vendor: str + model: str + cores: int + threads: int + def __init__(self, vendor: _Optional[str] = ..., model: _Optional[str] = ..., cores: _Optional[int] = ..., threads: _Optional[int] = ...) -> None: ... + +class MachineGPU(_message.Message): + __slots__ = ("vendor", "model") + VENDOR_FIELD_NUMBER: _ClassVar[int] + MODEL_FIELD_NUMBER: _ClassVar[int] + vendor: str + model: str + def __init__(self, vendor: _Optional[str] = ..., model: _Optional[str] = ...) -> None: ... + +class MachineNic(_message.Message): + __slots__ = ("mac", "name", "vendor", "model", "speed", "neighbors", "hostname", "identifier") + MAC_FIELD_NUMBER: _ClassVar[int] + NAME_FIELD_NUMBER: _ClassVar[int] + VENDOR_FIELD_NUMBER: _ClassVar[int] + MODEL_FIELD_NUMBER: _ClassVar[int] + SPEED_FIELD_NUMBER: _ClassVar[int] + NEIGHBORS_FIELD_NUMBER: _ClassVar[int] + HOSTNAME_FIELD_NUMBER: _ClassVar[int] + IDENTIFIER_FIELD_NUMBER: _ClassVar[int] + mac: str + name: str + vendor: str + model: str + speed: int + neighbors: _containers.RepeatedCompositeFieldContainer[MachineNic] + hostname: str + identifier: str + def __init__(self, mac: _Optional[str] = ..., name: _Optional[str] = ..., vendor: _Optional[str] = ..., model: _Optional[str] = ..., speed: _Optional[int] = ..., neighbors: _Optional[_Iterable[_Union[MachineNic, _Mapping]]] = ..., hostname: _Optional[str] = ..., identifier: _Optional[str] = ...) -> None: ... + +class MachineBlockDevice(_message.Message): + __slots__ = ("name", "size") + NAME_FIELD_NUMBER: _ClassVar[int] + SIZE_FIELD_NUMBER: _ClassVar[int] + name: str + size: int + def __init__(self, name: _Optional[str] = ..., size: _Optional[int] = ...) -> None: ... + +class MachineBIOS(_message.Message): + __slots__ = ("version", "vendor", "date") + VERSION_FIELD_NUMBER: _ClassVar[int] + VENDOR_FIELD_NUMBER: _ClassVar[int] + DATE_FIELD_NUMBER: _ClassVar[int] + version: str + vendor: str + date: str + def __init__(self, version: _Optional[str] = ..., vendor: _Optional[str] = ..., date: _Optional[str] = ...) -> None: ... + +class MachineIPMI(_message.Message): + __slots__ = ("address", "mac", "user", "password", "interface", "fru", "bmc_version", "power_state") + ADDRESS_FIELD_NUMBER: _ClassVar[int] + MAC_FIELD_NUMBER: _ClassVar[int] + USER_FIELD_NUMBER: _ClassVar[int] + PASSWORD_FIELD_NUMBER: _ClassVar[int] + INTERFACE_FIELD_NUMBER: _ClassVar[int] + FRU_FIELD_NUMBER: _ClassVar[int] + BMC_VERSION_FIELD_NUMBER: _ClassVar[int] + POWER_STATE_FIELD_NUMBER: _ClassVar[int] + address: str + mac: str + user: str + password: str + interface: str + fru: MachineFRU + bmc_version: str + power_state: str + def __init__(self, address: _Optional[str] = ..., mac: _Optional[str] = ..., user: _Optional[str] = ..., password: _Optional[str] = ..., interface: _Optional[str] = ..., fru: _Optional[_Union[MachineFRU, _Mapping]] = ..., bmc_version: _Optional[str] = ..., power_state: _Optional[str] = ...) -> None: ... + +class MachineFRU(_message.Message): + __slots__ = ("chassis_part_number", "chassis_part_serial", "board_mfg", "board_mfg_serial", "board_part_number", "product_manufacturer", "product_part_number", "product_serial") + CHASSIS_PART_NUMBER_FIELD_NUMBER: _ClassVar[int] + CHASSIS_PART_SERIAL_FIELD_NUMBER: _ClassVar[int] + BOARD_MFG_FIELD_NUMBER: _ClassVar[int] + BOARD_MFG_SERIAL_FIELD_NUMBER: _ClassVar[int] + BOARD_PART_NUMBER_FIELD_NUMBER: _ClassVar[int] + PRODUCT_MANUFACTURER_FIELD_NUMBER: _ClassVar[int] + PRODUCT_PART_NUMBER_FIELD_NUMBER: _ClassVar[int] + PRODUCT_SERIAL_FIELD_NUMBER: _ClassVar[int] + chassis_part_number: str + chassis_part_serial: str + board_mfg: str + board_mfg_serial: str + board_part_number: str + product_manufacturer: str + product_part_number: str + product_serial: str + def __init__(self, chassis_part_number: _Optional[str] = ..., chassis_part_serial: _Optional[str] = ..., board_mfg: _Optional[str] = ..., board_mfg_serial: _Optional[str] = ..., board_part_number: _Optional[str] = ..., product_manufacturer: _Optional[str] = ..., product_part_number: _Optional[str] = ..., product_serial: _Optional[str] = ...) -> None: ... + +class BootServiceReportRequest(_message.Message): + __slots__ = ("uuid", "console_password", "boot_info", "success", "message") + UUID_FIELD_NUMBER: _ClassVar[int] + CONSOLE_PASSWORD_FIELD_NUMBER: _ClassVar[int] + BOOT_INFO_FIELD_NUMBER: _ClassVar[int] + SUCCESS_FIELD_NUMBER: _ClassVar[int] + MESSAGE_FIELD_NUMBER: _ClassVar[int] + uuid: str + console_password: str + boot_info: BootInfo + success: bool + message: str + def __init__(self, uuid: _Optional[str] = ..., console_password: _Optional[str] = ..., boot_info: _Optional[_Union[BootInfo, _Mapping]] = ..., success: bool = ..., message: _Optional[str] = ...) -> None: ... + +class BootServiceReportResponse(_message.Message): + __slots__ = () + def __init__(self) -> None: ... + +class BootInfo(_message.Message): + __slots__ = ("image_id", "primary_disk", "os_partition", "initrd", "cmdline", "kernel", "bootloader_id") + IMAGE_ID_FIELD_NUMBER: _ClassVar[int] + PRIMARY_DISK_FIELD_NUMBER: _ClassVar[int] + OS_PARTITION_FIELD_NUMBER: _ClassVar[int] + INITRD_FIELD_NUMBER: _ClassVar[int] + CMDLINE_FIELD_NUMBER: _ClassVar[int] + KERNEL_FIELD_NUMBER: _ClassVar[int] + BOOTLOADER_ID_FIELD_NUMBER: _ClassVar[int] + image_id: str + primary_disk: str + os_partition: str + initrd: str + cmdline: str + kernel: str + bootloader_id: str + def __init__(self, image_id: _Optional[str] = ..., primary_disk: _Optional[str] = ..., os_partition: _Optional[str] = ..., initrd: _Optional[str] = ..., cmdline: _Optional[str] = ..., kernel: _Optional[str] = ..., bootloader_id: _Optional[str] = ...) -> None: ... + +class BootServiceAbortReinstallRequest(_message.Message): + __slots__ = ("uuid", "primary_disk_wiped") + UUID_FIELD_NUMBER: _ClassVar[int] + PRIMARY_DISK_WIPED_FIELD_NUMBER: _ClassVar[int] + uuid: str + primary_disk_wiped: bool + def __init__(self, uuid: _Optional[str] = ..., primary_disk_wiped: bool = ...) -> None: ... + +class BootServiceAbortReinstallResponse(_message.Message): + __slots__ = ("boot_info",) + BOOT_INFO_FIELD_NUMBER: _ClassVar[int] + boot_info: BootInfo + def __init__(self, boot_info: _Optional[_Union[BootInfo, _Mapping]] = ...) -> None: ... + +class BootServiceSuperUserPasswordRequest(_message.Message): + __slots__ = ("uuid",) + UUID_FIELD_NUMBER: _ClassVar[int] + uuid: str + def __init__(self, uuid: _Optional[str] = ...) -> None: ... + +class BootServiceSuperUserPasswordResponse(_message.Message): + __slots__ = ("feature_disabled", "super_user_password") + FEATURE_DISABLED_FIELD_NUMBER: _ClassVar[int] + SUPER_USER_PASSWORD_FIELD_NUMBER: _ClassVar[int] + feature_disabled: bool + super_user_password: str + def __init__(self, feature_disabled: bool = ..., super_user_password: _Optional[str] = ...) -> None: ... diff --git a/python/metalstack/infra/v2/boot_pb2_grpc.py b/python/metalstack/infra/v2/boot_pb2_grpc.py new file mode 100644 index 00000000..3fffe45d --- /dev/null +++ b/python/metalstack/infra/v2/boot_pb2_grpc.py @@ -0,0 +1,353 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc + +from metalstack.infra.v2 import boot_pb2 as metalstack_dot_infra_dot_v2_dot_boot__pb2 + + +class BootServiceStub(object): + """BootService is used for all boot related requests, either pixiecore or metal-hammer + Pixiecore + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.Dhcp = channel.unary_unary( + '/metalstack.infra.v2.BootService/Dhcp', + request_serializer=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpRequest.SerializeToString, + response_deserializer=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpResponse.FromString, + _registered_method=True) + self.Boot = channel.unary_unary( + '/metalstack.infra.v2.BootService/Boot', + request_serializer=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootRequest.SerializeToString, + response_deserializer=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootResponse.FromString, + _registered_method=True) + self.SuperUserPassword = channel.unary_unary( + '/metalstack.infra.v2.BootService/SuperUserPassword', + request_serializer=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordRequest.SerializeToString, + response_deserializer=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordResponse.FromString, + _registered_method=True) + self.Register = channel.unary_unary( + '/metalstack.infra.v2.BootService/Register', + request_serializer=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterRequest.SerializeToString, + response_deserializer=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterResponse.FromString, + _registered_method=True) + self.Wait = channel.unary_stream( + '/metalstack.infra.v2.BootService/Wait', + request_serializer=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitRequest.SerializeToString, + response_deserializer=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitResponse.FromString, + _registered_method=True) + self.Report = channel.unary_unary( + '/metalstack.infra.v2.BootService/Report', + request_serializer=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceReportRequest.SerializeToString, + response_deserializer=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceReportResponse.FromString, + _registered_method=True) + self.AbortReinstall = channel.unary_unary( + '/metalstack.infra.v2.BootService/AbortReinstall', + request_serializer=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceAbortReinstallRequest.SerializeToString, + response_deserializer=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceAbortReinstallResponse.FromString, + _registered_method=True) + + +class BootServiceServicer(object): + """BootService is used for all boot related requests, either pixiecore or metal-hammer + Pixiecore + """ + + def Dhcp(self, request, context): + """Dhcp is the first dhcp request (option 97). A ProvisioningEventPXEBooting is fired + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Boot(self, request, context): + """Boot is called from pixie once the machine got the first dhcp response and ipxie asks for subsequent kernel and initrd + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def SuperUserPassword(self, request, context): + """Metal Hammer + + SuperUserPassword metal-hammer takes the configured root password for the bmc from metal-api and configure the bmc accordingly + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Register(self, request, context): + """Register is called from metal-hammer after hardware inventory is finished, tells metal-api all glory details about that machine + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Wait(self, request, context): + """Wait is a hanging call that waits until the machine gets allocated by a user + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Report(self, request, context): + """FIXME after wait finished a MachineServiceGetRequest is required which must be possible with a machine_role_viewer + This should be part of machine.proto + + Report tells metal-api installation was either successful or failed + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def AbortReinstall(self, request, context): + """If reinstall failed and tell metal-api to restore to previous state + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_BootServiceServicer_to_server(servicer, server): + rpc_method_handlers = { + 'Dhcp': grpc.unary_unary_rpc_method_handler( + servicer.Dhcp, + request_deserializer=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpRequest.FromString, + response_serializer=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpResponse.SerializeToString, + ), + 'Boot': grpc.unary_unary_rpc_method_handler( + servicer.Boot, + request_deserializer=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootRequest.FromString, + response_serializer=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootResponse.SerializeToString, + ), + 'SuperUserPassword': grpc.unary_unary_rpc_method_handler( + servicer.SuperUserPassword, + request_deserializer=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordRequest.FromString, + response_serializer=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordResponse.SerializeToString, + ), + 'Register': grpc.unary_unary_rpc_method_handler( + servicer.Register, + request_deserializer=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterRequest.FromString, + response_serializer=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterResponse.SerializeToString, + ), + 'Wait': grpc.unary_stream_rpc_method_handler( + servicer.Wait, + request_deserializer=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitRequest.FromString, + response_serializer=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitResponse.SerializeToString, + ), + 'Report': grpc.unary_unary_rpc_method_handler( + servicer.Report, + request_deserializer=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceReportRequest.FromString, + response_serializer=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceReportResponse.SerializeToString, + ), + 'AbortReinstall': grpc.unary_unary_rpc_method_handler( + servicer.AbortReinstall, + request_deserializer=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceAbortReinstallRequest.FromString, + response_serializer=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceAbortReinstallResponse.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'metalstack.infra.v2.BootService', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('metalstack.infra.v2.BootService', rpc_method_handlers) + + + # This class is part of an EXPERIMENTAL API. +class BootService(object): + """BootService is used for all boot related requests, either pixiecore or metal-hammer + Pixiecore + """ + + @staticmethod + def Dhcp(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/metalstack.infra.v2.BootService/Dhcp', + metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpRequest.SerializeToString, + metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def Boot(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/metalstack.infra.v2.BootService/Boot', + metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootRequest.SerializeToString, + metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def SuperUserPassword(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/metalstack.infra.v2.BootService/SuperUserPassword', + metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordRequest.SerializeToString, + metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def Register(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/metalstack.infra.v2.BootService/Register', + metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterRequest.SerializeToString, + metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def Wait(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_stream( + request, + target, + '/metalstack.infra.v2.BootService/Wait', + metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitRequest.SerializeToString, + metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def Report(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/metalstack.infra.v2.BootService/Report', + metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceReportRequest.SerializeToString, + metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceReportResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def AbortReinstall(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/metalstack.infra.v2.BootService/AbortReinstall', + metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceAbortReinstallRequest.SerializeToString, + metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceAbortReinstallResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) From cbf5240578d1b9acb101a40178faa762bf86e72c Mon Sep 17 00:00:00 2001 From: Stefan Majer Date: Tue, 15 Jul 2025 15:48:49 +0200 Subject: [PATCH 07/27] Validation --- doc/index.html | 2 +- go/metalstack/infra/v2/boot.pb.go | 226 ++++++++++++--------- go/tests/validation/boot_test.go | 36 ++++ proto/metalstack/infra/v2/boot.proto | 251 +++++++++++++++++++----- python/metalstack/infra/v2/boot_pb2.py | 205 ++++++++++++++----- python/metalstack/infra/v2/boot_pb2.pyi | 1 + 6 files changed, 527 insertions(+), 194 deletions(-) create mode 100644 go/tests/validation/boot_test.go diff --git a/doc/index.html b/doc/index.html index 5b025858..fc19b6cd 100644 --- a/doc/index.html +++ b/doc/index.html @@ -15812,7 +15812,7 @@

    BootServiceBootRequest

    - + diff --git a/go/metalstack/infra/v2/boot.pb.go b/go/metalstack/infra/v2/boot.pb.go index db308f52..51358cea 100644 --- a/go/metalstack/infra/v2/boot.pb.go +++ b/go/metalstack/infra/v2/boot.pb.go @@ -7,6 +7,7 @@ package infrav2 import ( + _ "buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate" _ "github.com/metal-stack/api/go/metalstack/api/v2" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" @@ -108,7 +109,7 @@ func (*BootServiceDhcpResponse) Descriptor() ([]byte, []int) { // BootServiceBootRequest is called to get specified parameters to boot a machine with the given mac type BootServiceBootRequest struct { state protoimpl.MessageState `protogen:"open.v1"` - // Mac address of the machein + // Mac address of the machine Mac string `protobuf:"bytes,1,opt,name=mac,proto3" json:"mac,omitempty"` // Partition where this machine is located PartitionId string `protobuf:"bytes,2,opt,name=partition_id,json=partitionId,proto3" json:"partition_id,omitempty"` @@ -1552,90 +1553,125 @@ var File_metalstack_infra_v2_boot_proto protoreflect.FileDescriptor const file_metalstack_infra_v2_boot_proto_rawDesc = "" + "\n" + - "\x1emetalstack/infra/v2/boot.proto\x12\x13metalstack.infra.v2\x1a\x1emetalstack/api/v2/common.proto\",\n" + - "\x16BootServiceDhcpRequest\x12\x12\n" + - "\x04uuid\x18\x01 \x01(\tR\x04uuid\"\x19\n" + - "\x17BootServiceDhcpResponse\"M\n" + - "\x16BootServiceBootRequest\x12\x10\n" + - "\x03mac\x18\x01 \x01(\tR\x03mac\x12!\n" + - "\fpartition_id\x18\x02 \x01(\tR\vpartitionId\"\x82\x01\n" + - "\x17BootServiceBootResponse\x12\x16\n" + - "\x06kernel\x18\x01 \x01(\tR\x06kernel\x12$\n" + - "\x0einit_ram_disks\x18\x02 \x03(\tR\finitRamDisks\x12\x1d\n" + - "\acmdline\x18\x03 \x01(\tH\x00R\acmdline\x88\x01\x01B\n" + + "\x1emetalstack/infra/v2/boot.proto\x12\x13metalstack.infra.v2\x1a\x1bbuf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\"6\n" + + "\x16BootServiceDhcpRequest\x12\x1c\n" + + "\x04uuid\x18\x01 \x01(\tB\b\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\"\x19\n" + + "\x17BootServiceDhcpResponse\"\xc6\x01\n" + + "\x16BootServiceBootRequest\x12}\n" + + "\x03mac\x18\x01 \x01(\tBk\xbaHh\xba\x01e\n" + + "\x03mac\x12\x1fmac must be a valid mac address\x1a=this.matches('^(?:[0-9A-Fa-f]{2}[:-]){5}(?:[0-9A-Fa-f]{2})$')R\x03mac\x12-\n" + + "\fpartition_id\x18\x02 \x01(\tB\n" + + "\xbaH\ar\x05\x10\x02\x18\x80\x01R\vpartitionId\"\xd2\x01\n" + + "\x17BootServiceBootResponse\x12Z\n" + + "\x06kernel\x18\x01 \x01(\tBB\xbaH?\xba\x01<\n" + + "\x10valid_kernel_uri\x12\x1akernel must be a valid URI\x1a\fthis.isUri()R\x06kernel\x12$\n" + + "\x0einit_ram_disks\x18\x02 \x03(\tR\finitRamDisks\x12)\n" + + "\acmdline\x18\x03 \x01(\tB\n" + + "\xbaH\ar\x05\x10\x02\x18\x80\x01H\x00R\acmdline\x88\x01\x01B\n" + "\n" + - "\b_cmdline\"\xc7\x02\n" + - "\x1aBootServiceRegisterRequest\x12\x12\n" + - "\x04uuid\x18\x01 \x01(\tR\x04uuid\x12@\n" + + "\b_cmdline\"\xe9\x02\n" + + "\x1aBootServiceRegisterRequest\x12\x1c\n" + + "\x04uuid\x18\x01 \x01(\tB\b\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12@\n" + "\bhardware\x18\x02 \x01(\v2$.metalstack.infra.v2.MachineHardwareR\bhardware\x124\n" + "\x04bios\x18\x03 \x01(\v2 .metalstack.infra.v2.MachineBIOSR\x04bios\x124\n" + "\x04ipmi\x18\x04 \x01(\v2 .metalstack.infra.v2.MachineIPMIR\x04ipmi\x12\x12\n" + - "\x04tags\x18\x05 \x03(\tR\x04tags\x120\n" + - "\x14metal_hammer_version\x18\x06 \x01(\tR\x12metalHammerVersion\x12!\n" + - "\fpartition_id\x18\a \x01(\tR\vpartitionId\"h\n" + - "\x1bBootServiceRegisterResponse\x12\x12\n" + - "\x04uuid\x18\x01 \x01(\tR\x04uuid\x12\x12\n" + - "\x04size\x18\x02 \x01(\tR\x04size\x12!\n" + - "\fpartition_id\x18\x03 \x01(\tR\vpartitionId\",\n" + - "\x16BootServiceWaitRequest\x12\x12\n" + - "\x04uuid\x18\x01 \x01(\tR\x04uuid\"\x19\n" + + "\x04tags\x18\x05 \x03(\tR\x04tags\x12<\n" + + "\x14metal_hammer_version\x18\x06 \x01(\tB\n" + + "\xbaH\ar\x05\x10\x02\x18\x80\x01R\x12metalHammerVersion\x12-\n" + + "\fpartition_id\x18\a \x01(\tB\n" + + "\xbaH\ar\x05\x10\x02\x18\x80\x01R\vpartitionId\"\x8a\x01\n" + + "\x1bBootServiceRegisterResponse\x12\x1c\n" + + "\x04uuid\x18\x01 \x01(\tB\b\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12\x1e\n" + + "\x04size\x18\x02 \x01(\tB\n" + + "\xbaH\ar\x05\x10\x02\x18\x80\x01R\x04size\x12-\n" + + "\fpartition_id\x18\x03 \x01(\tB\n" + + "\xbaH\ar\x05\x10\x02\x18\x80\x01R\vpartitionId\"6\n" + + "\x16BootServiceWaitRequest\x12\x1c\n" + + "\x04uuid\x18\x01 \x01(\tB\b\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\"\x19\n" + "\x17BootServiceWaitResponse\"\x87\x02\n" + "\x0fMachineHardware\x12\x16\n" + "\x06memory\x18\x01 \x01(\x04R\x06memory\x12=\n" + "\x05disks\x18\x03 \x03(\v2'.metalstack.infra.v2.MachineBlockDeviceR\x05disks\x123\n" + "\x04nics\x18\x04 \x03(\v2\x1f.metalstack.infra.v2.MachineNicR\x04nics\x123\n" + "\x04cpus\x18\x05 \x03(\v2\x1f.metalstack.infra.v2.MachineCPUR\x04cpus\x123\n" + - "\x04gpus\x18\x06 \x03(\v2\x1f.metalstack.infra.v2.MachineGPUR\x04gpus\"j\n" + + "\x04gpus\x18\x06 \x03(\v2\x1f.metalstack.infra.v2.MachineGPUR\x04gpus\"\x82\x01\n" + "\n" + - "MachineCPU\x12\x16\n" + - "\x06vendor\x18\x01 \x01(\tR\x06vendor\x12\x14\n" + - "\x05model\x18\x02 \x01(\tR\x05model\x12\x14\n" + + "MachineCPU\x12\"\n" + + "\x06vendor\x18\x01 \x01(\tB\n" + + "\xbaH\ar\x05\x10\x02\x18\x80\x01R\x06vendor\x12 \n" + + "\x05model\x18\x02 \x01(\tB\n" + + "\xbaH\ar\x05\x10\x02\x18\x80\x01R\x05model\x12\x14\n" + "\x05cores\x18\x03 \x01(\rR\x05cores\x12\x18\n" + - "\athreads\x18\x04 \x01(\rR\athreads\":\n" + + "\athreads\x18\x04 \x01(\rR\athreads\"R\n" + "\n" + - "MachineGPU\x12\x16\n" + - "\x06vendor\x18\x01 \x01(\tR\x06vendor\x12\x14\n" + - "\x05model\x18\x02 \x01(\tR\x05model\"\xf1\x01\n" + + "MachineGPU\x12\"\n" + + "\x06vendor\x18\x01 \x01(\tB\n" + + "\xbaH\ar\x05\x10\x02\x18\x80\x01R\x06vendor\x12 \n" + + "\x05model\x18\x02 \x01(\tB\n" + + "\xbaH\ar\x05\x10\x02\x18\x80\x01R\x05model\"\x9a\x03\n" + "\n" + - "MachineNic\x12\x10\n" + - "\x03mac\x18\x01 \x01(\tR\x03mac\x12\x12\n" + - "\x04name\x18\x02 \x01(\tR\x04name\x12\x16\n" + - "\x06vendor\x18\x03 \x01(\tR\x06vendor\x12\x14\n" + - "\x05model\x18\x04 \x01(\tR\x05model\x12\x14\n" + + "MachineNic\x12}\n" + + "\x03mac\x18\x01 \x01(\tBk\xbaHh\xba\x01e\n" + + "\x03mac\x12\x1fmac must be a valid mac address\x1a=this.matches('^(?:[0-9A-Fa-f]{2}[:-]){5}(?:[0-9A-Fa-f]{2})$')R\x03mac\x12\x1e\n" + + "\x04name\x18\x02 \x01(\tB\n" + + "\xbaH\ar\x05\x10\x02\x18\x80\x01R\x04name\x12\"\n" + + "\x06vendor\x18\x03 \x01(\tB\n" + + "\xbaH\ar\x05\x10\x02\x18\x80\x01R\x06vendor\x12 \n" + + "\x05model\x18\x04 \x01(\tB\n" + + "\xbaH\ar\x05\x10\x02\x18\x80\x01R\x05model\x12\x14\n" + "\x05speed\x18\x05 \x01(\x04R\x05speed\x12=\n" + - "\tneighbors\x18\x06 \x03(\v2\x1f.metalstack.infra.v2.MachineNicR\tneighbors\x12\x1a\n" + - "\bhostname\x18\a \x01(\tR\bhostname\x12\x1e\n" + + "\tneighbors\x18\x06 \x03(\v2\x1f.metalstack.infra.v2.MachineNicR\tneighbors\x12&\n" + + "\bhostname\x18\a \x01(\tB\n" + + "\xbaH\ar\x05\x10\x02\x18\x80\x01R\bhostname\x12*\n" + "\n" + - "identifier\x18\b \x01(\tR\n" + - "identifier\"<\n" + - "\x12MachineBlockDevice\x12\x12\n" + - "\x04name\x18\x01 \x01(\tR\x04name\x12\x12\n" + - "\x04size\x18\x02 \x01(\x04R\x04size\"S\n" + - "\vMachineBIOS\x12\x18\n" + - "\aversion\x18\x01 \x01(\tR\aversion\x12\x16\n" + - "\x06vendor\x18\x02 \x01(\tR\x06vendor\x12\x12\n" + - "\x04date\x18\x03 \x01(\tR\x04date\"\xfc\x01\n" + - "\vMachineIPMI\x12\x18\n" + - "\aaddress\x18\x01 \x01(\tR\aaddress\x12\x10\n" + - "\x03mac\x18\x02 \x01(\tR\x03mac\x12\x12\n" + - "\x04user\x18\x03 \x01(\tR\x04user\x12\x1a\n" + - "\bpassword\x18\x04 \x01(\tR\bpassword\x12\x1c\n" + - "\tinterface\x18\x05 \x01(\tR\tinterface\x121\n" + - "\x03fru\x18\x06 \x01(\v2\x1f.metalstack.infra.v2.MachineFRUR\x03fru\x12\x1f\n" + - "\vbmc_version\x18\a \x01(\tR\n" + - "bmcVersion\x12\x1f\n" + - "\vpower_state\x18\b \x01(\tR\n" + - "powerState\"\xbe\x04\n" + + "identifier\x18\b \x01(\tB\n" + + "\xbaH\ar\x05\x10\x02\x18\x80\x01R\n" + + "identifier\"H\n" + + "\x12MachineBlockDevice\x12\x1e\n" + + "\x04name\x18\x01 \x01(\tB\n" + + "\xbaH\ar\x05\x10\x02\x18\x80\x01R\x04name\x12\x12\n" + + "\x04size\x18\x02 \x01(\x04R\x04size\"k\n" + + "\vMachineBIOS\x12$\n" + + "\aversion\x18\x01 \x01(\tB\n" + + "\xbaH\ar\x05\x10\x02\x18\x80\x01R\aversion\x12\"\n" + + "\x06vendor\x18\x02 \x01(\tB\n" + + "\xbaH\ar\x05\x10\x02\x18\x80\x01R\x06vendor\x12\x12\n" + + "\x04date\x18\x03 \x01(\tR\x04date\"\xae\x03\n" + + "\vMachineIPMI\x12!\n" + + "\aaddress\x18\x01 \x01(\tB\a\xbaH\x04r\x02p\x01R\aaddress\x12}\n" + + "\x03mac\x18\x02 \x01(\tBk\xbaHh\xba\x01e\n" + + "\x03mac\x12\x1fmac must be a valid mac address\x1a=this.matches('^(?:[0-9A-Fa-f]{2}[:-]){5}(?:[0-9A-Fa-f]{2})$')R\x03mac\x12\x1e\n" + + "\x04user\x18\x03 \x01(\tB\n" + + "\xbaH\ar\x05\x10\x02\x18\x80\x01R\x04user\x12&\n" + + "\bpassword\x18\x04 \x01(\tB\n" + + "\xbaH\ar\x05\x10\x02\x18\x80\x01R\bpassword\x12(\n" + + "\tinterface\x18\x05 \x01(\tB\n" + + "\xbaH\ar\x05\x10\x02\x18\x80\x01R\tinterface\x121\n" + + "\x03fru\x18\x06 \x01(\v2\x1f.metalstack.infra.v2.MachineFRUR\x03fru\x12+\n" + + "\vbmc_version\x18\a \x01(\tB\n" + + "\xbaH\ar\x05\x10\x02\x18\x80\x01R\n" + + "bmcVersion\x12+\n" + + "\vpower_state\x18\b \x01(\tB\n" + + "\xbaH\ar\x05\x10\x02\x18\x80\x01R\n" + + "powerState\"\x9e\x05\n" + "\n" + - "MachineFRU\x123\n" + - "\x13chassis_part_number\x18\x01 \x01(\tH\x00R\x11chassisPartNumber\x88\x01\x01\x123\n" + - "\x13chassis_part_serial\x18\x02 \x01(\tH\x01R\x11chassisPartSerial\x88\x01\x01\x12 \n" + - "\tboard_mfg\x18\x03 \x01(\tH\x02R\bboardMfg\x88\x01\x01\x12-\n" + - "\x10board_mfg_serial\x18\x04 \x01(\tH\x03R\x0eboardMfgSerial\x88\x01\x01\x12/\n" + - "\x11board_part_number\x18\x05 \x01(\tH\x04R\x0fboardPartNumber\x88\x01\x01\x126\n" + - "\x14product_manufacturer\x18\x06 \x01(\tH\x05R\x13productManufacturer\x88\x01\x01\x123\n" + - "\x13product_part_number\x18\a \x01(\tH\x06R\x11productPartNumber\x88\x01\x01\x12*\n" + - "\x0eproduct_serial\x18\b \x01(\tH\aR\rproductSerial\x88\x01\x01B\x16\n" + + "MachineFRU\x12?\n" + + "\x13chassis_part_number\x18\x01 \x01(\tB\n" + + "\xbaH\ar\x05\x10\x02\x18\x80\x01H\x00R\x11chassisPartNumber\x88\x01\x01\x12?\n" + + "\x13chassis_part_serial\x18\x02 \x01(\tB\n" + + "\xbaH\ar\x05\x10\x02\x18\x80\x01H\x01R\x11chassisPartSerial\x88\x01\x01\x12,\n" + + "\tboard_mfg\x18\x03 \x01(\tB\n" + + "\xbaH\ar\x05\x10\x02\x18\x80\x01H\x02R\bboardMfg\x88\x01\x01\x129\n" + + "\x10board_mfg_serial\x18\x04 \x01(\tB\n" + + "\xbaH\ar\x05\x10\x02\x18\x80\x01H\x03R\x0eboardMfgSerial\x88\x01\x01\x12;\n" + + "\x11board_part_number\x18\x05 \x01(\tB\n" + + "\xbaH\ar\x05\x10\x02\x18\x80\x01H\x04R\x0fboardPartNumber\x88\x01\x01\x12B\n" + + "\x14product_manufacturer\x18\x06 \x01(\tB\n" + + "\xbaH\ar\x05\x10\x02\x18\x80\x01H\x05R\x13productManufacturer\x88\x01\x01\x12?\n" + + "\x13product_part_number\x18\a \x01(\tB\n" + + "\xbaH\ar\x05\x10\x02\x18\x80\x01H\x06R\x11productPartNumber\x88\x01\x01\x126\n" + + "\x0eproduct_serial\x18\b \x01(\tB\n" + + "\xbaH\ar\x05\x10\x02\x18\x80\x01H\aR\rproductSerial\x88\x01\x01B\x16\n" + "\x14_chassis_part_numberB\x16\n" + "\x14_chassis_part_serialB\f\n" + "\n" + @@ -1644,32 +1680,42 @@ const file_metalstack_infra_v2_boot_proto_rawDesc = "" + "\x12_board_part_numberB\x17\n" + "\x15_product_manufacturerB\x16\n" + "\x14_product_part_numberB\x11\n" + - "\x0f_product_serial\"\xc9\x01\n" + - "\x18BootServiceReportRequest\x12\x12\n" + - "\x04uuid\x18\x01 \x01(\tR\x04uuid\x12)\n" + - "\x10console_password\x18\x02 \x01(\tR\x0fconsolePassword\x12:\n" + + "\x0f_product_serial\"\xeb\x01\n" + + "\x18BootServiceReportRequest\x12\x1c\n" + + "\x04uuid\x18\x01 \x01(\tB\b\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x125\n" + + "\x10console_password\x18\x02 \x01(\tB\n" + + "\xbaH\ar\x05\x10\x02\x18\x80\x01R\x0fconsolePassword\x12:\n" + "\tboot_info\x18\x03 \x01(\v2\x1d.metalstack.infra.v2.BootInfoR\bbootInfo\x12\x18\n" + - "\asuccess\x18\x04 \x01(\bR\asuccess\x12\x18\n" + - "\amessage\x18\x05 \x01(\tR\amessage\"\x1b\n" + - "\x19BootServiceReportResponse\"\xda\x01\n" + - "\bBootInfo\x12\x19\n" + - "\bimage_id\x18\x01 \x01(\tR\aimageId\x12!\n" + - "\fprimary_disk\x18\x02 \x01(\tR\vprimaryDisk\x12!\n" + - "\fos_partition\x18\x03 \x01(\tR\vosPartition\x12\x16\n" + - "\x06initrd\x18\x04 \x01(\tR\x06initrd\x12\x18\n" + - "\acmdline\x18\x05 \x01(\tR\acmdline\x12\x16\n" + - "\x06kernel\x18\x06 \x01(\tR\x06kernel\x12#\n" + - "\rbootloader_id\x18\b \x01(\tR\fbootloaderId\"d\n" + - " BootServiceAbortReinstallRequest\x12\x12\n" + - "\x04uuid\x18\x01 \x01(\tR\x04uuid\x12,\n" + + "\asuccess\x18\x04 \x01(\bR\asuccess\x12$\n" + + "\amessage\x18\x05 \x01(\tB\n" + + "\xbaH\ar\x05\x10\x02\x18\x80\x04R\amessage\"\x1b\n" + + "\x19BootServiceReportResponse\"\xae\x02\n" + + "\bBootInfo\x12%\n" + + "\bimage_id\x18\x01 \x01(\tB\n" + + "\xbaH\ar\x05\x10\x02\x18\x80\x01R\aimageId\x12-\n" + + "\fprimary_disk\x18\x02 \x01(\tB\n" + + "\xbaH\ar\x05\x10\x02\x18\x80\x01R\vprimaryDisk\x12-\n" + + "\fos_partition\x18\x03 \x01(\tB\n" + + "\xbaH\ar\x05\x10\x02\x18\x80\x01R\vosPartition\x12\"\n" + + "\x06initrd\x18\x04 \x01(\tB\n" + + "\xbaH\ar\x05\x10\x02\x18\x80\x01R\x06initrd\x12$\n" + + "\acmdline\x18\x05 \x01(\tB\n" + + "\xbaH\ar\x05\x10\x02\x18\x80\x01R\acmdline\x12\"\n" + + "\x06kernel\x18\x06 \x01(\tB\n" + + "\xbaH\ar\x05\x10\x02\x18\x80\x01R\x06kernel\x12/\n" + + "\rbootloader_id\x18\b \x01(\tB\n" + + "\xbaH\ar\x05\x10\x02\x18\x80\x01R\fbootloaderId\"n\n" + + " BootServiceAbortReinstallRequest\x12\x1c\n" + + "\x04uuid\x18\x01 \x01(\tB\b\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12,\n" + "\x12primary_disk_wiped\x18\x02 \x01(\bR\x10primaryDiskWiped\"_\n" + "!BootServiceAbortReinstallResponse\x12:\n" + - "\tboot_info\x18\x01 \x01(\v2\x1d.metalstack.infra.v2.BootInfoR\bbootInfo\"9\n" + - "#BootServiceSuperUserPasswordRequest\x12\x12\n" + - "\x04uuid\x18\x01 \x01(\tR\x04uuid\"\x81\x01\n" + + "\tboot_info\x18\x01 \x01(\v2\x1d.metalstack.infra.v2.BootInfoR\bbootInfo\"C\n" + + "#BootServiceSuperUserPasswordRequest\x12\x1c\n" + + "\x04uuid\x18\x01 \x01(\tB\b\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\"\x8d\x01\n" + "$BootServiceSuperUserPasswordResponse\x12)\n" + - "\x10feature_disabled\x18\x01 \x01(\bR\x0ffeatureDisabled\x12.\n" + - "\x13super_user_password\x18\x02 \x01(\tR\x11superUserPassword2\xf1\x06\n" + + "\x10feature_disabled\x18\x01 \x01(\bR\x0ffeatureDisabled\x12:\n" + + "\x13super_user_password\x18\x02 \x01(\tB\n" + + "\xbaH\ar\x05\x10\x02\x18\x80\x01R\x11superUserPassword2\xf1\x06\n" + "\vBootService\x12m\n" + "\x04Dhcp\x12+.metalstack.infra.v2.BootServiceDhcpRequest\x1a,.metalstack.infra.v2.BootServiceDhcpResponse\"\n" + "\xe0\xf3\x18\x02\xea\xf3\x18\x02\x01\x02\x12m\n" + diff --git a/go/tests/validation/boot_test.go b/go/tests/validation/boot_test.go new file mode 100644 index 00000000..6fb6da79 --- /dev/null +++ b/go/tests/validation/boot_test.go @@ -0,0 +1,36 @@ +package validation + +import ( + "testing" + + "buf.build/go/protovalidate" + infrav2 "github.com/metal-stack/api/go/metalstack/infra/v2" + "github.com/stretchr/testify/require" +) + +func TestValidateBoot(t *testing.T) { + validator, err := protovalidate.New() + require.NoError(t, err) + + tests := prototests{ + { + name: "Valid BootServiceBootRequest", + msg: &infrav2.BootServiceBootRequest{ + PartitionId: "partition-1", + Mac: "00:00:00:00:00:01", + }, + wantErr: false, + }, + { + name: "InValid BootServiceBootRequest", + msg: &infrav2.BootServiceBootRequest{ + PartitionId: "p1", + Mac: "X0-00:00:00:00:00:01", + }, + wantErr: true, + wantErrorMessage: `validation error: + - mac: mac must be a valid mac address [mac]`, + }, + } + validateProtos(t, tests, validator) +} diff --git a/proto/metalstack/infra/v2/boot.proto b/proto/metalstack/infra/v2/boot.proto index 0a7c6a0e..9dcb9f4a 100644 --- a/proto/metalstack/infra/v2/boot.proto +++ b/proto/metalstack/infra/v2/boot.proto @@ -2,6 +2,7 @@ syntax = "proto3"; package metalstack.infra.v2; +import "buf/validate/validate.proto"; import "metalstack/api/v2/common.proto"; // BootService is used for all boot related requests, either pixiecore or metal-hammer @@ -62,7 +63,7 @@ service BootService { // BootServiceDhcpRequest is called once a machine issues a dhcp request message BootServiceDhcpRequest { // UUID of the machine - string uuid = 1; + string uuid = 1 [(buf.validate.field).string.uuid = true]; } // BootServiceDhcpResponse contains the response to a dhcp request @@ -70,26 +71,43 @@ message BootServiceDhcpResponse {} // BootServiceBootRequest is called to get specified parameters to boot a machine with the given mac message BootServiceBootRequest { - // Mac address of the machein - string mac = 1; + // Mac address of the machine + string mac = 1 [(buf.validate.field).cel = { + id: "mac" + message: "mac must be a valid mac address" + expression: "this.matches('^(?:[0-9A-Fa-f]{2}[:-]){5}(?:[0-9A-Fa-f]{2})$')" + }]; // Partition where this machine is located - string partition_id = 2; + string partition_id = 2 [(buf.validate.field).string = { + min_len: 2 + max_len: 128 + }]; } // BootServiceBootResponse contains additional infos which are required to boot a machine message BootServiceBootResponse { // Kernel is the url to the linux kernel to boot - string kernel = 1; + string kernel = 1 [(buf.validate.field).cel = { + id: "valid_kernel_uri" + message: "kernel must be a valid URI" + // `isUri` validates that a string is an absolute URI. + // This expression validates that the uri field is an absolute URI. + // Note: to allow relative URI, use `isUriRef`. + expression: "this.isUri()" + }]; // Initial ram disk is the url to the initial ram disk to boot repeated string init_ram_disks = 2; // CMDLine contains kernel command line parameters to boot - optional string cmdline = 3; + optional string cmdline = 3 [(buf.validate.field).string = { + min_len: 2 + max_len: 128 + }]; } // BootServiceRegisterRequest is called from metal-hammer to register a machine with as much hardware details as possible message BootServiceRegisterRequest { // UUID of this machine - string uuid = 1; + string uuid = 1 [(buf.validate.field).string.uuid = true]; // Hardware details of this machine MachineHardware hardware = 2; // Bios details of this machine @@ -99,25 +117,37 @@ message BootServiceRegisterRequest { // Tags of this machine repeated string tags = 5; // MetalHammer version this machine was bootet into - string metal_hammer_version = 6; + string metal_hammer_version = 6 [(buf.validate.field).string = { + min_len: 2 + max_len: 128 + }]; // Partition where this machine is located - string partition_id = 7; + string partition_id = 7 [(buf.validate.field).string = { + min_len: 2 + max_len: 128 + }]; } // BootServiceRegisterResponse response to a BootServiceRegisterResponse request message BootServiceRegisterResponse { // UUID of this machine - string uuid = 1; + string uuid = 1 [(buf.validate.field).string.uuid = true]; // Size is the calculated size from given hardware details - string size = 2; + string size = 2 [(buf.validate.field).string = { + min_len: 2 + max_len: 128 + }]; // Partition of this machine - string partition_id = 3; + string partition_id = 3 [(buf.validate.field).string = { + min_len: 2 + max_len: 128 + }]; } // BootServiceWaitRequest is called when a machine was registered and is waiting for allocation message BootServiceWaitRequest { // UUID of this machine - string uuid = 1; + string uuid = 1 [(buf.validate.field).string.uuid = true]; } // BootServiceWaitResponse response to a wait request @@ -140,9 +170,15 @@ message MachineHardware { // MachineCPU describes a physical CPU message MachineCPU { // Vendor of this cpu - string vendor = 1; + string vendor = 1 [(buf.validate.field).string = { + min_len: 2 + max_len: 128 + }]; // Model of this cpu - string model = 2; + string model = 2 [(buf.validate.field).string = { + min_len: 2 + max_len: 128 + }]; // Cores in this cpu uint32 cores = 3; // Threads total in this cpu @@ -152,35 +188,63 @@ message MachineCPU { // MachineGPU describes a physical GPU message MachineGPU { // Vendor of this gpu - string vendor = 1; + string vendor = 1 [(buf.validate.field).string = { + min_len: 2 + max_len: 128 + }]; // Model of this gpu - string model = 2; + string model = 2 [(buf.validate.field).string = { + min_len: 2 + max_len: 128 + }]; } // MachineNIC describes a network interface card message MachineNic { // Mac address of this network card - string mac = 1; + string mac = 1 [(buf.validate.field).cel = { + id: "mac" + message: "mac must be a valid mac address" + expression: "this.matches('^(?:[0-9A-Fa-f]{2}[:-]){5}(?:[0-9A-Fa-f]{2})$')" + }]; // Name in the os of this network card, e.g. eth0 - string name = 2; + string name = 2 [(buf.validate.field).string = { + min_len: 2 + max_len: 128 + }]; // Vendor of this network card - string vendor = 3; + string vendor = 3 [(buf.validate.field).string = { + min_len: 2 + max_len: 128 + }]; // Model of this network card - string model = 4; + string model = 4 [(buf.validate.field).string = { + min_len: 2 + max_len: 128 + }]; // Speed in bits/second of this network card uint64 speed = 5; // Neighbors connected to this network card repeated MachineNic neighbors = 6; // Hostname FIXME clarify usage - string hostname = 7; + string hostname = 7 [(buf.validate.field).string = { + min_len: 2 + max_len: 128 + }]; // Identifier of this network card - string identifier = 8; + string identifier = 8 [(buf.validate.field).string = { + min_len: 2 + max_len: 128 + }]; } // MachineBlockDevice defines a disk built into a machine message MachineBlockDevice { // Name of this device - string name = 1; + string name = 1 [(buf.validate.field).string = { + min_len: 2 + max_len: 128 + }]; // Size in bytes of this device uint64 size = 2; } @@ -188,9 +252,15 @@ message MachineBlockDevice { // MachineBIOS describes details of the machine bios message MachineBIOS { // Version of the bios - string version = 1; + string version = 1 [(buf.validate.field).string = { + min_len: 2 + max_len: 128 + }]; // Vendor of the bios - string vendor = 2; + string vendor = 2 [(buf.validate.field).string = { + min_len: 2 + max_len: 128 + }]; // Date of the bios string date = 3; } @@ -198,55 +268,104 @@ message MachineBIOS { // MachineIPMI describe details of the ipmi or out of band device message MachineIPMI { // Address of this ipmi device from outside - string address = 1; + string address = 1 [(buf.validate.field).string.ip = true]; // Mac address of the network interface of this ipmi device - string mac = 2; + string mac = 2 [(buf.validate.field).cel = { + id: "mac" + message: "mac must be a valid mac address" + expression: "this.matches('^(?:[0-9A-Fa-f]{2}[:-]){5}(?:[0-9A-Fa-f]{2})$')" + }]; // User of this ipmi device - string user = 3; + string user = 3 [(buf.validate.field).string = { + min_len: 2 + max_len: 128 + }]; // Password of this ipmi device - string password = 4; + string password = 4 [(buf.validate.field).string = { + min_len: 2 + max_len: 128 + }]; // Interface of this ipmi device - string interface = 5; + string interface = 5 [(buf.validate.field).string = { + min_len: 2 + max_len: 128 + }]; // FRU field replaceable unit details for this machine MachineFRU fru = 6; // BMCVersion of this ipmi device - string bmc_version = 7; + string bmc_version = 7 [(buf.validate.field).string = { + min_len: 2 + max_len: 128 + }]; // PowerState of this machine - string power_state = 8; + string power_state = 8 [(buf.validate.field).string = { + min_len: 2 + max_len: 128 + }]; } // MachineFRU describes details to the machine which are required in case of a necessary replacement message MachineFRU { // ChassisPartNumber is the part number of the machine chassis - optional string chassis_part_number = 1; + optional string chassis_part_number = 1 [(buf.validate.field).string = { + min_len: 2 + max_len: 128 + }]; // ChassisPartSerial is the serial number of the machine chassis - optional string chassis_part_serial = 2; + optional string chassis_part_serial = 2 [(buf.validate.field).string = { + min_len: 2 + max_len: 128 + }]; // BoardMFG is the short description of the mainboard - optional string board_mfg = 3; + optional string board_mfg = 3 [(buf.validate.field).string = { + min_len: 2 + max_len: 128 + }]; // BoardSerial is the serial number of the mainboard - optional string board_mfg_serial = 4; + optional string board_mfg_serial = 4 [(buf.validate.field).string = { + min_len: 2 + max_len: 128 + }]; // BoardPartNumber is the part number of the mainboard - optional string board_part_number = 5; + optional string board_part_number = 5 [(buf.validate.field).string = { + min_len: 2 + max_len: 128 + }]; // ProductManufacturer is the manufacturer of the machine - optional string product_manufacturer = 6; + optional string product_manufacturer = 6 [(buf.validate.field).string = { + min_len: 2 + max_len: 128 + }]; // ProductPartNumber is the part number of the machine - optional string product_part_number = 7; + optional string product_part_number = 7 [(buf.validate.field).string = { + min_len: 2 + max_len: 128 + }]; // ProductSerial is the serial number of the machine - optional string product_serial = 8; + optional string product_serial = 8 [(buf.validate.field).string = { + min_len: 2 + max_len: 128 + }]; } // BootServiceReportRequest is sent from metal-hammer to the api to report the outcome of the register message BootServiceReportRequest { // UUID of the machine to boot - string uuid = 1; + string uuid = 1 [(buf.validate.field).string.uuid = true]; // Console_Password - string console_password = 2; + string console_password = 2 [(buf.validate.field).string = { + min_len: 2 + max_len: 128 + }]; // BootInfo contains all details which are the result of registration and allocation BootInfo boot_info = 3; // Success is set to true of the allocation succeeded bool success = 4; // Message contains additional information if installation failed - string message = 5; + string message = 5 [(buf.validate.field).string = { + min_len: 2 + max_len: 512 + }]; } // BootServiceReportRequest is the response to a BootServiceReportRequest @@ -255,25 +374,46 @@ message BootServiceReportResponse {} // BootInfo contains calculated values of a allocation message BootInfo { // Image which is going to be installed - string image_id = 1; + string image_id = 1 [(buf.validate.field).string = { + min_len: 2 + max_len: 128 + }]; // PrimaryDisk the machine boots from - string primary_disk = 2; + string primary_disk = 2 [(buf.validate.field).string = { + min_len: 2 + max_len: 128 + }]; // OSPartition where the operating system is stored - string os_partition = 3; + string os_partition = 3 [(buf.validate.field).string = { + min_len: 2 + max_len: 128 + }]; // Initrd the name of the initial ram disk - string initrd = 4; + string initrd = 4 [(buf.validate.field).string = { + min_len: 2 + max_len: 128 + }]; // Cmdline of the kernel - string cmdline = 5; + string cmdline = 5 [(buf.validate.field).string = { + min_len: 2 + max_len: 128 + }]; // Kernel to boot from - string kernel = 6; + string kernel = 6 [(buf.validate.field).string = { + min_len: 2 + max_len: 128 + }]; // BootloadID which is used to boot - string bootloader_id = 8; + string bootloader_id = 8 [(buf.validate.field).string = { + min_len: 2 + max_len: 128 + }]; } // BootServiceAbortReinstallRequest is called if the reinstallation failed and must aborted message BootServiceAbortReinstallRequest { // UUID of this machine - string uuid = 1; + string uuid = 1 [(buf.validate.field).string.uuid = true]; // PrimaryDiskWiped is set to true if the primary disk was wiped bool primary_disk_wiped = 2; } @@ -287,7 +427,7 @@ message BootServiceAbortReinstallResponse { // BootServiceSuperUserPasswordRequest this call returns the password for the machine superuser message BootServiceSuperUserPasswordRequest { // UUID of this machine - string uuid = 1; + string uuid = 1 [(buf.validate.field).string.uuid = true]; } // BootServiceSuperUserPasswordResponse the super user password is returned @@ -295,5 +435,8 @@ message BootServiceSuperUserPasswordResponse { // FeatureDisable FIXME bool feature_disabled = 1; // SuperUserPassword is the password of the superuser on the ipmi device - string super_user_password = 2; + string super_user_password = 2 [(buf.validate.field).string = { + min_len: 2 + max_len: 128 + }]; } diff --git a/python/metalstack/infra/v2/boot_pb2.py b/python/metalstack/infra/v2/boot_pb2.py index 9ff977a6..753abc74 100644 --- a/python/metalstack/infra/v2/boot_pb2.py +++ b/python/metalstack/infra/v2/boot_pb2.py @@ -22,10 +22,11 @@ _sym_db = _symbol_database.Default() +from buf.validate import validate_pb2 as buf_dot_validate_dot_validate__pb2 from metalstack.api.v2 import common_pb2 as metalstack_dot_api_dot_v2_dot_common__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1emetalstack/infra/v2/boot.proto\x12\x13metalstack.infra.v2\x1a\x1emetalstack/api/v2/common.proto\",\n\x16\x42ootServiceDhcpRequest\x12\x12\n\x04uuid\x18\x01 \x01(\tR\x04uuid\"\x19\n\x17\x42ootServiceDhcpResponse\"M\n\x16\x42ootServiceBootRequest\x12\x10\n\x03mac\x18\x01 \x01(\tR\x03mac\x12!\n\x0cpartition_id\x18\x02 \x01(\tR\x0bpartitionId\"\x82\x01\n\x17\x42ootServiceBootResponse\x12\x16\n\x06kernel\x18\x01 \x01(\tR\x06kernel\x12$\n\x0einit_ram_disks\x18\x02 \x03(\tR\x0cinitRamDisks\x12\x1d\n\x07\x63mdline\x18\x03 \x01(\tH\x00R\x07\x63mdline\x88\x01\x01\x42\n\n\x08_cmdline\"\xc7\x02\n\x1a\x42ootServiceRegisterRequest\x12\x12\n\x04uuid\x18\x01 \x01(\tR\x04uuid\x12@\n\x08hardware\x18\x02 \x01(\x0b\x32$.metalstack.infra.v2.MachineHardwareR\x08hardware\x12\x34\n\x04\x62ios\x18\x03 \x01(\x0b\x32 .metalstack.infra.v2.MachineBIOSR\x04\x62ios\x12\x34\n\x04ipmi\x18\x04 \x01(\x0b\x32 .metalstack.infra.v2.MachineIPMIR\x04ipmi\x12\x12\n\x04tags\x18\x05 \x03(\tR\x04tags\x12\x30\n\x14metal_hammer_version\x18\x06 \x01(\tR\x12metalHammerVersion\x12!\n\x0cpartition_id\x18\x07 \x01(\tR\x0bpartitionId\"h\n\x1b\x42ootServiceRegisterResponse\x12\x12\n\x04uuid\x18\x01 \x01(\tR\x04uuid\x12\x12\n\x04size\x18\x02 \x01(\tR\x04size\x12!\n\x0cpartition_id\x18\x03 \x01(\tR\x0bpartitionId\",\n\x16\x42ootServiceWaitRequest\x12\x12\n\x04uuid\x18\x01 \x01(\tR\x04uuid\"\x19\n\x17\x42ootServiceWaitResponse\"\x87\x02\n\x0fMachineHardware\x12\x16\n\x06memory\x18\x01 \x01(\x04R\x06memory\x12=\n\x05\x64isks\x18\x03 \x03(\x0b\x32\'.metalstack.infra.v2.MachineBlockDeviceR\x05\x64isks\x12\x33\n\x04nics\x18\x04 \x03(\x0b\x32\x1f.metalstack.infra.v2.MachineNicR\x04nics\x12\x33\n\x04\x63pus\x18\x05 \x03(\x0b\x32\x1f.metalstack.infra.v2.MachineCPUR\x04\x63pus\x12\x33\n\x04gpus\x18\x06 \x03(\x0b\x32\x1f.metalstack.infra.v2.MachineGPUR\x04gpus\"j\n\nMachineCPU\x12\x16\n\x06vendor\x18\x01 \x01(\tR\x06vendor\x12\x14\n\x05model\x18\x02 \x01(\tR\x05model\x12\x14\n\x05\x63ores\x18\x03 \x01(\rR\x05\x63ores\x12\x18\n\x07threads\x18\x04 \x01(\rR\x07threads\":\n\nMachineGPU\x12\x16\n\x06vendor\x18\x01 \x01(\tR\x06vendor\x12\x14\n\x05model\x18\x02 \x01(\tR\x05model\"\xf1\x01\n\nMachineNic\x12\x10\n\x03mac\x18\x01 \x01(\tR\x03mac\x12\x12\n\x04name\x18\x02 \x01(\tR\x04name\x12\x16\n\x06vendor\x18\x03 \x01(\tR\x06vendor\x12\x14\n\x05model\x18\x04 \x01(\tR\x05model\x12\x14\n\x05speed\x18\x05 \x01(\x04R\x05speed\x12=\n\tneighbors\x18\x06 \x03(\x0b\x32\x1f.metalstack.infra.v2.MachineNicR\tneighbors\x12\x1a\n\x08hostname\x18\x07 \x01(\tR\x08hostname\x12\x1e\n\nidentifier\x18\x08 \x01(\tR\nidentifier\"<\n\x12MachineBlockDevice\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x12\n\x04size\x18\x02 \x01(\x04R\x04size\"S\n\x0bMachineBIOS\x12\x18\n\x07version\x18\x01 \x01(\tR\x07version\x12\x16\n\x06vendor\x18\x02 \x01(\tR\x06vendor\x12\x12\n\x04\x64\x61te\x18\x03 \x01(\tR\x04\x64\x61te\"\xfc\x01\n\x0bMachineIPMI\x12\x18\n\x07\x61\x64\x64ress\x18\x01 \x01(\tR\x07\x61\x64\x64ress\x12\x10\n\x03mac\x18\x02 \x01(\tR\x03mac\x12\x12\n\x04user\x18\x03 \x01(\tR\x04user\x12\x1a\n\x08password\x18\x04 \x01(\tR\x08password\x12\x1c\n\tinterface\x18\x05 \x01(\tR\tinterface\x12\x31\n\x03\x66ru\x18\x06 \x01(\x0b\x32\x1f.metalstack.infra.v2.MachineFRUR\x03\x66ru\x12\x1f\n\x0b\x62mc_version\x18\x07 \x01(\tR\nbmcVersion\x12\x1f\n\x0bpower_state\x18\x08 \x01(\tR\npowerState\"\xbe\x04\n\nMachineFRU\x12\x33\n\x13\x63hassis_part_number\x18\x01 \x01(\tH\x00R\x11\x63hassisPartNumber\x88\x01\x01\x12\x33\n\x13\x63hassis_part_serial\x18\x02 \x01(\tH\x01R\x11\x63hassisPartSerial\x88\x01\x01\x12 \n\tboard_mfg\x18\x03 \x01(\tH\x02R\x08\x62oardMfg\x88\x01\x01\x12-\n\x10\x62oard_mfg_serial\x18\x04 \x01(\tH\x03R\x0e\x62oardMfgSerial\x88\x01\x01\x12/\n\x11\x62oard_part_number\x18\x05 \x01(\tH\x04R\x0f\x62oardPartNumber\x88\x01\x01\x12\x36\n\x14product_manufacturer\x18\x06 \x01(\tH\x05R\x13productManufacturer\x88\x01\x01\x12\x33\n\x13product_part_number\x18\x07 \x01(\tH\x06R\x11productPartNumber\x88\x01\x01\x12*\n\x0eproduct_serial\x18\x08 \x01(\tH\x07R\rproductSerial\x88\x01\x01\x42\x16\n\x14_chassis_part_numberB\x16\n\x14_chassis_part_serialB\x0c\n\n_board_mfgB\x13\n\x11_board_mfg_serialB\x14\n\x12_board_part_numberB\x17\n\x15_product_manufacturerB\x16\n\x14_product_part_numberB\x11\n\x0f_product_serial\"\xc9\x01\n\x18\x42ootServiceReportRequest\x12\x12\n\x04uuid\x18\x01 \x01(\tR\x04uuid\x12)\n\x10\x63onsole_password\x18\x02 \x01(\tR\x0f\x63onsolePassword\x12:\n\tboot_info\x18\x03 \x01(\x0b\x32\x1d.metalstack.infra.v2.BootInfoR\x08\x62ootInfo\x12\x18\n\x07success\x18\x04 \x01(\x08R\x07success\x12\x18\n\x07message\x18\x05 \x01(\tR\x07message\"\x1b\n\x19\x42ootServiceReportResponse\"\xda\x01\n\x08\x42ootInfo\x12\x19\n\x08image_id\x18\x01 \x01(\tR\x07imageId\x12!\n\x0cprimary_disk\x18\x02 \x01(\tR\x0bprimaryDisk\x12!\n\x0cos_partition\x18\x03 \x01(\tR\x0bosPartition\x12\x16\n\x06initrd\x18\x04 \x01(\tR\x06initrd\x12\x18\n\x07\x63mdline\x18\x05 \x01(\tR\x07\x63mdline\x12\x16\n\x06kernel\x18\x06 \x01(\tR\x06kernel\x12#\n\rbootloader_id\x18\x08 \x01(\tR\x0c\x62ootloaderId\"d\n BootServiceAbortReinstallRequest\x12\x12\n\x04uuid\x18\x01 \x01(\tR\x04uuid\x12,\n\x12primary_disk_wiped\x18\x02 \x01(\x08R\x10primaryDiskWiped\"_\n!BootServiceAbortReinstallResponse\x12:\n\tboot_info\x18\x01 \x01(\x0b\x32\x1d.metalstack.infra.v2.BootInfoR\x08\x62ootInfo\"9\n#BootServiceSuperUserPasswordRequest\x12\x12\n\x04uuid\x18\x01 \x01(\tR\x04uuid\"\x81\x01\n$BootServiceSuperUserPasswordResponse\x12)\n\x10\x66\x65\x61ture_disabled\x18\x01 \x01(\x08R\x0f\x66\x65\x61tureDisabled\x12.\n\x13super_user_password\x18\x02 \x01(\tR\x11superUserPassword2\xf1\x06\n\x0b\x42ootService\x12m\n\x04\x44hcp\x12+.metalstack.infra.v2.BootServiceDhcpRequest\x1a,.metalstack.infra.v2.BootServiceDhcpResponse\"\n\xe0\xf3\x18\x02\xea\xf3\x18\x02\x01\x02\x12m\n\x04\x42oot\x12+.metalstack.infra.v2.BootServiceBootRequest\x1a,.metalstack.infra.v2.BootServiceBootResponse\"\n\xe0\xf3\x18\x02\xea\xf3\x18\x02\x01\x02\x12\x94\x01\n\x11SuperUserPassword\x12\x38.metalstack.infra.v2.BootServiceSuperUserPasswordRequest\x1a\x39.metalstack.infra.v2.BootServiceSuperUserPasswordResponse\"\n\xe0\xf3\x18\x02\xf2\xf3\x18\x02\x01\x02\x12y\n\x08Register\x12/.metalstack.infra.v2.BootServiceRegisterRequest\x1a\x30.metalstack.infra.v2.BootServiceRegisterResponse\"\n\xe0\xf3\x18\x02\xf2\xf3\x18\x02\x01\x02\x12o\n\x04Wait\x12+.metalstack.infra.v2.BootServiceWaitRequest\x1a,.metalstack.infra.v2.BootServiceWaitResponse\"\n\xe0\xf3\x18\x02\xf2\xf3\x18\x02\x01\x02\x30\x01\x12s\n\x06Report\x12-.metalstack.infra.v2.BootServiceReportRequest\x1a..metalstack.infra.v2.BootServiceReportResponse\"\n\xe0\xf3\x18\x02\xf2\xf3\x18\x02\x01\x02\x12\x8b\x01\n\x0e\x41\x62ortReinstall\x12\x35.metalstack.infra.v2.BootServiceAbortReinstallRequest\x1a\x36.metalstack.infra.v2.BootServiceAbortReinstallResponse\"\n\xe0\xf3\x18\x02\xf2\xf3\x18\x02\x01\x02\x42\xcd\x01\n\x17\x63om.metalstack.infra.v2B\tBootProtoP\x01Z9github.com/metal-stack/api/go/metalstack/infra/v2;infrav2\xa2\x02\x03MIX\xaa\x02\x13Metalstack.Infra.V2\xca\x02\x13Metalstack\\Infra\\V2\xe2\x02\x1fMetalstack\\Infra\\V2\\GPBMetadata\xea\x02\x15Metalstack::Infra::V2b\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1emetalstack/infra/v2/boot.proto\x12\x13metalstack.infra.v2\x1a\x1b\x62uf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\"6\n\x16\x42ootServiceDhcpRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\"\x19\n\x17\x42ootServiceDhcpResponse\"\xc6\x01\n\x16\x42ootServiceBootRequest\x12}\n\x03mac\x18\x01 \x01(\tBk\xbaHh\xba\x01\x65\n\x03mac\x12\x1fmac must be a valid mac address\x1a=this.matches(\'^(?:[0-9A-Fa-f]{2}[:-]){5}(?:[0-9A-Fa-f]{2})$\')R\x03mac\x12-\n\x0cpartition_id\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x0bpartitionId\"\xd2\x01\n\x17\x42ootServiceBootResponse\x12Z\n\x06kernel\x18\x01 \x01(\tBB\xbaH?\xba\x01<\n\x10valid_kernel_uri\x12\x1akernel must be a valid URI\x1a\x0cthis.isUri()R\x06kernel\x12$\n\x0einit_ram_disks\x18\x02 \x03(\tR\x0cinitRamDisks\x12)\n\x07\x63mdline\x18\x03 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01H\x00R\x07\x63mdline\x88\x01\x01\x42\n\n\x08_cmdline\"\xe9\x02\n\x1a\x42ootServiceRegisterRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12@\n\x08hardware\x18\x02 \x01(\x0b\x32$.metalstack.infra.v2.MachineHardwareR\x08hardware\x12\x34\n\x04\x62ios\x18\x03 \x01(\x0b\x32 .metalstack.infra.v2.MachineBIOSR\x04\x62ios\x12\x34\n\x04ipmi\x18\x04 \x01(\x0b\x32 .metalstack.infra.v2.MachineIPMIR\x04ipmi\x12\x12\n\x04tags\x18\x05 \x03(\tR\x04tags\x12<\n\x14metal_hammer_version\x18\x06 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x12metalHammerVersion\x12-\n\x0cpartition_id\x18\x07 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x0bpartitionId\"\x8a\x01\n\x1b\x42ootServiceRegisterResponse\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12\x1e\n\x04size\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x04size\x12-\n\x0cpartition_id\x18\x03 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x0bpartitionId\"6\n\x16\x42ootServiceWaitRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\"\x19\n\x17\x42ootServiceWaitResponse\"\x87\x02\n\x0fMachineHardware\x12\x16\n\x06memory\x18\x01 \x01(\x04R\x06memory\x12=\n\x05\x64isks\x18\x03 \x03(\x0b\x32\'.metalstack.infra.v2.MachineBlockDeviceR\x05\x64isks\x12\x33\n\x04nics\x18\x04 \x03(\x0b\x32\x1f.metalstack.infra.v2.MachineNicR\x04nics\x12\x33\n\x04\x63pus\x18\x05 \x03(\x0b\x32\x1f.metalstack.infra.v2.MachineCPUR\x04\x63pus\x12\x33\n\x04gpus\x18\x06 \x03(\x0b\x32\x1f.metalstack.infra.v2.MachineGPUR\x04gpus\"\x82\x01\n\nMachineCPU\x12\"\n\x06vendor\x18\x01 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x06vendor\x12 \n\x05model\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x05model\x12\x14\n\x05\x63ores\x18\x03 \x01(\rR\x05\x63ores\x12\x18\n\x07threads\x18\x04 \x01(\rR\x07threads\"R\n\nMachineGPU\x12\"\n\x06vendor\x18\x01 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x06vendor\x12 \n\x05model\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x05model\"\x9a\x03\n\nMachineNic\x12}\n\x03mac\x18\x01 \x01(\tBk\xbaHh\xba\x01\x65\n\x03mac\x12\x1fmac must be a valid mac address\x1a=this.matches(\'^(?:[0-9A-Fa-f]{2}[:-]){5}(?:[0-9A-Fa-f]{2})$\')R\x03mac\x12\x1e\n\x04name\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x04name\x12\"\n\x06vendor\x18\x03 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x06vendor\x12 \n\x05model\x18\x04 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x05model\x12\x14\n\x05speed\x18\x05 \x01(\x04R\x05speed\x12=\n\tneighbors\x18\x06 \x03(\x0b\x32\x1f.metalstack.infra.v2.MachineNicR\tneighbors\x12&\n\x08hostname\x18\x07 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x08hostname\x12*\n\nidentifier\x18\x08 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\nidentifier\"H\n\x12MachineBlockDevice\x12\x1e\n\x04name\x18\x01 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x04name\x12\x12\n\x04size\x18\x02 \x01(\x04R\x04size\"k\n\x0bMachineBIOS\x12$\n\x07version\x18\x01 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x07version\x12\"\n\x06vendor\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x06vendor\x12\x12\n\x04\x64\x61te\x18\x03 \x01(\tR\x04\x64\x61te\"\xae\x03\n\x0bMachineIPMI\x12!\n\x07\x61\x64\x64ress\x18\x01 \x01(\tB\x07\xbaH\x04r\x02p\x01R\x07\x61\x64\x64ress\x12}\n\x03mac\x18\x02 \x01(\tBk\xbaHh\xba\x01\x65\n\x03mac\x12\x1fmac must be a valid mac address\x1a=this.matches(\'^(?:[0-9A-Fa-f]{2}[:-]){5}(?:[0-9A-Fa-f]{2})$\')R\x03mac\x12\x1e\n\x04user\x18\x03 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x04user\x12&\n\x08password\x18\x04 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x08password\x12(\n\tinterface\x18\x05 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\tinterface\x12\x31\n\x03\x66ru\x18\x06 \x01(\x0b\x32\x1f.metalstack.infra.v2.MachineFRUR\x03\x66ru\x12+\n\x0b\x62mc_version\x18\x07 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\nbmcVersion\x12+\n\x0bpower_state\x18\x08 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\npowerState\"\x9e\x05\n\nMachineFRU\x12?\n\x13\x63hassis_part_number\x18\x01 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01H\x00R\x11\x63hassisPartNumber\x88\x01\x01\x12?\n\x13\x63hassis_part_serial\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01H\x01R\x11\x63hassisPartSerial\x88\x01\x01\x12,\n\tboard_mfg\x18\x03 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01H\x02R\x08\x62oardMfg\x88\x01\x01\x12\x39\n\x10\x62oard_mfg_serial\x18\x04 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01H\x03R\x0e\x62oardMfgSerial\x88\x01\x01\x12;\n\x11\x62oard_part_number\x18\x05 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01H\x04R\x0f\x62oardPartNumber\x88\x01\x01\x12\x42\n\x14product_manufacturer\x18\x06 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01H\x05R\x13productManufacturer\x88\x01\x01\x12?\n\x13product_part_number\x18\x07 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01H\x06R\x11productPartNumber\x88\x01\x01\x12\x36\n\x0eproduct_serial\x18\x08 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01H\x07R\rproductSerial\x88\x01\x01\x42\x16\n\x14_chassis_part_numberB\x16\n\x14_chassis_part_serialB\x0c\n\n_board_mfgB\x13\n\x11_board_mfg_serialB\x14\n\x12_board_part_numberB\x17\n\x15_product_manufacturerB\x16\n\x14_product_part_numberB\x11\n\x0f_product_serial\"\xeb\x01\n\x18\x42ootServiceReportRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12\x35\n\x10\x63onsole_password\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x0f\x63onsolePassword\x12:\n\tboot_info\x18\x03 \x01(\x0b\x32\x1d.metalstack.infra.v2.BootInfoR\x08\x62ootInfo\x12\x18\n\x07success\x18\x04 \x01(\x08R\x07success\x12$\n\x07message\x18\x05 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x04R\x07message\"\x1b\n\x19\x42ootServiceReportResponse\"\xae\x02\n\x08\x42ootInfo\x12%\n\x08image_id\x18\x01 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x07imageId\x12-\n\x0cprimary_disk\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x0bprimaryDisk\x12-\n\x0cos_partition\x18\x03 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x0bosPartition\x12\"\n\x06initrd\x18\x04 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x06initrd\x12$\n\x07\x63mdline\x18\x05 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x07\x63mdline\x12\"\n\x06kernel\x18\x06 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x06kernel\x12/\n\rbootloader_id\x18\x08 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x0c\x62ootloaderId\"n\n BootServiceAbortReinstallRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12,\n\x12primary_disk_wiped\x18\x02 \x01(\x08R\x10primaryDiskWiped\"_\n!BootServiceAbortReinstallResponse\x12:\n\tboot_info\x18\x01 \x01(\x0b\x32\x1d.metalstack.infra.v2.BootInfoR\x08\x62ootInfo\"C\n#BootServiceSuperUserPasswordRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\"\x8d\x01\n$BootServiceSuperUserPasswordResponse\x12)\n\x10\x66\x65\x61ture_disabled\x18\x01 \x01(\x08R\x0f\x66\x65\x61tureDisabled\x12:\n\x13super_user_password\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x11superUserPassword2\xf1\x06\n\x0b\x42ootService\x12m\n\x04\x44hcp\x12+.metalstack.infra.v2.BootServiceDhcpRequest\x1a,.metalstack.infra.v2.BootServiceDhcpResponse\"\n\xe0\xf3\x18\x02\xea\xf3\x18\x02\x01\x02\x12m\n\x04\x42oot\x12+.metalstack.infra.v2.BootServiceBootRequest\x1a,.metalstack.infra.v2.BootServiceBootResponse\"\n\xe0\xf3\x18\x02\xea\xf3\x18\x02\x01\x02\x12\x94\x01\n\x11SuperUserPassword\x12\x38.metalstack.infra.v2.BootServiceSuperUserPasswordRequest\x1a\x39.metalstack.infra.v2.BootServiceSuperUserPasswordResponse\"\n\xe0\xf3\x18\x02\xf2\xf3\x18\x02\x01\x02\x12y\n\x08Register\x12/.metalstack.infra.v2.BootServiceRegisterRequest\x1a\x30.metalstack.infra.v2.BootServiceRegisterResponse\"\n\xe0\xf3\x18\x02\xf2\xf3\x18\x02\x01\x02\x12o\n\x04Wait\x12+.metalstack.infra.v2.BootServiceWaitRequest\x1a,.metalstack.infra.v2.BootServiceWaitResponse\"\n\xe0\xf3\x18\x02\xf2\xf3\x18\x02\x01\x02\x30\x01\x12s\n\x06Report\x12-.metalstack.infra.v2.BootServiceReportRequest\x1a..metalstack.infra.v2.BootServiceReportResponse\"\n\xe0\xf3\x18\x02\xf2\xf3\x18\x02\x01\x02\x12\x8b\x01\n\x0e\x41\x62ortReinstall\x12\x35.metalstack.infra.v2.BootServiceAbortReinstallRequest\x1a\x36.metalstack.infra.v2.BootServiceAbortReinstallResponse\"\n\xe0\xf3\x18\x02\xf2\xf3\x18\x02\x01\x02\x42\xcd\x01\n\x17\x63om.metalstack.infra.v2B\tBootProtoP\x01Z9github.com/metal-stack/api/go/metalstack/infra/v2;infrav2\xa2\x02\x03MIX\xaa\x02\x13Metalstack.Infra.V2\xca\x02\x13Metalstack\\Infra\\V2\xe2\x02\x1fMetalstack\\Infra\\V2\\GPBMetadata\xea\x02\x15Metalstack::Infra::V2b\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -33,6 +34,112 @@ if not _descriptor._USE_C_DESCRIPTORS: _globals['DESCRIPTOR']._loaded_options = None _globals['DESCRIPTOR']._serialized_options = b'\n\027com.metalstack.infra.v2B\tBootProtoP\001Z9github.com/metal-stack/api/go/metalstack/infra/v2;infrav2\242\002\003MIX\252\002\023Metalstack.Infra.V2\312\002\023Metalstack\\Infra\\V2\342\002\037Metalstack\\Infra\\V2\\GPBMetadata\352\002\025Metalstack::Infra::V2' + _globals['_BOOTSERVICEDHCPREQUEST'].fields_by_name['uuid']._loaded_options = None + _globals['_BOOTSERVICEDHCPREQUEST'].fields_by_name['uuid']._serialized_options = b'\272H\005r\003\260\001\001' + _globals['_BOOTSERVICEBOOTREQUEST'].fields_by_name['mac']._loaded_options = None + _globals['_BOOTSERVICEBOOTREQUEST'].fields_by_name['mac']._serialized_options = b'\272Hh\272\001e\n\003mac\022\037mac must be a valid mac address\032=this.matches(\'^(?:[0-9A-Fa-f]{2}[:-]){5}(?:[0-9A-Fa-f]{2})$\')' + _globals['_BOOTSERVICEBOOTREQUEST'].fields_by_name['partition_id']._loaded_options = None + _globals['_BOOTSERVICEBOOTREQUEST'].fields_by_name['partition_id']._serialized_options = b'\272H\007r\005\020\002\030\200\001' + _globals['_BOOTSERVICEBOOTRESPONSE'].fields_by_name['kernel']._loaded_options = None + _globals['_BOOTSERVICEBOOTRESPONSE'].fields_by_name['kernel']._serialized_options = b'\272H?\272\001<\n\020valid_kernel_uri\022\032kernel must be a valid URI\032\014this.isUri()' + _globals['_BOOTSERVICEBOOTRESPONSE'].fields_by_name['cmdline']._loaded_options = None + _globals['_BOOTSERVICEBOOTRESPONSE'].fields_by_name['cmdline']._serialized_options = b'\272H\007r\005\020\002\030\200\001' + _globals['_BOOTSERVICEREGISTERREQUEST'].fields_by_name['uuid']._loaded_options = None + _globals['_BOOTSERVICEREGISTERREQUEST'].fields_by_name['uuid']._serialized_options = b'\272H\005r\003\260\001\001' + _globals['_BOOTSERVICEREGISTERREQUEST'].fields_by_name['metal_hammer_version']._loaded_options = None + _globals['_BOOTSERVICEREGISTERREQUEST'].fields_by_name['metal_hammer_version']._serialized_options = b'\272H\007r\005\020\002\030\200\001' + _globals['_BOOTSERVICEREGISTERREQUEST'].fields_by_name['partition_id']._loaded_options = None + _globals['_BOOTSERVICEREGISTERREQUEST'].fields_by_name['partition_id']._serialized_options = b'\272H\007r\005\020\002\030\200\001' + _globals['_BOOTSERVICEREGISTERRESPONSE'].fields_by_name['uuid']._loaded_options = None + _globals['_BOOTSERVICEREGISTERRESPONSE'].fields_by_name['uuid']._serialized_options = b'\272H\005r\003\260\001\001' + _globals['_BOOTSERVICEREGISTERRESPONSE'].fields_by_name['size']._loaded_options = None + _globals['_BOOTSERVICEREGISTERRESPONSE'].fields_by_name['size']._serialized_options = b'\272H\007r\005\020\002\030\200\001' + _globals['_BOOTSERVICEREGISTERRESPONSE'].fields_by_name['partition_id']._loaded_options = None + _globals['_BOOTSERVICEREGISTERRESPONSE'].fields_by_name['partition_id']._serialized_options = b'\272H\007r\005\020\002\030\200\001' + _globals['_BOOTSERVICEWAITREQUEST'].fields_by_name['uuid']._loaded_options = None + _globals['_BOOTSERVICEWAITREQUEST'].fields_by_name['uuid']._serialized_options = b'\272H\005r\003\260\001\001' + _globals['_MACHINECPU'].fields_by_name['vendor']._loaded_options = None + _globals['_MACHINECPU'].fields_by_name['vendor']._serialized_options = b'\272H\007r\005\020\002\030\200\001' + _globals['_MACHINECPU'].fields_by_name['model']._loaded_options = None + _globals['_MACHINECPU'].fields_by_name['model']._serialized_options = b'\272H\007r\005\020\002\030\200\001' + _globals['_MACHINEGPU'].fields_by_name['vendor']._loaded_options = None + _globals['_MACHINEGPU'].fields_by_name['vendor']._serialized_options = b'\272H\007r\005\020\002\030\200\001' + _globals['_MACHINEGPU'].fields_by_name['model']._loaded_options = None + _globals['_MACHINEGPU'].fields_by_name['model']._serialized_options = b'\272H\007r\005\020\002\030\200\001' + _globals['_MACHINENIC'].fields_by_name['mac']._loaded_options = None + _globals['_MACHINENIC'].fields_by_name['mac']._serialized_options = b'\272Hh\272\001e\n\003mac\022\037mac must be a valid mac address\032=this.matches(\'^(?:[0-9A-Fa-f]{2}[:-]){5}(?:[0-9A-Fa-f]{2})$\')' + _globals['_MACHINENIC'].fields_by_name['name']._loaded_options = None + _globals['_MACHINENIC'].fields_by_name['name']._serialized_options = b'\272H\007r\005\020\002\030\200\001' + _globals['_MACHINENIC'].fields_by_name['vendor']._loaded_options = None + _globals['_MACHINENIC'].fields_by_name['vendor']._serialized_options = b'\272H\007r\005\020\002\030\200\001' + _globals['_MACHINENIC'].fields_by_name['model']._loaded_options = None + _globals['_MACHINENIC'].fields_by_name['model']._serialized_options = b'\272H\007r\005\020\002\030\200\001' + _globals['_MACHINENIC'].fields_by_name['hostname']._loaded_options = None + _globals['_MACHINENIC'].fields_by_name['hostname']._serialized_options = b'\272H\007r\005\020\002\030\200\001' + _globals['_MACHINENIC'].fields_by_name['identifier']._loaded_options = None + _globals['_MACHINENIC'].fields_by_name['identifier']._serialized_options = b'\272H\007r\005\020\002\030\200\001' + _globals['_MACHINEBLOCKDEVICE'].fields_by_name['name']._loaded_options = None + _globals['_MACHINEBLOCKDEVICE'].fields_by_name['name']._serialized_options = b'\272H\007r\005\020\002\030\200\001' + _globals['_MACHINEBIOS'].fields_by_name['version']._loaded_options = None + _globals['_MACHINEBIOS'].fields_by_name['version']._serialized_options = b'\272H\007r\005\020\002\030\200\001' + _globals['_MACHINEBIOS'].fields_by_name['vendor']._loaded_options = None + _globals['_MACHINEBIOS'].fields_by_name['vendor']._serialized_options = b'\272H\007r\005\020\002\030\200\001' + _globals['_MACHINEIPMI'].fields_by_name['address']._loaded_options = None + _globals['_MACHINEIPMI'].fields_by_name['address']._serialized_options = b'\272H\004r\002p\001' + _globals['_MACHINEIPMI'].fields_by_name['mac']._loaded_options = None + _globals['_MACHINEIPMI'].fields_by_name['mac']._serialized_options = b'\272Hh\272\001e\n\003mac\022\037mac must be a valid mac address\032=this.matches(\'^(?:[0-9A-Fa-f]{2}[:-]){5}(?:[0-9A-Fa-f]{2})$\')' + _globals['_MACHINEIPMI'].fields_by_name['user']._loaded_options = None + _globals['_MACHINEIPMI'].fields_by_name['user']._serialized_options = b'\272H\007r\005\020\002\030\200\001' + _globals['_MACHINEIPMI'].fields_by_name['password']._loaded_options = None + _globals['_MACHINEIPMI'].fields_by_name['password']._serialized_options = b'\272H\007r\005\020\002\030\200\001' + _globals['_MACHINEIPMI'].fields_by_name['interface']._loaded_options = None + _globals['_MACHINEIPMI'].fields_by_name['interface']._serialized_options = b'\272H\007r\005\020\002\030\200\001' + _globals['_MACHINEIPMI'].fields_by_name['bmc_version']._loaded_options = None + _globals['_MACHINEIPMI'].fields_by_name['bmc_version']._serialized_options = b'\272H\007r\005\020\002\030\200\001' + _globals['_MACHINEIPMI'].fields_by_name['power_state']._loaded_options = None + _globals['_MACHINEIPMI'].fields_by_name['power_state']._serialized_options = b'\272H\007r\005\020\002\030\200\001' + _globals['_MACHINEFRU'].fields_by_name['chassis_part_number']._loaded_options = None + _globals['_MACHINEFRU'].fields_by_name['chassis_part_number']._serialized_options = b'\272H\007r\005\020\002\030\200\001' + _globals['_MACHINEFRU'].fields_by_name['chassis_part_serial']._loaded_options = None + _globals['_MACHINEFRU'].fields_by_name['chassis_part_serial']._serialized_options = b'\272H\007r\005\020\002\030\200\001' + _globals['_MACHINEFRU'].fields_by_name['board_mfg']._loaded_options = None + _globals['_MACHINEFRU'].fields_by_name['board_mfg']._serialized_options = b'\272H\007r\005\020\002\030\200\001' + _globals['_MACHINEFRU'].fields_by_name['board_mfg_serial']._loaded_options = None + _globals['_MACHINEFRU'].fields_by_name['board_mfg_serial']._serialized_options = b'\272H\007r\005\020\002\030\200\001' + _globals['_MACHINEFRU'].fields_by_name['board_part_number']._loaded_options = None + _globals['_MACHINEFRU'].fields_by_name['board_part_number']._serialized_options = b'\272H\007r\005\020\002\030\200\001' + _globals['_MACHINEFRU'].fields_by_name['product_manufacturer']._loaded_options = None + _globals['_MACHINEFRU'].fields_by_name['product_manufacturer']._serialized_options = b'\272H\007r\005\020\002\030\200\001' + _globals['_MACHINEFRU'].fields_by_name['product_part_number']._loaded_options = None + _globals['_MACHINEFRU'].fields_by_name['product_part_number']._serialized_options = b'\272H\007r\005\020\002\030\200\001' + _globals['_MACHINEFRU'].fields_by_name['product_serial']._loaded_options = None + _globals['_MACHINEFRU'].fields_by_name['product_serial']._serialized_options = b'\272H\007r\005\020\002\030\200\001' + _globals['_BOOTSERVICEREPORTREQUEST'].fields_by_name['uuid']._loaded_options = None + _globals['_BOOTSERVICEREPORTREQUEST'].fields_by_name['uuid']._serialized_options = b'\272H\005r\003\260\001\001' + _globals['_BOOTSERVICEREPORTREQUEST'].fields_by_name['console_password']._loaded_options = None + _globals['_BOOTSERVICEREPORTREQUEST'].fields_by_name['console_password']._serialized_options = b'\272H\007r\005\020\002\030\200\001' + _globals['_BOOTSERVICEREPORTREQUEST'].fields_by_name['message']._loaded_options = None + _globals['_BOOTSERVICEREPORTREQUEST'].fields_by_name['message']._serialized_options = b'\272H\007r\005\020\002\030\200\004' + _globals['_BOOTINFO'].fields_by_name['image_id']._loaded_options = None + _globals['_BOOTINFO'].fields_by_name['image_id']._serialized_options = b'\272H\007r\005\020\002\030\200\001' + _globals['_BOOTINFO'].fields_by_name['primary_disk']._loaded_options = None + _globals['_BOOTINFO'].fields_by_name['primary_disk']._serialized_options = b'\272H\007r\005\020\002\030\200\001' + _globals['_BOOTINFO'].fields_by_name['os_partition']._loaded_options = None + _globals['_BOOTINFO'].fields_by_name['os_partition']._serialized_options = b'\272H\007r\005\020\002\030\200\001' + _globals['_BOOTINFO'].fields_by_name['initrd']._loaded_options = None + _globals['_BOOTINFO'].fields_by_name['initrd']._serialized_options = b'\272H\007r\005\020\002\030\200\001' + _globals['_BOOTINFO'].fields_by_name['cmdline']._loaded_options = None + _globals['_BOOTINFO'].fields_by_name['cmdline']._serialized_options = b'\272H\007r\005\020\002\030\200\001' + _globals['_BOOTINFO'].fields_by_name['kernel']._loaded_options = None + _globals['_BOOTINFO'].fields_by_name['kernel']._serialized_options = b'\272H\007r\005\020\002\030\200\001' + _globals['_BOOTINFO'].fields_by_name['bootloader_id']._loaded_options = None + _globals['_BOOTINFO'].fields_by_name['bootloader_id']._serialized_options = b'\272H\007r\005\020\002\030\200\001' + _globals['_BOOTSERVICEABORTREINSTALLREQUEST'].fields_by_name['uuid']._loaded_options = None + _globals['_BOOTSERVICEABORTREINSTALLREQUEST'].fields_by_name['uuid']._serialized_options = b'\272H\005r\003\260\001\001' + _globals['_BOOTSERVICESUPERUSERPASSWORDREQUEST'].fields_by_name['uuid']._loaded_options = None + _globals['_BOOTSERVICESUPERUSERPASSWORDREQUEST'].fields_by_name['uuid']._serialized_options = b'\272H\005r\003\260\001\001' + _globals['_BOOTSERVICESUPERUSERPASSWORDRESPONSE'].fields_by_name['super_user_password']._loaded_options = None + _globals['_BOOTSERVICESUPERUSERPASSWORDRESPONSE'].fields_by_name['super_user_password']._serialized_options = b'\272H\007r\005\020\002\030\200\001' _globals['_BOOTSERVICE'].methods_by_name['Dhcp']._loaded_options = None _globals['_BOOTSERVICE'].methods_by_name['Dhcp']._serialized_options = b'\340\363\030\002\352\363\030\002\001\002' _globals['_BOOTSERVICE'].methods_by_name['Boot']._loaded_options = None @@ -47,52 +154,52 @@ _globals['_BOOTSERVICE'].methods_by_name['Report']._serialized_options = b'\340\363\030\002\362\363\030\002\001\002' _globals['_BOOTSERVICE'].methods_by_name['AbortReinstall']._loaded_options = None _globals['_BOOTSERVICE'].methods_by_name['AbortReinstall']._serialized_options = b'\340\363\030\002\362\363\030\002\001\002' - _globals['_BOOTSERVICEDHCPREQUEST']._serialized_start=87 - _globals['_BOOTSERVICEDHCPREQUEST']._serialized_end=131 - _globals['_BOOTSERVICEDHCPRESPONSE']._serialized_start=133 - _globals['_BOOTSERVICEDHCPRESPONSE']._serialized_end=158 - _globals['_BOOTSERVICEBOOTREQUEST']._serialized_start=160 - _globals['_BOOTSERVICEBOOTREQUEST']._serialized_end=237 - _globals['_BOOTSERVICEBOOTRESPONSE']._serialized_start=240 - _globals['_BOOTSERVICEBOOTRESPONSE']._serialized_end=370 - _globals['_BOOTSERVICEREGISTERREQUEST']._serialized_start=373 - _globals['_BOOTSERVICEREGISTERREQUEST']._serialized_end=700 - _globals['_BOOTSERVICEREGISTERRESPONSE']._serialized_start=702 - _globals['_BOOTSERVICEREGISTERRESPONSE']._serialized_end=806 - _globals['_BOOTSERVICEWAITREQUEST']._serialized_start=808 - _globals['_BOOTSERVICEWAITREQUEST']._serialized_end=852 - _globals['_BOOTSERVICEWAITRESPONSE']._serialized_start=854 - _globals['_BOOTSERVICEWAITRESPONSE']._serialized_end=879 - _globals['_MACHINEHARDWARE']._serialized_start=882 - _globals['_MACHINEHARDWARE']._serialized_end=1145 - _globals['_MACHINECPU']._serialized_start=1147 - _globals['_MACHINECPU']._serialized_end=1253 - _globals['_MACHINEGPU']._serialized_start=1255 - _globals['_MACHINEGPU']._serialized_end=1313 - _globals['_MACHINENIC']._serialized_start=1316 - _globals['_MACHINENIC']._serialized_end=1557 - _globals['_MACHINEBLOCKDEVICE']._serialized_start=1559 - _globals['_MACHINEBLOCKDEVICE']._serialized_end=1619 - _globals['_MACHINEBIOS']._serialized_start=1621 - _globals['_MACHINEBIOS']._serialized_end=1704 - _globals['_MACHINEIPMI']._serialized_start=1707 - _globals['_MACHINEIPMI']._serialized_end=1959 - _globals['_MACHINEFRU']._serialized_start=1962 - _globals['_MACHINEFRU']._serialized_end=2536 - _globals['_BOOTSERVICEREPORTREQUEST']._serialized_start=2539 - _globals['_BOOTSERVICEREPORTREQUEST']._serialized_end=2740 - _globals['_BOOTSERVICEREPORTRESPONSE']._serialized_start=2742 - _globals['_BOOTSERVICEREPORTRESPONSE']._serialized_end=2769 - _globals['_BOOTINFO']._serialized_start=2772 - _globals['_BOOTINFO']._serialized_end=2990 - _globals['_BOOTSERVICEABORTREINSTALLREQUEST']._serialized_start=2992 - _globals['_BOOTSERVICEABORTREINSTALLREQUEST']._serialized_end=3092 - _globals['_BOOTSERVICEABORTREINSTALLRESPONSE']._serialized_start=3094 - _globals['_BOOTSERVICEABORTREINSTALLRESPONSE']._serialized_end=3189 - _globals['_BOOTSERVICESUPERUSERPASSWORDREQUEST']._serialized_start=3191 - _globals['_BOOTSERVICESUPERUSERPASSWORDREQUEST']._serialized_end=3248 - _globals['_BOOTSERVICESUPERUSERPASSWORDRESPONSE']._serialized_start=3251 - _globals['_BOOTSERVICESUPERUSERPASSWORDRESPONSE']._serialized_end=3380 - _globals['_BOOTSERVICE']._serialized_start=3383 - _globals['_BOOTSERVICE']._serialized_end=4264 + _globals['_BOOTSERVICEDHCPREQUEST']._serialized_start=116 + _globals['_BOOTSERVICEDHCPREQUEST']._serialized_end=170 + _globals['_BOOTSERVICEDHCPRESPONSE']._serialized_start=172 + _globals['_BOOTSERVICEDHCPRESPONSE']._serialized_end=197 + _globals['_BOOTSERVICEBOOTREQUEST']._serialized_start=200 + _globals['_BOOTSERVICEBOOTREQUEST']._serialized_end=398 + _globals['_BOOTSERVICEBOOTRESPONSE']._serialized_start=401 + _globals['_BOOTSERVICEBOOTRESPONSE']._serialized_end=611 + _globals['_BOOTSERVICEREGISTERREQUEST']._serialized_start=614 + _globals['_BOOTSERVICEREGISTERREQUEST']._serialized_end=975 + _globals['_BOOTSERVICEREGISTERRESPONSE']._serialized_start=978 + _globals['_BOOTSERVICEREGISTERRESPONSE']._serialized_end=1116 + _globals['_BOOTSERVICEWAITREQUEST']._serialized_start=1118 + _globals['_BOOTSERVICEWAITREQUEST']._serialized_end=1172 + _globals['_BOOTSERVICEWAITRESPONSE']._serialized_start=1174 + _globals['_BOOTSERVICEWAITRESPONSE']._serialized_end=1199 + _globals['_MACHINEHARDWARE']._serialized_start=1202 + _globals['_MACHINEHARDWARE']._serialized_end=1465 + _globals['_MACHINECPU']._serialized_start=1468 + _globals['_MACHINECPU']._serialized_end=1598 + _globals['_MACHINEGPU']._serialized_start=1600 + _globals['_MACHINEGPU']._serialized_end=1682 + _globals['_MACHINENIC']._serialized_start=1685 + _globals['_MACHINENIC']._serialized_end=2095 + _globals['_MACHINEBLOCKDEVICE']._serialized_start=2097 + _globals['_MACHINEBLOCKDEVICE']._serialized_end=2169 + _globals['_MACHINEBIOS']._serialized_start=2171 + _globals['_MACHINEBIOS']._serialized_end=2278 + _globals['_MACHINEIPMI']._serialized_start=2281 + _globals['_MACHINEIPMI']._serialized_end=2711 + _globals['_MACHINEFRU']._serialized_start=2714 + _globals['_MACHINEFRU']._serialized_end=3384 + _globals['_BOOTSERVICEREPORTREQUEST']._serialized_start=3387 + _globals['_BOOTSERVICEREPORTREQUEST']._serialized_end=3622 + _globals['_BOOTSERVICEREPORTRESPONSE']._serialized_start=3624 + _globals['_BOOTSERVICEREPORTRESPONSE']._serialized_end=3651 + _globals['_BOOTINFO']._serialized_start=3654 + _globals['_BOOTINFO']._serialized_end=3956 + _globals['_BOOTSERVICEABORTREINSTALLREQUEST']._serialized_start=3958 + _globals['_BOOTSERVICEABORTREINSTALLREQUEST']._serialized_end=4068 + _globals['_BOOTSERVICEABORTREINSTALLRESPONSE']._serialized_start=4070 + _globals['_BOOTSERVICEABORTREINSTALLRESPONSE']._serialized_end=4165 + _globals['_BOOTSERVICESUPERUSERPASSWORDREQUEST']._serialized_start=4167 + _globals['_BOOTSERVICESUPERUSERPASSWORDREQUEST']._serialized_end=4234 + _globals['_BOOTSERVICESUPERUSERPASSWORDRESPONSE']._serialized_start=4237 + _globals['_BOOTSERVICESUPERUSERPASSWORDRESPONSE']._serialized_end=4378 + _globals['_BOOTSERVICE']._serialized_start=4381 + _globals['_BOOTSERVICE']._serialized_end=5262 # @@protoc_insertion_point(module_scope) diff --git a/python/metalstack/infra/v2/boot_pb2.pyi b/python/metalstack/infra/v2/boot_pb2.pyi index d1be8831..5c2b9a97 100644 --- a/python/metalstack/infra/v2/boot_pb2.pyi +++ b/python/metalstack/infra/v2/boot_pb2.pyi @@ -1,3 +1,4 @@ +from buf.validate import validate_pb2 as _validate_pb2 from metalstack.api.v2 import common_pb2 as _common_pb2 from google.protobuf.internal import containers as _containers from google.protobuf import descriptor as _descriptor From 6456f5b1165dd945f7866fef861f3ff893ce6fa3 Mon Sep 17 00:00:00 2001 From: Stefan Majer Date: Fri, 1 Aug 2025 14:01:59 +0200 Subject: [PATCH 08/27] Merge main --- python/metalstack/client/client.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/python/metalstack/client/client.py b/python/metalstack/client/client.py index 037b560a..4105a152 100755 --- a/python/metalstack/client/client.py +++ b/python/metalstack/client/client.py @@ -26,6 +26,7 @@ import metalstack.api.v2.version_connecpy as api_version_connecpy import metalstack.infra.v2.bmc_connecpy as infra_bmc_connecpy +import metalstack.infra.v2.boot_connecpy as infra_boot_connecpy @@ -137,4 +138,7 @@ def __init__(self, baseurl: str, session=None): def bmc(self): return infra_bmc_connecpy.BMCServiceClient(address=self._baseurl, session=self._session) + def boot(self): + return infra_boot_connecpy.BootServiceClient(address=self._baseurl, session=self._session) + From b0a6cc9b184d62b9ac2b749106801a95c9ff82c7 Mon Sep 17 00:00:00 2001 From: Stefan Majer Date: Sat, 16 Aug 2025 10:25:25 +0200 Subject: [PATCH 09/27] Update deps --- go.mod | 8 ++++---- go.sum | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index 04b85b31..0155a40c 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/metal-stack/api go 1.24.0 require ( - buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.6-20250717185734-6c6e0d3c608e.1 + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.7-20250717185734-6c6e0d3c608e.1 buf.build/go/protovalidate v0.14.0 connectrpc.com/connect v1.18.1 github.com/bufbuild/protocompile v0.14.1 @@ -25,10 +25,10 @@ require ( github.com/pmezard/go-difflib v1.0.0 // indirect github.com/stoewer/go-strcase v1.3.1 // indirect github.com/stretchr/objx v0.5.2 // indirect - golang.org/x/exp v0.0.0-20250718183923-645b1fa84792 // indirect + golang.org/x/exp v0.0.0-20250811191247-51f88131bc50 // indirect golang.org/x/text v0.28.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20250804133106-a7a43d27e69b // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20250804133106-a7a43d27e69b // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20250811230008-5f3141c8851a // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20250811230008-5f3141c8851a // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 1481002f..28817441 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.6-20250717185734-6c6e0d3c608e.1 h1:Lg6klmCi3v7VvpqeeLEER9/m5S8y9e9DjhqQnSCNy4k= -buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.6-20250717185734-6c6e0d3c608e.1/go.mod h1:avRlCjnFzl98VPaeCtJ24RrV/wwHFzB8sWXhj26+n/U= +buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.7-20250717185734-6c6e0d3c608e.1 h1:/AZH8sVB6LHv8G+hZlAMCP31NevnesHwYgnlgS5Vt14= +buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.7-20250717185734-6c6e0d3c608e.1/go.mod h1:eva/VCrd8X7xuJw+JtwCEyrCKiRRASukFqmirnWBvFU= buf.build/go/protovalidate v0.14.0 h1:kr/rC/no+DtRyYX+8KXLDxNnI1rINz0imk5K44ZpZ3A= buf.build/go/protovalidate v0.14.0/go.mod h1:+F/oISho9MO7gJQNYC2VWLzcO1fTPmaTA08SDYJZncA= cel.dev/expr v0.24.0 h1:56OvJKSH3hDGL0ml5uSxZmz3/3Pq4tJ+fb1unVLAFcY= @@ -50,16 +50,16 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -golang.org/x/exp v0.0.0-20250718183923-645b1fa84792 h1:R9PFI6EUdfVKgwKjZef7QIwGcBKu86OEFpJ9nUEP2l4= -golang.org/x/exp v0.0.0-20250718183923-645b1fa84792/go.mod h1:A+z0yzpGtvnG90cToK5n2tu8UJVP2XUATh+r+sfOOOc= +golang.org/x/exp v0.0.0-20250811191247-51f88131bc50 h1:3yiSh9fhy5/RhCSntf4Sy0Tnx50DmMpQ4MQdKKk4yg4= +golang.org/x/exp v0.0.0-20250811191247-51f88131bc50/go.mod h1:rT6SFzZ7oxADUDx58pcaKFTcZ+inxAa9fTrYx/uVYwg= golang.org/x/net v0.37.0 h1:1zLorHbz+LYj7MQlSf1+2tPIIgibq2eL5xkrGk6f+2c= golang.org/x/net v0.37.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8= golang.org/x/text v0.28.0 h1:rhazDwis8INMIwQ4tpjLDzUhx6RlXqZNPEM0huQojng= golang.org/x/text v0.28.0/go.mod h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU= -google.golang.org/genproto/googleapis/api v0.0.0-20250804133106-a7a43d27e69b h1:ULiyYQ0FdsJhwwZUwbaXpZF5yUE3h+RA+gxvBu37ucc= -google.golang.org/genproto/googleapis/api v0.0.0-20250804133106-a7a43d27e69b/go.mod h1:oDOGiMSXHL4sDTJvFvIB9nRQCGdLP1o/iVaqQK8zB+M= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250804133106-a7a43d27e69b h1:zPKJod4w6F1+nRGDI9ubnXYhU9NSWoFAijkHkUXeTK8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250804133106-a7a43d27e69b/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A= +google.golang.org/genproto/googleapis/api v0.0.0-20250811230008-5f3141c8851a h1:DMCgtIAIQGZqJXMVzJF4MV8BlWoJh2ZuFiRdAleyr58= +google.golang.org/genproto/googleapis/api v0.0.0-20250811230008-5f3141c8851a/go.mod h1:y2yVLIE/CSMCPXaHnSKXxu1spLPnglFLegmgdY23uuE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250811230008-5f3141c8851a h1:tPE/Kp+x9dMSwUm/uM0JKK0IfdiJkwAbSMSeZBXXJXc= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250811230008-5f3141c8851a/go.mod h1:gw1tLEfykwDz2ET4a12jcXt4couGAm7IwsVaTy0Sflo= google.golang.org/protobuf v1.36.7 h1:IgrO7UwFQGJdRNXH/sQux4R1Dj1WAKcLElzeeRaXV2A= google.golang.org/protobuf v1.36.7/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= From c25abefd62dadbfd6eaf3c6e2c48f68ae85faae8 Mon Sep 17 00:00:00 2001 From: Stefan Majer Date: Tue, 2 Sep 2025 07:57:49 +0200 Subject: [PATCH 10/27] Merge main --- go.sum | 4 +- python/metalstack/client/client.py | 2 +- python/metalstack/infra/v2/boot_connecpy.py | 624 +++++++++++--------- 3 files changed, 346 insertions(+), 284 deletions(-) diff --git a/go.sum b/go.sum index 1ff46bae..372905de 100644 --- a/go.sum +++ b/go.sum @@ -22,8 +22,8 @@ github.com/google/cel-go v0.26.1 h1:iPbVVEdkhTX++hpe3lzSk7D3G3QSYqLGoHOcEio+UXQ= github.com/google/cel-go v0.26.1/go.mod h1:A9O8OU9rdvrK5MQyrqfIxo1a0u4g3sF8KB6PUIaryMM= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= -github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I= -github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo= +github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ= github.com/klauspost/connect-compress/v2 v2.0.0 h1:L7TVsLa6Oo9Hkkb6r3DwSrhBbcWlXjneqBj7fCRXviU= github.com/klauspost/connect-compress/v2 v2.0.0/go.mod h1:604CD9JSAjGqtVzCM4SRgM/9TFTkWBcp+2wlQfGyJ6c= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= diff --git a/python/metalstack/client/client.py b/python/metalstack/client/client.py index 2dcc8a24..d24bd59c 100755 --- a/python/metalstack/client/client.py +++ b/python/metalstack/client/client.py @@ -148,7 +148,7 @@ def bmc(self): return infra_bmc_connecpy.BMCServiceClientSync(address=self._baseurl, session=self._session) def boot(self): - return infra_boot_connecpy.BootServiceClient(address=self._baseurl, session=self._session) + return infra_boot_connecpy.BootServiceClientSync(address=self._baseurl, session=self._session) def switch(self): return infra_switch_connecpy.SwitchServiceClientSync(address=self._baseurl, session=self._session) diff --git a/python/metalstack/infra/v2/boot_connecpy.py b/python/metalstack/infra/v2/boot_connecpy.py index 62594503..fad163eb 100644 --- a/python/metalstack/infra/v2/boot_connecpy.py +++ b/python/metalstack/infra/v2/boot_connecpy.py @@ -1,382 +1,444 @@ # -*- coding: utf-8 -*- -# Generated by https://github.com/i2y/connecpy/protoc-gen-connecpy. DO NOT EDIT! +# Generated by https://github.com/i2y/connecpy/v2/protoc-gen-connecpy. DO NOT EDIT! # source: metalstack/infra/v2/boot.proto -from typing import Optional, Protocol, Union +from collections.abc import AsyncIterator, Iterable, Iterator, Mapping +from typing import Protocol -import httpx - -from connecpy.async_client import AsyncConnecpyClient -from connecpy.base import Endpoint -from connecpy.server import ConnecpyServer -from connecpy.client import ConnecpyClient -from connecpy.context import ClientContext, ServiceContext +from connecpy.client import ConnecpyClient, ConnecpyClientSync +from connecpy.code import Code +from connecpy.exceptions import ConnecpyException +from connecpy.interceptor import Interceptor, InterceptorSync +from connecpy.method import IdempotencyLevel, MethodInfo +from connecpy.request import Headers, RequestContext +from connecpy.server import ConnecpyASGIApplication, ConnecpyWSGIApplication, Endpoint, EndpointSync import metalstack.infra.v2.boot_pb2 as metalstack_dot_infra_dot_v2_dot_boot__pb2 class BootService(Protocol): - async def Dhcp(self, req: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpRequest, ctx: ServiceContext) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpResponse: ... - async def Boot(self, req: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootRequest, ctx: ServiceContext) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootResponse: ... - async def SuperUserPassword(self, req: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordRequest, ctx: ServiceContext) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordResponse: ... - async def Register(self, req: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterRequest, ctx: ServiceContext) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterResponse: ... - async def Wait(self, req: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitRequest, ctx: ServiceContext) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitResponse: ... - async def Report(self, req: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceReportRequest, ctx: ServiceContext) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceReportResponse: ... + async def dhcp(self, request: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpRequest, ctx: RequestContext) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpResponse: + raise ConnecpyException(Code.UNIMPLEMENTED, "Not implemented") + async def boot(self, request: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootRequest, ctx: RequestContext) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootResponse: + raise ConnecpyException(Code.UNIMPLEMENTED, "Not implemented") -class BootServiceServer(ConnecpyServer): - def __init__(self, *, service: BootService, server_path_prefix=""): - super().__init__() - self._prefix = f"{server_path_prefix}/metalstack.infra.v2.BootService" - self._endpoints = { - "Dhcp": Endpoint[metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpRequest, metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpResponse]( - service_name="BootService", - name="Dhcp", - function=getattr(service, "Dhcp"), - input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpRequest, - output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpResponse, - allowed_methods=("POST",), - ), - "Boot": Endpoint[metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootRequest, metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootResponse]( - service_name="BootService", - name="Boot", - function=getattr(service, "Boot"), - input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootRequest, - output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootResponse, - allowed_methods=("POST",), - ), - "SuperUserPassword": Endpoint[metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordRequest, metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordResponse]( - service_name="BootService", - name="SuperUserPassword", - function=getattr(service, "SuperUserPassword"), - input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordRequest, - output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordResponse, - allowed_methods=("POST",), - ), - "Register": Endpoint[metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterRequest, metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterResponse]( - service_name="BootService", - name="Register", - function=getattr(service, "Register"), - input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterRequest, - output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterResponse, - allowed_methods=("POST",), - ), - "Wait": Endpoint[metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitRequest, metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitResponse]( - service_name="BootService", - name="Wait", - function=getattr(service, "Wait"), - input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitRequest, - output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitResponse, - allowed_methods=("POST",), - ), - "Report": Endpoint[metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceReportRequest, metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceReportResponse]( - service_name="BootService", - name="Report", - function=getattr(service, "Report"), - input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceReportRequest, - output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceReportResponse, - allowed_methods=("POST",), - ), - } + async def super_user_password(self, request: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordRequest, ctx: RequestContext) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordResponse: + raise ConnecpyException(Code.UNIMPLEMENTED, "Not implemented") - def serviceName(self): - return "metalstack.infra.v2.BootService" + async def register(self, request: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterRequest, ctx: RequestContext) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterResponse: + raise ConnecpyException(Code.UNIMPLEMENTED, "Not implemented") + def wait(self, request: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitRequest, ctx: RequestContext) -> AsyncIterator[metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitResponse]: + raise ConnecpyException(Code.UNIMPLEMENTED, "Not implemented") -class BootServiceSync(Protocol): - def Dhcp(self, req: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpRequest, ctx: ServiceContext) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpResponse: ... - def Boot(self, req: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootRequest, ctx: ServiceContext) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootResponse: ... - def SuperUserPassword(self, req: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordRequest, ctx: ServiceContext) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordResponse: ... - def Register(self, req: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterRequest, ctx: ServiceContext) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterResponse: ... - def Wait(self, req: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitRequest, ctx: ServiceContext) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitResponse: ... - def Report(self, req: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceReportRequest, ctx: ServiceContext) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceReportResponse: ... + async def report(self, request: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceReportRequest, ctx: RequestContext) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceReportResponse: + raise ConnecpyException(Code.UNIMPLEMENTED, "Not implemented") -class BootServiceServerSync(ConnecpyServer): - def __init__(self, *, service: BootServiceSync, server_path_prefix=""): - super().__init__() - self._prefix = f"{server_path_prefix}/metalstack.infra.v2.BootService" - self._endpoints = { - "Dhcp": Endpoint[metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpRequest, metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpResponse]( - service_name="BootService", - name="Dhcp", - function=getattr(service, "Dhcp"), - input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpRequest, - output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpResponse, - allowed_methods=("POST",), - ), - "Boot": Endpoint[metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootRequest, metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootResponse]( - service_name="BootService", - name="Boot", - function=getattr(service, "Boot"), - input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootRequest, - output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootResponse, - allowed_methods=("POST",), - ), - "SuperUserPassword": Endpoint[metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordRequest, metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordResponse]( - service_name="BootService", - name="SuperUserPassword", - function=getattr(service, "SuperUserPassword"), - input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordRequest, - output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordResponse, - allowed_methods=("POST",), - ), - "Register": Endpoint[metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterRequest, metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterResponse]( - service_name="BootService", - name="Register", - function=getattr(service, "Register"), - input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterRequest, - output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterResponse, - allowed_methods=("POST",), - ), - "Wait": Endpoint[metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitRequest, metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitResponse]( - service_name="BootService", - name="Wait", - function=getattr(service, "Wait"), - input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitRequest, - output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitResponse, - allowed_methods=("POST",), - ), - "Report": Endpoint[metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceReportRequest, metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceReportResponse]( - service_name="BootService", - name="Report", - function=getattr(service, "Report"), - input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceReportRequest, - output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceReportResponse, - allowed_methods=("POST",), - ), - } +class BootServiceASGIApplication(ConnecpyASGIApplication): + def __init__(self, service: BootService, *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None): + super().__init__( + endpoints={ + "/metalstack.infra.v2.BootService/Dhcp": Endpoint.unary( + method=MethodInfo( + name="Dhcp", + service_name="metalstack.infra.v2.BootService", + input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpRequest, + output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpResponse, + idempotency_level=IdempotencyLevel.UNKNOWN, + ), + function=service.dhcp, + ), + "/metalstack.infra.v2.BootService/Boot": Endpoint.unary( + method=MethodInfo( + name="Boot", + service_name="metalstack.infra.v2.BootService", + input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootRequest, + output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootResponse, + idempotency_level=IdempotencyLevel.UNKNOWN, + ), + function=service.boot, + ), + "/metalstack.infra.v2.BootService/SuperUserPassword": Endpoint.unary( + method=MethodInfo( + name="SuperUserPassword", + service_name="metalstack.infra.v2.BootService", + input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordRequest, + output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordResponse, + idempotency_level=IdempotencyLevel.UNKNOWN, + ), + function=service.super_user_password, + ), + "/metalstack.infra.v2.BootService/Register": Endpoint.unary( + method=MethodInfo( + name="Register", + service_name="metalstack.infra.v2.BootService", + input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterRequest, + output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterResponse, + idempotency_level=IdempotencyLevel.UNKNOWN, + ), + function=service.register, + ), + "/metalstack.infra.v2.BootService/Wait": Endpoint.server_stream( + method=MethodInfo( + name="Wait", + service_name="metalstack.infra.v2.BootService", + input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitRequest, + output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitResponse, + idempotency_level=IdempotencyLevel.UNKNOWN, + ), + function=service.wait, + ), + "/metalstack.infra.v2.BootService/Report": Endpoint.unary( + method=MethodInfo( + name="Report", + service_name="metalstack.infra.v2.BootService", + input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceReportRequest, + output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceReportResponse, + idempotency_level=IdempotencyLevel.UNKNOWN, + ), + function=service.report, + ), + }, + interceptors=interceptors, + read_max_bytes=read_max_bytes, + ) - def serviceName(self): - return "metalstack.infra.v2.BootService" + @property + def path(self): + """Returns the URL path to mount the application to when serving multiple applications.""" + return "/metalstack.infra.v2.BootService" class BootServiceClient(ConnecpyClient): - def Dhcp( + async def dhcp( self, request: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpRequest, *, - ctx: Optional[ClientContext] = None, - server_path_prefix: str = "", - **kwargs, + headers: Headers | Mapping[str, str] | None = None, + timeout_ms: int | None = None, ) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpResponse: - method = "POST" - return self._make_request( - url=f"{server_path_prefix}/metalstack.infra.v2.BootService/Dhcp", - ctx=ctx, + return await self.execute_unary( request=request, - response_class=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpResponse, - method=method, - **kwargs, + method=MethodInfo( + name="Dhcp", + service_name="metalstack.infra.v2.BootService", + input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpRequest, + output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpResponse, + idempotency_level=IdempotencyLevel.UNKNOWN, + ), + headers=headers, + timeout_ms=timeout_ms, ) - def Boot( + async def boot( self, request: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootRequest, *, - ctx: Optional[ClientContext] = None, - server_path_prefix: str = "", - **kwargs, + headers: Headers | Mapping[str, str] | None = None, + timeout_ms: int | None = None, ) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootResponse: - method = "POST" - return self._make_request( - url=f"{server_path_prefix}/metalstack.infra.v2.BootService/Boot", - ctx=ctx, + return await self.execute_unary( request=request, - response_class=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootResponse, - method=method, - **kwargs, + method=MethodInfo( + name="Boot", + service_name="metalstack.infra.v2.BootService", + input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootRequest, + output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootResponse, + idempotency_level=IdempotencyLevel.UNKNOWN, + ), + headers=headers, + timeout_ms=timeout_ms, ) - def SuperUserPassword( + async def super_user_password( self, request: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordRequest, *, - ctx: Optional[ClientContext] = None, - server_path_prefix: str = "", - **kwargs, + headers: Headers | Mapping[str, str] | None = None, + timeout_ms: int | None = None, ) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordResponse: - method = "POST" - return self._make_request( - url=f"{server_path_prefix}/metalstack.infra.v2.BootService/SuperUserPassword", - ctx=ctx, + return await self.execute_unary( request=request, - response_class=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordResponse, - method=method, - **kwargs, + method=MethodInfo( + name="SuperUserPassword", + service_name="metalstack.infra.v2.BootService", + input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordRequest, + output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordResponse, + idempotency_level=IdempotencyLevel.UNKNOWN, + ), + headers=headers, + timeout_ms=timeout_ms, ) - def Register( + async def register( self, request: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterRequest, *, - ctx: Optional[ClientContext] = None, - server_path_prefix: str = "", - **kwargs, + headers: Headers | Mapping[str, str] | None = None, + timeout_ms: int | None = None, ) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterResponse: - method = "POST" - return self._make_request( - url=f"{server_path_prefix}/metalstack.infra.v2.BootService/Register", - ctx=ctx, + return await self.execute_unary( request=request, - response_class=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterResponse, - method=method, - **kwargs, + method=MethodInfo( + name="Register", + service_name="metalstack.infra.v2.BootService", + input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterRequest, + output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterResponse, + idempotency_level=IdempotencyLevel.UNKNOWN, + ), + headers=headers, + timeout_ms=timeout_ms, ) - def Wait( + def wait( self, request: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitRequest, *, - ctx: Optional[ClientContext] = None, - server_path_prefix: str = "", - **kwargs, - ) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitResponse: - method = "POST" - return self._make_request( - url=f"{server_path_prefix}/metalstack.infra.v2.BootService/Wait", - ctx=ctx, + headers: Headers | Mapping[str, str] | None = None, + timeout_ms: int | None = None, + ) -> AsyncIterator[metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitResponse]: + return self.execute_server_stream( request=request, - response_class=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitResponse, - method=method, - **kwargs, + method=MethodInfo( + name="Wait", + service_name="metalstack.infra.v2.BootService", + input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitRequest, + output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitResponse, + idempotency_level=IdempotencyLevel.UNKNOWN, + ), + headers=headers, + timeout_ms=timeout_ms, ) - def Report( + async def report( self, request: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceReportRequest, *, - ctx: Optional[ClientContext] = None, - server_path_prefix: str = "", - **kwargs, + headers: Headers | Mapping[str, str] | None = None, + timeout_ms: int | None = None, ) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceReportResponse: - method = "POST" - return self._make_request( - url=f"{server_path_prefix}/metalstack.infra.v2.BootService/Report", - ctx=ctx, + return await self.execute_unary( request=request, - response_class=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceReportResponse, - method=method, - **kwargs, + method=MethodInfo( + name="Report", + service_name="metalstack.infra.v2.BootService", + input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceReportRequest, + output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceReportResponse, + idempotency_level=IdempotencyLevel.UNKNOWN, + ), + headers=headers, + timeout_ms=timeout_ms, ) -class AsyncBootServiceClient(AsyncConnecpyClient): - async def Dhcp( +class BootServiceSync(Protocol): + def dhcp(self, request: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpRequest, ctx: RequestContext) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpResponse: + raise ConnecpyException(Code.UNIMPLEMENTED, "Not implemented") + def boot(self, request: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootRequest, ctx: RequestContext) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootResponse: + raise ConnecpyException(Code.UNIMPLEMENTED, "Not implemented") + def super_user_password(self, request: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordRequest, ctx: RequestContext) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordResponse: + raise ConnecpyException(Code.UNIMPLEMENTED, "Not implemented") + def register(self, request: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterRequest, ctx: RequestContext) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterResponse: + raise ConnecpyException(Code.UNIMPLEMENTED, "Not implemented") + def wait(self, request: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitRequest, ctx: RequestContext) -> Iterator[metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitResponse]: + raise ConnecpyException(Code.UNIMPLEMENTED, "Not implemented") + def report(self, request: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceReportRequest, ctx: RequestContext) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceReportResponse: + raise ConnecpyException(Code.UNIMPLEMENTED, "Not implemented") + + +class BootServiceWSGIApplication(ConnecpyWSGIApplication): + def __init__(self, service: BootServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None): + super().__init__( + endpoints={ + "/metalstack.infra.v2.BootService/Dhcp": EndpointSync.unary( + method=MethodInfo( + name="Dhcp", + service_name="metalstack.infra.v2.BootService", + input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpRequest, + output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpResponse, + idempotency_level=IdempotencyLevel.UNKNOWN, + ), + function=service.dhcp, + ), + "/metalstack.infra.v2.BootService/Boot": EndpointSync.unary( + method=MethodInfo( + name="Boot", + service_name="metalstack.infra.v2.BootService", + input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootRequest, + output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootResponse, + idempotency_level=IdempotencyLevel.UNKNOWN, + ), + function=service.boot, + ), + "/metalstack.infra.v2.BootService/SuperUserPassword": EndpointSync.unary( + method=MethodInfo( + name="SuperUserPassword", + service_name="metalstack.infra.v2.BootService", + input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordRequest, + output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordResponse, + idempotency_level=IdempotencyLevel.UNKNOWN, + ), + function=service.super_user_password, + ), + "/metalstack.infra.v2.BootService/Register": EndpointSync.unary( + method=MethodInfo( + name="Register", + service_name="metalstack.infra.v2.BootService", + input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterRequest, + output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterResponse, + idempotency_level=IdempotencyLevel.UNKNOWN, + ), + function=service.register, + ), + "/metalstack.infra.v2.BootService/Wait": EndpointSync.server_stream( + method=MethodInfo( + name="Wait", + service_name="metalstack.infra.v2.BootService", + input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitRequest, + output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitResponse, + idempotency_level=IdempotencyLevel.UNKNOWN, + ), + function=service.wait, + ), + "/metalstack.infra.v2.BootService/Report": EndpointSync.unary( + method=MethodInfo( + name="Report", + service_name="metalstack.infra.v2.BootService", + input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceReportRequest, + output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceReportResponse, + idempotency_level=IdempotencyLevel.UNKNOWN, + ), + function=service.report, + ), + }, + interceptors=interceptors, + read_max_bytes=read_max_bytes, + ) + + @property + def path(self): + """Returns the URL path to mount the application to when serving multiple applications.""" + return "/metalstack.infra.v2.BootService" + + +class BootServiceClientSync(ConnecpyClientSync): + def dhcp( self, request: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpRequest, *, - ctx: Optional[ClientContext] = None, - server_path_prefix: str = "", - session: Union[httpx.AsyncClient, None] = None, - **kwargs, + headers: Headers | Mapping[str, str] | None = None, + timeout_ms: int | None = None, ) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpResponse: - method = "POST" - return await self._make_request( - url=f"{server_path_prefix}/metalstack.infra.v2.BootService/Dhcp", - ctx=ctx, + return self.execute_unary( request=request, - response_class=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpResponse, - method=method, - session=session, - **kwargs, + method=MethodInfo( + name="Dhcp", + service_name="metalstack.infra.v2.BootService", + input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpRequest, + output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpResponse, + idempotency_level=IdempotencyLevel.UNKNOWN, + ), + headers=headers, + timeout_ms=timeout_ms, ) - async def Boot( + def boot( self, request: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootRequest, *, - ctx: Optional[ClientContext] = None, - server_path_prefix: str = "", - session: Union[httpx.AsyncClient, None] = None, - **kwargs, + headers: Headers | Mapping[str, str] | None = None, + timeout_ms: int | None = None, ) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootResponse: - method = "POST" - return await self._make_request( - url=f"{server_path_prefix}/metalstack.infra.v2.BootService/Boot", - ctx=ctx, + return self.execute_unary( request=request, - response_class=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootResponse, - method=method, - session=session, - **kwargs, + method=MethodInfo( + name="Boot", + service_name="metalstack.infra.v2.BootService", + input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootRequest, + output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootResponse, + idempotency_level=IdempotencyLevel.UNKNOWN, + ), + headers=headers, + timeout_ms=timeout_ms, ) - async def SuperUserPassword( + def super_user_password( self, request: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordRequest, *, - ctx: Optional[ClientContext] = None, - server_path_prefix: str = "", - session: Union[httpx.AsyncClient, None] = None, - **kwargs, + headers: Headers | Mapping[str, str] | None = None, + timeout_ms: int | None = None, ) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordResponse: - method = "POST" - return await self._make_request( - url=f"{server_path_prefix}/metalstack.infra.v2.BootService/SuperUserPassword", - ctx=ctx, + return self.execute_unary( request=request, - response_class=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordResponse, - method=method, - session=session, - **kwargs, + method=MethodInfo( + name="SuperUserPassword", + service_name="metalstack.infra.v2.BootService", + input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordRequest, + output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordResponse, + idempotency_level=IdempotencyLevel.UNKNOWN, + ), + headers=headers, + timeout_ms=timeout_ms, ) - async def Register( + def register( self, request: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterRequest, *, - ctx: Optional[ClientContext] = None, - server_path_prefix: str = "", - session: Union[httpx.AsyncClient, None] = None, - **kwargs, + headers: Headers | Mapping[str, str] | None = None, + timeout_ms: int | None = None, ) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterResponse: - method = "POST" - return await self._make_request( - url=f"{server_path_prefix}/metalstack.infra.v2.BootService/Register", - ctx=ctx, + return self.execute_unary( request=request, - response_class=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterResponse, - method=method, - session=session, - **kwargs, + method=MethodInfo( + name="Register", + service_name="metalstack.infra.v2.BootService", + input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterRequest, + output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterResponse, + idempotency_level=IdempotencyLevel.UNKNOWN, + ), + headers=headers, + timeout_ms=timeout_ms, ) - async def Wait( + def wait( self, request: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitRequest, *, - ctx: Optional[ClientContext] = None, - server_path_prefix: str = "", - session: Union[httpx.AsyncClient, None] = None, - **kwargs, - ) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitResponse: - method = "POST" - return await self._make_request( - url=f"{server_path_prefix}/metalstack.infra.v2.BootService/Wait", - ctx=ctx, + headers: Headers | Mapping[str, str] | None = None, + timeout_ms: int | None = None, + ) -> Iterator[metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitResponse]: + return self.execute_server_stream( request=request, - response_class=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitResponse, - method=method, - session=session, - **kwargs, + method=MethodInfo( + name="Wait", + service_name="metalstack.infra.v2.BootService", + input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitRequest, + output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitResponse, + idempotency_level=IdempotencyLevel.UNKNOWN, + ), + headers=headers, + timeout_ms=timeout_ms, ) - async def Report( + def report( self, request: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceReportRequest, *, - ctx: Optional[ClientContext] = None, - server_path_prefix: str = "", - session: Union[httpx.AsyncClient, None] = None, - **kwargs, + headers: Headers | Mapping[str, str] | None = None, + timeout_ms: int | None = None, ) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceReportResponse: - method = "POST" - return await self._make_request( - url=f"{server_path_prefix}/metalstack.infra.v2.BootService/Report", - ctx=ctx, + return self.execute_unary( request=request, - response_class=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceReportResponse, - method=method, - session=session, - **kwargs, + method=MethodInfo( + name="Report", + service_name="metalstack.infra.v2.BootService", + input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceReportRequest, + output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceReportResponse, + idempotency_level=IdempotencyLevel.UNKNOWN, + ), + headers=headers, + timeout_ms=timeout_ms, ) From aed443a0c1cc289d5a06b74546f5e4a29d6d54ff Mon Sep 17 00:00:00 2001 From: Stefan Majer Date: Tue, 2 Sep 2025 11:29:04 +0200 Subject: [PATCH 11/27] Add event service --- doc/index.html | 217 +++++++++++ go/client/client.go | 10 + go/metalstack/infra/v2/event.pb.go | 356 ++++++++++++++++++ .../infra/v2/infrav2connect/event.connect.go | 140 +++++++ go/permissions/servicepermissions.go | 15 +- go/tests/mock_clients.go | 9 + go/tests/mocks/client/Infrav2.go | 20 + .../v2/infrav2connect/EventServiceClient.go | 92 +++++ .../v2/infrav2connect/EventServiceHandler.go | 92 +++++ proto/metalstack/infra/v2/event.proto | 60 +++ python/metalstack/client/client.py | 4 + python/metalstack/infra/v2/event_connecpy.py | 184 +++++++++ python/metalstack/infra/v2/event_pb2.py | 67 ++++ python/metalstack/infra/v2/event_pb2.pyi | 52 +++ python/metalstack/infra/v2/event_pb2_grpc.py | 125 ++++++ 15 files changed, 1439 insertions(+), 4 deletions(-) create mode 100644 go/metalstack/infra/v2/event.pb.go create mode 100644 go/metalstack/infra/v2/infrav2connect/event.connect.go create mode 100644 go/tests/mocks/metalstack/infra/v2/infrav2connect/EventServiceClient.go create mode 100644 go/tests/mocks/metalstack/infra/v2/infrav2connect/EventServiceHandler.go create mode 100644 proto/metalstack/infra/v2/event.proto create mode 100644 python/metalstack/infra/v2/event_connecpy.py create mode 100644 python/metalstack/infra/v2/event_pb2.py create mode 100644 python/metalstack/infra/v2/event_pb2.pyi create mode 100644 python/metalstack/infra/v2/event_pb2_grpc.py diff --git a/doc/index.html b/doc/index.html index 7ef9b9c0..060ae012 100644 --- a/doc/index.html +++ b/doc/index.html @@ -2018,6 +2018,45 @@

    Table of Contents

    +
  • + metalstack/infra/v2/event.proto + +
  • + +
  • metalstack/infra/v2/switch.proto
      @@ -19260,6 +19299,184 @@

      BootService

      +
      +

      metalstack/infra/v2/event.proto

      Top +
      +

      + + +

      EventServiceSendMultiRequest

      +

      EventServiceSendMultiRequest contains events for many machines

      + + +
  • mac string

    Mac address of the machein

    Mac address of the machine

    + + + + + + + + + + + + + +
    FieldTypeLabelDescription
    eventsEventServiceSendMultiRequest.EventsEntryrepeated

    Events of many machines, key is the machine uuid

    + + + + + +

    EventServiceSendMultiRequest.EventsEntry

    +

    + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeLabelDescription
    keystring

    valueMachineProvisioningEvent

    + + + + + +

    EventServiceSendMultiResponse

    +

    EventServiceSendMultiResponse is returned after events have been sent

    + + + + + +

    EventServiceSendRequest

    +

    EventServiceSendRequest

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

    UUID of the machine of the event

    eventMachineProvisioningEvent

    Event details

    + + + + + +

    EventServiceSendResponse

    +

    EventServiceSendResponse is the response of a single event sent

    + + + + + +

    MachineProvisioningEvent

    +

    MachineProvisioningEvent describes a event for a single machine

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeLabelDescription
    timegoogle.protobuf.Timestamp

    timestamp when the event occurred

    eventmetalstack.api.v2.MachineProvisioningEventType

    the event type

    messagestring

    an additional message describing the event more detailed

    + + + + + + + + + + + +

    EventService

    +

    EventService is used to send machine related events

    + + + + + + + + + + + + + + + + + + + + + +
    Method NameRequest TypeResponse TypeDescription
    SendEventServiceSendRequestEventServiceSendResponse

    Send an event of a single machine to the api

    SendMultiEventServiceSendMultiRequestEventServiceSendMultiResponse

    SendMulti sends events of a bunch of machines in one request to the api

    + + + +

    metalstack/infra/v2/switch.proto

    Top
    diff --git a/go/client/client.go b/go/client/client.go index 5196c002..9e281aec 100755 --- a/go/client/client.go +++ b/go/client/client.go @@ -83,12 +83,14 @@ type ( Infrav2 interface { BMC() infrav2connect.BMCServiceClient Boot() infrav2connect.BootServiceClient + Event() infrav2connect.EventServiceClient Switch() infrav2connect.SwitchServiceClient } infrav2 struct { bmcservice infrav2connect.BMCServiceClient bootservice infrav2connect.BootServiceClient + eventservice infrav2connect.EventServiceClient switchservice infrav2connect.SwitchServiceClient } ) @@ -317,6 +319,11 @@ func (c *client) Infrav2() Infrav2 { c.config.BaseURL, compress.WithAll(compress.LevelBalanced), ), + eventservice: infrav2connect.NewEventServiceClient( + c.config.HttpClient(), + c.config.BaseURL, + compress.WithAll(compress.LevelBalanced), + ), switchservice: infrav2connect.NewSwitchServiceClient( c.config.HttpClient(), c.config.BaseURL, @@ -332,6 +339,9 @@ func (c *infrav2) BMC() infrav2connect.BMCServiceClient { func (c *infrav2) Boot() infrav2connect.BootServiceClient { return c.bootservice } +func (c *infrav2) Event() infrav2connect.EventServiceClient { + return c.eventservice +} func (c *infrav2) Switch() infrav2connect.SwitchServiceClient { return c.switchservice } diff --git a/go/metalstack/infra/v2/event.pb.go b/go/metalstack/infra/v2/event.pb.go new file mode 100644 index 00000000..06722a45 --- /dev/null +++ b/go/metalstack/infra/v2/event.pb.go @@ -0,0 +1,356 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.8 +// protoc (unknown) +// source: metalstack/infra/v2/event.proto + +package infrav2 + +import ( + _ "buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate" + v2 "github.com/metal-stack/api/go/metalstack/api/v2" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// EventServiceSendRequest +type EventServiceSendRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // UUID of the machine of the event + Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` + // Event details + Event *MachineProvisioningEvent `protobuf:"bytes,2,opt,name=event,proto3" json:"event,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *EventServiceSendRequest) Reset() { + *x = EventServiceSendRequest{} + mi := &file_metalstack_infra_v2_event_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *EventServiceSendRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventServiceSendRequest) ProtoMessage() {} + +func (x *EventServiceSendRequest) ProtoReflect() protoreflect.Message { + mi := &file_metalstack_infra_v2_event_proto_msgTypes[0] + 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 EventServiceSendRequest.ProtoReflect.Descriptor instead. +func (*EventServiceSendRequest) Descriptor() ([]byte, []int) { + return file_metalstack_infra_v2_event_proto_rawDescGZIP(), []int{0} +} + +func (x *EventServiceSendRequest) GetUuid() string { + if x != nil { + return x.Uuid + } + return "" +} + +func (x *EventServiceSendRequest) GetEvent() *MachineProvisioningEvent { + if x != nil { + return x.Event + } + return nil +} + +// EventServiceSendResponse is the response of a single event sent +type EventServiceSendResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *EventServiceSendResponse) Reset() { + *x = EventServiceSendResponse{} + mi := &file_metalstack_infra_v2_event_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *EventServiceSendResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventServiceSendResponse) ProtoMessage() {} + +func (x *EventServiceSendResponse) ProtoReflect() protoreflect.Message { + mi := &file_metalstack_infra_v2_event_proto_msgTypes[1] + 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 EventServiceSendResponse.ProtoReflect.Descriptor instead. +func (*EventServiceSendResponse) Descriptor() ([]byte, []int) { + return file_metalstack_infra_v2_event_proto_rawDescGZIP(), []int{1} +} + +// EventServiceSendMultiRequest contains events for many machines +type EventServiceSendMultiRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Events of many machines, key is the machine uuid + Events map[string]*MachineProvisioningEvent `protobuf:"bytes,1,rep,name=events,proto3" json:"events,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *EventServiceSendMultiRequest) Reset() { + *x = EventServiceSendMultiRequest{} + mi := &file_metalstack_infra_v2_event_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *EventServiceSendMultiRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventServiceSendMultiRequest) ProtoMessage() {} + +func (x *EventServiceSendMultiRequest) ProtoReflect() protoreflect.Message { + mi := &file_metalstack_infra_v2_event_proto_msgTypes[2] + 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 EventServiceSendMultiRequest.ProtoReflect.Descriptor instead. +func (*EventServiceSendMultiRequest) Descriptor() ([]byte, []int) { + return file_metalstack_infra_v2_event_proto_rawDescGZIP(), []int{2} +} + +func (x *EventServiceSendMultiRequest) GetEvents() map[string]*MachineProvisioningEvent { + if x != nil { + return x.Events + } + return nil +} + +// EventServiceSendMultiResponse is returned after events have been sent +type EventServiceSendMultiResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *EventServiceSendMultiResponse) Reset() { + *x = EventServiceSendMultiResponse{} + mi := &file_metalstack_infra_v2_event_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *EventServiceSendMultiResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventServiceSendMultiResponse) ProtoMessage() {} + +func (x *EventServiceSendMultiResponse) ProtoReflect() protoreflect.Message { + mi := &file_metalstack_infra_v2_event_proto_msgTypes[3] + 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 EventServiceSendMultiResponse.ProtoReflect.Descriptor instead. +func (*EventServiceSendMultiResponse) Descriptor() ([]byte, []int) { + return file_metalstack_infra_v2_event_proto_rawDescGZIP(), []int{3} +} + +// MachineProvisioningEvent describes a event for a single machine +type MachineProvisioningEvent struct { + state protoimpl.MessageState `protogen:"open.v1"` + // timestamp when the event occurred + Time *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=time,proto3" json:"time,omitempty"` + // the event type + Event v2.MachineProvisioningEventType `protobuf:"varint,2,opt,name=event,proto3,enum=metalstack.api.v2.MachineProvisioningEventType" json:"event,omitempty"` + // an additional message describing the event more detailed + Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MachineProvisioningEvent) Reset() { + *x = MachineProvisioningEvent{} + mi := &file_metalstack_infra_v2_event_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MachineProvisioningEvent) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MachineProvisioningEvent) ProtoMessage() {} + +func (x *MachineProvisioningEvent) ProtoReflect() protoreflect.Message { + mi := &file_metalstack_infra_v2_event_proto_msgTypes[4] + 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 MachineProvisioningEvent.ProtoReflect.Descriptor instead. +func (*MachineProvisioningEvent) Descriptor() ([]byte, []int) { + return file_metalstack_infra_v2_event_proto_rawDescGZIP(), []int{4} +} + +func (x *MachineProvisioningEvent) GetTime() *timestamppb.Timestamp { + if x != nil { + return x.Time + } + return nil +} + +func (x *MachineProvisioningEvent) GetEvent() v2.MachineProvisioningEventType { + if x != nil { + return x.Event + } + return v2.MachineProvisioningEventType(0) +} + +func (x *MachineProvisioningEvent) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +var File_metalstack_infra_v2_event_proto protoreflect.FileDescriptor + +const file_metalstack_infra_v2_event_proto_rawDesc = "" + + "\n" + + "\x1fmetalstack/infra/v2/event.proto\x12\x13metalstack.infra.v2\x1a\x1bbuf/validate/validate.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1emetalstack/api/v2/common.proto\x1a\x1fmetalstack/api/v2/machine.proto\"|\n" + + "\x17EventServiceSendRequest\x12\x1c\n" + + "\x04uuid\x18\x01 \x01(\tB\b\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12C\n" + + "\x05event\x18\x02 \x01(\v2-.metalstack.infra.v2.MachineProvisioningEventR\x05event\"\x1a\n" + + "\x18EventServiceSendResponse\"\xf1\x01\n" + + "\x1cEventServiceSendMultiRequest\x12g\n" + + "\x06events\x18\x01 \x03(\v2=.metalstack.infra.v2.EventServiceSendMultiRequest.EventsEntryB\x10\xbaH\r\x9a\x01\n" + + "\x10\x80\b\"\x05r\x03\xb0\x01\x01R\x06events\x1ah\n" + + "\vEventsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12C\n" + + "\x05value\x18\x02 \x01(\v2-.metalstack.infra.v2.MachineProvisioningEventR\x05value:\x028\x01\"\x1f\n" + + "\x1dEventServiceSendMultiResponse\"\xbf\x01\n" + + "\x18MachineProvisioningEvent\x12.\n" + + "\x04time\x18\x01 \x01(\v2\x1a.google.protobuf.TimestampR\x04time\x12O\n" + + "\x05event\x18\x02 \x01(\x0e2/.metalstack.api.v2.MachineProvisioningEventTypeB\b\xbaH\x05\x82\x01\x02\x10\x01R\x05event\x12\"\n" + + "\amessage\x18\x03 \x01(\tB\b\xbaH\x05r\x03\x18\x80\x02R\amessage2\xff\x01\n" + + "\fEventService\x12o\n" + + "\x04Send\x12,.metalstack.infra.v2.EventServiceSendRequest\x1a-.metalstack.infra.v2.EventServiceSendResponse\"\n" + + "\xe0\xf3\x18\x02\xf2\xf3\x18\x02\x01\x02\x12~\n" + + "\tSendMulti\x121.metalstack.infra.v2.EventServiceSendMultiRequest\x1a2.metalstack.infra.v2.EventServiceSendMultiResponse\"\n" + + "\xe0\xf3\x18\x02\xea\xf3\x18\x02\x01\x02B\xce\x01\n" + + "\x17com.metalstack.infra.v2B\n" + + "EventProtoP\x01Z9github.com/metal-stack/api/go/metalstack/infra/v2;infrav2\xa2\x02\x03MIX\xaa\x02\x13Metalstack.Infra.V2\xca\x02\x13Metalstack\\Infra\\V2\xe2\x02\x1fMetalstack\\Infra\\V2\\GPBMetadata\xea\x02\x15Metalstack::Infra::V2b\x06proto3" + +var ( + file_metalstack_infra_v2_event_proto_rawDescOnce sync.Once + file_metalstack_infra_v2_event_proto_rawDescData []byte +) + +func file_metalstack_infra_v2_event_proto_rawDescGZIP() []byte { + file_metalstack_infra_v2_event_proto_rawDescOnce.Do(func() { + file_metalstack_infra_v2_event_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_metalstack_infra_v2_event_proto_rawDesc), len(file_metalstack_infra_v2_event_proto_rawDesc))) + }) + return file_metalstack_infra_v2_event_proto_rawDescData +} + +var file_metalstack_infra_v2_event_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_metalstack_infra_v2_event_proto_goTypes = []any{ + (*EventServiceSendRequest)(nil), // 0: metalstack.infra.v2.EventServiceSendRequest + (*EventServiceSendResponse)(nil), // 1: metalstack.infra.v2.EventServiceSendResponse + (*EventServiceSendMultiRequest)(nil), // 2: metalstack.infra.v2.EventServiceSendMultiRequest + (*EventServiceSendMultiResponse)(nil), // 3: metalstack.infra.v2.EventServiceSendMultiResponse + (*MachineProvisioningEvent)(nil), // 4: metalstack.infra.v2.MachineProvisioningEvent + nil, // 5: metalstack.infra.v2.EventServiceSendMultiRequest.EventsEntry + (*timestamppb.Timestamp)(nil), // 6: google.protobuf.Timestamp + (v2.MachineProvisioningEventType)(0), // 7: metalstack.api.v2.MachineProvisioningEventType +} +var file_metalstack_infra_v2_event_proto_depIdxs = []int32{ + 4, // 0: metalstack.infra.v2.EventServiceSendRequest.event:type_name -> metalstack.infra.v2.MachineProvisioningEvent + 5, // 1: metalstack.infra.v2.EventServiceSendMultiRequest.events:type_name -> metalstack.infra.v2.EventServiceSendMultiRequest.EventsEntry + 6, // 2: metalstack.infra.v2.MachineProvisioningEvent.time:type_name -> google.protobuf.Timestamp + 7, // 3: metalstack.infra.v2.MachineProvisioningEvent.event:type_name -> metalstack.api.v2.MachineProvisioningEventType + 4, // 4: metalstack.infra.v2.EventServiceSendMultiRequest.EventsEntry.value:type_name -> metalstack.infra.v2.MachineProvisioningEvent + 0, // 5: metalstack.infra.v2.EventService.Send:input_type -> metalstack.infra.v2.EventServiceSendRequest + 2, // 6: metalstack.infra.v2.EventService.SendMulti:input_type -> metalstack.infra.v2.EventServiceSendMultiRequest + 1, // 7: metalstack.infra.v2.EventService.Send:output_type -> metalstack.infra.v2.EventServiceSendResponse + 3, // 8: metalstack.infra.v2.EventService.SendMulti:output_type -> metalstack.infra.v2.EventServiceSendMultiResponse + 7, // [7:9] is the sub-list for method output_type + 5, // [5:7] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name +} + +func init() { file_metalstack_infra_v2_event_proto_init() } +func file_metalstack_infra_v2_event_proto_init() { + if File_metalstack_infra_v2_event_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_metalstack_infra_v2_event_proto_rawDesc), len(file_metalstack_infra_v2_event_proto_rawDesc)), + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_metalstack_infra_v2_event_proto_goTypes, + DependencyIndexes: file_metalstack_infra_v2_event_proto_depIdxs, + MessageInfos: file_metalstack_infra_v2_event_proto_msgTypes, + }.Build() + File_metalstack_infra_v2_event_proto = out.File + file_metalstack_infra_v2_event_proto_goTypes = nil + file_metalstack_infra_v2_event_proto_depIdxs = nil +} diff --git a/go/metalstack/infra/v2/infrav2connect/event.connect.go b/go/metalstack/infra/v2/infrav2connect/event.connect.go new file mode 100644 index 00000000..f3b6e495 --- /dev/null +++ b/go/metalstack/infra/v2/infrav2connect/event.connect.go @@ -0,0 +1,140 @@ +// Code generated by protoc-gen-connect-go. DO NOT EDIT. +// +// Source: metalstack/infra/v2/event.proto + +package infrav2connect + +import ( + connect "connectrpc.com/connect" + context "context" + errors "errors" + v2 "github.com/metal-stack/api/go/metalstack/infra/v2" + http "net/http" + strings "strings" +) + +// This is a compile-time assertion to ensure that this generated file and the connect package are +// compatible. If you get a compiler error that this constant is not defined, this code was +// generated with a version of connect newer than the one compiled into your binary. You can fix the +// problem by either regenerating this code with an older version of connect or updating the connect +// version compiled into your binary. +const _ = connect.IsAtLeastVersion1_13_0 + +const ( + // EventServiceName is the fully-qualified name of the EventService service. + EventServiceName = "metalstack.infra.v2.EventService" +) + +// These constants are the fully-qualified names of the RPCs defined in this package. They're +// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route. +// +// Note that these are different from the fully-qualified method names used by +// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to +// reflection-formatted method names, remove the leading slash and convert the remaining slash to a +// period. +const ( + // EventServiceSendProcedure is the fully-qualified name of the EventService's Send RPC. + EventServiceSendProcedure = "/metalstack.infra.v2.EventService/Send" + // EventServiceSendMultiProcedure is the fully-qualified name of the EventService's SendMulti RPC. + EventServiceSendMultiProcedure = "/metalstack.infra.v2.EventService/SendMulti" +) + +// EventServiceClient is a client for the metalstack.infra.v2.EventService service. +type EventServiceClient interface { + // Send an event of a single machine to the api + Send(context.Context, *connect.Request[v2.EventServiceSendRequest]) (*connect.Response[v2.EventServiceSendResponse], error) + // SendMulti sends events of a bunch of machines in one request to the api + SendMulti(context.Context, *connect.Request[v2.EventServiceSendMultiRequest]) (*connect.Response[v2.EventServiceSendMultiResponse], error) +} + +// NewEventServiceClient constructs a client for the metalstack.infra.v2.EventService service. By +// default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, +// and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the +// connect.WithGRPC() or connect.WithGRPCWeb() options. +// +// The URL supplied here should be the base URL for the Connect or gRPC server (for example, +// http://api.acme.com or https://acme.com/grpc). +func NewEventServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) EventServiceClient { + baseURL = strings.TrimRight(baseURL, "/") + eventServiceMethods := v2.File_metalstack_infra_v2_event_proto.Services().ByName("EventService").Methods() + return &eventServiceClient{ + send: connect.NewClient[v2.EventServiceSendRequest, v2.EventServiceSendResponse]( + httpClient, + baseURL+EventServiceSendProcedure, + connect.WithSchema(eventServiceMethods.ByName("Send")), + connect.WithClientOptions(opts...), + ), + sendMulti: connect.NewClient[v2.EventServiceSendMultiRequest, v2.EventServiceSendMultiResponse]( + httpClient, + baseURL+EventServiceSendMultiProcedure, + connect.WithSchema(eventServiceMethods.ByName("SendMulti")), + connect.WithClientOptions(opts...), + ), + } +} + +// eventServiceClient implements EventServiceClient. +type eventServiceClient struct { + send *connect.Client[v2.EventServiceSendRequest, v2.EventServiceSendResponse] + sendMulti *connect.Client[v2.EventServiceSendMultiRequest, v2.EventServiceSendMultiResponse] +} + +// Send calls metalstack.infra.v2.EventService.Send. +func (c *eventServiceClient) Send(ctx context.Context, req *connect.Request[v2.EventServiceSendRequest]) (*connect.Response[v2.EventServiceSendResponse], error) { + return c.send.CallUnary(ctx, req) +} + +// SendMulti calls metalstack.infra.v2.EventService.SendMulti. +func (c *eventServiceClient) SendMulti(ctx context.Context, req *connect.Request[v2.EventServiceSendMultiRequest]) (*connect.Response[v2.EventServiceSendMultiResponse], error) { + return c.sendMulti.CallUnary(ctx, req) +} + +// EventServiceHandler is an implementation of the metalstack.infra.v2.EventService service. +type EventServiceHandler interface { + // Send an event of a single machine to the api + Send(context.Context, *connect.Request[v2.EventServiceSendRequest]) (*connect.Response[v2.EventServiceSendResponse], error) + // SendMulti sends events of a bunch of machines in one request to the api + SendMulti(context.Context, *connect.Request[v2.EventServiceSendMultiRequest]) (*connect.Response[v2.EventServiceSendMultiResponse], error) +} + +// NewEventServiceHandler builds an HTTP handler from the service implementation. It returns the +// path on which to mount the handler and the handler itself. +// +// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf +// and JSON codecs. They also support gzip compression. +func NewEventServiceHandler(svc EventServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { + eventServiceMethods := v2.File_metalstack_infra_v2_event_proto.Services().ByName("EventService").Methods() + eventServiceSendHandler := connect.NewUnaryHandler( + EventServiceSendProcedure, + svc.Send, + connect.WithSchema(eventServiceMethods.ByName("Send")), + connect.WithHandlerOptions(opts...), + ) + eventServiceSendMultiHandler := connect.NewUnaryHandler( + EventServiceSendMultiProcedure, + svc.SendMulti, + connect.WithSchema(eventServiceMethods.ByName("SendMulti")), + connect.WithHandlerOptions(opts...), + ) + return "/metalstack.infra.v2.EventService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + switch r.URL.Path { + case EventServiceSendProcedure: + eventServiceSendHandler.ServeHTTP(w, r) + case EventServiceSendMultiProcedure: + eventServiceSendMultiHandler.ServeHTTP(w, r) + default: + http.NotFound(w, r) + } + }) +} + +// UnimplementedEventServiceHandler returns CodeUnimplemented from all methods. +type UnimplementedEventServiceHandler struct{} + +func (UnimplementedEventServiceHandler) Send(context.Context, *connect.Request[v2.EventServiceSendRequest]) (*connect.Response[v2.EventServiceSendResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("metalstack.infra.v2.EventService.Send is not implemented")) +} + +func (UnimplementedEventServiceHandler) SendMulti(context.Context, *connect.Request[v2.EventServiceSendMultiRequest]) (*connect.Response[v2.EventServiceSendMultiResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("metalstack.infra.v2.EventService.SendMulti is not implemented")) +} diff --git a/go/permissions/servicepermissions.go b/go/permissions/servicepermissions.go index 1b1a2bb2..9899237e 100755 --- a/go/permissions/servicepermissions.go +++ b/go/permissions/servicepermissions.go @@ -32,6 +32,7 @@ func GetServices() []string { "metalstack.api.v2.VersionService", "metalstack.infra.v2.BMCService", "metalstack.infra.v2.BootService", + "metalstack.infra.v2.EventService", "metalstack.infra.v2.SwitchService", } } @@ -93,10 +94,10 @@ func GetServicePermissions() *ServicePermissions { "/metalstack.infra.v2.SwitchService/Register", }, "MACHINE_ROLE_EDITOR": []string{ - "/metalstack.infra.v2.BootService/Report", + "/metalstack.infra.v2.EventService/Send", }, "MACHINE_ROLE_VIEWER": []string{ - "/metalstack.infra.v2.BootService/Report", + "/metalstack.infra.v2.EventService/Send", }, }, Machine: Machine{ @@ -107,10 +108,10 @@ func GetServicePermissions() *ServicePermissions { "/metalstack.infra.v2.SwitchService/Register", }, "MACHINE_ROLE_EDITOR": []string{ - "/metalstack.infra.v2.BootService/Report", + "/metalstack.infra.v2.EventService/Send", }, "MACHINE_ROLE_VIEWER": []string{ - "/metalstack.infra.v2.BootService/Report", + "/metalstack.infra.v2.EventService/Send", }, }, Tenant: Tenant{ @@ -293,6 +294,8 @@ func GetServicePermissions() *ServicePermissions { "/metalstack.infra.v2.BootService/Report": true, "/metalstack.infra.v2.BootService/SuperUserPassword": true, "/metalstack.infra.v2.BootService/Wait": true, + "/metalstack.infra.v2.EventService/Send": true, + "/metalstack.infra.v2.EventService/SendMulti": true, "/metalstack.infra.v2.SwitchService/Register": true, }, Visibility: Visibility{ @@ -363,6 +366,7 @@ func GetServicePermissions() *ServicePermissions { "/metalstack.infra.v2.BMCService/UpdateBMCInfo": true, "/metalstack.infra.v2.BootService/Boot": true, "/metalstack.infra.v2.BootService/Dhcp": true, + "/metalstack.infra.v2.EventService/SendMulti": true, "/metalstack.infra.v2.SwitchService/Register": true, }, Machine: map[string]bool{ @@ -370,6 +374,7 @@ func GetServicePermissions() *ServicePermissions { "/metalstack.infra.v2.BootService/Report": true, "/metalstack.infra.v2.BootService/SuperUserPassword": true, "/metalstack.infra.v2.BootService/Wait": true, + "/metalstack.infra.v2.EventService/Send": true, }, Tenant: map[string]bool{ "/metalstack.api.v2.ProjectService/Create": true, @@ -505,6 +510,8 @@ func GetServicePermissions() *ServicePermissions { "/metalstack.infra.v2.BootService/Report": false, "/metalstack.infra.v2.BootService/SuperUserPassword": false, "/metalstack.infra.v2.BootService/Wait": false, + "/metalstack.infra.v2.EventService/Send": false, + "/metalstack.infra.v2.EventService/SendMulti": false, "/metalstack.infra.v2.SwitchService/Register": false, }, } diff --git a/go/tests/mock_clients.go b/go/tests/mock_clients.go index ccb090ec..17fa6e75 100755 --- a/go/tests/mock_clients.go +++ b/go/tests/mock_clients.go @@ -90,12 +90,14 @@ type ( infrav2 struct { bmcservice *infrav2mocks.BMCServiceClient bootservice *infrav2mocks.BootServiceClient + eventservice *infrav2mocks.EventServiceClient switchservice *infrav2mocks.SwitchServiceClient } Infrav2MockFns struct { BMC func(m *mock.Mock) Boot func(m *mock.Mock) + Event func(m *mock.Mock) Switch func(m *mock.Mock) } ) @@ -323,6 +325,7 @@ func newinfrav2(t *testing.T, fns *Infrav2MockFns) *infrav2 { a := &infrav2{ bmcservice: infrav2mocks.NewBMCServiceClient(t), bootservice: infrav2mocks.NewBootServiceClient(t), + eventservice: infrav2mocks.NewEventServiceClient(t), switchservice: infrav2mocks.NewSwitchServiceClient(t), } @@ -333,6 +336,9 @@ func newinfrav2(t *testing.T, fns *Infrav2MockFns) *infrav2 { if fns.Boot != nil { fns.Boot(&a.bootservice.Mock) } + if fns.Event != nil { + fns.Event(&a.eventservice.Mock) + } if fns.Switch != nil { fns.Switch(&a.switchservice.Mock) } @@ -348,6 +354,9 @@ func (c *infrav2) BMC() infrav2connect.BMCServiceClient { func (c *infrav2) Boot() infrav2connect.BootServiceClient { return c.bootservice } +func (c *infrav2) Event() infrav2connect.EventServiceClient { + return c.eventservice +} func (c *infrav2) Switch() infrav2connect.SwitchServiceClient { return c.switchservice } diff --git a/go/tests/mocks/client/Infrav2.go b/go/tests/mocks/client/Infrav2.go index 12c3b977..9cdac85c 100644 --- a/go/tests/mocks/client/Infrav2.go +++ b/go/tests/mocks/client/Infrav2.go @@ -52,6 +52,26 @@ func (_m *Infrav2) Boot() infrav2connect.BootServiceClient { return r0 } +// Event provides a mock function with no fields +func (_m *Infrav2) Event() infrav2connect.EventServiceClient { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Event") + } + + var r0 infrav2connect.EventServiceClient + if rf, ok := ret.Get(0).(func() infrav2connect.EventServiceClient); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(infrav2connect.EventServiceClient) + } + } + + return r0 +} + // Switch provides a mock function with no fields func (_m *Infrav2) Switch() infrav2connect.SwitchServiceClient { ret := _m.Called() diff --git a/go/tests/mocks/metalstack/infra/v2/infrav2connect/EventServiceClient.go b/go/tests/mocks/metalstack/infra/v2/infrav2connect/EventServiceClient.go new file mode 100644 index 00000000..83bb5acd --- /dev/null +++ b/go/tests/mocks/metalstack/infra/v2/infrav2connect/EventServiceClient.go @@ -0,0 +1,92 @@ +// Code generated by mockery v2.53.5. DO NOT EDIT. + +package infrav2connect + +import ( + context "context" + + connect "connectrpc.com/connect" + + infrav2 "github.com/metal-stack/api/go/metalstack/infra/v2" + + mock "github.com/stretchr/testify/mock" +) + +// EventServiceClient is an autogenerated mock type for the EventServiceClient type +type EventServiceClient struct { + mock.Mock +} + +// Send provides a mock function with given fields: _a0, _a1 +func (_m *EventServiceClient) Send(_a0 context.Context, _a1 *connect.Request[infrav2.EventServiceSendRequest]) (*connect.Response[infrav2.EventServiceSendResponse], error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for Send") + } + + var r0 *connect.Response[infrav2.EventServiceSendResponse] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.EventServiceSendRequest]) (*connect.Response[infrav2.EventServiceSendResponse], error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.EventServiceSendRequest]) *connect.Response[infrav2.EventServiceSendResponse]); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.Response[infrav2.EventServiceSendResponse]) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[infrav2.EventServiceSendRequest]) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// SendMulti provides a mock function with given fields: _a0, _a1 +func (_m *EventServiceClient) SendMulti(_a0 context.Context, _a1 *connect.Request[infrav2.EventServiceSendMultiRequest]) (*connect.Response[infrav2.EventServiceSendMultiResponse], error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for SendMulti") + } + + var r0 *connect.Response[infrav2.EventServiceSendMultiResponse] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.EventServiceSendMultiRequest]) (*connect.Response[infrav2.EventServiceSendMultiResponse], error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.EventServiceSendMultiRequest]) *connect.Response[infrav2.EventServiceSendMultiResponse]); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.Response[infrav2.EventServiceSendMultiResponse]) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[infrav2.EventServiceSendMultiRequest]) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// NewEventServiceClient creates a new instance of EventServiceClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewEventServiceClient(t interface { + mock.TestingT + Cleanup(func()) +}) *EventServiceClient { + mock := &EventServiceClient{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/go/tests/mocks/metalstack/infra/v2/infrav2connect/EventServiceHandler.go b/go/tests/mocks/metalstack/infra/v2/infrav2connect/EventServiceHandler.go new file mode 100644 index 00000000..3627e6be --- /dev/null +++ b/go/tests/mocks/metalstack/infra/v2/infrav2connect/EventServiceHandler.go @@ -0,0 +1,92 @@ +// Code generated by mockery v2.53.5. DO NOT EDIT. + +package infrav2connect + +import ( + context "context" + + connect "connectrpc.com/connect" + + infrav2 "github.com/metal-stack/api/go/metalstack/infra/v2" + + mock "github.com/stretchr/testify/mock" +) + +// EventServiceHandler is an autogenerated mock type for the EventServiceHandler type +type EventServiceHandler struct { + mock.Mock +} + +// Send provides a mock function with given fields: _a0, _a1 +func (_m *EventServiceHandler) Send(_a0 context.Context, _a1 *connect.Request[infrav2.EventServiceSendRequest]) (*connect.Response[infrav2.EventServiceSendResponse], error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for Send") + } + + var r0 *connect.Response[infrav2.EventServiceSendResponse] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.EventServiceSendRequest]) (*connect.Response[infrav2.EventServiceSendResponse], error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.EventServiceSendRequest]) *connect.Response[infrav2.EventServiceSendResponse]); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.Response[infrav2.EventServiceSendResponse]) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[infrav2.EventServiceSendRequest]) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// SendMulti provides a mock function with given fields: _a0, _a1 +func (_m *EventServiceHandler) SendMulti(_a0 context.Context, _a1 *connect.Request[infrav2.EventServiceSendMultiRequest]) (*connect.Response[infrav2.EventServiceSendMultiResponse], error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for SendMulti") + } + + var r0 *connect.Response[infrav2.EventServiceSendMultiResponse] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.EventServiceSendMultiRequest]) (*connect.Response[infrav2.EventServiceSendMultiResponse], error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.EventServiceSendMultiRequest]) *connect.Response[infrav2.EventServiceSendMultiResponse]); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.Response[infrav2.EventServiceSendMultiResponse]) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[infrav2.EventServiceSendMultiRequest]) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// NewEventServiceHandler creates a new instance of EventServiceHandler. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewEventServiceHandler(t interface { + mock.TestingT + Cleanup(func()) +}) *EventServiceHandler { + mock := &EventServiceHandler{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/proto/metalstack/infra/v2/event.proto b/proto/metalstack/infra/v2/event.proto new file mode 100644 index 00000000..772521f6 --- /dev/null +++ b/proto/metalstack/infra/v2/event.proto @@ -0,0 +1,60 @@ +syntax = "proto3"; + +package metalstack.infra.v2; + +import "buf/validate/validate.proto"; +import "google/protobuf/timestamp.proto"; +import "metalstack/api/v2/common.proto"; +import "metalstack/api/v2/machine.proto"; + +// EventService is used to send machine related events +service EventService { + // Send an event of a single machine to the api + rpc Send(EventServiceSendRequest) returns (EventServiceSendResponse) { + option (metalstack.api.v2.machine_roles) = MACHINE_ROLE_EDITOR; + option (metalstack.api.v2.machine_roles) = MACHINE_ROLE_VIEWER; + option (metalstack.api.v2.auditing) = AUDITING_EXCLUDED; + } + + // SendMulti sends events of a bunch of machines in one request to the api + rpc SendMulti(EventServiceSendMultiRequest) returns (EventServiceSendMultiResponse) { + option (metalstack.api.v2.infra_roles) = INFRA_ROLE_EDITOR; + option (metalstack.api.v2.infra_roles) = INFRA_ROLE_VIEWER; + option (metalstack.api.v2.auditing) = AUDITING_EXCLUDED; + } +} + +// EventServiceSendRequest +message EventServiceSendRequest { + // UUID of the machine of the event + string uuid = 1 [(buf.validate.field).string.uuid = true]; + // Event details + MachineProvisioningEvent event = 2; +} + +// EventServiceSendResponse is the response of a single event sent +message EventServiceSendResponse {} + +// EventServiceSendMultiRequest contains events for many machines +message EventServiceSendMultiRequest { + // Events of many machines, key is the machine uuid + map events = 1 [(buf.validate.field).map = { + max_pairs: 1024 + keys: { + string: {uuid: true} + } + }]; +} + +// EventServiceSendMultiResponse is returned after events have been sent +message EventServiceSendMultiResponse {} + +// MachineProvisioningEvent describes a event for a single machine +message MachineProvisioningEvent { + // timestamp when the event occurred + google.protobuf.Timestamp time = 1; + // the event type + metalstack.api.v2.MachineProvisioningEventType event = 2 [(buf.validate.field).enum.defined_only = true]; + // an additional message describing the event more detailed + string message = 3 [(buf.validate.field).string.max_len = 256]; +} diff --git a/python/metalstack/client/client.py b/python/metalstack/client/client.py index d24bd59c..47fc57dd 100755 --- a/python/metalstack/client/client.py +++ b/python/metalstack/client/client.py @@ -29,6 +29,7 @@ import metalstack.infra.v2.bmc_connecpy as infra_bmc_connecpy import metalstack.infra.v2.boot_connecpy as infra_boot_connecpy +import metalstack.infra.v2.event_connecpy as infra_event_connecpy import metalstack.infra.v2.switch_connecpy as infra_switch_connecpy @@ -150,6 +151,9 @@ def bmc(self): def boot(self): return infra_boot_connecpy.BootServiceClientSync(address=self._baseurl, session=self._session) + def event(self): + return infra_event_connecpy.EventServiceClientSync(address=self._baseurl, session=self._session) + def switch(self): return infra_switch_connecpy.SwitchServiceClientSync(address=self._baseurl, session=self._session) diff --git a/python/metalstack/infra/v2/event_connecpy.py b/python/metalstack/infra/v2/event_connecpy.py new file mode 100644 index 00000000..c1f50e54 --- /dev/null +++ b/python/metalstack/infra/v2/event_connecpy.py @@ -0,0 +1,184 @@ +# -*- coding: utf-8 -*- +# Generated by https://github.com/i2y/connecpy/v2/protoc-gen-connecpy. DO NOT EDIT! +# source: metalstack/infra/v2/event.proto + +from collections.abc import AsyncIterator, Iterable, Iterator, Mapping +from typing import Protocol + +from connecpy.client import ConnecpyClient, ConnecpyClientSync +from connecpy.code import Code +from connecpy.exceptions import ConnecpyException +from connecpy.interceptor import Interceptor, InterceptorSync +from connecpy.method import IdempotencyLevel, MethodInfo +from connecpy.request import Headers, RequestContext +from connecpy.server import ConnecpyASGIApplication, ConnecpyWSGIApplication, Endpoint, EndpointSync +import metalstack.infra.v2.event_pb2 as metalstack_dot_infra_dot_v2_dot_event__pb2 + + +class EventService(Protocol): + async def send(self, request: metalstack_dot_infra_dot_v2_dot_event__pb2.EventServiceSendRequest, ctx: RequestContext) -> metalstack_dot_infra_dot_v2_dot_event__pb2.EventServiceSendResponse: + raise ConnecpyException(Code.UNIMPLEMENTED, "Not implemented") + + async def send_multi(self, request: metalstack_dot_infra_dot_v2_dot_event__pb2.EventServiceSendMultiRequest, ctx: RequestContext) -> metalstack_dot_infra_dot_v2_dot_event__pb2.EventServiceSendMultiResponse: + raise ConnecpyException(Code.UNIMPLEMENTED, "Not implemented") + + +class EventServiceASGIApplication(ConnecpyASGIApplication): + def __init__(self, service: EventService, *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None): + super().__init__( + endpoints={ + "/metalstack.infra.v2.EventService/Send": Endpoint.unary( + method=MethodInfo( + name="Send", + service_name="metalstack.infra.v2.EventService", + input=metalstack_dot_infra_dot_v2_dot_event__pb2.EventServiceSendRequest, + output=metalstack_dot_infra_dot_v2_dot_event__pb2.EventServiceSendResponse, + idempotency_level=IdempotencyLevel.UNKNOWN, + ), + function=service.send, + ), + "/metalstack.infra.v2.EventService/SendMulti": Endpoint.unary( + method=MethodInfo( + name="SendMulti", + service_name="metalstack.infra.v2.EventService", + input=metalstack_dot_infra_dot_v2_dot_event__pb2.EventServiceSendMultiRequest, + output=metalstack_dot_infra_dot_v2_dot_event__pb2.EventServiceSendMultiResponse, + idempotency_level=IdempotencyLevel.UNKNOWN, + ), + function=service.send_multi, + ), + }, + interceptors=interceptors, + read_max_bytes=read_max_bytes, + ) + + @property + def path(self): + """Returns the URL path to mount the application to when serving multiple applications.""" + return "/metalstack.infra.v2.EventService" + + +class EventServiceClient(ConnecpyClient): + async def send( + self, + request: metalstack_dot_infra_dot_v2_dot_event__pb2.EventServiceSendRequest, + *, + headers: Headers | Mapping[str, str] | None = None, + timeout_ms: int | None = None, + ) -> metalstack_dot_infra_dot_v2_dot_event__pb2.EventServiceSendResponse: + return await self.execute_unary( + request=request, + method=MethodInfo( + name="Send", + service_name="metalstack.infra.v2.EventService", + input=metalstack_dot_infra_dot_v2_dot_event__pb2.EventServiceSendRequest, + output=metalstack_dot_infra_dot_v2_dot_event__pb2.EventServiceSendResponse, + idempotency_level=IdempotencyLevel.UNKNOWN, + ), + headers=headers, + timeout_ms=timeout_ms, + ) + + async def send_multi( + self, + request: metalstack_dot_infra_dot_v2_dot_event__pb2.EventServiceSendMultiRequest, + *, + headers: Headers | Mapping[str, str] | None = None, + timeout_ms: int | None = None, + ) -> metalstack_dot_infra_dot_v2_dot_event__pb2.EventServiceSendMultiResponse: + return await self.execute_unary( + request=request, + method=MethodInfo( + name="SendMulti", + service_name="metalstack.infra.v2.EventService", + input=metalstack_dot_infra_dot_v2_dot_event__pb2.EventServiceSendMultiRequest, + output=metalstack_dot_infra_dot_v2_dot_event__pb2.EventServiceSendMultiResponse, + idempotency_level=IdempotencyLevel.UNKNOWN, + ), + headers=headers, + timeout_ms=timeout_ms, + ) + + +class EventServiceSync(Protocol): + def send(self, request: metalstack_dot_infra_dot_v2_dot_event__pb2.EventServiceSendRequest, ctx: RequestContext) -> metalstack_dot_infra_dot_v2_dot_event__pb2.EventServiceSendResponse: + raise ConnecpyException(Code.UNIMPLEMENTED, "Not implemented") + def send_multi(self, request: metalstack_dot_infra_dot_v2_dot_event__pb2.EventServiceSendMultiRequest, ctx: RequestContext) -> metalstack_dot_infra_dot_v2_dot_event__pb2.EventServiceSendMultiResponse: + raise ConnecpyException(Code.UNIMPLEMENTED, "Not implemented") + + +class EventServiceWSGIApplication(ConnecpyWSGIApplication): + def __init__(self, service: EventServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None): + super().__init__( + endpoints={ + "/metalstack.infra.v2.EventService/Send": EndpointSync.unary( + method=MethodInfo( + name="Send", + service_name="metalstack.infra.v2.EventService", + input=metalstack_dot_infra_dot_v2_dot_event__pb2.EventServiceSendRequest, + output=metalstack_dot_infra_dot_v2_dot_event__pb2.EventServiceSendResponse, + idempotency_level=IdempotencyLevel.UNKNOWN, + ), + function=service.send, + ), + "/metalstack.infra.v2.EventService/SendMulti": EndpointSync.unary( + method=MethodInfo( + name="SendMulti", + service_name="metalstack.infra.v2.EventService", + input=metalstack_dot_infra_dot_v2_dot_event__pb2.EventServiceSendMultiRequest, + output=metalstack_dot_infra_dot_v2_dot_event__pb2.EventServiceSendMultiResponse, + idempotency_level=IdempotencyLevel.UNKNOWN, + ), + function=service.send_multi, + ), + }, + interceptors=interceptors, + read_max_bytes=read_max_bytes, + ) + + @property + def path(self): + """Returns the URL path to mount the application to when serving multiple applications.""" + return "/metalstack.infra.v2.EventService" + + +class EventServiceClientSync(ConnecpyClientSync): + def send( + self, + request: metalstack_dot_infra_dot_v2_dot_event__pb2.EventServiceSendRequest, + *, + headers: Headers | Mapping[str, str] | None = None, + timeout_ms: int | None = None, + ) -> metalstack_dot_infra_dot_v2_dot_event__pb2.EventServiceSendResponse: + return self.execute_unary( + request=request, + method=MethodInfo( + name="Send", + service_name="metalstack.infra.v2.EventService", + input=metalstack_dot_infra_dot_v2_dot_event__pb2.EventServiceSendRequest, + output=metalstack_dot_infra_dot_v2_dot_event__pb2.EventServiceSendResponse, + idempotency_level=IdempotencyLevel.UNKNOWN, + ), + headers=headers, + timeout_ms=timeout_ms, + ) + + def send_multi( + self, + request: metalstack_dot_infra_dot_v2_dot_event__pb2.EventServiceSendMultiRequest, + *, + headers: Headers | Mapping[str, str] | None = None, + timeout_ms: int | None = None, + ) -> metalstack_dot_infra_dot_v2_dot_event__pb2.EventServiceSendMultiResponse: + return self.execute_unary( + request=request, + method=MethodInfo( + name="SendMulti", + service_name="metalstack.infra.v2.EventService", + input=metalstack_dot_infra_dot_v2_dot_event__pb2.EventServiceSendMultiRequest, + output=metalstack_dot_infra_dot_v2_dot_event__pb2.EventServiceSendMultiResponse, + idempotency_level=IdempotencyLevel.UNKNOWN, + ), + headers=headers, + timeout_ms=timeout_ms, + ) diff --git a/python/metalstack/infra/v2/event_pb2.py b/python/metalstack/infra/v2/event_pb2.py new file mode 100644 index 00000000..fff57ea1 --- /dev/null +++ b/python/metalstack/infra/v2/event_pb2.py @@ -0,0 +1,67 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: metalstack/infra/v2/event.proto +# Protobuf Python Version: 6.32.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 32, + 0, + '', + 'metalstack/infra/v2/event.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from buf.validate import validate_pb2 as buf_dot_validate_dot_validate__pb2 +from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 +from metalstack.api.v2 import common_pb2 as metalstack_dot_api_dot_v2_dot_common__pb2 +from metalstack.api.v2 import machine_pb2 as metalstack_dot_api_dot_v2_dot_machine__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1fmetalstack/infra/v2/event.proto\x12\x13metalstack.infra.v2\x1a\x1b\x62uf/validate/validate.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1emetalstack/api/v2/common.proto\x1a\x1fmetalstack/api/v2/machine.proto\"|\n\x17\x45ventServiceSendRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12\x43\n\x05\x65vent\x18\x02 \x01(\x0b\x32-.metalstack.infra.v2.MachineProvisioningEventR\x05\x65vent\"\x1a\n\x18\x45ventServiceSendResponse\"\xf1\x01\n\x1c\x45ventServiceSendMultiRequest\x12g\n\x06\x65vents\x18\x01 \x03(\x0b\x32=.metalstack.infra.v2.EventServiceSendMultiRequest.EventsEntryB\x10\xbaH\r\x9a\x01\n\x10\x80\x08\"\x05r\x03\xb0\x01\x01R\x06\x65vents\x1ah\n\x0b\x45ventsEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x43\n\x05value\x18\x02 \x01(\x0b\x32-.metalstack.infra.v2.MachineProvisioningEventR\x05value:\x02\x38\x01\"\x1f\n\x1d\x45ventServiceSendMultiResponse\"\xbf\x01\n\x18MachineProvisioningEvent\x12.\n\x04time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x04time\x12O\n\x05\x65vent\x18\x02 \x01(\x0e\x32/.metalstack.api.v2.MachineProvisioningEventTypeB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x05\x65vent\x12\"\n\x07message\x18\x03 \x01(\tB\x08\xbaH\x05r\x03\x18\x80\x02R\x07message2\xff\x01\n\x0c\x45ventService\x12o\n\x04Send\x12,.metalstack.infra.v2.EventServiceSendRequest\x1a-.metalstack.infra.v2.EventServiceSendResponse\"\n\xe0\xf3\x18\x02\xf2\xf3\x18\x02\x01\x02\x12~\n\tSendMulti\x12\x31.metalstack.infra.v2.EventServiceSendMultiRequest\x1a\x32.metalstack.infra.v2.EventServiceSendMultiResponse\"\n\xe0\xf3\x18\x02\xea\xf3\x18\x02\x01\x02\x42\xce\x01\n\x17\x63om.metalstack.infra.v2B\nEventProtoP\x01Z9github.com/metal-stack/api/go/metalstack/infra/v2;infrav2\xa2\x02\x03MIX\xaa\x02\x13Metalstack.Infra.V2\xca\x02\x13Metalstack\\Infra\\V2\xe2\x02\x1fMetalstack\\Infra\\V2\\GPBMetadata\xea\x02\x15Metalstack::Infra::V2b\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'metalstack.infra.v2.event_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\027com.metalstack.infra.v2B\nEventProtoP\001Z9github.com/metal-stack/api/go/metalstack/infra/v2;infrav2\242\002\003MIX\252\002\023Metalstack.Infra.V2\312\002\023Metalstack\\Infra\\V2\342\002\037Metalstack\\Infra\\V2\\GPBMetadata\352\002\025Metalstack::Infra::V2' + _globals['_EVENTSERVICESENDREQUEST'].fields_by_name['uuid']._loaded_options = None + _globals['_EVENTSERVICESENDREQUEST'].fields_by_name['uuid']._serialized_options = b'\272H\005r\003\260\001\001' + _globals['_EVENTSERVICESENDMULTIREQUEST_EVENTSENTRY']._loaded_options = None + _globals['_EVENTSERVICESENDMULTIREQUEST_EVENTSENTRY']._serialized_options = b'8\001' + _globals['_EVENTSERVICESENDMULTIREQUEST'].fields_by_name['events']._loaded_options = None + _globals['_EVENTSERVICESENDMULTIREQUEST'].fields_by_name['events']._serialized_options = b'\272H\r\232\001\n\020\200\010\"\005r\003\260\001\001' + _globals['_MACHINEPROVISIONINGEVENT'].fields_by_name['event']._loaded_options = None + _globals['_MACHINEPROVISIONINGEVENT'].fields_by_name['event']._serialized_options = b'\272H\005\202\001\002\020\001' + _globals['_MACHINEPROVISIONINGEVENT'].fields_by_name['message']._loaded_options = None + _globals['_MACHINEPROVISIONINGEVENT'].fields_by_name['message']._serialized_options = b'\272H\005r\003\030\200\002' + _globals['_EVENTSERVICE'].methods_by_name['Send']._loaded_options = None + _globals['_EVENTSERVICE'].methods_by_name['Send']._serialized_options = b'\340\363\030\002\362\363\030\002\001\002' + _globals['_EVENTSERVICE'].methods_by_name['SendMulti']._loaded_options = None + _globals['_EVENTSERVICE'].methods_by_name['SendMulti']._serialized_options = b'\340\363\030\002\352\363\030\002\001\002' + _globals['_EVENTSERVICESENDREQUEST']._serialized_start=183 + _globals['_EVENTSERVICESENDREQUEST']._serialized_end=307 + _globals['_EVENTSERVICESENDRESPONSE']._serialized_start=309 + _globals['_EVENTSERVICESENDRESPONSE']._serialized_end=335 + _globals['_EVENTSERVICESENDMULTIREQUEST']._serialized_start=338 + _globals['_EVENTSERVICESENDMULTIREQUEST']._serialized_end=579 + _globals['_EVENTSERVICESENDMULTIREQUEST_EVENTSENTRY']._serialized_start=475 + _globals['_EVENTSERVICESENDMULTIREQUEST_EVENTSENTRY']._serialized_end=579 + _globals['_EVENTSERVICESENDMULTIRESPONSE']._serialized_start=581 + _globals['_EVENTSERVICESENDMULTIRESPONSE']._serialized_end=612 + _globals['_MACHINEPROVISIONINGEVENT']._serialized_start=615 + _globals['_MACHINEPROVISIONINGEVENT']._serialized_end=806 + _globals['_EVENTSERVICE']._serialized_start=809 + _globals['_EVENTSERVICE']._serialized_end=1064 +# @@protoc_insertion_point(module_scope) diff --git a/python/metalstack/infra/v2/event_pb2.pyi b/python/metalstack/infra/v2/event_pb2.pyi new file mode 100644 index 00000000..560d3574 --- /dev/null +++ b/python/metalstack/infra/v2/event_pb2.pyi @@ -0,0 +1,52 @@ +import datetime + +from buf.validate import validate_pb2 as _validate_pb2 +from google.protobuf import timestamp_pb2 as _timestamp_pb2 +from metalstack.api.v2 import common_pb2 as _common_pb2 +from metalstack.api.v2 import machine_pb2 as _machine_pb2 +from google.protobuf.internal import containers as _containers +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from collections.abc import Mapping as _Mapping +from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union + +DESCRIPTOR: _descriptor.FileDescriptor + +class EventServiceSendRequest(_message.Message): + __slots__ = ("uuid", "event") + UUID_FIELD_NUMBER: _ClassVar[int] + EVENT_FIELD_NUMBER: _ClassVar[int] + uuid: str + event: MachineProvisioningEvent + def __init__(self, uuid: _Optional[str] = ..., event: _Optional[_Union[MachineProvisioningEvent, _Mapping]] = ...) -> None: ... + +class EventServiceSendResponse(_message.Message): + __slots__ = () + def __init__(self) -> None: ... + +class EventServiceSendMultiRequest(_message.Message): + __slots__ = ("events",) + class EventsEntry(_message.Message): + __slots__ = ("key", "value") + KEY_FIELD_NUMBER: _ClassVar[int] + VALUE_FIELD_NUMBER: _ClassVar[int] + key: str + value: MachineProvisioningEvent + def __init__(self, key: _Optional[str] = ..., value: _Optional[_Union[MachineProvisioningEvent, _Mapping]] = ...) -> None: ... + EVENTS_FIELD_NUMBER: _ClassVar[int] + events: _containers.MessageMap[str, MachineProvisioningEvent] + def __init__(self, events: _Optional[_Mapping[str, MachineProvisioningEvent]] = ...) -> None: ... + +class EventServiceSendMultiResponse(_message.Message): + __slots__ = () + def __init__(self) -> None: ... + +class MachineProvisioningEvent(_message.Message): + __slots__ = ("time", "event", "message") + TIME_FIELD_NUMBER: _ClassVar[int] + EVENT_FIELD_NUMBER: _ClassVar[int] + MESSAGE_FIELD_NUMBER: _ClassVar[int] + time: _timestamp_pb2.Timestamp + event: _machine_pb2.MachineProvisioningEventType + message: str + def __init__(self, time: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., event: _Optional[_Union[_machine_pb2.MachineProvisioningEventType, str]] = ..., message: _Optional[str] = ...) -> None: ... diff --git a/python/metalstack/infra/v2/event_pb2_grpc.py b/python/metalstack/infra/v2/event_pb2_grpc.py new file mode 100644 index 00000000..d4f98b8f --- /dev/null +++ b/python/metalstack/infra/v2/event_pb2_grpc.py @@ -0,0 +1,125 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc + +from metalstack.infra.v2 import event_pb2 as metalstack_dot_infra_dot_v2_dot_event__pb2 + + +class EventServiceStub(object): + """EventService is used to send machine related events + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.Send = channel.unary_unary( + '/metalstack.infra.v2.EventService/Send', + request_serializer=metalstack_dot_infra_dot_v2_dot_event__pb2.EventServiceSendRequest.SerializeToString, + response_deserializer=metalstack_dot_infra_dot_v2_dot_event__pb2.EventServiceSendResponse.FromString, + _registered_method=True) + self.SendMulti = channel.unary_unary( + '/metalstack.infra.v2.EventService/SendMulti', + request_serializer=metalstack_dot_infra_dot_v2_dot_event__pb2.EventServiceSendMultiRequest.SerializeToString, + response_deserializer=metalstack_dot_infra_dot_v2_dot_event__pb2.EventServiceSendMultiResponse.FromString, + _registered_method=True) + + +class EventServiceServicer(object): + """EventService is used to send machine related events + """ + + def Send(self, request, context): + """Send an event of a single machine to the api + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def SendMulti(self, request, context): + """SendMulti sends events of a bunch of machines in one request to the api + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_EventServiceServicer_to_server(servicer, server): + rpc_method_handlers = { + 'Send': grpc.unary_unary_rpc_method_handler( + servicer.Send, + request_deserializer=metalstack_dot_infra_dot_v2_dot_event__pb2.EventServiceSendRequest.FromString, + response_serializer=metalstack_dot_infra_dot_v2_dot_event__pb2.EventServiceSendResponse.SerializeToString, + ), + 'SendMulti': grpc.unary_unary_rpc_method_handler( + servicer.SendMulti, + request_deserializer=metalstack_dot_infra_dot_v2_dot_event__pb2.EventServiceSendMultiRequest.FromString, + response_serializer=metalstack_dot_infra_dot_v2_dot_event__pb2.EventServiceSendMultiResponse.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'metalstack.infra.v2.EventService', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('metalstack.infra.v2.EventService', rpc_method_handlers) + + + # This class is part of an EXPERIMENTAL API. +class EventService(object): + """EventService is used to send machine related events + """ + + @staticmethod + def Send(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/metalstack.infra.v2.EventService/Send', + metalstack_dot_infra_dot_v2_dot_event__pb2.EventServiceSendRequest.SerializeToString, + metalstack_dot_infra_dot_v2_dot_event__pb2.EventServiceSendResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def SendMulti(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/metalstack.infra.v2.EventService/SendMulti', + metalstack_dot_infra_dot_v2_dot_event__pb2.EventServiceSendMultiRequest.SerializeToString, + metalstack_dot_infra_dot_v2_dot_event__pb2.EventServiceSendMultiResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) From 76b300f1eee172fccc6fce534f2f3031cf894b6a Mon Sep 17 00:00:00 2001 From: Stefan Majer Date: Wed, 3 Sep 2025 14:34:59 +0200 Subject: [PATCH 12/27] Pass partition with dhcp request --- doc/index.html | 7 ++++ go/metalstack/infra/v2/boot.pb.go | 17 ++++++-- proto/metalstack/infra/v2/boot.proto | 5 +++ python/metalstack/infra/v2/boot_pb2.py | 54 +++++++++++++------------ python/metalstack/infra/v2/boot_pb2.pyi | 6 ++- 5 files changed, 58 insertions(+), 31 deletions(-) diff --git a/doc/index.html b/doc/index.html index 060ae012..6b41cfc4 100644 --- a/doc/index.html +++ b/doc/index.html @@ -18981,6 +18981,13 @@

    BootServiceDhcpRequest

    UUID of the machine

    + + partition_id + string + +

    Partition where this machine is located

    + + diff --git a/go/metalstack/infra/v2/boot.pb.go b/go/metalstack/infra/v2/boot.pb.go index c3dcf4c0..203bd9d2 100644 --- a/go/metalstack/infra/v2/boot.pb.go +++ b/go/metalstack/infra/v2/boot.pb.go @@ -27,7 +27,9 @@ const ( type BootServiceDhcpRequest struct { state protoimpl.MessageState `protogen:"open.v1"` // UUID of the machine - Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` + Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` + // Partition where this machine is located + PartitionId string `protobuf:"bytes,2,opt,name=partition_id,json=partitionId,proto3" json:"partition_id,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -69,6 +71,13 @@ func (x *BootServiceDhcpRequest) GetUuid() string { return "" } +func (x *BootServiceDhcpRequest) GetPartitionId() string { + if x != nil { + return x.PartitionId + } + return "" +} + // BootServiceDhcpResponse contains the response to a dhcp request type BootServiceDhcpResponse struct { state protoimpl.MessageState `protogen:"open.v1"` @@ -687,9 +696,11 @@ var File_metalstack_infra_v2_boot_proto protoreflect.FileDescriptor const file_metalstack_infra_v2_boot_proto_rawDesc = "" + "\n" + - "\x1emetalstack/infra/v2/boot.proto\x12\x13metalstack.infra.v2\x1a\x1bbuf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a\x1fmetalstack/api/v2/machine.proto\"6\n" + + "\x1emetalstack/infra/v2/boot.proto\x12\x13metalstack.infra.v2\x1a\x1bbuf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a\x1fmetalstack/api/v2/machine.proto\"e\n" + "\x16BootServiceDhcpRequest\x12\x1c\n" + - "\x04uuid\x18\x01 \x01(\tB\b\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\"\x19\n" + + "\x04uuid\x18\x01 \x01(\tB\b\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12-\n" + + "\fpartition_id\x18\x02 \x01(\tB\n" + + "\xbaH\ar\x05\x10\x02\x18\x80\x01R\vpartitionId\"\x19\n" + "\x17BootServiceDhcpResponse\"\xc6\x01\n" + "\x16BootServiceBootRequest\x12}\n" + "\x03mac\x18\x01 \x01(\tBk\xbaHh\xba\x01e\n" + diff --git a/proto/metalstack/infra/v2/boot.proto b/proto/metalstack/infra/v2/boot.proto index aab1428d..3c1743f4 100644 --- a/proto/metalstack/infra/v2/boot.proto +++ b/proto/metalstack/infra/v2/boot.proto @@ -59,6 +59,11 @@ service BootService { message BootServiceDhcpRequest { // UUID of the machine string uuid = 1 [(buf.validate.field).string.uuid = true]; + // Partition where this machine is located + string partition_id = 2 [(buf.validate.field).string = { + min_len: 2 + max_len: 128 + }]; } // BootServiceDhcpResponse contains the response to a dhcp request diff --git a/python/metalstack/infra/v2/boot_pb2.py b/python/metalstack/infra/v2/boot_pb2.py index 41cf67b3..24850eef 100644 --- a/python/metalstack/infra/v2/boot_pb2.py +++ b/python/metalstack/infra/v2/boot_pb2.py @@ -27,7 +27,7 @@ from metalstack.api.v2 import machine_pb2 as metalstack_dot_api_dot_v2_dot_machine__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1emetalstack/infra/v2/boot.proto\x12\x13metalstack.infra.v2\x1a\x1b\x62uf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a\x1fmetalstack/api/v2/machine.proto\"6\n\x16\x42ootServiceDhcpRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\"\x19\n\x17\x42ootServiceDhcpResponse\"\xc6\x01\n\x16\x42ootServiceBootRequest\x12}\n\x03mac\x18\x01 \x01(\tBk\xbaHh\xba\x01\x65\n\x03mac\x12\x1fmac must be a valid mac address\x1a=this.matches(\'^(?:[0-9A-Fa-f]{2}[:-]){5}(?:[0-9A-Fa-f]{2})$\')R\x03mac\x12-\n\x0cpartition_id\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x0bpartitionId\"\xd2\x01\n\x17\x42ootServiceBootResponse\x12Z\n\x06kernel\x18\x01 \x01(\tBB\xbaH?\xba\x01<\n\x10valid_kernel_uri\x12\x1akernel must be a valid URI\x1a\x0cthis.isUri()R\x06kernel\x12$\n\x0einit_ram_disks\x18\x02 \x03(\tR\x0cinitRamDisks\x12)\n\x07\x63mdline\x18\x03 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01H\x00R\x07\x63mdline\x88\x01\x01\x42\n\n\x08_cmdline\"\xe3\x02\n\x1a\x42ootServiceRegisterRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12>\n\x08hardware\x18\x02 \x01(\x0b\x32\".metalstack.api.v2.MachineHardwareR\x08hardware\x12\x32\n\x04\x62ios\x18\x03 \x01(\x0b\x32\x1e.metalstack.api.v2.MachineBiosR\x04\x62ios\x12\x32\n\x04ipmi\x18\x04 \x01(\x0b\x32\x1e.metalstack.api.v2.MachineIPMIR\x04ipmi\x12\x12\n\x04tags\x18\x05 \x03(\tR\x04tags\x12<\n\x14metal_hammer_version\x18\x06 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x12metalHammerVersion\x12-\n\x0cpartition_id\x18\x07 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x0bpartitionId\"\x8a\x01\n\x1b\x42ootServiceRegisterResponse\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12\x1e\n\x04size\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x04size\x12-\n\x0cpartition_id\x18\x03 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x0bpartitionId\"6\n\x16\x42ootServiceWaitRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\"\x19\n\x17\x42ootServiceWaitResponse\"\xaf\x01\n\x18\x42ootServiceReportRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12\x35\n\x10\x63onsole_password\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x0f\x63onsolePassword\x12\x18\n\x07success\x18\x04 \x01(\x08R\x07success\x12$\n\x07message\x18\x05 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x04R\x07message\"\x1b\n\x19\x42ootServiceReportResponse\"C\n#BootServiceSuperUserPasswordRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\"\x8d\x01\n$BootServiceSuperUserPasswordResponse\x12)\n\x10\x66\x65\x61ture_disabled\x18\x01 \x01(\x08R\x0f\x66\x65\x61tureDisabled\x12:\n\x13super_user_password\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x11superUserPassword2\xe3\x05\n\x0b\x42ootService\x12m\n\x04\x44hcp\x12+.metalstack.infra.v2.BootServiceDhcpRequest\x1a,.metalstack.infra.v2.BootServiceDhcpResponse\"\n\xe0\xf3\x18\x02\xea\xf3\x18\x02\x01\x02\x12m\n\x04\x42oot\x12+.metalstack.infra.v2.BootServiceBootRequest\x1a,.metalstack.infra.v2.BootServiceBootResponse\"\n\xe0\xf3\x18\x02\xea\xf3\x18\x02\x01\x02\x12\x94\x01\n\x11SuperUserPassword\x12\x38.metalstack.infra.v2.BootServiceSuperUserPasswordRequest\x1a\x39.metalstack.infra.v2.BootServiceSuperUserPasswordResponse\"\n\xe0\xf3\x18\x02\xf2\xf3\x18\x02\x01\x02\x12y\n\x08Register\x12/.metalstack.infra.v2.BootServiceRegisterRequest\x1a\x30.metalstack.infra.v2.BootServiceRegisterResponse\"\n\xe0\xf3\x18\x02\xf2\xf3\x18\x02\x01\x02\x12o\n\x04Wait\x12+.metalstack.infra.v2.BootServiceWaitRequest\x1a,.metalstack.infra.v2.BootServiceWaitResponse\"\n\xe0\xf3\x18\x02\xf2\xf3\x18\x02\x01\x02\x30\x01\x12s\n\x06Report\x12-.metalstack.infra.v2.BootServiceReportRequest\x1a..metalstack.infra.v2.BootServiceReportResponse\"\n\xe0\xf3\x18\x02\xf2\xf3\x18\x02\x01\x02\x42\xcd\x01\n\x17\x63om.metalstack.infra.v2B\tBootProtoP\x01Z9github.com/metal-stack/api/go/metalstack/infra/v2;infrav2\xa2\x02\x03MIX\xaa\x02\x13Metalstack.Infra.V2\xca\x02\x13Metalstack\\Infra\\V2\xe2\x02\x1fMetalstack\\Infra\\V2\\GPBMetadata\xea\x02\x15Metalstack::Infra::V2b\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1emetalstack/infra/v2/boot.proto\x12\x13metalstack.infra.v2\x1a\x1b\x62uf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a\x1fmetalstack/api/v2/machine.proto\"e\n\x16\x42ootServiceDhcpRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12-\n\x0cpartition_id\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x0bpartitionId\"\x19\n\x17\x42ootServiceDhcpResponse\"\xc6\x01\n\x16\x42ootServiceBootRequest\x12}\n\x03mac\x18\x01 \x01(\tBk\xbaHh\xba\x01\x65\n\x03mac\x12\x1fmac must be a valid mac address\x1a=this.matches(\'^(?:[0-9A-Fa-f]{2}[:-]){5}(?:[0-9A-Fa-f]{2})$\')R\x03mac\x12-\n\x0cpartition_id\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x0bpartitionId\"\xd2\x01\n\x17\x42ootServiceBootResponse\x12Z\n\x06kernel\x18\x01 \x01(\tBB\xbaH?\xba\x01<\n\x10valid_kernel_uri\x12\x1akernel must be a valid URI\x1a\x0cthis.isUri()R\x06kernel\x12$\n\x0einit_ram_disks\x18\x02 \x03(\tR\x0cinitRamDisks\x12)\n\x07\x63mdline\x18\x03 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01H\x00R\x07\x63mdline\x88\x01\x01\x42\n\n\x08_cmdline\"\xe3\x02\n\x1a\x42ootServiceRegisterRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12>\n\x08hardware\x18\x02 \x01(\x0b\x32\".metalstack.api.v2.MachineHardwareR\x08hardware\x12\x32\n\x04\x62ios\x18\x03 \x01(\x0b\x32\x1e.metalstack.api.v2.MachineBiosR\x04\x62ios\x12\x32\n\x04ipmi\x18\x04 \x01(\x0b\x32\x1e.metalstack.api.v2.MachineIPMIR\x04ipmi\x12\x12\n\x04tags\x18\x05 \x03(\tR\x04tags\x12<\n\x14metal_hammer_version\x18\x06 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x12metalHammerVersion\x12-\n\x0cpartition_id\x18\x07 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x0bpartitionId\"\x8a\x01\n\x1b\x42ootServiceRegisterResponse\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12\x1e\n\x04size\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x04size\x12-\n\x0cpartition_id\x18\x03 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x0bpartitionId\"6\n\x16\x42ootServiceWaitRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\"\x19\n\x17\x42ootServiceWaitResponse\"\xaf\x01\n\x18\x42ootServiceReportRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12\x35\n\x10\x63onsole_password\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x0f\x63onsolePassword\x12\x18\n\x07success\x18\x04 \x01(\x08R\x07success\x12$\n\x07message\x18\x05 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x04R\x07message\"\x1b\n\x19\x42ootServiceReportResponse\"C\n#BootServiceSuperUserPasswordRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\"\x8d\x01\n$BootServiceSuperUserPasswordResponse\x12)\n\x10\x66\x65\x61ture_disabled\x18\x01 \x01(\x08R\x0f\x66\x65\x61tureDisabled\x12:\n\x13super_user_password\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x11superUserPassword2\xe3\x05\n\x0b\x42ootService\x12m\n\x04\x44hcp\x12+.metalstack.infra.v2.BootServiceDhcpRequest\x1a,.metalstack.infra.v2.BootServiceDhcpResponse\"\n\xe0\xf3\x18\x02\xea\xf3\x18\x02\x01\x02\x12m\n\x04\x42oot\x12+.metalstack.infra.v2.BootServiceBootRequest\x1a,.metalstack.infra.v2.BootServiceBootResponse\"\n\xe0\xf3\x18\x02\xea\xf3\x18\x02\x01\x02\x12\x94\x01\n\x11SuperUserPassword\x12\x38.metalstack.infra.v2.BootServiceSuperUserPasswordRequest\x1a\x39.metalstack.infra.v2.BootServiceSuperUserPasswordResponse\"\n\xe0\xf3\x18\x02\xf2\xf3\x18\x02\x01\x02\x12y\n\x08Register\x12/.metalstack.infra.v2.BootServiceRegisterRequest\x1a\x30.metalstack.infra.v2.BootServiceRegisterResponse\"\n\xe0\xf3\x18\x02\xf2\xf3\x18\x02\x01\x02\x12o\n\x04Wait\x12+.metalstack.infra.v2.BootServiceWaitRequest\x1a,.metalstack.infra.v2.BootServiceWaitResponse\"\n\xe0\xf3\x18\x02\xf2\xf3\x18\x02\x01\x02\x30\x01\x12s\n\x06Report\x12-.metalstack.infra.v2.BootServiceReportRequest\x1a..metalstack.infra.v2.BootServiceReportResponse\"\n\xe0\xf3\x18\x02\xf2\xf3\x18\x02\x01\x02\x42\xcd\x01\n\x17\x63om.metalstack.infra.v2B\tBootProtoP\x01Z9github.com/metal-stack/api/go/metalstack/infra/v2;infrav2\xa2\x02\x03MIX\xaa\x02\x13Metalstack.Infra.V2\xca\x02\x13Metalstack\\Infra\\V2\xe2\x02\x1fMetalstack\\Infra\\V2\\GPBMetadata\xea\x02\x15Metalstack::Infra::V2b\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -37,6 +37,8 @@ _globals['DESCRIPTOR']._serialized_options = b'\n\027com.metalstack.infra.v2B\tBootProtoP\001Z9github.com/metal-stack/api/go/metalstack/infra/v2;infrav2\242\002\003MIX\252\002\023Metalstack.Infra.V2\312\002\023Metalstack\\Infra\\V2\342\002\037Metalstack\\Infra\\V2\\GPBMetadata\352\002\025Metalstack::Infra::V2' _globals['_BOOTSERVICEDHCPREQUEST'].fields_by_name['uuid']._loaded_options = None _globals['_BOOTSERVICEDHCPREQUEST'].fields_by_name['uuid']._serialized_options = b'\272H\005r\003\260\001\001' + _globals['_BOOTSERVICEDHCPREQUEST'].fields_by_name['partition_id']._loaded_options = None + _globals['_BOOTSERVICEDHCPREQUEST'].fields_by_name['partition_id']._serialized_options = b'\272H\007r\005\020\002\030\200\001' _globals['_BOOTSERVICEBOOTREQUEST'].fields_by_name['mac']._loaded_options = None _globals['_BOOTSERVICEBOOTREQUEST'].fields_by_name['mac']._serialized_options = b'\272Hh\272\001e\n\003mac\022\037mac must be a valid mac address\032=this.matches(\'^(?:[0-9A-Fa-f]{2}[:-]){5}(?:[0-9A-Fa-f]{2})$\')' _globals['_BOOTSERVICEBOOTREQUEST'].fields_by_name['partition_id']._loaded_options = None @@ -82,29 +84,29 @@ _globals['_BOOTSERVICE'].methods_by_name['Report']._loaded_options = None _globals['_BOOTSERVICE'].methods_by_name['Report']._serialized_options = b'\340\363\030\002\362\363\030\002\001\002' _globals['_BOOTSERVICEDHCPREQUEST']._serialized_start=149 - _globals['_BOOTSERVICEDHCPREQUEST']._serialized_end=203 - _globals['_BOOTSERVICEDHCPRESPONSE']._serialized_start=205 - _globals['_BOOTSERVICEDHCPRESPONSE']._serialized_end=230 - _globals['_BOOTSERVICEBOOTREQUEST']._serialized_start=233 - _globals['_BOOTSERVICEBOOTREQUEST']._serialized_end=431 - _globals['_BOOTSERVICEBOOTRESPONSE']._serialized_start=434 - _globals['_BOOTSERVICEBOOTRESPONSE']._serialized_end=644 - _globals['_BOOTSERVICEREGISTERREQUEST']._serialized_start=647 - _globals['_BOOTSERVICEREGISTERREQUEST']._serialized_end=1002 - _globals['_BOOTSERVICEREGISTERRESPONSE']._serialized_start=1005 - _globals['_BOOTSERVICEREGISTERRESPONSE']._serialized_end=1143 - _globals['_BOOTSERVICEWAITREQUEST']._serialized_start=1145 - _globals['_BOOTSERVICEWAITREQUEST']._serialized_end=1199 - _globals['_BOOTSERVICEWAITRESPONSE']._serialized_start=1201 - _globals['_BOOTSERVICEWAITRESPONSE']._serialized_end=1226 - _globals['_BOOTSERVICEREPORTREQUEST']._serialized_start=1229 - _globals['_BOOTSERVICEREPORTREQUEST']._serialized_end=1404 - _globals['_BOOTSERVICEREPORTRESPONSE']._serialized_start=1406 - _globals['_BOOTSERVICEREPORTRESPONSE']._serialized_end=1433 - _globals['_BOOTSERVICESUPERUSERPASSWORDREQUEST']._serialized_start=1435 - _globals['_BOOTSERVICESUPERUSERPASSWORDREQUEST']._serialized_end=1502 - _globals['_BOOTSERVICESUPERUSERPASSWORDRESPONSE']._serialized_start=1505 - _globals['_BOOTSERVICESUPERUSERPASSWORDRESPONSE']._serialized_end=1646 - _globals['_BOOTSERVICE']._serialized_start=1649 - _globals['_BOOTSERVICE']._serialized_end=2388 + _globals['_BOOTSERVICEDHCPREQUEST']._serialized_end=250 + _globals['_BOOTSERVICEDHCPRESPONSE']._serialized_start=252 + _globals['_BOOTSERVICEDHCPRESPONSE']._serialized_end=277 + _globals['_BOOTSERVICEBOOTREQUEST']._serialized_start=280 + _globals['_BOOTSERVICEBOOTREQUEST']._serialized_end=478 + _globals['_BOOTSERVICEBOOTRESPONSE']._serialized_start=481 + _globals['_BOOTSERVICEBOOTRESPONSE']._serialized_end=691 + _globals['_BOOTSERVICEREGISTERREQUEST']._serialized_start=694 + _globals['_BOOTSERVICEREGISTERREQUEST']._serialized_end=1049 + _globals['_BOOTSERVICEREGISTERRESPONSE']._serialized_start=1052 + _globals['_BOOTSERVICEREGISTERRESPONSE']._serialized_end=1190 + _globals['_BOOTSERVICEWAITREQUEST']._serialized_start=1192 + _globals['_BOOTSERVICEWAITREQUEST']._serialized_end=1246 + _globals['_BOOTSERVICEWAITRESPONSE']._serialized_start=1248 + _globals['_BOOTSERVICEWAITRESPONSE']._serialized_end=1273 + _globals['_BOOTSERVICEREPORTREQUEST']._serialized_start=1276 + _globals['_BOOTSERVICEREPORTREQUEST']._serialized_end=1451 + _globals['_BOOTSERVICEREPORTRESPONSE']._serialized_start=1453 + _globals['_BOOTSERVICEREPORTRESPONSE']._serialized_end=1480 + _globals['_BOOTSERVICESUPERUSERPASSWORDREQUEST']._serialized_start=1482 + _globals['_BOOTSERVICESUPERUSERPASSWORDREQUEST']._serialized_end=1549 + _globals['_BOOTSERVICESUPERUSERPASSWORDRESPONSE']._serialized_start=1552 + _globals['_BOOTSERVICESUPERUSERPASSWORDRESPONSE']._serialized_end=1693 + _globals['_BOOTSERVICE']._serialized_start=1696 + _globals['_BOOTSERVICE']._serialized_end=2435 # @@protoc_insertion_point(module_scope) diff --git a/python/metalstack/infra/v2/boot_pb2.pyi b/python/metalstack/infra/v2/boot_pb2.pyi index 1d87c168..9ef1a822 100644 --- a/python/metalstack/infra/v2/boot_pb2.pyi +++ b/python/metalstack/infra/v2/boot_pb2.pyi @@ -10,10 +10,12 @@ from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union DESCRIPTOR: _descriptor.FileDescriptor class BootServiceDhcpRequest(_message.Message): - __slots__ = ("uuid",) + __slots__ = ("uuid", "partition_id") UUID_FIELD_NUMBER: _ClassVar[int] + PARTITION_ID_FIELD_NUMBER: _ClassVar[int] uuid: str - def __init__(self, uuid: _Optional[str] = ...) -> None: ... + partition_id: str + def __init__(self, uuid: _Optional[str] = ..., partition_id: _Optional[str] = ...) -> None: ... class BootServiceDhcpResponse(_message.Message): __slots__ = () From eeb8f8f82166f618e70ebb75d430529d353a66d6 Mon Sep 17 00:00:00 2001 From: Stefan Majer Date: Wed, 3 Sep 2025 14:45:35 +0200 Subject: [PATCH 13/27] No _id --- doc/index.html | 8 +-- go/metalstack/infra/v2/boot.pb.go | 54 ++++++++++---------- go/tests/validation/boot_test.go | 8 +-- proto/metalstack/infra/v2/boot.proto | 8 +-- python/metalstack/infra/v2/boot_pb2.py | 68 ++++++++++++------------- python/metalstack/infra/v2/boot_pb2.pyi | 32 ++++++------ 6 files changed, 89 insertions(+), 89 deletions(-) diff --git a/doc/index.html b/doc/index.html index 6b41cfc4..0d903579 100644 --- a/doc/index.html +++ b/doc/index.html @@ -18913,7 +18913,7 @@

    BootServiceBootRequest

    - partition_id + partition string

    Partition where this machine is located

    @@ -18982,7 +18982,7 @@

    BootServiceDhcpRequest

    - partition_id + partition string

    Partition where this machine is located

    @@ -19055,7 +19055,7 @@

    BootServiceRegisterReque - partition_id + partition string

    Partition where this machine is located

    @@ -19093,7 +19093,7 @@

    BootServiceRegisterResp - partition_id + partition string

    Partition of this machine

    diff --git a/go/metalstack/infra/v2/boot.pb.go b/go/metalstack/infra/v2/boot.pb.go index 203bd9d2..760bce20 100644 --- a/go/metalstack/infra/v2/boot.pb.go +++ b/go/metalstack/infra/v2/boot.pb.go @@ -29,7 +29,7 @@ type BootServiceDhcpRequest struct { // UUID of the machine Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` // Partition where this machine is located - PartitionId string `protobuf:"bytes,2,opt,name=partition_id,json=partitionId,proto3" json:"partition_id,omitempty"` + Partition string `protobuf:"bytes,2,opt,name=partition,proto3" json:"partition,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -71,9 +71,9 @@ func (x *BootServiceDhcpRequest) GetUuid() string { return "" } -func (x *BootServiceDhcpRequest) GetPartitionId() string { +func (x *BootServiceDhcpRequest) GetPartition() string { if x != nil { - return x.PartitionId + return x.Partition } return "" } @@ -121,7 +121,7 @@ type BootServiceBootRequest struct { // Mac address of the machine Mac string `protobuf:"bytes,1,opt,name=mac,proto3" json:"mac,omitempty"` // Partition where this machine is located - PartitionId string `protobuf:"bytes,2,opt,name=partition_id,json=partitionId,proto3" json:"partition_id,omitempty"` + Partition string `protobuf:"bytes,2,opt,name=partition,proto3" json:"partition,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -163,9 +163,9 @@ func (x *BootServiceBootRequest) GetMac() string { return "" } -func (x *BootServiceBootRequest) GetPartitionId() string { +func (x *BootServiceBootRequest) GetPartition() string { if x != nil { - return x.PartitionId + return x.Partition } return "" } @@ -250,7 +250,7 @@ type BootServiceRegisterRequest struct { // MetalHammer version this machine was bootet into MetalHammerVersion string `protobuf:"bytes,6,opt,name=metal_hammer_version,json=metalHammerVersion,proto3" json:"metal_hammer_version,omitempty"` // Partition where this machine is located - PartitionId string `protobuf:"bytes,7,opt,name=partition_id,json=partitionId,proto3" json:"partition_id,omitempty"` + Partition string `protobuf:"bytes,7,opt,name=partition,proto3" json:"partition,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -327,9 +327,9 @@ func (x *BootServiceRegisterRequest) GetMetalHammerVersion() string { return "" } -func (x *BootServiceRegisterRequest) GetPartitionId() string { +func (x *BootServiceRegisterRequest) GetPartition() string { if x != nil { - return x.PartitionId + return x.Partition } return "" } @@ -342,7 +342,7 @@ type BootServiceRegisterResponse struct { // Size is the calculated size from given hardware details Size string `protobuf:"bytes,2,opt,name=size,proto3" json:"size,omitempty"` // Partition of this machine - PartitionId string `protobuf:"bytes,3,opt,name=partition_id,json=partitionId,proto3" json:"partition_id,omitempty"` + Partition string `protobuf:"bytes,3,opt,name=partition,proto3" json:"partition,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -391,9 +391,9 @@ func (x *BootServiceRegisterResponse) GetSize() string { return "" } -func (x *BootServiceRegisterResponse) GetPartitionId() string { +func (x *BootServiceRegisterResponse) GetPartition() string { if x != nil { - return x.PartitionId + return x.Partition } return "" } @@ -696,17 +696,17 @@ var File_metalstack_infra_v2_boot_proto protoreflect.FileDescriptor const file_metalstack_infra_v2_boot_proto_rawDesc = "" + "\n" + - "\x1emetalstack/infra/v2/boot.proto\x12\x13metalstack.infra.v2\x1a\x1bbuf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a\x1fmetalstack/api/v2/machine.proto\"e\n" + + "\x1emetalstack/infra/v2/boot.proto\x12\x13metalstack.infra.v2\x1a\x1bbuf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a\x1fmetalstack/api/v2/machine.proto\"`\n" + "\x16BootServiceDhcpRequest\x12\x1c\n" + - "\x04uuid\x18\x01 \x01(\tB\b\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12-\n" + - "\fpartition_id\x18\x02 \x01(\tB\n" + - "\xbaH\ar\x05\x10\x02\x18\x80\x01R\vpartitionId\"\x19\n" + - "\x17BootServiceDhcpResponse\"\xc6\x01\n" + + "\x04uuid\x18\x01 \x01(\tB\b\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12(\n" + + "\tpartition\x18\x02 \x01(\tB\n" + + "\xbaH\ar\x05\x10\x02\x18\x80\x01R\tpartition\"\x19\n" + + "\x17BootServiceDhcpResponse\"\xc1\x01\n" + "\x16BootServiceBootRequest\x12}\n" + "\x03mac\x18\x01 \x01(\tBk\xbaHh\xba\x01e\n" + - "\x03mac\x12\x1fmac must be a valid mac address\x1a=this.matches('^(?:[0-9A-Fa-f]{2}[:-]){5}(?:[0-9A-Fa-f]{2})$')R\x03mac\x12-\n" + - "\fpartition_id\x18\x02 \x01(\tB\n" + - "\xbaH\ar\x05\x10\x02\x18\x80\x01R\vpartitionId\"\xd2\x01\n" + + "\x03mac\x12\x1fmac must be a valid mac address\x1a=this.matches('^(?:[0-9A-Fa-f]{2}[:-]){5}(?:[0-9A-Fa-f]{2})$')R\x03mac\x12(\n" + + "\tpartition\x18\x02 \x01(\tB\n" + + "\xbaH\ar\x05\x10\x02\x18\x80\x01R\tpartition\"\xd2\x01\n" + "\x17BootServiceBootResponse\x12Z\n" + "\x06kernel\x18\x01 \x01(\tBB\xbaH?\xba\x01<\n" + "\x10valid_kernel_uri\x12\x1akernel must be a valid URI\x1a\fthis.isUri()R\x06kernel\x12$\n" + @@ -714,7 +714,7 @@ const file_metalstack_infra_v2_boot_proto_rawDesc = "" + "\acmdline\x18\x03 \x01(\tB\n" + "\xbaH\ar\x05\x10\x02\x18\x80\x01H\x00R\acmdline\x88\x01\x01B\n" + "\n" + - "\b_cmdline\"\xe3\x02\n" + + "\b_cmdline\"\xde\x02\n" + "\x1aBootServiceRegisterRequest\x12\x1c\n" + "\x04uuid\x18\x01 \x01(\tB\b\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12>\n" + "\bhardware\x18\x02 \x01(\v2\".metalstack.api.v2.MachineHardwareR\bhardware\x122\n" + @@ -722,15 +722,15 @@ const file_metalstack_infra_v2_boot_proto_rawDesc = "" + "\x04ipmi\x18\x04 \x01(\v2\x1e.metalstack.api.v2.MachineIPMIR\x04ipmi\x12\x12\n" + "\x04tags\x18\x05 \x03(\tR\x04tags\x12<\n" + "\x14metal_hammer_version\x18\x06 \x01(\tB\n" + - "\xbaH\ar\x05\x10\x02\x18\x80\x01R\x12metalHammerVersion\x12-\n" + - "\fpartition_id\x18\a \x01(\tB\n" + - "\xbaH\ar\x05\x10\x02\x18\x80\x01R\vpartitionId\"\x8a\x01\n" + + "\xbaH\ar\x05\x10\x02\x18\x80\x01R\x12metalHammerVersion\x12(\n" + + "\tpartition\x18\a \x01(\tB\n" + + "\xbaH\ar\x05\x10\x02\x18\x80\x01R\tpartition\"\x85\x01\n" + "\x1bBootServiceRegisterResponse\x12\x1c\n" + "\x04uuid\x18\x01 \x01(\tB\b\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12\x1e\n" + "\x04size\x18\x02 \x01(\tB\n" + - "\xbaH\ar\x05\x10\x02\x18\x80\x01R\x04size\x12-\n" + - "\fpartition_id\x18\x03 \x01(\tB\n" + - "\xbaH\ar\x05\x10\x02\x18\x80\x01R\vpartitionId\"6\n" + + "\xbaH\ar\x05\x10\x02\x18\x80\x01R\x04size\x12(\n" + + "\tpartition\x18\x03 \x01(\tB\n" + + "\xbaH\ar\x05\x10\x02\x18\x80\x01R\tpartition\"6\n" + "\x16BootServiceWaitRequest\x12\x1c\n" + "\x04uuid\x18\x01 \x01(\tB\b\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\"\x19\n" + "\x17BootServiceWaitResponse\"\xaf\x01\n" + diff --git a/go/tests/validation/boot_test.go b/go/tests/validation/boot_test.go index 6fb6da79..1699adeb 100644 --- a/go/tests/validation/boot_test.go +++ b/go/tests/validation/boot_test.go @@ -16,16 +16,16 @@ func TestValidateBoot(t *testing.T) { { name: "Valid BootServiceBootRequest", msg: &infrav2.BootServiceBootRequest{ - PartitionId: "partition-1", - Mac: "00:00:00:00:00:01", + Partition: "partition-1", + Mac: "00:00:00:00:00:01", }, wantErr: false, }, { name: "InValid BootServiceBootRequest", msg: &infrav2.BootServiceBootRequest{ - PartitionId: "p1", - Mac: "X0-00:00:00:00:00:01", + Partition: "p1", + Mac: "X0-00:00:00:00:00:01", }, wantErr: true, wantErrorMessage: `validation error: diff --git a/proto/metalstack/infra/v2/boot.proto b/proto/metalstack/infra/v2/boot.proto index 3c1743f4..a93e8ba4 100644 --- a/proto/metalstack/infra/v2/boot.proto +++ b/proto/metalstack/infra/v2/boot.proto @@ -60,7 +60,7 @@ message BootServiceDhcpRequest { // UUID of the machine string uuid = 1 [(buf.validate.field).string.uuid = true]; // Partition where this machine is located - string partition_id = 2 [(buf.validate.field).string = { + string partition = 2 [(buf.validate.field).string = { min_len: 2 max_len: 128 }]; @@ -78,7 +78,7 @@ message BootServiceBootRequest { expression: "this.matches('^(?:[0-9A-Fa-f]{2}[:-]){5}(?:[0-9A-Fa-f]{2})$')" }]; // Partition where this machine is located - string partition_id = 2 [(buf.validate.field).string = { + string partition = 2 [(buf.validate.field).string = { min_len: 2 max_len: 128 }]; @@ -122,7 +122,7 @@ message BootServiceRegisterRequest { max_len: 128 }]; // Partition where this machine is located - string partition_id = 7 [(buf.validate.field).string = { + string partition = 7 [(buf.validate.field).string = { min_len: 2 max_len: 128 }]; @@ -138,7 +138,7 @@ message BootServiceRegisterResponse { max_len: 128 }]; // Partition of this machine - string partition_id = 3 [(buf.validate.field).string = { + string partition = 3 [(buf.validate.field).string = { min_len: 2 max_len: 128 }]; diff --git a/python/metalstack/infra/v2/boot_pb2.py b/python/metalstack/infra/v2/boot_pb2.py index 24850eef..d8d71c56 100644 --- a/python/metalstack/infra/v2/boot_pb2.py +++ b/python/metalstack/infra/v2/boot_pb2.py @@ -27,7 +27,7 @@ from metalstack.api.v2 import machine_pb2 as metalstack_dot_api_dot_v2_dot_machine__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1emetalstack/infra/v2/boot.proto\x12\x13metalstack.infra.v2\x1a\x1b\x62uf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a\x1fmetalstack/api/v2/machine.proto\"e\n\x16\x42ootServiceDhcpRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12-\n\x0cpartition_id\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x0bpartitionId\"\x19\n\x17\x42ootServiceDhcpResponse\"\xc6\x01\n\x16\x42ootServiceBootRequest\x12}\n\x03mac\x18\x01 \x01(\tBk\xbaHh\xba\x01\x65\n\x03mac\x12\x1fmac must be a valid mac address\x1a=this.matches(\'^(?:[0-9A-Fa-f]{2}[:-]){5}(?:[0-9A-Fa-f]{2})$\')R\x03mac\x12-\n\x0cpartition_id\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x0bpartitionId\"\xd2\x01\n\x17\x42ootServiceBootResponse\x12Z\n\x06kernel\x18\x01 \x01(\tBB\xbaH?\xba\x01<\n\x10valid_kernel_uri\x12\x1akernel must be a valid URI\x1a\x0cthis.isUri()R\x06kernel\x12$\n\x0einit_ram_disks\x18\x02 \x03(\tR\x0cinitRamDisks\x12)\n\x07\x63mdline\x18\x03 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01H\x00R\x07\x63mdline\x88\x01\x01\x42\n\n\x08_cmdline\"\xe3\x02\n\x1a\x42ootServiceRegisterRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12>\n\x08hardware\x18\x02 \x01(\x0b\x32\".metalstack.api.v2.MachineHardwareR\x08hardware\x12\x32\n\x04\x62ios\x18\x03 \x01(\x0b\x32\x1e.metalstack.api.v2.MachineBiosR\x04\x62ios\x12\x32\n\x04ipmi\x18\x04 \x01(\x0b\x32\x1e.metalstack.api.v2.MachineIPMIR\x04ipmi\x12\x12\n\x04tags\x18\x05 \x03(\tR\x04tags\x12<\n\x14metal_hammer_version\x18\x06 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x12metalHammerVersion\x12-\n\x0cpartition_id\x18\x07 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x0bpartitionId\"\x8a\x01\n\x1b\x42ootServiceRegisterResponse\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12\x1e\n\x04size\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x04size\x12-\n\x0cpartition_id\x18\x03 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x0bpartitionId\"6\n\x16\x42ootServiceWaitRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\"\x19\n\x17\x42ootServiceWaitResponse\"\xaf\x01\n\x18\x42ootServiceReportRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12\x35\n\x10\x63onsole_password\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x0f\x63onsolePassword\x12\x18\n\x07success\x18\x04 \x01(\x08R\x07success\x12$\n\x07message\x18\x05 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x04R\x07message\"\x1b\n\x19\x42ootServiceReportResponse\"C\n#BootServiceSuperUserPasswordRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\"\x8d\x01\n$BootServiceSuperUserPasswordResponse\x12)\n\x10\x66\x65\x61ture_disabled\x18\x01 \x01(\x08R\x0f\x66\x65\x61tureDisabled\x12:\n\x13super_user_password\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x11superUserPassword2\xe3\x05\n\x0b\x42ootService\x12m\n\x04\x44hcp\x12+.metalstack.infra.v2.BootServiceDhcpRequest\x1a,.metalstack.infra.v2.BootServiceDhcpResponse\"\n\xe0\xf3\x18\x02\xea\xf3\x18\x02\x01\x02\x12m\n\x04\x42oot\x12+.metalstack.infra.v2.BootServiceBootRequest\x1a,.metalstack.infra.v2.BootServiceBootResponse\"\n\xe0\xf3\x18\x02\xea\xf3\x18\x02\x01\x02\x12\x94\x01\n\x11SuperUserPassword\x12\x38.metalstack.infra.v2.BootServiceSuperUserPasswordRequest\x1a\x39.metalstack.infra.v2.BootServiceSuperUserPasswordResponse\"\n\xe0\xf3\x18\x02\xf2\xf3\x18\x02\x01\x02\x12y\n\x08Register\x12/.metalstack.infra.v2.BootServiceRegisterRequest\x1a\x30.metalstack.infra.v2.BootServiceRegisterResponse\"\n\xe0\xf3\x18\x02\xf2\xf3\x18\x02\x01\x02\x12o\n\x04Wait\x12+.metalstack.infra.v2.BootServiceWaitRequest\x1a,.metalstack.infra.v2.BootServiceWaitResponse\"\n\xe0\xf3\x18\x02\xf2\xf3\x18\x02\x01\x02\x30\x01\x12s\n\x06Report\x12-.metalstack.infra.v2.BootServiceReportRequest\x1a..metalstack.infra.v2.BootServiceReportResponse\"\n\xe0\xf3\x18\x02\xf2\xf3\x18\x02\x01\x02\x42\xcd\x01\n\x17\x63om.metalstack.infra.v2B\tBootProtoP\x01Z9github.com/metal-stack/api/go/metalstack/infra/v2;infrav2\xa2\x02\x03MIX\xaa\x02\x13Metalstack.Infra.V2\xca\x02\x13Metalstack\\Infra\\V2\xe2\x02\x1fMetalstack\\Infra\\V2\\GPBMetadata\xea\x02\x15Metalstack::Infra::V2b\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1emetalstack/infra/v2/boot.proto\x12\x13metalstack.infra.v2\x1a\x1b\x62uf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a\x1fmetalstack/api/v2/machine.proto\"`\n\x16\x42ootServiceDhcpRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12(\n\tpartition\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\tpartition\"\x19\n\x17\x42ootServiceDhcpResponse\"\xc1\x01\n\x16\x42ootServiceBootRequest\x12}\n\x03mac\x18\x01 \x01(\tBk\xbaHh\xba\x01\x65\n\x03mac\x12\x1fmac must be a valid mac address\x1a=this.matches(\'^(?:[0-9A-Fa-f]{2}[:-]){5}(?:[0-9A-Fa-f]{2})$\')R\x03mac\x12(\n\tpartition\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\tpartition\"\xd2\x01\n\x17\x42ootServiceBootResponse\x12Z\n\x06kernel\x18\x01 \x01(\tBB\xbaH?\xba\x01<\n\x10valid_kernel_uri\x12\x1akernel must be a valid URI\x1a\x0cthis.isUri()R\x06kernel\x12$\n\x0einit_ram_disks\x18\x02 \x03(\tR\x0cinitRamDisks\x12)\n\x07\x63mdline\x18\x03 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01H\x00R\x07\x63mdline\x88\x01\x01\x42\n\n\x08_cmdline\"\xde\x02\n\x1a\x42ootServiceRegisterRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12>\n\x08hardware\x18\x02 \x01(\x0b\x32\".metalstack.api.v2.MachineHardwareR\x08hardware\x12\x32\n\x04\x62ios\x18\x03 \x01(\x0b\x32\x1e.metalstack.api.v2.MachineBiosR\x04\x62ios\x12\x32\n\x04ipmi\x18\x04 \x01(\x0b\x32\x1e.metalstack.api.v2.MachineIPMIR\x04ipmi\x12\x12\n\x04tags\x18\x05 \x03(\tR\x04tags\x12<\n\x14metal_hammer_version\x18\x06 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x12metalHammerVersion\x12(\n\tpartition\x18\x07 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\tpartition\"\x85\x01\n\x1b\x42ootServiceRegisterResponse\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12\x1e\n\x04size\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x04size\x12(\n\tpartition\x18\x03 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\tpartition\"6\n\x16\x42ootServiceWaitRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\"\x19\n\x17\x42ootServiceWaitResponse\"\xaf\x01\n\x18\x42ootServiceReportRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12\x35\n\x10\x63onsole_password\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x0f\x63onsolePassword\x12\x18\n\x07success\x18\x04 \x01(\x08R\x07success\x12$\n\x07message\x18\x05 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x04R\x07message\"\x1b\n\x19\x42ootServiceReportResponse\"C\n#BootServiceSuperUserPasswordRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\"\x8d\x01\n$BootServiceSuperUserPasswordResponse\x12)\n\x10\x66\x65\x61ture_disabled\x18\x01 \x01(\x08R\x0f\x66\x65\x61tureDisabled\x12:\n\x13super_user_password\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x11superUserPassword2\xe3\x05\n\x0b\x42ootService\x12m\n\x04\x44hcp\x12+.metalstack.infra.v2.BootServiceDhcpRequest\x1a,.metalstack.infra.v2.BootServiceDhcpResponse\"\n\xe0\xf3\x18\x02\xea\xf3\x18\x02\x01\x02\x12m\n\x04\x42oot\x12+.metalstack.infra.v2.BootServiceBootRequest\x1a,.metalstack.infra.v2.BootServiceBootResponse\"\n\xe0\xf3\x18\x02\xea\xf3\x18\x02\x01\x02\x12\x94\x01\n\x11SuperUserPassword\x12\x38.metalstack.infra.v2.BootServiceSuperUserPasswordRequest\x1a\x39.metalstack.infra.v2.BootServiceSuperUserPasswordResponse\"\n\xe0\xf3\x18\x02\xf2\xf3\x18\x02\x01\x02\x12y\n\x08Register\x12/.metalstack.infra.v2.BootServiceRegisterRequest\x1a\x30.metalstack.infra.v2.BootServiceRegisterResponse\"\n\xe0\xf3\x18\x02\xf2\xf3\x18\x02\x01\x02\x12o\n\x04Wait\x12+.metalstack.infra.v2.BootServiceWaitRequest\x1a,.metalstack.infra.v2.BootServiceWaitResponse\"\n\xe0\xf3\x18\x02\xf2\xf3\x18\x02\x01\x02\x30\x01\x12s\n\x06Report\x12-.metalstack.infra.v2.BootServiceReportRequest\x1a..metalstack.infra.v2.BootServiceReportResponse\"\n\xe0\xf3\x18\x02\xf2\xf3\x18\x02\x01\x02\x42\xcd\x01\n\x17\x63om.metalstack.infra.v2B\tBootProtoP\x01Z9github.com/metal-stack/api/go/metalstack/infra/v2;infrav2\xa2\x02\x03MIX\xaa\x02\x13Metalstack.Infra.V2\xca\x02\x13Metalstack\\Infra\\V2\xe2\x02\x1fMetalstack\\Infra\\V2\\GPBMetadata\xea\x02\x15Metalstack::Infra::V2b\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -37,12 +37,12 @@ _globals['DESCRIPTOR']._serialized_options = b'\n\027com.metalstack.infra.v2B\tBootProtoP\001Z9github.com/metal-stack/api/go/metalstack/infra/v2;infrav2\242\002\003MIX\252\002\023Metalstack.Infra.V2\312\002\023Metalstack\\Infra\\V2\342\002\037Metalstack\\Infra\\V2\\GPBMetadata\352\002\025Metalstack::Infra::V2' _globals['_BOOTSERVICEDHCPREQUEST'].fields_by_name['uuid']._loaded_options = None _globals['_BOOTSERVICEDHCPREQUEST'].fields_by_name['uuid']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_BOOTSERVICEDHCPREQUEST'].fields_by_name['partition_id']._loaded_options = None - _globals['_BOOTSERVICEDHCPREQUEST'].fields_by_name['partition_id']._serialized_options = b'\272H\007r\005\020\002\030\200\001' + _globals['_BOOTSERVICEDHCPREQUEST'].fields_by_name['partition']._loaded_options = None + _globals['_BOOTSERVICEDHCPREQUEST'].fields_by_name['partition']._serialized_options = b'\272H\007r\005\020\002\030\200\001' _globals['_BOOTSERVICEBOOTREQUEST'].fields_by_name['mac']._loaded_options = None _globals['_BOOTSERVICEBOOTREQUEST'].fields_by_name['mac']._serialized_options = b'\272Hh\272\001e\n\003mac\022\037mac must be a valid mac address\032=this.matches(\'^(?:[0-9A-Fa-f]{2}[:-]){5}(?:[0-9A-Fa-f]{2})$\')' - _globals['_BOOTSERVICEBOOTREQUEST'].fields_by_name['partition_id']._loaded_options = None - _globals['_BOOTSERVICEBOOTREQUEST'].fields_by_name['partition_id']._serialized_options = b'\272H\007r\005\020\002\030\200\001' + _globals['_BOOTSERVICEBOOTREQUEST'].fields_by_name['partition']._loaded_options = None + _globals['_BOOTSERVICEBOOTREQUEST'].fields_by_name['partition']._serialized_options = b'\272H\007r\005\020\002\030\200\001' _globals['_BOOTSERVICEBOOTRESPONSE'].fields_by_name['kernel']._loaded_options = None _globals['_BOOTSERVICEBOOTRESPONSE'].fields_by_name['kernel']._serialized_options = b'\272H?\272\001<\n\020valid_kernel_uri\022\032kernel must be a valid URI\032\014this.isUri()' _globals['_BOOTSERVICEBOOTRESPONSE'].fields_by_name['cmdline']._loaded_options = None @@ -51,14 +51,14 @@ _globals['_BOOTSERVICEREGISTERREQUEST'].fields_by_name['uuid']._serialized_options = b'\272H\005r\003\260\001\001' _globals['_BOOTSERVICEREGISTERREQUEST'].fields_by_name['metal_hammer_version']._loaded_options = None _globals['_BOOTSERVICEREGISTERREQUEST'].fields_by_name['metal_hammer_version']._serialized_options = b'\272H\007r\005\020\002\030\200\001' - _globals['_BOOTSERVICEREGISTERREQUEST'].fields_by_name['partition_id']._loaded_options = None - _globals['_BOOTSERVICEREGISTERREQUEST'].fields_by_name['partition_id']._serialized_options = b'\272H\007r\005\020\002\030\200\001' + _globals['_BOOTSERVICEREGISTERREQUEST'].fields_by_name['partition']._loaded_options = None + _globals['_BOOTSERVICEREGISTERREQUEST'].fields_by_name['partition']._serialized_options = b'\272H\007r\005\020\002\030\200\001' _globals['_BOOTSERVICEREGISTERRESPONSE'].fields_by_name['uuid']._loaded_options = None _globals['_BOOTSERVICEREGISTERRESPONSE'].fields_by_name['uuid']._serialized_options = b'\272H\005r\003\260\001\001' _globals['_BOOTSERVICEREGISTERRESPONSE'].fields_by_name['size']._loaded_options = None _globals['_BOOTSERVICEREGISTERRESPONSE'].fields_by_name['size']._serialized_options = b'\272H\007r\005\020\002\030\200\001' - _globals['_BOOTSERVICEREGISTERRESPONSE'].fields_by_name['partition_id']._loaded_options = None - _globals['_BOOTSERVICEREGISTERRESPONSE'].fields_by_name['partition_id']._serialized_options = b'\272H\007r\005\020\002\030\200\001' + _globals['_BOOTSERVICEREGISTERRESPONSE'].fields_by_name['partition']._loaded_options = None + _globals['_BOOTSERVICEREGISTERRESPONSE'].fields_by_name['partition']._serialized_options = b'\272H\007r\005\020\002\030\200\001' _globals['_BOOTSERVICEWAITREQUEST'].fields_by_name['uuid']._loaded_options = None _globals['_BOOTSERVICEWAITREQUEST'].fields_by_name['uuid']._serialized_options = b'\272H\005r\003\260\001\001' _globals['_BOOTSERVICEREPORTREQUEST'].fields_by_name['uuid']._loaded_options = None @@ -84,29 +84,29 @@ _globals['_BOOTSERVICE'].methods_by_name['Report']._loaded_options = None _globals['_BOOTSERVICE'].methods_by_name['Report']._serialized_options = b'\340\363\030\002\362\363\030\002\001\002' _globals['_BOOTSERVICEDHCPREQUEST']._serialized_start=149 - _globals['_BOOTSERVICEDHCPREQUEST']._serialized_end=250 - _globals['_BOOTSERVICEDHCPRESPONSE']._serialized_start=252 - _globals['_BOOTSERVICEDHCPRESPONSE']._serialized_end=277 - _globals['_BOOTSERVICEBOOTREQUEST']._serialized_start=280 - _globals['_BOOTSERVICEBOOTREQUEST']._serialized_end=478 - _globals['_BOOTSERVICEBOOTRESPONSE']._serialized_start=481 - _globals['_BOOTSERVICEBOOTRESPONSE']._serialized_end=691 - _globals['_BOOTSERVICEREGISTERREQUEST']._serialized_start=694 - _globals['_BOOTSERVICEREGISTERREQUEST']._serialized_end=1049 - _globals['_BOOTSERVICEREGISTERRESPONSE']._serialized_start=1052 - _globals['_BOOTSERVICEREGISTERRESPONSE']._serialized_end=1190 - _globals['_BOOTSERVICEWAITREQUEST']._serialized_start=1192 - _globals['_BOOTSERVICEWAITREQUEST']._serialized_end=1246 - _globals['_BOOTSERVICEWAITRESPONSE']._serialized_start=1248 - _globals['_BOOTSERVICEWAITRESPONSE']._serialized_end=1273 - _globals['_BOOTSERVICEREPORTREQUEST']._serialized_start=1276 - _globals['_BOOTSERVICEREPORTREQUEST']._serialized_end=1451 - _globals['_BOOTSERVICEREPORTRESPONSE']._serialized_start=1453 - _globals['_BOOTSERVICEREPORTRESPONSE']._serialized_end=1480 - _globals['_BOOTSERVICESUPERUSERPASSWORDREQUEST']._serialized_start=1482 - _globals['_BOOTSERVICESUPERUSERPASSWORDREQUEST']._serialized_end=1549 - _globals['_BOOTSERVICESUPERUSERPASSWORDRESPONSE']._serialized_start=1552 - _globals['_BOOTSERVICESUPERUSERPASSWORDRESPONSE']._serialized_end=1693 - _globals['_BOOTSERVICE']._serialized_start=1696 - _globals['_BOOTSERVICE']._serialized_end=2435 + _globals['_BOOTSERVICEDHCPREQUEST']._serialized_end=245 + _globals['_BOOTSERVICEDHCPRESPONSE']._serialized_start=247 + _globals['_BOOTSERVICEDHCPRESPONSE']._serialized_end=272 + _globals['_BOOTSERVICEBOOTREQUEST']._serialized_start=275 + _globals['_BOOTSERVICEBOOTREQUEST']._serialized_end=468 + _globals['_BOOTSERVICEBOOTRESPONSE']._serialized_start=471 + _globals['_BOOTSERVICEBOOTRESPONSE']._serialized_end=681 + _globals['_BOOTSERVICEREGISTERREQUEST']._serialized_start=684 + _globals['_BOOTSERVICEREGISTERREQUEST']._serialized_end=1034 + _globals['_BOOTSERVICEREGISTERRESPONSE']._serialized_start=1037 + _globals['_BOOTSERVICEREGISTERRESPONSE']._serialized_end=1170 + _globals['_BOOTSERVICEWAITREQUEST']._serialized_start=1172 + _globals['_BOOTSERVICEWAITREQUEST']._serialized_end=1226 + _globals['_BOOTSERVICEWAITRESPONSE']._serialized_start=1228 + _globals['_BOOTSERVICEWAITRESPONSE']._serialized_end=1253 + _globals['_BOOTSERVICEREPORTREQUEST']._serialized_start=1256 + _globals['_BOOTSERVICEREPORTREQUEST']._serialized_end=1431 + _globals['_BOOTSERVICEREPORTRESPONSE']._serialized_start=1433 + _globals['_BOOTSERVICEREPORTRESPONSE']._serialized_end=1460 + _globals['_BOOTSERVICESUPERUSERPASSWORDREQUEST']._serialized_start=1462 + _globals['_BOOTSERVICESUPERUSERPASSWORDREQUEST']._serialized_end=1529 + _globals['_BOOTSERVICESUPERUSERPASSWORDRESPONSE']._serialized_start=1532 + _globals['_BOOTSERVICESUPERUSERPASSWORDRESPONSE']._serialized_end=1673 + _globals['_BOOTSERVICE']._serialized_start=1676 + _globals['_BOOTSERVICE']._serialized_end=2415 # @@protoc_insertion_point(module_scope) diff --git a/python/metalstack/infra/v2/boot_pb2.pyi b/python/metalstack/infra/v2/boot_pb2.pyi index 9ef1a822..51f65461 100644 --- a/python/metalstack/infra/v2/boot_pb2.pyi +++ b/python/metalstack/infra/v2/boot_pb2.pyi @@ -10,24 +10,24 @@ from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union DESCRIPTOR: _descriptor.FileDescriptor class BootServiceDhcpRequest(_message.Message): - __slots__ = ("uuid", "partition_id") + __slots__ = ("uuid", "partition") UUID_FIELD_NUMBER: _ClassVar[int] - PARTITION_ID_FIELD_NUMBER: _ClassVar[int] + PARTITION_FIELD_NUMBER: _ClassVar[int] uuid: str - partition_id: str - def __init__(self, uuid: _Optional[str] = ..., partition_id: _Optional[str] = ...) -> None: ... + partition: str + def __init__(self, uuid: _Optional[str] = ..., partition: _Optional[str] = ...) -> None: ... class BootServiceDhcpResponse(_message.Message): __slots__ = () def __init__(self) -> None: ... class BootServiceBootRequest(_message.Message): - __slots__ = ("mac", "partition_id") + __slots__ = ("mac", "partition") MAC_FIELD_NUMBER: _ClassVar[int] - PARTITION_ID_FIELD_NUMBER: _ClassVar[int] + PARTITION_FIELD_NUMBER: _ClassVar[int] mac: str - partition_id: str - def __init__(self, mac: _Optional[str] = ..., partition_id: _Optional[str] = ...) -> None: ... + partition: str + def __init__(self, mac: _Optional[str] = ..., partition: _Optional[str] = ...) -> None: ... class BootServiceBootResponse(_message.Message): __slots__ = ("kernel", "init_ram_disks", "cmdline") @@ -40,32 +40,32 @@ class BootServiceBootResponse(_message.Message): def __init__(self, kernel: _Optional[str] = ..., init_ram_disks: _Optional[_Iterable[str]] = ..., cmdline: _Optional[str] = ...) -> None: ... class BootServiceRegisterRequest(_message.Message): - __slots__ = ("uuid", "hardware", "bios", "ipmi", "tags", "metal_hammer_version", "partition_id") + __slots__ = ("uuid", "hardware", "bios", "ipmi", "tags", "metal_hammer_version", "partition") UUID_FIELD_NUMBER: _ClassVar[int] HARDWARE_FIELD_NUMBER: _ClassVar[int] BIOS_FIELD_NUMBER: _ClassVar[int] IPMI_FIELD_NUMBER: _ClassVar[int] TAGS_FIELD_NUMBER: _ClassVar[int] METAL_HAMMER_VERSION_FIELD_NUMBER: _ClassVar[int] - PARTITION_ID_FIELD_NUMBER: _ClassVar[int] + PARTITION_FIELD_NUMBER: _ClassVar[int] uuid: str hardware: _machine_pb2.MachineHardware bios: _machine_pb2.MachineBios ipmi: _machine_pb2.MachineIPMI tags: _containers.RepeatedScalarFieldContainer[str] metal_hammer_version: str - partition_id: str - def __init__(self, uuid: _Optional[str] = ..., hardware: _Optional[_Union[_machine_pb2.MachineHardware, _Mapping]] = ..., bios: _Optional[_Union[_machine_pb2.MachineBios, _Mapping]] = ..., ipmi: _Optional[_Union[_machine_pb2.MachineIPMI, _Mapping]] = ..., tags: _Optional[_Iterable[str]] = ..., metal_hammer_version: _Optional[str] = ..., partition_id: _Optional[str] = ...) -> None: ... + partition: str + def __init__(self, uuid: _Optional[str] = ..., hardware: _Optional[_Union[_machine_pb2.MachineHardware, _Mapping]] = ..., bios: _Optional[_Union[_machine_pb2.MachineBios, _Mapping]] = ..., ipmi: _Optional[_Union[_machine_pb2.MachineIPMI, _Mapping]] = ..., tags: _Optional[_Iterable[str]] = ..., metal_hammer_version: _Optional[str] = ..., partition: _Optional[str] = ...) -> None: ... class BootServiceRegisterResponse(_message.Message): - __slots__ = ("uuid", "size", "partition_id") + __slots__ = ("uuid", "size", "partition") UUID_FIELD_NUMBER: _ClassVar[int] SIZE_FIELD_NUMBER: _ClassVar[int] - PARTITION_ID_FIELD_NUMBER: _ClassVar[int] + PARTITION_FIELD_NUMBER: _ClassVar[int] uuid: str size: str - partition_id: str - def __init__(self, uuid: _Optional[str] = ..., size: _Optional[str] = ..., partition_id: _Optional[str] = ...) -> None: ... + partition: str + def __init__(self, uuid: _Optional[str] = ..., size: _Optional[str] = ..., partition: _Optional[str] = ...) -> None: ... class BootServiceWaitRequest(_message.Message): __slots__ = ("uuid",) From f9b69b1d5a71a076447fba8fb45e9d37645f2a08 Mon Sep 17 00:00:00 2001 From: Stefan Majer Date: Wed, 3 Sep 2025 14:59:59 +0200 Subject: [PATCH 14/27] pixie requires lower go version --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index c19251c5..a436be14 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/metal-stack/api -go 1.25 +go 1.24.0 require ( buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.8-20250717185734-6c6e0d3c608e.1 From 09308f7efc30da202b5c816be331300c28bbcd1e Mon Sep 17 00:00:00 2001 From: Stefan Majer Date: Thu, 4 Sep 2025 07:39:08 +0200 Subject: [PATCH 15/27] Machine and Infra Roles --- doc/index.html | 252 +++++++++++++++++++++++++ go/metalstack/api/v2/token.pb.go | 237 ++++++++++++++++------- proto/metalstack/api/v2/token.proto | 68 ++++++- python/metalstack/api/v2/token_pb2.py | 120 +++++++----- python/metalstack/api/v2/token_pb2.pyi | 66 ++++++- 5 files changed, 624 insertions(+), 119 deletions(-) diff --git a/doc/index.html b/doc/index.html index 0d903579..606202ce 100644 --- a/doc/index.html +++ b/doc/index.html @@ -1504,6 +1504,14 @@

    Table of Contents

    MToken +
  • + MToken.InfraRolesEntry +
  • + +
  • + MToken.MachineRolesEntry +
  • +
  • MToken.ProjectRolesEntry
  • @@ -1516,6 +1524,14 @@

    Table of Contents

    MTokenServiceCreateRequest +
  • + MTokenServiceCreateRequest.InfraRolesEntry +
  • + +
  • + MTokenServiceCreateRequest.MachineRolesEntry +
  • +
  • MTokenServiceCreateRequest.ProjectRolesEntry
  • @@ -1564,6 +1580,14 @@

    Table of Contents

    MTokenServiceUpdateRequest +
  • + MTokenServiceUpdateRequest.InfraRolesEntry +
  • + +
  • + MTokenServiceUpdateRequest.MachineRolesEntry +
  • +
  • MTokenServiceUpdateRequest.ProjectRolesEntry
  • @@ -15995,6 +16019,20 @@

    Token

    TenantRoles associates a tenant id with the corresponding role of the token owner

    + + machine_roles + Token.MachineRolesEntry + repeated +

    MachineRoles associates a machine uuid with the corresponding role of the token owner

    + + + + infra_roles + Token.InfraRolesEntry + repeated +

    InfraRoles associates a infra service with the corresponding role of the token owner

    + + admin_role AdminRole @@ -16009,6 +16047,68 @@

    Token

    +

    Token.InfraRolesEntry

    +

    + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeLabelDescription
    keystring

    valueInfraRole

    + + + + + +

    Token.MachineRolesEntry

    +

    + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeLabelDescription
    keystring

    valueMachineRole

    + + + + +

    Token.ProjectRolesEntry

    @@ -16116,6 +16216,20 @@

    TokenServiceCreateRequest

    TenantRoles associates a tenant id with the corresponding role of the token owner

    + + machine_roles + TokenServiceCreateRequest.MachineRolesEntry + repeated +

    MachineRoles associates a machine uuid with the corresponding role of the token owner

    + + + + infra_roles + TokenServiceCreateRequest.InfraRolesEntry + repeated +

    InfraRoles associates a infra service with the corresponding role of the token owner

    + + admin_role AdminRole @@ -16130,6 +16244,68 @@

    TokenServiceCreateRequestTokenServiceCreateRequest.InfraRolesEntry

    +

    + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeLabelDescription
    keystring

    valueInfraRole

    + + + + + +

    TokenServiceCreateRequest.MachineRolesEntry

    +

    + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeLabelDescription
    keystring

    valueMachineRole

    + + + + +

    TokenServiceCreateRequest.ProjectRolesEntry

    @@ -16416,6 +16592,20 @@

    TokenServiceUpdateRequest

    TenantRoles associates a tenant id with the corresponding role of the token owner

    + + machine_roles + TokenServiceUpdateRequest.MachineRolesEntry + repeated +

    MachineRoles associates a machine uuid with the corresponding role of the token owner

    + + + + infra_roles + TokenServiceUpdateRequest.InfraRolesEntry + repeated +

    InfraRoles associates a infra service with the corresponding role of the token owner

    + + admin_role AdminRole @@ -16430,6 +16620,68 @@

    TokenServiceUpdateRequestTokenServiceUpdateRequest.InfraRolesEntry

    +

    + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeLabelDescription
    keystring

    valueInfraRole

    + + + + + +

    TokenServiceUpdateRequest.MachineRolesEntry

    +

    + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeLabelDescription
    keystring

    valueMachineRole

    + + + + +

    TokenServiceUpdateRequest.ProjectRolesEntry

    diff --git a/go/metalstack/api/v2/token.pb.go b/go/metalstack/api/v2/token.pb.go index 29253de1..6c42780e 100644 --- a/go/metalstack/api/v2/token.pb.go +++ b/go/metalstack/api/v2/token.pb.go @@ -98,8 +98,12 @@ type Token struct { ProjectRoles map[string]ProjectRole `protobuf:"bytes,9,rep,name=project_roles,json=projectRoles,proto3" json:"project_roles,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value,enum=metalstack.api.v2.ProjectRole"` // TenantRoles associates a tenant id with the corresponding role of the token owner TenantRoles map[string]TenantRole `protobuf:"bytes,10,rep,name=tenant_roles,json=tenantRoles,proto3" json:"tenant_roles,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value,enum=metalstack.api.v2.TenantRole"` + // MachineRoles associates a machine uuid with the corresponding role of the token owner + MachineRoles map[string]MachineRole `protobuf:"bytes,11,rep,name=machine_roles,json=machineRoles,proto3" json:"machine_roles,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value,enum=metalstack.api.v2.MachineRole"` + // InfraRoles associates a infra service with the corresponding role of the token owner + InfraRoles map[string]InfraRole `protobuf:"bytes,12,rep,name=infra_roles,json=infraRoles,proto3" json:"infra_roles,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value,enum=metalstack.api.v2.InfraRole"` // AdminRole defines the admin role of the token owner - AdminRole *AdminRole `protobuf:"varint,11,opt,name=admin_role,json=adminRole,proto3,enum=metalstack.api.v2.AdminRole,oneof" json:"admin_role,omitempty"` + AdminRole *AdminRole `protobuf:"varint,13,opt,name=admin_role,json=adminRole,proto3,enum=metalstack.api.v2.AdminRole,oneof" json:"admin_role,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -197,6 +201,20 @@ func (x *Token) GetTenantRoles() map[string]TenantRole { return nil } +func (x *Token) GetMachineRoles() map[string]MachineRole { + if x != nil { + return x.MachineRoles + } + return nil +} + +func (x *Token) GetInfraRoles() map[string]InfraRole { + if x != nil { + return x.InfraRoles + } + return nil +} + func (x *Token) GetAdminRole() AdminRole { if x != nil && x.AdminRole != nil { return *x.AdminRole @@ -217,8 +235,12 @@ type TokenServiceCreateRequest struct { ProjectRoles map[string]ProjectRole `protobuf:"bytes,5,rep,name=project_roles,json=projectRoles,proto3" json:"project_roles,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value,enum=metalstack.api.v2.ProjectRole"` // TenantRoles associates a tenant id with the corresponding role of the token owner TenantRoles map[string]TenantRole `protobuf:"bytes,6,rep,name=tenant_roles,json=tenantRoles,proto3" json:"tenant_roles,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value,enum=metalstack.api.v2.TenantRole"` + // MachineRoles associates a machine uuid with the corresponding role of the token owner + MachineRoles map[string]MachineRole `protobuf:"bytes,7,rep,name=machine_roles,json=machineRoles,proto3" json:"machine_roles,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value,enum=metalstack.api.v2.MachineRole"` + // InfraRoles associates a infra service with the corresponding role of the token owner + InfraRoles map[string]InfraRole `protobuf:"bytes,8,rep,name=infra_roles,json=infraRoles,proto3" json:"infra_roles,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value,enum=metalstack.api.v2.InfraRole"` // AdminRole defines the admin role of the token owner - AdminRole *AdminRole `protobuf:"varint,7,opt,name=admin_role,json=adminRole,proto3,enum=metalstack.api.v2.AdminRole,oneof" json:"admin_role,omitempty"` + AdminRole *AdminRole `protobuf:"varint,9,opt,name=admin_role,json=adminRole,proto3,enum=metalstack.api.v2.AdminRole,oneof" json:"admin_role,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -288,6 +310,20 @@ func (x *TokenServiceCreateRequest) GetTenantRoles() map[string]TenantRole { return nil } +func (x *TokenServiceCreateRequest) GetMachineRoles() map[string]MachineRole { + if x != nil { + return x.MachineRoles + } + return nil +} + +func (x *TokenServiceCreateRequest) GetInfraRoles() map[string]InfraRole { + if x != nil { + return x.InfraRoles + } + return nil +} + func (x *TokenServiceCreateRequest) GetAdminRole() AdminRole { if x != nil && x.AdminRole != nil { return *x.AdminRole @@ -585,8 +621,12 @@ type TokenServiceUpdateRequest struct { ProjectRoles map[string]ProjectRole `protobuf:"bytes,4,rep,name=project_roles,json=projectRoles,proto3" json:"project_roles,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value,enum=metalstack.api.v2.ProjectRole"` // TenantRoles associates a tenant id with the corresponding role of the token owner TenantRoles map[string]TenantRole `protobuf:"bytes,5,rep,name=tenant_roles,json=tenantRoles,proto3" json:"tenant_roles,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value,enum=metalstack.api.v2.TenantRole"` + // MachineRoles associates a machine uuid with the corresponding role of the token owner + MachineRoles map[string]MachineRole `protobuf:"bytes,6,rep,name=machine_roles,json=machineRoles,proto3" json:"machine_roles,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value,enum=metalstack.api.v2.MachineRole"` + // InfraRoles associates a infra service with the corresponding role of the token owner + InfraRoles map[string]InfraRole `protobuf:"bytes,7,rep,name=infra_roles,json=infraRoles,proto3" json:"infra_roles,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value,enum=metalstack.api.v2.InfraRole"` // AdminRole defines the admin role of the token owner - AdminRole *AdminRole `protobuf:"varint,6,opt,name=admin_role,json=adminRole,proto3,enum=metalstack.api.v2.AdminRole,oneof" json:"admin_role,omitempty"` + AdminRole *AdminRole `protobuf:"varint,8,opt,name=admin_role,json=adminRole,proto3,enum=metalstack.api.v2.AdminRole,oneof" json:"admin_role,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -656,6 +696,20 @@ func (x *TokenServiceUpdateRequest) GetTenantRoles() map[string]TenantRole { return nil } +func (x *TokenServiceUpdateRequest) GetMachineRoles() map[string]MachineRole { + if x != nil { + return x.MachineRoles + } + return nil +} + +func (x *TokenServiceUpdateRequest) GetInfraRoles() map[string]InfraRole { + if x != nil { + return x.InfraRoles + } + return nil +} + func (x *TokenServiceUpdateRequest) GetAdminRole() AdminRole { if x != nil && x.AdminRole != nil { return *x.AdminRole @@ -899,7 +953,7 @@ var File_metalstack_api_v2_token_proto protoreflect.FileDescriptor const file_metalstack_api_v2_token_proto_rawDesc = "" + "\n" + - "\x1dmetalstack/api/v2/token.proto\x12\x11metalstack.api.v2\x1a\x1bbuf/validate/validate.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1emetalstack/api/v2/common.proto\"\xb5\x06\n" + + "\x1dmetalstack/api/v2/token.proto\x12\x11metalstack.api.v2\x1a\x1bbuf/validate/validate.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1emetalstack/api/v2/common.proto\"\x8f\t\n" + "\x05Token\x12\x1c\n" + "\x04uuid\x18\x01 \x01(\tB\b\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12\x1e\n" + "\x04user\x18\x02 \x01(\tB\n" + @@ -913,16 +967,25 @@ const file_metalstack_api_v2_token_proto_rawDesc = "" + "token_type\x18\b \x01(\x0e2\x1c.metalstack.api.v2.TokenTypeB\b\xbaH\x05\x82\x01\x02\x10\x01R\ttokenType\x12O\n" + "\rproject_roles\x18\t \x03(\v2*.metalstack.api.v2.Token.ProjectRolesEntryR\fprojectRoles\x12L\n" + "\ftenant_roles\x18\n" + - " \x03(\v2).metalstack.api.v2.Token.TenantRolesEntryR\vtenantRoles\x12J\n" + + " \x03(\v2).metalstack.api.v2.Token.TenantRolesEntryR\vtenantRoles\x12O\n" + + "\rmachine_roles\x18\v \x03(\v2*.metalstack.api.v2.Token.MachineRolesEntryR\fmachineRoles\x12I\n" + + "\vinfra_roles\x18\f \x03(\v2(.metalstack.api.v2.Token.InfraRolesEntryR\n" + + "infraRoles\x12J\n" + "\n" + - "admin_role\x18\v \x01(\x0e2\x1c.metalstack.api.v2.AdminRoleB\b\xbaH\x05\x82\x01\x02\x10\x01H\x00R\tadminRole\x88\x01\x01\x1a_\n" + + "admin_role\x18\r \x01(\x0e2\x1c.metalstack.api.v2.AdminRoleB\b\xbaH\x05\x82\x01\x02\x10\x01H\x00R\tadminRole\x88\x01\x01\x1a_\n" + "\x11ProjectRolesEntry\x12\x10\n" + "\x03key\x18\x01 \x01(\tR\x03key\x124\n" + "\x05value\x18\x02 \x01(\x0e2\x1e.metalstack.api.v2.ProjectRoleR\x05value:\x028\x01\x1a]\n" + "\x10TenantRolesEntry\x12\x10\n" + "\x03key\x18\x01 \x01(\tR\x03key\x123\n" + - "\x05value\x18\x02 \x01(\x0e2\x1d.metalstack.api.v2.TenantRoleR\x05value:\x028\x01B\r\n" + - "\v_admin_role\"\x82\a\n" + + "\x05value\x18\x02 \x01(\x0e2\x1d.metalstack.api.v2.TenantRoleR\x05value:\x028\x01\x1a_\n" + + "\x11MachineRolesEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x124\n" + + "\x05value\x18\x02 \x01(\x0e2\x1e.metalstack.api.v2.MachineRoleR\x05value:\x028\x01\x1a[\n" + + "\x0fInfraRolesEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x122\n" + + "\x05value\x18\x02 \x01(\x0e2\x1c.metalstack.api.v2.InfraRoleR\x05value:\x028\x01B\r\n" + + "\v_admin_role\"\xbe\v\n" + "\x19TokenServiceCreateRequest\x12,\n" + "\vdescription\x18\x01 \x01(\tB\n" + "\xbaH\ar\x05\x10\x02\x18\x80\x02R\vdescription\x12O\n" + @@ -931,15 +994,26 @@ const file_metalstack_api_v2_token_proto_rawDesc = "" + "\rproject_roles\x18\x05 \x03(\v2>.metalstack.api.v2.TokenServiceCreateRequest.ProjectRolesEntryB\\\xbaHY\x9a\x01V\"\ar\x05\x10\x03\x18\x80\x01*K\xba\x01H\n" + "\x0erole-specified\x12\x1eproject role must be specified\x1a\x16this >= 0 && this <= 3R\fprojectRoles\x12\xbd\x01\n" + "\ftenant_roles\x18\x06 \x03(\v2=.metalstack.api.v2.TokenServiceCreateRequest.TenantRolesEntryB[\xbaHX\x9a\x01U\"\ar\x05\x10\x03\x18\x80\x01*J\xba\x01G\n" + - "\x0erole-specified\x12\x1dtenant role must be specified\x1a\x16this >= 0 && this <= 4R\vtenantRoles\x12J\n" + + "\x0erole-specified\x12\x1dtenant role must be specified\x1a\x16this >= 0 && this <= 4R\vtenantRoles\x12\xbe\x01\n" + + "\rmachine_roles\x18\a \x03(\v2>.metalstack.api.v2.TokenServiceCreateRequest.MachineRolesEntryBY\xbaHV\x9a\x01S\"\x05r\x03\xb0\x01\x01*J\xba\x01G\n" + + "\x0erole-specified\x12\x1dtenant role must be specified\x1a\x16this >= 0 && this <= 4R\fmachineRoles\x12\xba\x01\n" + + "\vinfra_roles\x18\b \x03(\v2<.metalstack.api.v2.TokenServiceCreateRequest.InfraRolesEntryB[\xbaHX\x9a\x01U\"\ar\x05\x10\x03\x18\x80\x01*J\xba\x01G\n" + + "\x0erole-specified\x12\x1dtenant role must be specified\x1a\x16this >= 0 && this <= 4R\n" + + "infraRoles\x12J\n" + "\n" + - "admin_role\x18\a \x01(\x0e2\x1c.metalstack.api.v2.AdminRoleB\b\xbaH\x05\x82\x01\x02\x10\x01H\x00R\tadminRole\x88\x01\x01\x1a_\n" + + "admin_role\x18\t \x01(\x0e2\x1c.metalstack.api.v2.AdminRoleB\b\xbaH\x05\x82\x01\x02\x10\x01H\x00R\tadminRole\x88\x01\x01\x1a_\n" + "\x11ProjectRolesEntry\x12\x10\n" + "\x03key\x18\x01 \x01(\tR\x03key\x124\n" + "\x05value\x18\x02 \x01(\x0e2\x1e.metalstack.api.v2.ProjectRoleR\x05value:\x028\x01\x1a]\n" + "\x10TenantRolesEntry\x12\x10\n" + "\x03key\x18\x01 \x01(\tR\x03key\x123\n" + - "\x05value\x18\x02 \x01(\x0e2\x1d.metalstack.api.v2.TenantRoleR\x05value:\x028\x01B\r\n" + + "\x05value\x18\x02 \x01(\x0e2\x1d.metalstack.api.v2.TenantRoleR\x05value:\x028\x01\x1a_\n" + + "\x11MachineRolesEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x124\n" + + "\x05value\x18\x02 \x01(\x0e2\x1e.metalstack.api.v2.MachineRoleR\x05value:\x028\x01\x1a[\n" + + "\x0fInfraRolesEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x122\n" + + "\x05value\x18\x02 \x01(\x0e2\x1c.metalstack.api.v2.InfraRoleR\x05value:\x028\x01B\r\n" + "\v_admin_role\"]\n" + "\x10MethodPermission\x12$\n" + "\asubject\x18\x01 \x01(\tB\n" + @@ -953,7 +1027,7 @@ const file_metalstack_api_v2_token_proto_rawDesc = "" + "\x06tokens\x18\x01 \x03(\v2\x18.metalstack.api.v2.TokenR\x06tokens\"9\n" + "\x19TokenServiceRevokeRequest\x12\x1c\n" + "\x04uuid\x18\x01 \x01(\tB\b\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\"\x1c\n" + - "\x1aTokenServiceRevokeResponse\"\xe2\x06\n" + + "\x1aTokenServiceRevokeResponse\"\x9e\v\n" + "\x19TokenServiceUpdateRequest\x12\x1c\n" + "\x04uuid\x18\x01 \x01(\tB\b\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x121\n" + "\vdescription\x18\x02 \x01(\tB\n" + @@ -962,15 +1036,26 @@ const file_metalstack_api_v2_token_proto_rawDesc = "" + "\rproject_roles\x18\x04 \x03(\v2>.metalstack.api.v2.TokenServiceUpdateRequest.ProjectRolesEntryB\\\xbaHY\x9a\x01V\"\ar\x05\x10\x03\x18\x80\x01*K\xba\x01H\n" + "\x0erole-specified\x12\x1eproject role must be specified\x1a\x16this >= 0 && this <= 3R\fprojectRoles\x12\xbd\x01\n" + "\ftenant_roles\x18\x05 \x03(\v2=.metalstack.api.v2.TokenServiceUpdateRequest.TenantRolesEntryB[\xbaHX\x9a\x01U\"\ar\x05\x10\x03\x18\x80\x01*J\xba\x01G\n" + - "\x0erole-specified\x12\x1dtenant role must be specified\x1a\x16this >= 0 && this <= 4R\vtenantRoles\x12J\n" + + "\x0erole-specified\x12\x1dtenant role must be specified\x1a\x16this >= 0 && this <= 4R\vtenantRoles\x12\xbe\x01\n" + + "\rmachine_roles\x18\x06 \x03(\v2>.metalstack.api.v2.TokenServiceUpdateRequest.MachineRolesEntryBY\xbaHV\x9a\x01S\"\x05r\x03\xb0\x01\x01*J\xba\x01G\n" + + "\x0erole-specified\x12\x1dtenant role must be specified\x1a\x16this >= 0 && this <= 4R\fmachineRoles\x12\xba\x01\n" + + "\vinfra_roles\x18\a \x03(\v2<.metalstack.api.v2.TokenServiceUpdateRequest.InfraRolesEntryB[\xbaHX\x9a\x01U\"\ar\x05\x10\x03\x18\x80\x01*J\xba\x01G\n" + + "\x0erole-specified\x12\x1dtenant role must be specified\x1a\x16this >= 0 && this <= 4R\n" + + "infraRoles\x12J\n" + "\n" + - "admin_role\x18\x06 \x01(\x0e2\x1c.metalstack.api.v2.AdminRoleB\b\xbaH\x05\x82\x01\x02\x10\x01H\x01R\tadminRole\x88\x01\x01\x1a_\n" + + "admin_role\x18\b \x01(\x0e2\x1c.metalstack.api.v2.AdminRoleB\b\xbaH\x05\x82\x01\x02\x10\x01H\x01R\tadminRole\x88\x01\x01\x1a_\n" + "\x11ProjectRolesEntry\x12\x10\n" + "\x03key\x18\x01 \x01(\tR\x03key\x124\n" + "\x05value\x18\x02 \x01(\x0e2\x1e.metalstack.api.v2.ProjectRoleR\x05value:\x028\x01\x1a]\n" + "\x10TenantRolesEntry\x12\x10\n" + "\x03key\x18\x01 \x01(\tR\x03key\x123\n" + - "\x05value\x18\x02 \x01(\x0e2\x1d.metalstack.api.v2.TenantRoleR\x05value:\x028\x01B\x0e\n" + + "\x05value\x18\x02 \x01(\x0e2\x1d.metalstack.api.v2.TenantRoleR\x05value:\x028\x01\x1a_\n" + + "\x11MachineRolesEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x124\n" + + "\x05value\x18\x02 \x01(\x0e2\x1e.metalstack.api.v2.MachineRoleR\x05value:\x028\x01\x1a[\n" + + "\x0fInfraRolesEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x122\n" + + "\x05value\x18\x02 \x01(\x0e2\x1c.metalstack.api.v2.InfraRoleR\x05value:\x028\x01B\x0e\n" + "\f_descriptionB\r\n" + "\v_admin_role\"L\n" + "\x1aTokenServiceUpdateResponse\x12.\n" + @@ -1010,7 +1095,7 @@ func file_metalstack_api_v2_token_proto_rawDescGZIP() []byte { } var file_metalstack_api_v2_token_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_metalstack_api_v2_token_proto_msgTypes = make([]protoimpl.MessageInfo, 20) +var file_metalstack_api_v2_token_proto_msgTypes = make([]protoimpl.MessageInfo, 26) var file_metalstack_api_v2_token_proto_goTypes = []any{ (TokenType)(0), // 0: metalstack.api.v2.TokenType (*Token)(nil), // 1: metalstack.api.v2.Token @@ -1029,61 +1114,81 @@ var file_metalstack_api_v2_token_proto_goTypes = []any{ (*TokenServiceRefreshResponse)(nil), // 14: metalstack.api.v2.TokenServiceRefreshResponse nil, // 15: metalstack.api.v2.Token.ProjectRolesEntry nil, // 16: metalstack.api.v2.Token.TenantRolesEntry - nil, // 17: metalstack.api.v2.TokenServiceCreateRequest.ProjectRolesEntry - nil, // 18: metalstack.api.v2.TokenServiceCreateRequest.TenantRolesEntry - nil, // 19: metalstack.api.v2.TokenServiceUpdateRequest.ProjectRolesEntry - nil, // 20: metalstack.api.v2.TokenServiceUpdateRequest.TenantRolesEntry - (*timestamppb.Timestamp)(nil), // 21: google.protobuf.Timestamp - (AdminRole)(0), // 22: metalstack.api.v2.AdminRole - (*durationpb.Duration)(nil), // 23: google.protobuf.Duration - (ProjectRole)(0), // 24: metalstack.api.v2.ProjectRole - (TenantRole)(0), // 25: metalstack.api.v2.TenantRole + nil, // 17: metalstack.api.v2.Token.MachineRolesEntry + nil, // 18: metalstack.api.v2.Token.InfraRolesEntry + nil, // 19: metalstack.api.v2.TokenServiceCreateRequest.ProjectRolesEntry + nil, // 20: metalstack.api.v2.TokenServiceCreateRequest.TenantRolesEntry + nil, // 21: metalstack.api.v2.TokenServiceCreateRequest.MachineRolesEntry + nil, // 22: metalstack.api.v2.TokenServiceCreateRequest.InfraRolesEntry + nil, // 23: metalstack.api.v2.TokenServiceUpdateRequest.ProjectRolesEntry + nil, // 24: metalstack.api.v2.TokenServiceUpdateRequest.TenantRolesEntry + nil, // 25: metalstack.api.v2.TokenServiceUpdateRequest.MachineRolesEntry + nil, // 26: metalstack.api.v2.TokenServiceUpdateRequest.InfraRolesEntry + (*timestamppb.Timestamp)(nil), // 27: google.protobuf.Timestamp + (AdminRole)(0), // 28: metalstack.api.v2.AdminRole + (*durationpb.Duration)(nil), // 29: google.protobuf.Duration + (ProjectRole)(0), // 30: metalstack.api.v2.ProjectRole + (TenantRole)(0), // 31: metalstack.api.v2.TenantRole + (MachineRole)(0), // 32: metalstack.api.v2.MachineRole + (InfraRole)(0), // 33: metalstack.api.v2.InfraRole } var file_metalstack_api_v2_token_proto_depIdxs = []int32{ 3, // 0: metalstack.api.v2.Token.permissions:type_name -> metalstack.api.v2.MethodPermission - 21, // 1: metalstack.api.v2.Token.expires:type_name -> google.protobuf.Timestamp - 21, // 2: metalstack.api.v2.Token.issued_at:type_name -> google.protobuf.Timestamp + 27, // 1: metalstack.api.v2.Token.expires:type_name -> google.protobuf.Timestamp + 27, // 2: metalstack.api.v2.Token.issued_at:type_name -> google.protobuf.Timestamp 0, // 3: metalstack.api.v2.Token.token_type:type_name -> metalstack.api.v2.TokenType 15, // 4: metalstack.api.v2.Token.project_roles:type_name -> metalstack.api.v2.Token.ProjectRolesEntry 16, // 5: metalstack.api.v2.Token.tenant_roles:type_name -> metalstack.api.v2.Token.TenantRolesEntry - 22, // 6: metalstack.api.v2.Token.admin_role:type_name -> metalstack.api.v2.AdminRole - 3, // 7: metalstack.api.v2.TokenServiceCreateRequest.permissions:type_name -> metalstack.api.v2.MethodPermission - 23, // 8: metalstack.api.v2.TokenServiceCreateRequest.expires:type_name -> google.protobuf.Duration - 17, // 9: metalstack.api.v2.TokenServiceCreateRequest.project_roles:type_name -> metalstack.api.v2.TokenServiceCreateRequest.ProjectRolesEntry - 18, // 10: metalstack.api.v2.TokenServiceCreateRequest.tenant_roles:type_name -> metalstack.api.v2.TokenServiceCreateRequest.TenantRolesEntry - 22, // 11: metalstack.api.v2.TokenServiceCreateRequest.admin_role:type_name -> metalstack.api.v2.AdminRole - 1, // 12: metalstack.api.v2.TokenServiceCreateResponse.token:type_name -> metalstack.api.v2.Token - 1, // 13: metalstack.api.v2.TokenServiceListResponse.tokens:type_name -> metalstack.api.v2.Token - 3, // 14: metalstack.api.v2.TokenServiceUpdateRequest.permissions:type_name -> metalstack.api.v2.MethodPermission - 19, // 15: metalstack.api.v2.TokenServiceUpdateRequest.project_roles:type_name -> metalstack.api.v2.TokenServiceUpdateRequest.ProjectRolesEntry - 20, // 16: metalstack.api.v2.TokenServiceUpdateRequest.tenant_roles:type_name -> metalstack.api.v2.TokenServiceUpdateRequest.TenantRolesEntry - 22, // 17: metalstack.api.v2.TokenServiceUpdateRequest.admin_role:type_name -> metalstack.api.v2.AdminRole - 1, // 18: metalstack.api.v2.TokenServiceUpdateResponse.token:type_name -> metalstack.api.v2.Token - 1, // 19: metalstack.api.v2.TokenServiceGetResponse.token:type_name -> metalstack.api.v2.Token - 1, // 20: metalstack.api.v2.TokenServiceRefreshResponse.token:type_name -> metalstack.api.v2.Token - 24, // 21: metalstack.api.v2.Token.ProjectRolesEntry.value:type_name -> metalstack.api.v2.ProjectRole - 25, // 22: metalstack.api.v2.Token.TenantRolesEntry.value:type_name -> metalstack.api.v2.TenantRole - 24, // 23: metalstack.api.v2.TokenServiceCreateRequest.ProjectRolesEntry.value:type_name -> metalstack.api.v2.ProjectRole - 25, // 24: metalstack.api.v2.TokenServiceCreateRequest.TenantRolesEntry.value:type_name -> metalstack.api.v2.TenantRole - 24, // 25: metalstack.api.v2.TokenServiceUpdateRequest.ProjectRolesEntry.value:type_name -> metalstack.api.v2.ProjectRole - 25, // 26: metalstack.api.v2.TokenServiceUpdateRequest.TenantRolesEntry.value:type_name -> metalstack.api.v2.TenantRole - 11, // 27: metalstack.api.v2.TokenService.Get:input_type -> metalstack.api.v2.TokenServiceGetRequest - 2, // 28: metalstack.api.v2.TokenService.Create:input_type -> metalstack.api.v2.TokenServiceCreateRequest - 9, // 29: metalstack.api.v2.TokenService.Update:input_type -> metalstack.api.v2.TokenServiceUpdateRequest - 5, // 30: metalstack.api.v2.TokenService.List:input_type -> metalstack.api.v2.TokenServiceListRequest - 7, // 31: metalstack.api.v2.TokenService.Revoke:input_type -> metalstack.api.v2.TokenServiceRevokeRequest - 13, // 32: metalstack.api.v2.TokenService.Refresh:input_type -> metalstack.api.v2.TokenServiceRefreshRequest - 12, // 33: metalstack.api.v2.TokenService.Get:output_type -> metalstack.api.v2.TokenServiceGetResponse - 4, // 34: metalstack.api.v2.TokenService.Create:output_type -> metalstack.api.v2.TokenServiceCreateResponse - 10, // 35: metalstack.api.v2.TokenService.Update:output_type -> metalstack.api.v2.TokenServiceUpdateResponse - 6, // 36: metalstack.api.v2.TokenService.List:output_type -> metalstack.api.v2.TokenServiceListResponse - 8, // 37: metalstack.api.v2.TokenService.Revoke:output_type -> metalstack.api.v2.TokenServiceRevokeResponse - 14, // 38: metalstack.api.v2.TokenService.Refresh:output_type -> metalstack.api.v2.TokenServiceRefreshResponse - 33, // [33:39] is the sub-list for method output_type - 27, // [27:33] is the sub-list for method input_type - 27, // [27:27] is the sub-list for extension type_name - 27, // [27:27] is the sub-list for extension extendee - 0, // [0:27] is the sub-list for field type_name + 17, // 6: metalstack.api.v2.Token.machine_roles:type_name -> metalstack.api.v2.Token.MachineRolesEntry + 18, // 7: metalstack.api.v2.Token.infra_roles:type_name -> metalstack.api.v2.Token.InfraRolesEntry + 28, // 8: metalstack.api.v2.Token.admin_role:type_name -> metalstack.api.v2.AdminRole + 3, // 9: metalstack.api.v2.TokenServiceCreateRequest.permissions:type_name -> metalstack.api.v2.MethodPermission + 29, // 10: metalstack.api.v2.TokenServiceCreateRequest.expires:type_name -> google.protobuf.Duration + 19, // 11: metalstack.api.v2.TokenServiceCreateRequest.project_roles:type_name -> metalstack.api.v2.TokenServiceCreateRequest.ProjectRolesEntry + 20, // 12: metalstack.api.v2.TokenServiceCreateRequest.tenant_roles:type_name -> metalstack.api.v2.TokenServiceCreateRequest.TenantRolesEntry + 21, // 13: metalstack.api.v2.TokenServiceCreateRequest.machine_roles:type_name -> metalstack.api.v2.TokenServiceCreateRequest.MachineRolesEntry + 22, // 14: metalstack.api.v2.TokenServiceCreateRequest.infra_roles:type_name -> metalstack.api.v2.TokenServiceCreateRequest.InfraRolesEntry + 28, // 15: metalstack.api.v2.TokenServiceCreateRequest.admin_role:type_name -> metalstack.api.v2.AdminRole + 1, // 16: metalstack.api.v2.TokenServiceCreateResponse.token:type_name -> metalstack.api.v2.Token + 1, // 17: metalstack.api.v2.TokenServiceListResponse.tokens:type_name -> metalstack.api.v2.Token + 3, // 18: metalstack.api.v2.TokenServiceUpdateRequest.permissions:type_name -> metalstack.api.v2.MethodPermission + 23, // 19: metalstack.api.v2.TokenServiceUpdateRequest.project_roles:type_name -> metalstack.api.v2.TokenServiceUpdateRequest.ProjectRolesEntry + 24, // 20: metalstack.api.v2.TokenServiceUpdateRequest.tenant_roles:type_name -> metalstack.api.v2.TokenServiceUpdateRequest.TenantRolesEntry + 25, // 21: metalstack.api.v2.TokenServiceUpdateRequest.machine_roles:type_name -> metalstack.api.v2.TokenServiceUpdateRequest.MachineRolesEntry + 26, // 22: metalstack.api.v2.TokenServiceUpdateRequest.infra_roles:type_name -> metalstack.api.v2.TokenServiceUpdateRequest.InfraRolesEntry + 28, // 23: metalstack.api.v2.TokenServiceUpdateRequest.admin_role:type_name -> metalstack.api.v2.AdminRole + 1, // 24: metalstack.api.v2.TokenServiceUpdateResponse.token:type_name -> metalstack.api.v2.Token + 1, // 25: metalstack.api.v2.TokenServiceGetResponse.token:type_name -> metalstack.api.v2.Token + 1, // 26: metalstack.api.v2.TokenServiceRefreshResponse.token:type_name -> metalstack.api.v2.Token + 30, // 27: metalstack.api.v2.Token.ProjectRolesEntry.value:type_name -> metalstack.api.v2.ProjectRole + 31, // 28: metalstack.api.v2.Token.TenantRolesEntry.value:type_name -> metalstack.api.v2.TenantRole + 32, // 29: metalstack.api.v2.Token.MachineRolesEntry.value:type_name -> metalstack.api.v2.MachineRole + 33, // 30: metalstack.api.v2.Token.InfraRolesEntry.value:type_name -> metalstack.api.v2.InfraRole + 30, // 31: metalstack.api.v2.TokenServiceCreateRequest.ProjectRolesEntry.value:type_name -> metalstack.api.v2.ProjectRole + 31, // 32: metalstack.api.v2.TokenServiceCreateRequest.TenantRolesEntry.value:type_name -> metalstack.api.v2.TenantRole + 32, // 33: metalstack.api.v2.TokenServiceCreateRequest.MachineRolesEntry.value:type_name -> metalstack.api.v2.MachineRole + 33, // 34: metalstack.api.v2.TokenServiceCreateRequest.InfraRolesEntry.value:type_name -> metalstack.api.v2.InfraRole + 30, // 35: metalstack.api.v2.TokenServiceUpdateRequest.ProjectRolesEntry.value:type_name -> metalstack.api.v2.ProjectRole + 31, // 36: metalstack.api.v2.TokenServiceUpdateRequest.TenantRolesEntry.value:type_name -> metalstack.api.v2.TenantRole + 32, // 37: metalstack.api.v2.TokenServiceUpdateRequest.MachineRolesEntry.value:type_name -> metalstack.api.v2.MachineRole + 33, // 38: metalstack.api.v2.TokenServiceUpdateRequest.InfraRolesEntry.value:type_name -> metalstack.api.v2.InfraRole + 11, // 39: metalstack.api.v2.TokenService.Get:input_type -> metalstack.api.v2.TokenServiceGetRequest + 2, // 40: metalstack.api.v2.TokenService.Create:input_type -> metalstack.api.v2.TokenServiceCreateRequest + 9, // 41: metalstack.api.v2.TokenService.Update:input_type -> metalstack.api.v2.TokenServiceUpdateRequest + 5, // 42: metalstack.api.v2.TokenService.List:input_type -> metalstack.api.v2.TokenServiceListRequest + 7, // 43: metalstack.api.v2.TokenService.Revoke:input_type -> metalstack.api.v2.TokenServiceRevokeRequest + 13, // 44: metalstack.api.v2.TokenService.Refresh:input_type -> metalstack.api.v2.TokenServiceRefreshRequest + 12, // 45: metalstack.api.v2.TokenService.Get:output_type -> metalstack.api.v2.TokenServiceGetResponse + 4, // 46: metalstack.api.v2.TokenService.Create:output_type -> metalstack.api.v2.TokenServiceCreateResponse + 10, // 47: metalstack.api.v2.TokenService.Update:output_type -> metalstack.api.v2.TokenServiceUpdateResponse + 6, // 48: metalstack.api.v2.TokenService.List:output_type -> metalstack.api.v2.TokenServiceListResponse + 8, // 49: metalstack.api.v2.TokenService.Revoke:output_type -> metalstack.api.v2.TokenServiceRevokeResponse + 14, // 50: metalstack.api.v2.TokenService.Refresh:output_type -> metalstack.api.v2.TokenServiceRefreshResponse + 45, // [45:51] is the sub-list for method output_type + 39, // [39:45] is the sub-list for method input_type + 39, // [39:39] is the sub-list for extension type_name + 39, // [39:39] is the sub-list for extension extendee + 0, // [0:39] is the sub-list for field type_name } func init() { file_metalstack_api_v2_token_proto_init() } @@ -1101,7 +1206,7 @@ func file_metalstack_api_v2_token_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_metalstack_api_v2_token_proto_rawDesc), len(file_metalstack_api_v2_token_proto_rawDesc)), NumEnums: 1, - NumMessages: 20, + NumMessages: 26, NumExtensions: 0, NumServices: 1, }, diff --git a/proto/metalstack/api/v2/token.proto b/proto/metalstack/api/v2/token.proto index a2747b70..2b250d59 100644 --- a/proto/metalstack/api/v2/token.proto +++ b/proto/metalstack/api/v2/token.proto @@ -61,8 +61,12 @@ message Token { map project_roles = 9; // TenantRoles associates a tenant id with the corresponding role of the token owner map tenant_roles = 10; + // MachineRoles associates a machine uuid with the corresponding role of the token owner + map machine_roles = 11; + // InfraRoles associates a infra service with the corresponding role of the token owner + map infra_roles = 12; // AdminRole defines the admin role of the token owner - optional AdminRole admin_role = 11 [(buf.validate.field).enum.defined_only = true]; + optional AdminRole admin_role = 13 [(buf.validate.field).enum.defined_only = true]; } // TokenType specifies different use cases of tokens @@ -121,8 +125,37 @@ message TokenServiceCreateRequest { } } }]; + // MachineRoles associates a machine uuid with the corresponding role of the token owner + map machine_roles = 7 [(buf.validate.field).map = { + keys: { + string: {uuid: true} + } + values: { + cel: { + id: "role-specified" + message: "tenant role must be specified" + expression: "this >= 0 && this <= 4" + } + } + }]; + // InfraRoles associates a infra service with the corresponding role of the token owner + map infra_roles = 8 [(buf.validate.field).map = { + keys: { + string: { + min_len: 3 + max_len: 128 + } + } + values: { + cel: { + id: "role-specified" + message: "tenant role must be specified" + expression: "this >= 0 && this <= 4" + } + } + }]; // AdminRole defines the admin role of the token owner - optional AdminRole admin_role = 7 [(buf.validate.field).enum.defined_only = true]; + optional AdminRole admin_role = 9 [(buf.validate.field).enum.defined_only = true]; } // MethodPermission is a mapping from a subject/project to a service method @@ -206,8 +239,37 @@ message TokenServiceUpdateRequest { } } }]; + // MachineRoles associates a machine uuid with the corresponding role of the token owner + map machine_roles = 6 [(buf.validate.field).map = { + keys: { + string: {uuid: true} + } + values: { + cel: { + id: "role-specified" + message: "tenant role must be specified" + expression: "this >= 0 && this <= 4" + } + } + }]; + // InfraRoles associates a infra service with the corresponding role of the token owner + map infra_roles = 7 [(buf.validate.field).map = { + keys: { + string: { + min_len: 3 + max_len: 128 + } + } + values: { + cel: { + id: "role-specified" + message: "tenant role must be specified" + expression: "this >= 0 && this <= 4" + } + } + }]; // AdminRole defines the admin role of the token owner - optional AdminRole admin_role = 6 [(buf.validate.field).enum.defined_only = true]; + optional AdminRole admin_role = 8 [(buf.validate.field).enum.defined_only = true]; } // TokenServiceUpdateResponse is the response payload of a token update request diff --git a/python/metalstack/api/v2/token_pb2.py b/python/metalstack/api/v2/token_pb2.py index 156df0f4..21b63815 100644 --- a/python/metalstack/api/v2/token_pb2.py +++ b/python/metalstack/api/v2/token_pb2.py @@ -28,7 +28,7 @@ from metalstack.api.v2 import common_pb2 as metalstack_dot_api_dot_v2_dot_common__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1dmetalstack/api/v2/token.proto\x12\x11metalstack.api.v2\x1a\x1b\x62uf/validate/validate.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1emetalstack/api/v2/common.proto\"\xb5\x06\n\x05Token\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12\x1e\n\x04user\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x04R\x04user\x12,\n\x0b\x64\x65scription\x18\x03 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x02R\x0b\x64\x65scription\x12P\n\x0bpermissions\x18\x04 \x03(\x0b\x32#.metalstack.api.v2.MethodPermissionB\t\xbaH\x06\x92\x01\x03\x10\xf4\x03R\x0bpermissions\x12\x34\n\x07\x65xpires\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x07\x65xpires\x12\x37\n\tissued_at\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x08issuedAt\x12\x45\n\ntoken_type\x18\x08 \x01(\x0e\x32\x1c.metalstack.api.v2.TokenTypeB\x08\xbaH\x05\x82\x01\x02\x10\x01R\ttokenType\x12O\n\rproject_roles\x18\t \x03(\x0b\x32*.metalstack.api.v2.Token.ProjectRolesEntryR\x0cprojectRoles\x12L\n\x0ctenant_roles\x18\n \x03(\x0b\x32).metalstack.api.v2.Token.TenantRolesEntryR\x0btenantRoles\x12J\n\nadmin_role\x18\x0b \x01(\x0e\x32\x1c.metalstack.api.v2.AdminRoleB\x08\xbaH\x05\x82\x01\x02\x10\x01H\x00R\tadminRole\x88\x01\x01\x1a_\n\x11ProjectRolesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x34\n\x05value\x18\x02 \x01(\x0e\x32\x1e.metalstack.api.v2.ProjectRoleR\x05value:\x02\x38\x01\x1a]\n\x10TenantRolesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x33\n\x05value\x18\x02 \x01(\x0e\x32\x1d.metalstack.api.v2.TenantRoleR\x05value:\x02\x38\x01\x42\r\n\x0b_admin_role\"\x82\x07\n\x19TokenServiceCreateRequest\x12,\n\x0b\x64\x65scription\x18\x01 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x02R\x0b\x64\x65scription\x12O\n\x0bpermissions\x18\x02 \x03(\x0b\x32#.metalstack.api.v2.MethodPermissionB\x08\xbaH\x05\x92\x01\x02\x10\x64R\x0bpermissions\x12G\n\x07\x65xpires\x18\x04 \x01(\x0b\x32\x19.google.protobuf.DurationB\x12\xbaH\x0f\xaa\x01\x0c\x1a\x05\x08\x81\xe7\x84\x0f\x32\x03\x08\xd8\x04R\x07\x65xpires\x12\xc1\x01\n\rproject_roles\x18\x05 \x03(\x0b\x32>.metalstack.api.v2.TokenServiceCreateRequest.ProjectRolesEntryB\\\xbaHY\x9a\x01V\"\x07r\x05\x10\x03\x18\x80\x01*K\xba\x01H\n\x0erole-specified\x12\x1eproject role must be specified\x1a\x16this >= 0 && this <= 3R\x0cprojectRoles\x12\xbd\x01\n\x0ctenant_roles\x18\x06 \x03(\x0b\x32=.metalstack.api.v2.TokenServiceCreateRequest.TenantRolesEntryB[\xbaHX\x9a\x01U\"\x07r\x05\x10\x03\x18\x80\x01*J\xba\x01G\n\x0erole-specified\x12\x1dtenant role must be specified\x1a\x16this >= 0 && this <= 4R\x0btenantRoles\x12J\n\nadmin_role\x18\x07 \x01(\x0e\x32\x1c.metalstack.api.v2.AdminRoleB\x08\xbaH\x05\x82\x01\x02\x10\x01H\x00R\tadminRole\x88\x01\x01\x1a_\n\x11ProjectRolesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x34\n\x05value\x18\x02 \x01(\x0e\x32\x1e.metalstack.api.v2.ProjectRoleR\x05value:\x02\x38\x01\x1a]\n\x10TenantRolesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x33\n\x05value\x18\x02 \x01(\x0e\x32\x1d.metalstack.api.v2.TenantRoleR\x05value:\x02\x38\x01\x42\r\n\x0b_admin_role\"]\n\x10MethodPermission\x12$\n\x07subject\x18\x01 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x02R\x07subject\x12#\n\x07methods\x18\x02 \x03(\tB\t\xbaH\x06\x92\x01\x03\x10\xf4\x03R\x07methods\"d\n\x1aTokenServiceCreateResponse\x12.\n\x05token\x18\x01 \x01(\x0b\x32\x18.metalstack.api.v2.TokenR\x05token\x12\x16\n\x06secret\x18\x02 \x01(\tR\x06secret\"\x19\n\x17TokenServiceListRequest\"L\n\x18TokenServiceListResponse\x12\x30\n\x06tokens\x18\x01 \x03(\x0b\x32\x18.metalstack.api.v2.TokenR\x06tokens\"9\n\x19TokenServiceRevokeRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\"\x1c\n\x1aTokenServiceRevokeResponse\"\xe2\x06\n\x19TokenServiceUpdateRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12\x31\n\x0b\x64\x65scription\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x02H\x00R\x0b\x64\x65scription\x88\x01\x01\x12\x45\n\x0bpermissions\x18\x03 \x03(\x0b\x32#.metalstack.api.v2.MethodPermissionR\x0bpermissions\x12\xc1\x01\n\rproject_roles\x18\x04 \x03(\x0b\x32>.metalstack.api.v2.TokenServiceUpdateRequest.ProjectRolesEntryB\\\xbaHY\x9a\x01V\"\x07r\x05\x10\x03\x18\x80\x01*K\xba\x01H\n\x0erole-specified\x12\x1eproject role must be specified\x1a\x16this >= 0 && this <= 3R\x0cprojectRoles\x12\xbd\x01\n\x0ctenant_roles\x18\x05 \x03(\x0b\x32=.metalstack.api.v2.TokenServiceUpdateRequest.TenantRolesEntryB[\xbaHX\x9a\x01U\"\x07r\x05\x10\x03\x18\x80\x01*J\xba\x01G\n\x0erole-specified\x12\x1dtenant role must be specified\x1a\x16this >= 0 && this <= 4R\x0btenantRoles\x12J\n\nadmin_role\x18\x06 \x01(\x0e\x32\x1c.metalstack.api.v2.AdminRoleB\x08\xbaH\x05\x82\x01\x02\x10\x01H\x01R\tadminRole\x88\x01\x01\x1a_\n\x11ProjectRolesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x34\n\x05value\x18\x02 \x01(\x0e\x32\x1e.metalstack.api.v2.ProjectRoleR\x05value:\x02\x38\x01\x1a]\n\x10TenantRolesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x33\n\x05value\x18\x02 \x01(\x0e\x32\x1d.metalstack.api.v2.TenantRoleR\x05value:\x02\x38\x01\x42\x0e\n\x0c_descriptionB\r\n\x0b_admin_role\"L\n\x1aTokenServiceUpdateResponse\x12.\n\x05token\x18\x01 \x01(\x0b\x32\x18.metalstack.api.v2.TokenR\x05token\"6\n\x16TokenServiceGetRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\"I\n\x17TokenServiceGetResponse\x12.\n\x05token\x18\x01 \x01(\x0b\x32\x18.metalstack.api.v2.TokenR\x05token\"\x1c\n\x1aTokenServiceRefreshRequest\"e\n\x1bTokenServiceRefreshResponse\x12.\n\x05token\x18\x01 \x01(\x0b\x32\x18.metalstack.api.v2.TokenR\x05token\x12\x16\n\x06secret\x18\x02 \x01(\tR\x06secret*S\n\tTokenType\x12\x1a\n\x16TOKEN_TYPE_UNSPECIFIED\x10\x00\x12\x12\n\x0eTOKEN_TYPE_API\x10\x01\x12\x16\n\x12TOKEN_TYPE_CONSOLE\x10\x02\x32\x90\x05\n\x0cTokenService\x12\x62\n\x03Get\x12).metalstack.api.v2.TokenServiceGetRequest\x1a*.metalstack.api.v2.TokenServiceGetResponse\"\x04\xd8\xf3\x18\x03\x12k\n\x06\x43reate\x12,.metalstack.api.v2.TokenServiceCreateRequest\x1a-.metalstack.api.v2.TokenServiceCreateResponse\"\x04\xd8\xf3\x18\x03\x12k\n\x06Update\x12,.metalstack.api.v2.TokenServiceUpdateRequest\x1a-.metalstack.api.v2.TokenServiceUpdateResponse\"\x04\xd8\xf3\x18\x03\x12\x65\n\x04List\x12*.metalstack.api.v2.TokenServiceListRequest\x1a+.metalstack.api.v2.TokenServiceListResponse\"\x04\xd8\xf3\x18\x03\x12k\n\x06Revoke\x12,.metalstack.api.v2.TokenServiceRevokeRequest\x1a-.metalstack.api.v2.TokenServiceRevokeResponse\"\x04\xd8\xf3\x18\x03\x12n\n\x07Refresh\x12-.metalstack.api.v2.TokenServiceRefreshRequest\x1a..metalstack.api.v2.TokenServiceRefreshResponse\"\x04\xd8\xf3\x18\x03\x42\xc0\x01\n\x15\x63om.metalstack.api.v2B\nTokenProtoP\x01Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\xa2\x02\x03MAX\xaa\x02\x11Metalstack.Api.V2\xca\x02\x11Metalstack\\Api\\V2\xe2\x02\x1dMetalstack\\Api\\V2\\GPBMetadata\xea\x02\x13Metalstack::Api::V2b\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1dmetalstack/api/v2/token.proto\x12\x11metalstack.api.v2\x1a\x1b\x62uf/validate/validate.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1emetalstack/api/v2/common.proto\"\x8f\t\n\x05Token\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12\x1e\n\x04user\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x04R\x04user\x12,\n\x0b\x64\x65scription\x18\x03 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x02R\x0b\x64\x65scription\x12P\n\x0bpermissions\x18\x04 \x03(\x0b\x32#.metalstack.api.v2.MethodPermissionB\t\xbaH\x06\x92\x01\x03\x10\xf4\x03R\x0bpermissions\x12\x34\n\x07\x65xpires\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x07\x65xpires\x12\x37\n\tissued_at\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x08issuedAt\x12\x45\n\ntoken_type\x18\x08 \x01(\x0e\x32\x1c.metalstack.api.v2.TokenTypeB\x08\xbaH\x05\x82\x01\x02\x10\x01R\ttokenType\x12O\n\rproject_roles\x18\t \x03(\x0b\x32*.metalstack.api.v2.Token.ProjectRolesEntryR\x0cprojectRoles\x12L\n\x0ctenant_roles\x18\n \x03(\x0b\x32).metalstack.api.v2.Token.TenantRolesEntryR\x0btenantRoles\x12O\n\rmachine_roles\x18\x0b \x03(\x0b\x32*.metalstack.api.v2.Token.MachineRolesEntryR\x0cmachineRoles\x12I\n\x0binfra_roles\x18\x0c \x03(\x0b\x32(.metalstack.api.v2.Token.InfraRolesEntryR\ninfraRoles\x12J\n\nadmin_role\x18\r \x01(\x0e\x32\x1c.metalstack.api.v2.AdminRoleB\x08\xbaH\x05\x82\x01\x02\x10\x01H\x00R\tadminRole\x88\x01\x01\x1a_\n\x11ProjectRolesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x34\n\x05value\x18\x02 \x01(\x0e\x32\x1e.metalstack.api.v2.ProjectRoleR\x05value:\x02\x38\x01\x1a]\n\x10TenantRolesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x33\n\x05value\x18\x02 \x01(\x0e\x32\x1d.metalstack.api.v2.TenantRoleR\x05value:\x02\x38\x01\x1a_\n\x11MachineRolesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x34\n\x05value\x18\x02 \x01(\x0e\x32\x1e.metalstack.api.v2.MachineRoleR\x05value:\x02\x38\x01\x1a[\n\x0fInfraRolesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x32\n\x05value\x18\x02 \x01(\x0e\x32\x1c.metalstack.api.v2.InfraRoleR\x05value:\x02\x38\x01\x42\r\n\x0b_admin_role\"\xbe\x0b\n\x19TokenServiceCreateRequest\x12,\n\x0b\x64\x65scription\x18\x01 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x02R\x0b\x64\x65scription\x12O\n\x0bpermissions\x18\x02 \x03(\x0b\x32#.metalstack.api.v2.MethodPermissionB\x08\xbaH\x05\x92\x01\x02\x10\x64R\x0bpermissions\x12G\n\x07\x65xpires\x18\x04 \x01(\x0b\x32\x19.google.protobuf.DurationB\x12\xbaH\x0f\xaa\x01\x0c\x1a\x05\x08\x81\xe7\x84\x0f\x32\x03\x08\xd8\x04R\x07\x65xpires\x12\xc1\x01\n\rproject_roles\x18\x05 \x03(\x0b\x32>.metalstack.api.v2.TokenServiceCreateRequest.ProjectRolesEntryB\\\xbaHY\x9a\x01V\"\x07r\x05\x10\x03\x18\x80\x01*K\xba\x01H\n\x0erole-specified\x12\x1eproject role must be specified\x1a\x16this >= 0 && this <= 3R\x0cprojectRoles\x12\xbd\x01\n\x0ctenant_roles\x18\x06 \x03(\x0b\x32=.metalstack.api.v2.TokenServiceCreateRequest.TenantRolesEntryB[\xbaHX\x9a\x01U\"\x07r\x05\x10\x03\x18\x80\x01*J\xba\x01G\n\x0erole-specified\x12\x1dtenant role must be specified\x1a\x16this >= 0 && this <= 4R\x0btenantRoles\x12\xbe\x01\n\rmachine_roles\x18\x07 \x03(\x0b\x32>.metalstack.api.v2.TokenServiceCreateRequest.MachineRolesEntryBY\xbaHV\x9a\x01S\"\x05r\x03\xb0\x01\x01*J\xba\x01G\n\x0erole-specified\x12\x1dtenant role must be specified\x1a\x16this >= 0 && this <= 4R\x0cmachineRoles\x12\xba\x01\n\x0binfra_roles\x18\x08 \x03(\x0b\x32<.metalstack.api.v2.TokenServiceCreateRequest.InfraRolesEntryB[\xbaHX\x9a\x01U\"\x07r\x05\x10\x03\x18\x80\x01*J\xba\x01G\n\x0erole-specified\x12\x1dtenant role must be specified\x1a\x16this >= 0 && this <= 4R\ninfraRoles\x12J\n\nadmin_role\x18\t \x01(\x0e\x32\x1c.metalstack.api.v2.AdminRoleB\x08\xbaH\x05\x82\x01\x02\x10\x01H\x00R\tadminRole\x88\x01\x01\x1a_\n\x11ProjectRolesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x34\n\x05value\x18\x02 \x01(\x0e\x32\x1e.metalstack.api.v2.ProjectRoleR\x05value:\x02\x38\x01\x1a]\n\x10TenantRolesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x33\n\x05value\x18\x02 \x01(\x0e\x32\x1d.metalstack.api.v2.TenantRoleR\x05value:\x02\x38\x01\x1a_\n\x11MachineRolesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x34\n\x05value\x18\x02 \x01(\x0e\x32\x1e.metalstack.api.v2.MachineRoleR\x05value:\x02\x38\x01\x1a[\n\x0fInfraRolesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x32\n\x05value\x18\x02 \x01(\x0e\x32\x1c.metalstack.api.v2.InfraRoleR\x05value:\x02\x38\x01\x42\r\n\x0b_admin_role\"]\n\x10MethodPermission\x12$\n\x07subject\x18\x01 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x02R\x07subject\x12#\n\x07methods\x18\x02 \x03(\tB\t\xbaH\x06\x92\x01\x03\x10\xf4\x03R\x07methods\"d\n\x1aTokenServiceCreateResponse\x12.\n\x05token\x18\x01 \x01(\x0b\x32\x18.metalstack.api.v2.TokenR\x05token\x12\x16\n\x06secret\x18\x02 \x01(\tR\x06secret\"\x19\n\x17TokenServiceListRequest\"L\n\x18TokenServiceListResponse\x12\x30\n\x06tokens\x18\x01 \x03(\x0b\x32\x18.metalstack.api.v2.TokenR\x06tokens\"9\n\x19TokenServiceRevokeRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\"\x1c\n\x1aTokenServiceRevokeResponse\"\x9e\x0b\n\x19TokenServiceUpdateRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12\x31\n\x0b\x64\x65scription\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x02H\x00R\x0b\x64\x65scription\x88\x01\x01\x12\x45\n\x0bpermissions\x18\x03 \x03(\x0b\x32#.metalstack.api.v2.MethodPermissionR\x0bpermissions\x12\xc1\x01\n\rproject_roles\x18\x04 \x03(\x0b\x32>.metalstack.api.v2.TokenServiceUpdateRequest.ProjectRolesEntryB\\\xbaHY\x9a\x01V\"\x07r\x05\x10\x03\x18\x80\x01*K\xba\x01H\n\x0erole-specified\x12\x1eproject role must be specified\x1a\x16this >= 0 && this <= 3R\x0cprojectRoles\x12\xbd\x01\n\x0ctenant_roles\x18\x05 \x03(\x0b\x32=.metalstack.api.v2.TokenServiceUpdateRequest.TenantRolesEntryB[\xbaHX\x9a\x01U\"\x07r\x05\x10\x03\x18\x80\x01*J\xba\x01G\n\x0erole-specified\x12\x1dtenant role must be specified\x1a\x16this >= 0 && this <= 4R\x0btenantRoles\x12\xbe\x01\n\rmachine_roles\x18\x06 \x03(\x0b\x32>.metalstack.api.v2.TokenServiceUpdateRequest.MachineRolesEntryBY\xbaHV\x9a\x01S\"\x05r\x03\xb0\x01\x01*J\xba\x01G\n\x0erole-specified\x12\x1dtenant role must be specified\x1a\x16this >= 0 && this <= 4R\x0cmachineRoles\x12\xba\x01\n\x0binfra_roles\x18\x07 \x03(\x0b\x32<.metalstack.api.v2.TokenServiceUpdateRequest.InfraRolesEntryB[\xbaHX\x9a\x01U\"\x07r\x05\x10\x03\x18\x80\x01*J\xba\x01G\n\x0erole-specified\x12\x1dtenant role must be specified\x1a\x16this >= 0 && this <= 4R\ninfraRoles\x12J\n\nadmin_role\x18\x08 \x01(\x0e\x32\x1c.metalstack.api.v2.AdminRoleB\x08\xbaH\x05\x82\x01\x02\x10\x01H\x01R\tadminRole\x88\x01\x01\x1a_\n\x11ProjectRolesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x34\n\x05value\x18\x02 \x01(\x0e\x32\x1e.metalstack.api.v2.ProjectRoleR\x05value:\x02\x38\x01\x1a]\n\x10TenantRolesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x33\n\x05value\x18\x02 \x01(\x0e\x32\x1d.metalstack.api.v2.TenantRoleR\x05value:\x02\x38\x01\x1a_\n\x11MachineRolesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x34\n\x05value\x18\x02 \x01(\x0e\x32\x1e.metalstack.api.v2.MachineRoleR\x05value:\x02\x38\x01\x1a[\n\x0fInfraRolesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x32\n\x05value\x18\x02 \x01(\x0e\x32\x1c.metalstack.api.v2.InfraRoleR\x05value:\x02\x38\x01\x42\x0e\n\x0c_descriptionB\r\n\x0b_admin_role\"L\n\x1aTokenServiceUpdateResponse\x12.\n\x05token\x18\x01 \x01(\x0b\x32\x18.metalstack.api.v2.TokenR\x05token\"6\n\x16TokenServiceGetRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\"I\n\x17TokenServiceGetResponse\x12.\n\x05token\x18\x01 \x01(\x0b\x32\x18.metalstack.api.v2.TokenR\x05token\"\x1c\n\x1aTokenServiceRefreshRequest\"e\n\x1bTokenServiceRefreshResponse\x12.\n\x05token\x18\x01 \x01(\x0b\x32\x18.metalstack.api.v2.TokenR\x05token\x12\x16\n\x06secret\x18\x02 \x01(\tR\x06secret*S\n\tTokenType\x12\x1a\n\x16TOKEN_TYPE_UNSPECIFIED\x10\x00\x12\x12\n\x0eTOKEN_TYPE_API\x10\x01\x12\x16\n\x12TOKEN_TYPE_CONSOLE\x10\x02\x32\x90\x05\n\x0cTokenService\x12\x62\n\x03Get\x12).metalstack.api.v2.TokenServiceGetRequest\x1a*.metalstack.api.v2.TokenServiceGetResponse\"\x04\xd8\xf3\x18\x03\x12k\n\x06\x43reate\x12,.metalstack.api.v2.TokenServiceCreateRequest\x1a-.metalstack.api.v2.TokenServiceCreateResponse\"\x04\xd8\xf3\x18\x03\x12k\n\x06Update\x12,.metalstack.api.v2.TokenServiceUpdateRequest\x1a-.metalstack.api.v2.TokenServiceUpdateResponse\"\x04\xd8\xf3\x18\x03\x12\x65\n\x04List\x12*.metalstack.api.v2.TokenServiceListRequest\x1a+.metalstack.api.v2.TokenServiceListResponse\"\x04\xd8\xf3\x18\x03\x12k\n\x06Revoke\x12,.metalstack.api.v2.TokenServiceRevokeRequest\x1a-.metalstack.api.v2.TokenServiceRevokeResponse\"\x04\xd8\xf3\x18\x03\x12n\n\x07Refresh\x12-.metalstack.api.v2.TokenServiceRefreshRequest\x1a..metalstack.api.v2.TokenServiceRefreshResponse\"\x04\xd8\xf3\x18\x03\x42\xc0\x01\n\x15\x63om.metalstack.api.v2B\nTokenProtoP\x01Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\xa2\x02\x03MAX\xaa\x02\x11Metalstack.Api.V2\xca\x02\x11Metalstack\\Api\\V2\xe2\x02\x1dMetalstack\\Api\\V2\\GPBMetadata\xea\x02\x13Metalstack::Api::V2b\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -40,6 +40,10 @@ _globals['_TOKEN_PROJECTROLESENTRY']._serialized_options = b'8\001' _globals['_TOKEN_TENANTROLESENTRY']._loaded_options = None _globals['_TOKEN_TENANTROLESENTRY']._serialized_options = b'8\001' + _globals['_TOKEN_MACHINEROLESENTRY']._loaded_options = None + _globals['_TOKEN_MACHINEROLESENTRY']._serialized_options = b'8\001' + _globals['_TOKEN_INFRAROLESENTRY']._loaded_options = None + _globals['_TOKEN_INFRAROLESENTRY']._serialized_options = b'8\001' _globals['_TOKEN'].fields_by_name['uuid']._loaded_options = None _globals['_TOKEN'].fields_by_name['uuid']._serialized_options = b'\272H\005r\003\260\001\001' _globals['_TOKEN'].fields_by_name['user']._loaded_options = None @@ -56,6 +60,10 @@ _globals['_TOKENSERVICECREATEREQUEST_PROJECTROLESENTRY']._serialized_options = b'8\001' _globals['_TOKENSERVICECREATEREQUEST_TENANTROLESENTRY']._loaded_options = None _globals['_TOKENSERVICECREATEREQUEST_TENANTROLESENTRY']._serialized_options = b'8\001' + _globals['_TOKENSERVICECREATEREQUEST_MACHINEROLESENTRY']._loaded_options = None + _globals['_TOKENSERVICECREATEREQUEST_MACHINEROLESENTRY']._serialized_options = b'8\001' + _globals['_TOKENSERVICECREATEREQUEST_INFRAROLESENTRY']._loaded_options = None + _globals['_TOKENSERVICECREATEREQUEST_INFRAROLESENTRY']._serialized_options = b'8\001' _globals['_TOKENSERVICECREATEREQUEST'].fields_by_name['description']._loaded_options = None _globals['_TOKENSERVICECREATEREQUEST'].fields_by_name['description']._serialized_options = b'\272H\007r\005\020\002\030\200\002' _globals['_TOKENSERVICECREATEREQUEST'].fields_by_name['permissions']._loaded_options = None @@ -66,6 +74,10 @@ _globals['_TOKENSERVICECREATEREQUEST'].fields_by_name['project_roles']._serialized_options = b'\272HY\232\001V\"\007r\005\020\003\030\200\001*K\272\001H\n\016role-specified\022\036project role must be specified\032\026this >= 0 && this <= 3' _globals['_TOKENSERVICECREATEREQUEST'].fields_by_name['tenant_roles']._loaded_options = None _globals['_TOKENSERVICECREATEREQUEST'].fields_by_name['tenant_roles']._serialized_options = b'\272HX\232\001U\"\007r\005\020\003\030\200\001*J\272\001G\n\016role-specified\022\035tenant role must be specified\032\026this >= 0 && this <= 4' + _globals['_TOKENSERVICECREATEREQUEST'].fields_by_name['machine_roles']._loaded_options = None + _globals['_TOKENSERVICECREATEREQUEST'].fields_by_name['machine_roles']._serialized_options = b'\272HV\232\001S\"\005r\003\260\001\001*J\272\001G\n\016role-specified\022\035tenant role must be specified\032\026this >= 0 && this <= 4' + _globals['_TOKENSERVICECREATEREQUEST'].fields_by_name['infra_roles']._loaded_options = None + _globals['_TOKENSERVICECREATEREQUEST'].fields_by_name['infra_roles']._serialized_options = b'\272HX\232\001U\"\007r\005\020\003\030\200\001*J\272\001G\n\016role-specified\022\035tenant role must be specified\032\026this >= 0 && this <= 4' _globals['_TOKENSERVICECREATEREQUEST'].fields_by_name['admin_role']._loaded_options = None _globals['_TOKENSERVICECREATEREQUEST'].fields_by_name['admin_role']._serialized_options = b'\272H\005\202\001\002\020\001' _globals['_METHODPERMISSION'].fields_by_name['subject']._loaded_options = None @@ -78,6 +90,10 @@ _globals['_TOKENSERVICEUPDATEREQUEST_PROJECTROLESENTRY']._serialized_options = b'8\001' _globals['_TOKENSERVICEUPDATEREQUEST_TENANTROLESENTRY']._loaded_options = None _globals['_TOKENSERVICEUPDATEREQUEST_TENANTROLESENTRY']._serialized_options = b'8\001' + _globals['_TOKENSERVICEUPDATEREQUEST_MACHINEROLESENTRY']._loaded_options = None + _globals['_TOKENSERVICEUPDATEREQUEST_MACHINEROLESENTRY']._serialized_options = b'8\001' + _globals['_TOKENSERVICEUPDATEREQUEST_INFRAROLESENTRY']._loaded_options = None + _globals['_TOKENSERVICEUPDATEREQUEST_INFRAROLESENTRY']._serialized_options = b'8\001' _globals['_TOKENSERVICEUPDATEREQUEST'].fields_by_name['uuid']._loaded_options = None _globals['_TOKENSERVICEUPDATEREQUEST'].fields_by_name['uuid']._serialized_options = b'\272H\005r\003\260\001\001' _globals['_TOKENSERVICEUPDATEREQUEST'].fields_by_name['description']._loaded_options = None @@ -86,6 +102,10 @@ _globals['_TOKENSERVICEUPDATEREQUEST'].fields_by_name['project_roles']._serialized_options = b'\272HY\232\001V\"\007r\005\020\003\030\200\001*K\272\001H\n\016role-specified\022\036project role must be specified\032\026this >= 0 && this <= 3' _globals['_TOKENSERVICEUPDATEREQUEST'].fields_by_name['tenant_roles']._loaded_options = None _globals['_TOKENSERVICEUPDATEREQUEST'].fields_by_name['tenant_roles']._serialized_options = b'\272HX\232\001U\"\007r\005\020\003\030\200\001*J\272\001G\n\016role-specified\022\035tenant role must be specified\032\026this >= 0 && this <= 4' + _globals['_TOKENSERVICEUPDATEREQUEST'].fields_by_name['machine_roles']._loaded_options = None + _globals['_TOKENSERVICEUPDATEREQUEST'].fields_by_name['machine_roles']._serialized_options = b'\272HV\232\001S\"\005r\003\260\001\001*J\272\001G\n\016role-specified\022\035tenant role must be specified\032\026this >= 0 && this <= 4' + _globals['_TOKENSERVICEUPDATEREQUEST'].fields_by_name['infra_roles']._loaded_options = None + _globals['_TOKENSERVICEUPDATEREQUEST'].fields_by_name['infra_roles']._serialized_options = b'\272HX\232\001U\"\007r\005\020\003\030\200\001*J\272\001G\n\016role-specified\022\035tenant role must be specified\032\026this >= 0 && this <= 4' _globals['_TOKENSERVICEUPDATEREQUEST'].fields_by_name['admin_role']._loaded_options = None _globals['_TOKENSERVICEUPDATEREQUEST'].fields_by_name['admin_role']._serialized_options = b'\272H\005\202\001\002\020\001' _globals['_TOKENSERVICEGETREQUEST'].fields_by_name['uuid']._loaded_options = None @@ -102,48 +122,60 @@ _globals['_TOKENSERVICE'].methods_by_name['Revoke']._serialized_options = b'\330\363\030\003' _globals['_TOKENSERVICE'].methods_by_name['Refresh']._loaded_options = None _globals['_TOKENSERVICE'].methods_by_name['Refresh']._serialized_options = b'\330\363\030\003' - _globals['_TOKENTYPE']._serialized_start=3505 - _globals['_TOKENTYPE']._serialized_end=3588 + _globals['_TOKENTYPE']._serialized_start=4995 + _globals['_TOKENTYPE']._serialized_end=5078 _globals['_TOKEN']._serialized_start=179 - _globals['_TOKEN']._serialized_end=1000 - _globals['_TOKEN_PROJECTROLESENTRY']._serialized_start=795 - _globals['_TOKEN_PROJECTROLESENTRY']._serialized_end=890 - _globals['_TOKEN_TENANTROLESENTRY']._serialized_start=892 - _globals['_TOKEN_TENANTROLESENTRY']._serialized_end=985 - _globals['_TOKENSERVICECREATEREQUEST']._serialized_start=1003 - _globals['_TOKENSERVICECREATEREQUEST']._serialized_end=1901 - _globals['_TOKENSERVICECREATEREQUEST_PROJECTROLESENTRY']._serialized_start=795 - _globals['_TOKENSERVICECREATEREQUEST_PROJECTROLESENTRY']._serialized_end=890 - _globals['_TOKENSERVICECREATEREQUEST_TENANTROLESENTRY']._serialized_start=892 - _globals['_TOKENSERVICECREATEREQUEST_TENANTROLESENTRY']._serialized_end=985 - _globals['_METHODPERMISSION']._serialized_start=1903 - _globals['_METHODPERMISSION']._serialized_end=1996 - _globals['_TOKENSERVICECREATERESPONSE']._serialized_start=1998 - _globals['_TOKENSERVICECREATERESPONSE']._serialized_end=2098 - _globals['_TOKENSERVICELISTREQUEST']._serialized_start=2100 - _globals['_TOKENSERVICELISTREQUEST']._serialized_end=2125 - _globals['_TOKENSERVICELISTRESPONSE']._serialized_start=2127 - _globals['_TOKENSERVICELISTRESPONSE']._serialized_end=2203 - _globals['_TOKENSERVICEREVOKEREQUEST']._serialized_start=2205 - _globals['_TOKENSERVICEREVOKEREQUEST']._serialized_end=2262 - _globals['_TOKENSERVICEREVOKERESPONSE']._serialized_start=2264 - _globals['_TOKENSERVICEREVOKERESPONSE']._serialized_end=2292 - _globals['_TOKENSERVICEUPDATEREQUEST']._serialized_start=2295 - _globals['_TOKENSERVICEUPDATEREQUEST']._serialized_end=3161 - _globals['_TOKENSERVICEUPDATEREQUEST_PROJECTROLESENTRY']._serialized_start=795 - _globals['_TOKENSERVICEUPDATEREQUEST_PROJECTROLESENTRY']._serialized_end=890 - _globals['_TOKENSERVICEUPDATEREQUEST_TENANTROLESENTRY']._serialized_start=892 - _globals['_TOKENSERVICEUPDATEREQUEST_TENANTROLESENTRY']._serialized_end=985 - _globals['_TOKENSERVICEUPDATERESPONSE']._serialized_start=3163 - _globals['_TOKENSERVICEUPDATERESPONSE']._serialized_end=3239 - _globals['_TOKENSERVICEGETREQUEST']._serialized_start=3241 - _globals['_TOKENSERVICEGETREQUEST']._serialized_end=3295 - _globals['_TOKENSERVICEGETRESPONSE']._serialized_start=3297 - _globals['_TOKENSERVICEGETRESPONSE']._serialized_end=3370 - _globals['_TOKENSERVICEREFRESHREQUEST']._serialized_start=3372 - _globals['_TOKENSERVICEREFRESHREQUEST']._serialized_end=3400 - _globals['_TOKENSERVICEREFRESHRESPONSE']._serialized_start=3402 - _globals['_TOKENSERVICEREFRESHRESPONSE']._serialized_end=3503 - _globals['_TOKENSERVICE']._serialized_start=3591 - _globals['_TOKENSERVICE']._serialized_end=4247 + _globals['_TOKEN']._serialized_end=1346 + _globals['_TOKEN_PROJECTROLESENTRY']._serialized_start=951 + _globals['_TOKEN_PROJECTROLESENTRY']._serialized_end=1046 + _globals['_TOKEN_TENANTROLESENTRY']._serialized_start=1048 + _globals['_TOKEN_TENANTROLESENTRY']._serialized_end=1141 + _globals['_TOKEN_MACHINEROLESENTRY']._serialized_start=1143 + _globals['_TOKEN_MACHINEROLESENTRY']._serialized_end=1238 + _globals['_TOKEN_INFRAROLESENTRY']._serialized_start=1240 + _globals['_TOKEN_INFRAROLESENTRY']._serialized_end=1331 + _globals['_TOKENSERVICECREATEREQUEST']._serialized_start=1349 + _globals['_TOKENSERVICECREATEREQUEST']._serialized_end=2819 + _globals['_TOKENSERVICECREATEREQUEST_PROJECTROLESENTRY']._serialized_start=951 + _globals['_TOKENSERVICECREATEREQUEST_PROJECTROLESENTRY']._serialized_end=1046 + _globals['_TOKENSERVICECREATEREQUEST_TENANTROLESENTRY']._serialized_start=1048 + _globals['_TOKENSERVICECREATEREQUEST_TENANTROLESENTRY']._serialized_end=1141 + _globals['_TOKENSERVICECREATEREQUEST_MACHINEROLESENTRY']._serialized_start=1143 + _globals['_TOKENSERVICECREATEREQUEST_MACHINEROLESENTRY']._serialized_end=1238 + _globals['_TOKENSERVICECREATEREQUEST_INFRAROLESENTRY']._serialized_start=1240 + _globals['_TOKENSERVICECREATEREQUEST_INFRAROLESENTRY']._serialized_end=1331 + _globals['_METHODPERMISSION']._serialized_start=2821 + _globals['_METHODPERMISSION']._serialized_end=2914 + _globals['_TOKENSERVICECREATERESPONSE']._serialized_start=2916 + _globals['_TOKENSERVICECREATERESPONSE']._serialized_end=3016 + _globals['_TOKENSERVICELISTREQUEST']._serialized_start=3018 + _globals['_TOKENSERVICELISTREQUEST']._serialized_end=3043 + _globals['_TOKENSERVICELISTRESPONSE']._serialized_start=3045 + _globals['_TOKENSERVICELISTRESPONSE']._serialized_end=3121 + _globals['_TOKENSERVICEREVOKEREQUEST']._serialized_start=3123 + _globals['_TOKENSERVICEREVOKEREQUEST']._serialized_end=3180 + _globals['_TOKENSERVICEREVOKERESPONSE']._serialized_start=3182 + _globals['_TOKENSERVICEREVOKERESPONSE']._serialized_end=3210 + _globals['_TOKENSERVICEUPDATEREQUEST']._serialized_start=3213 + _globals['_TOKENSERVICEUPDATEREQUEST']._serialized_end=4651 + _globals['_TOKENSERVICEUPDATEREQUEST_PROJECTROLESENTRY']._serialized_start=951 + _globals['_TOKENSERVICEUPDATEREQUEST_PROJECTROLESENTRY']._serialized_end=1046 + _globals['_TOKENSERVICEUPDATEREQUEST_TENANTROLESENTRY']._serialized_start=1048 + _globals['_TOKENSERVICEUPDATEREQUEST_TENANTROLESENTRY']._serialized_end=1141 + _globals['_TOKENSERVICEUPDATEREQUEST_MACHINEROLESENTRY']._serialized_start=1143 + _globals['_TOKENSERVICEUPDATEREQUEST_MACHINEROLESENTRY']._serialized_end=1238 + _globals['_TOKENSERVICEUPDATEREQUEST_INFRAROLESENTRY']._serialized_start=1240 + _globals['_TOKENSERVICEUPDATEREQUEST_INFRAROLESENTRY']._serialized_end=1331 + _globals['_TOKENSERVICEUPDATERESPONSE']._serialized_start=4653 + _globals['_TOKENSERVICEUPDATERESPONSE']._serialized_end=4729 + _globals['_TOKENSERVICEGETREQUEST']._serialized_start=4731 + _globals['_TOKENSERVICEGETREQUEST']._serialized_end=4785 + _globals['_TOKENSERVICEGETRESPONSE']._serialized_start=4787 + _globals['_TOKENSERVICEGETRESPONSE']._serialized_end=4860 + _globals['_TOKENSERVICEREFRESHREQUEST']._serialized_start=4862 + _globals['_TOKENSERVICEREFRESHREQUEST']._serialized_end=4890 + _globals['_TOKENSERVICEREFRESHRESPONSE']._serialized_start=4892 + _globals['_TOKENSERVICEREFRESHRESPONSE']._serialized_end=4993 + _globals['_TOKENSERVICE']._serialized_start=5081 + _globals['_TOKENSERVICE']._serialized_end=5737 # @@protoc_insertion_point(module_scope) diff --git a/python/metalstack/api/v2/token_pb2.pyi b/python/metalstack/api/v2/token_pb2.pyi index 52b4b752..de6cf138 100644 --- a/python/metalstack/api/v2/token_pb2.pyi +++ b/python/metalstack/api/v2/token_pb2.pyi @@ -23,7 +23,7 @@ TOKEN_TYPE_API: TokenType TOKEN_TYPE_CONSOLE: TokenType class Token(_message.Message): - __slots__ = ("uuid", "user", "description", "permissions", "expires", "issued_at", "token_type", "project_roles", "tenant_roles", "admin_role") + __slots__ = ("uuid", "user", "description", "permissions", "expires", "issued_at", "token_type", "project_roles", "tenant_roles", "machine_roles", "infra_roles", "admin_role") class ProjectRolesEntry(_message.Message): __slots__ = ("key", "value") KEY_FIELD_NUMBER: _ClassVar[int] @@ -38,6 +38,20 @@ class Token(_message.Message): key: str value: _common_pb2.TenantRole def __init__(self, key: _Optional[str] = ..., value: _Optional[_Union[_common_pb2.TenantRole, str]] = ...) -> None: ... + class MachineRolesEntry(_message.Message): + __slots__ = ("key", "value") + KEY_FIELD_NUMBER: _ClassVar[int] + VALUE_FIELD_NUMBER: _ClassVar[int] + key: str + value: _common_pb2.MachineRole + def __init__(self, key: _Optional[str] = ..., value: _Optional[_Union[_common_pb2.MachineRole, str]] = ...) -> None: ... + class InfraRolesEntry(_message.Message): + __slots__ = ("key", "value") + KEY_FIELD_NUMBER: _ClassVar[int] + VALUE_FIELD_NUMBER: _ClassVar[int] + key: str + value: _common_pb2.InfraRole + def __init__(self, key: _Optional[str] = ..., value: _Optional[_Union[_common_pb2.InfraRole, str]] = ...) -> None: ... UUID_FIELD_NUMBER: _ClassVar[int] USER_FIELD_NUMBER: _ClassVar[int] DESCRIPTION_FIELD_NUMBER: _ClassVar[int] @@ -47,6 +61,8 @@ class Token(_message.Message): TOKEN_TYPE_FIELD_NUMBER: _ClassVar[int] PROJECT_ROLES_FIELD_NUMBER: _ClassVar[int] TENANT_ROLES_FIELD_NUMBER: _ClassVar[int] + MACHINE_ROLES_FIELD_NUMBER: _ClassVar[int] + INFRA_ROLES_FIELD_NUMBER: _ClassVar[int] ADMIN_ROLE_FIELD_NUMBER: _ClassVar[int] uuid: str user: str @@ -57,11 +73,13 @@ class Token(_message.Message): token_type: TokenType project_roles: _containers.ScalarMap[str, _common_pb2.ProjectRole] tenant_roles: _containers.ScalarMap[str, _common_pb2.TenantRole] + machine_roles: _containers.ScalarMap[str, _common_pb2.MachineRole] + infra_roles: _containers.ScalarMap[str, _common_pb2.InfraRole] admin_role: _common_pb2.AdminRole - def __init__(self, uuid: _Optional[str] = ..., user: _Optional[str] = ..., description: _Optional[str] = ..., permissions: _Optional[_Iterable[_Union[MethodPermission, _Mapping]]] = ..., expires: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., issued_at: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., token_type: _Optional[_Union[TokenType, str]] = ..., project_roles: _Optional[_Mapping[str, _common_pb2.ProjectRole]] = ..., tenant_roles: _Optional[_Mapping[str, _common_pb2.TenantRole]] = ..., admin_role: _Optional[_Union[_common_pb2.AdminRole, str]] = ...) -> None: ... + def __init__(self, uuid: _Optional[str] = ..., user: _Optional[str] = ..., description: _Optional[str] = ..., permissions: _Optional[_Iterable[_Union[MethodPermission, _Mapping]]] = ..., expires: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., issued_at: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., token_type: _Optional[_Union[TokenType, str]] = ..., project_roles: _Optional[_Mapping[str, _common_pb2.ProjectRole]] = ..., tenant_roles: _Optional[_Mapping[str, _common_pb2.TenantRole]] = ..., machine_roles: _Optional[_Mapping[str, _common_pb2.MachineRole]] = ..., infra_roles: _Optional[_Mapping[str, _common_pb2.InfraRole]] = ..., admin_role: _Optional[_Union[_common_pb2.AdminRole, str]] = ...) -> None: ... class TokenServiceCreateRequest(_message.Message): - __slots__ = ("description", "permissions", "expires", "project_roles", "tenant_roles", "admin_role") + __slots__ = ("description", "permissions", "expires", "project_roles", "tenant_roles", "machine_roles", "infra_roles", "admin_role") class ProjectRolesEntry(_message.Message): __slots__ = ("key", "value") KEY_FIELD_NUMBER: _ClassVar[int] @@ -76,19 +94,37 @@ class TokenServiceCreateRequest(_message.Message): key: str value: _common_pb2.TenantRole def __init__(self, key: _Optional[str] = ..., value: _Optional[_Union[_common_pb2.TenantRole, str]] = ...) -> None: ... + class MachineRolesEntry(_message.Message): + __slots__ = ("key", "value") + KEY_FIELD_NUMBER: _ClassVar[int] + VALUE_FIELD_NUMBER: _ClassVar[int] + key: str + value: _common_pb2.MachineRole + def __init__(self, key: _Optional[str] = ..., value: _Optional[_Union[_common_pb2.MachineRole, str]] = ...) -> None: ... + class InfraRolesEntry(_message.Message): + __slots__ = ("key", "value") + KEY_FIELD_NUMBER: _ClassVar[int] + VALUE_FIELD_NUMBER: _ClassVar[int] + key: str + value: _common_pb2.InfraRole + def __init__(self, key: _Optional[str] = ..., value: _Optional[_Union[_common_pb2.InfraRole, str]] = ...) -> None: ... DESCRIPTION_FIELD_NUMBER: _ClassVar[int] PERMISSIONS_FIELD_NUMBER: _ClassVar[int] EXPIRES_FIELD_NUMBER: _ClassVar[int] PROJECT_ROLES_FIELD_NUMBER: _ClassVar[int] TENANT_ROLES_FIELD_NUMBER: _ClassVar[int] + MACHINE_ROLES_FIELD_NUMBER: _ClassVar[int] + INFRA_ROLES_FIELD_NUMBER: _ClassVar[int] ADMIN_ROLE_FIELD_NUMBER: _ClassVar[int] description: str permissions: _containers.RepeatedCompositeFieldContainer[MethodPermission] expires: _duration_pb2.Duration project_roles: _containers.ScalarMap[str, _common_pb2.ProjectRole] tenant_roles: _containers.ScalarMap[str, _common_pb2.TenantRole] + machine_roles: _containers.ScalarMap[str, _common_pb2.MachineRole] + infra_roles: _containers.ScalarMap[str, _common_pb2.InfraRole] admin_role: _common_pb2.AdminRole - def __init__(self, description: _Optional[str] = ..., permissions: _Optional[_Iterable[_Union[MethodPermission, _Mapping]]] = ..., expires: _Optional[_Union[datetime.timedelta, _duration_pb2.Duration, _Mapping]] = ..., project_roles: _Optional[_Mapping[str, _common_pb2.ProjectRole]] = ..., tenant_roles: _Optional[_Mapping[str, _common_pb2.TenantRole]] = ..., admin_role: _Optional[_Union[_common_pb2.AdminRole, str]] = ...) -> None: ... + def __init__(self, description: _Optional[str] = ..., permissions: _Optional[_Iterable[_Union[MethodPermission, _Mapping]]] = ..., expires: _Optional[_Union[datetime.timedelta, _duration_pb2.Duration, _Mapping]] = ..., project_roles: _Optional[_Mapping[str, _common_pb2.ProjectRole]] = ..., tenant_roles: _Optional[_Mapping[str, _common_pb2.TenantRole]] = ..., machine_roles: _Optional[_Mapping[str, _common_pb2.MachineRole]] = ..., infra_roles: _Optional[_Mapping[str, _common_pb2.InfraRole]] = ..., admin_role: _Optional[_Union[_common_pb2.AdminRole, str]] = ...) -> None: ... class MethodPermission(_message.Message): __slots__ = ("subject", "methods") @@ -127,7 +163,7 @@ class TokenServiceRevokeResponse(_message.Message): def __init__(self) -> None: ... class TokenServiceUpdateRequest(_message.Message): - __slots__ = ("uuid", "description", "permissions", "project_roles", "tenant_roles", "admin_role") + __slots__ = ("uuid", "description", "permissions", "project_roles", "tenant_roles", "machine_roles", "infra_roles", "admin_role") class ProjectRolesEntry(_message.Message): __slots__ = ("key", "value") KEY_FIELD_NUMBER: _ClassVar[int] @@ -142,19 +178,37 @@ class TokenServiceUpdateRequest(_message.Message): key: str value: _common_pb2.TenantRole def __init__(self, key: _Optional[str] = ..., value: _Optional[_Union[_common_pb2.TenantRole, str]] = ...) -> None: ... + class MachineRolesEntry(_message.Message): + __slots__ = ("key", "value") + KEY_FIELD_NUMBER: _ClassVar[int] + VALUE_FIELD_NUMBER: _ClassVar[int] + key: str + value: _common_pb2.MachineRole + def __init__(self, key: _Optional[str] = ..., value: _Optional[_Union[_common_pb2.MachineRole, str]] = ...) -> None: ... + class InfraRolesEntry(_message.Message): + __slots__ = ("key", "value") + KEY_FIELD_NUMBER: _ClassVar[int] + VALUE_FIELD_NUMBER: _ClassVar[int] + key: str + value: _common_pb2.InfraRole + def __init__(self, key: _Optional[str] = ..., value: _Optional[_Union[_common_pb2.InfraRole, str]] = ...) -> None: ... UUID_FIELD_NUMBER: _ClassVar[int] DESCRIPTION_FIELD_NUMBER: _ClassVar[int] PERMISSIONS_FIELD_NUMBER: _ClassVar[int] PROJECT_ROLES_FIELD_NUMBER: _ClassVar[int] TENANT_ROLES_FIELD_NUMBER: _ClassVar[int] + MACHINE_ROLES_FIELD_NUMBER: _ClassVar[int] + INFRA_ROLES_FIELD_NUMBER: _ClassVar[int] ADMIN_ROLE_FIELD_NUMBER: _ClassVar[int] uuid: str description: str permissions: _containers.RepeatedCompositeFieldContainer[MethodPermission] project_roles: _containers.ScalarMap[str, _common_pb2.ProjectRole] tenant_roles: _containers.ScalarMap[str, _common_pb2.TenantRole] + machine_roles: _containers.ScalarMap[str, _common_pb2.MachineRole] + infra_roles: _containers.ScalarMap[str, _common_pb2.InfraRole] admin_role: _common_pb2.AdminRole - def __init__(self, uuid: _Optional[str] = ..., description: _Optional[str] = ..., permissions: _Optional[_Iterable[_Union[MethodPermission, _Mapping]]] = ..., project_roles: _Optional[_Mapping[str, _common_pb2.ProjectRole]] = ..., tenant_roles: _Optional[_Mapping[str, _common_pb2.TenantRole]] = ..., admin_role: _Optional[_Union[_common_pb2.AdminRole, str]] = ...) -> None: ... + def __init__(self, uuid: _Optional[str] = ..., description: _Optional[str] = ..., permissions: _Optional[_Iterable[_Union[MethodPermission, _Mapping]]] = ..., project_roles: _Optional[_Mapping[str, _common_pb2.ProjectRole]] = ..., tenant_roles: _Optional[_Mapping[str, _common_pb2.TenantRole]] = ..., machine_roles: _Optional[_Mapping[str, _common_pb2.MachineRole]] = ..., infra_roles: _Optional[_Mapping[str, _common_pb2.InfraRole]] = ..., admin_role: _Optional[_Union[_common_pb2.AdminRole, str]] = ...) -> None: ... class TokenServiceUpdateResponse(_message.Message): __slots__ = ("token",) From 6b6b09cd88b848730b72cdb1ac2f03d9b0a1374f Mon Sep 17 00:00:00 2001 From: Stefan Majer Date: Thu, 4 Sep 2025 11:46:57 +0200 Subject: [PATCH 16/27] Fix and simplify generation of servicepermissions --- generate/generate.go | 48 ++++++++-------------------- generate/go_servicepermissions.tpl | 2 +- go/permissions/servicepermissions.go | 28 +++++++++------- 3 files changed, 30 insertions(+), 48 deletions(-) diff --git a/generate/generate.go b/generate/generate.go index 41e5cc90..a695b4aa 100644 --- a/generate/generate.go +++ b/generate/generate.go @@ -140,58 +140,36 @@ func servicePermissions(root string) (*permissions.ServicePermissions, error) { continue } auditable[methodName] = true + + role := *methodOpt.IdentifierValue + switch role { // Tenant - switch *methodOpt.IdentifierValue { - case v1.TenantRole_TENANT_ROLE_OWNER.String(): - roles.Tenant[v1.TenantRole_TENANT_ROLE_OWNER.String()] = append(roles.Tenant[v1.TenantRole_TENANT_ROLE_OWNER.String()], methodName) - visibility.Tenant[methodName] = true - case v1.TenantRole_TENANT_ROLE_EDITOR.String(): - roles.Tenant[v1.TenantRole_TENANT_ROLE_EDITOR.String()] = append(roles.Tenant[v1.TenantRole_TENANT_ROLE_EDITOR.String()], methodName) - visibility.Tenant[methodName] = true - case v1.TenantRole_TENANT_ROLE_VIEWER.String(): - roles.Tenant[v1.TenantRole_TENANT_ROLE_VIEWER.String()] = append(roles.Tenant[v1.TenantRole_TENANT_ROLE_VIEWER.String()], methodName) - visibility.Tenant[methodName] = true - case v1.TenantRole_TENANT_ROLE_GUEST.String(): - roles.Tenant[v1.TenantRole_TENANT_ROLE_GUEST.String()] = append(roles.Tenant[v1.TenantRole_TENANT_ROLE_GUEST.String()], methodName) + case v1.TenantRole_TENANT_ROLE_OWNER.String(), v1.TenantRole_TENANT_ROLE_EDITOR.String(), v1.TenantRole_TENANT_ROLE_VIEWER.String(), v1.TenantRole_TENANT_ROLE_GUEST.String(): + roles.Tenant[role] = append(roles.Tenant[role], methodName) visibility.Tenant[methodName] = true case v1.TenantRole_TENANT_ROLE_UNSPECIFIED.String(): // noop // Project - case v1.ProjectRole_PROJECT_ROLE_OWNER.String(): - roles.Project[v1.ProjectRole_PROJECT_ROLE_OWNER.String()] = append(roles.Project[v1.ProjectRole_PROJECT_ROLE_OWNER.String()], methodName) - visibility.Project[methodName] = true - case v1.ProjectRole_PROJECT_ROLE_EDITOR.String(): + case v1.ProjectRole_PROJECT_ROLE_OWNER.String(), v1.ProjectRole_PROJECT_ROLE_EDITOR.String(), v1.ProjectRole_PROJECT_ROLE_VIEWER.String(): + roles.Project[role] = append(roles.Project[role], methodName) visibility.Project[methodName] = true - roles.Project[v1.ProjectRole_PROJECT_ROLE_EDITOR.String()] = append(roles.Project[v1.ProjectRole_PROJECT_ROLE_EDITOR.String()], methodName) - case v1.ProjectRole_PROJECT_ROLE_VIEWER.String(): - visibility.Project[methodName] = true - roles.Project[v1.ProjectRole_PROJECT_ROLE_VIEWER.String()] = append(roles.Project[v1.ProjectRole_PROJECT_ROLE_VIEWER.String()], methodName) case v1.ProjectRole_PROJECT_ROLE_UNSPECIFIED.String(): // noop // Admin - case v1.AdminRole_ADMIN_ROLE_EDITOR.String(): - roles.Admin[v1.AdminRole_ADMIN_ROLE_EDITOR.String()] = append(roles.Admin[v1.AdminRole_ADMIN_ROLE_EDITOR.String()], methodName) - visibility.Admin[methodName] = true - case v1.AdminRole_ADMIN_ROLE_VIEWER.String(): - roles.Admin[v1.AdminRole_ADMIN_ROLE_VIEWER.String()] = append(roles.Admin[v1.AdminRole_ADMIN_ROLE_VIEWER.String()], methodName) + case v1.AdminRole_ADMIN_ROLE_EDITOR.String(), v1.AdminRole_ADMIN_ROLE_VIEWER.String(): + roles.Admin[role] = append(roles.Admin[role], methodName) visibility.Admin[methodName] = true case v1.AdminRole_ADMIN_ROLE_UNSPECIFIED.String(): // noop // Infra - case v1.InfraRole_INFRA_ROLE_EDITOR.String(): - roles.Infra[v1.InfraRole_INFRA_ROLE_EDITOR.String()] = append(roles.Admin[v1.InfraRole_INFRA_ROLE_EDITOR.String()], methodName) - visibility.Infra[methodName] = true - case v1.InfraRole_INFRA_ROLE_VIEWER.String(): - roles.Infra[v1.InfraRole_INFRA_ROLE_VIEWER.String()] = append(roles.Admin[v1.InfraRole_INFRA_ROLE_VIEWER.String()], methodName) + case v1.InfraRole_INFRA_ROLE_EDITOR.String(), v1.InfraRole_INFRA_ROLE_VIEWER.String(): + roles.Infra[role] = append(roles.Infra[role], methodName) visibility.Infra[methodName] = true case v1.InfraRole_INFRA_ROLE_UNSPECIFIED.String(): // noop // Machine - case v1.MachineRole_MACHINE_ROLE_EDITOR.String(): - roles.Infra[v1.MachineRole_MACHINE_ROLE_EDITOR.String()] = append(roles.Admin[v1.MachineRole_MACHINE_ROLE_EDITOR.String()], methodName) - visibility.Machine[methodName] = true - case v1.MachineRole_MACHINE_ROLE_VIEWER.String(): - roles.Infra[v1.MachineRole_MACHINE_ROLE_VIEWER.String()] = append(roles.Admin[v1.MachineRole_MACHINE_ROLE_VIEWER.String()], methodName) + case v1.MachineRole_MACHINE_ROLE_EDITOR.String(), v1.MachineRole_MACHINE_ROLE_VIEWER.String(): + roles.Machine[role] = append(roles.Machine[role], methodName) visibility.Machine[methodName] = true case v1.MachineRole_MACHINE_ROLE_UNSPECIFIED.String(): // noop diff --git a/generate/go_servicepermissions.tpl b/generate/go_servicepermissions.tpl index ac0ea35b..5750cea0 100644 --- a/generate/go_servicepermissions.tpl +++ b/generate/go_servicepermissions.tpl @@ -35,7 +35,7 @@ func GetServicePermissions() *ServicePermissions { {{- end }} }, Machine: Machine{ - {{- range $role, $methods := .Roles.Infra }} + {{- range $role, $methods := .Roles.Machine }} "{{ $role }}": []string{ {{- range $method := $methods }} "{{ $method }}", diff --git a/go/permissions/servicepermissions.go b/go/permissions/servicepermissions.go index 9899237e..2bcc9d0b 100755 --- a/go/permissions/servicepermissions.go +++ b/go/permissions/servicepermissions.go @@ -88,29 +88,33 @@ func GetServicePermissions() *ServicePermissions { }, Infra: Infra{ "INFRA_ROLE_EDITOR": []string{ + "/metalstack.infra.v2.BMCService/UpdateBMCInfo", + "/metalstack.infra.v2.BootService/Dhcp", + "/metalstack.infra.v2.BootService/Boot", + "/metalstack.infra.v2.EventService/SendMulti", "/metalstack.infra.v2.SwitchService/Register", }, "INFRA_ROLE_VIEWER": []string{ + "/metalstack.infra.v2.BMCService/UpdateBMCInfo", + "/metalstack.infra.v2.BootService/Dhcp", + "/metalstack.infra.v2.BootService/Boot", + "/metalstack.infra.v2.EventService/SendMulti", "/metalstack.infra.v2.SwitchService/Register", }, - "MACHINE_ROLE_EDITOR": []string{ - "/metalstack.infra.v2.EventService/Send", - }, - "MACHINE_ROLE_VIEWER": []string{ - "/metalstack.infra.v2.EventService/Send", - }, }, Machine: Machine{ - "INFRA_ROLE_EDITOR": []string{ - "/metalstack.infra.v2.SwitchService/Register", - }, - "INFRA_ROLE_VIEWER": []string{ - "/metalstack.infra.v2.SwitchService/Register", - }, "MACHINE_ROLE_EDITOR": []string{ + "/metalstack.infra.v2.BootService/SuperUserPassword", + "/metalstack.infra.v2.BootService/Register", + "/metalstack.infra.v2.BootService/Wait", + "/metalstack.infra.v2.BootService/Report", "/metalstack.infra.v2.EventService/Send", }, "MACHINE_ROLE_VIEWER": []string{ + "/metalstack.infra.v2.BootService/SuperUserPassword", + "/metalstack.infra.v2.BootService/Register", + "/metalstack.infra.v2.BootService/Wait", + "/metalstack.infra.v2.BootService/Report", "/metalstack.infra.v2.EventService/Send", }, }, From 9ae58eb288868021a1834db8a5cf7b6d9f402f21 Mon Sep 17 00:00:00 2001 From: Stefan Majer Date: Thu, 4 Sep 2025 15:15:59 +0200 Subject: [PATCH 17/27] WTF --- go/permissions/permissions.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go/permissions/permissions.go b/go/permissions/permissions.go index d15ed1a8..966d8fb6 100644 --- a/go/permissions/permissions.go +++ b/go/permissions/permissions.go @@ -28,7 +28,7 @@ type ( type Roles struct { Admin Admin `json:"admin,omitempty"` Infra Infra `json:"infra,omitempty"` - Machine Machine `json:"Machine,omitempty"` + Machine Machine `json:"machine,omitempty"` Tenant Tenant `json:"tenant,omitempty"` Project Project `json:"project,omitempty"` } From 724a154c5b83116466f87da0ec9de704f8a21f49 Mon Sep 17 00:00:00 2001 From: Stefan Majer Date: Fri, 5 Sep 2025 07:26:25 +0200 Subject: [PATCH 18/27] Back to go-1.25 --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index a436be14..c19251c5 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/metal-stack/api -go 1.24.0 +go 1.25 require ( buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.8-20250717185734-6c6e0d3c608e.1 From 079632352b783eeede4e2d2d08f33e303e25d017 Mon Sep 17 00:00:00 2001 From: Stefan Majer Date: Fri, 5 Sep 2025 15:09:26 +0200 Subject: [PATCH 19/27] lower rights --- doc/index.html | 6 ++++-- go/metalstack/api/v2/token.pb.go | 2 ++ go/metalstack/infra/v2/boot.pb.go | 16 ++++++---------- go/permissions/servicepermissions.go | 4 ---- proto/metalstack/api/v2/token.proto | 2 ++ proto/metalstack/infra/v2/boot.proto | 4 ---- python/metalstack/infra/v2/boot_pb2.py | 12 ++++++------ 7 files changed, 20 insertions(+), 26 deletions(-) diff --git a/doc/index.html b/doc/index.html index 606202ce..206fe8e2 100644 --- a/doc/index.html +++ b/doc/index.html @@ -16023,14 +16023,16 @@

    Token

    machine_roles Token.MachineRolesEntry repeated -

    MachineRoles associates a machine uuid with the corresponding role of the token owner

    +

    MachineRoles associates a machine uuid with the corresponding role of the token owner +TODO: decide if we need this map from machine.uuid->role, we could instead use the subject in the token instead

    infra_roles Token.InfraRolesEntry repeated -

    InfraRoles associates a infra service with the corresponding role of the token owner

    +

    InfraRoles associates a infra service with the corresponding role of the token owner +TODO: decide if we need this map from service.name->role, we could instead use the subject in the token instead

    diff --git a/go/metalstack/api/v2/token.pb.go b/go/metalstack/api/v2/token.pb.go index 6c42780e..aa9a6ac6 100644 --- a/go/metalstack/api/v2/token.pb.go +++ b/go/metalstack/api/v2/token.pb.go @@ -99,8 +99,10 @@ type Token struct { // TenantRoles associates a tenant id with the corresponding role of the token owner TenantRoles map[string]TenantRole `protobuf:"bytes,10,rep,name=tenant_roles,json=tenantRoles,proto3" json:"tenant_roles,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value,enum=metalstack.api.v2.TenantRole"` // MachineRoles associates a machine uuid with the corresponding role of the token owner + // TODO: decide if we need this map from machine.uuid->role, we could instead use the subject in the token instead MachineRoles map[string]MachineRole `protobuf:"bytes,11,rep,name=machine_roles,json=machineRoles,proto3" json:"machine_roles,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value,enum=metalstack.api.v2.MachineRole"` // InfraRoles associates a infra service with the corresponding role of the token owner + // TODO: decide if we need this map from service.name->role, we could instead use the subject in the token instead InfraRoles map[string]InfraRole `protobuf:"bytes,12,rep,name=infra_roles,json=infraRoles,proto3" json:"infra_roles,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value,enum=metalstack.api.v2.InfraRole"` // AdminRole defines the admin role of the token owner AdminRole *AdminRole `protobuf:"varint,13,opt,name=admin_role,json=adminRole,proto3,enum=metalstack.api.v2.AdminRole,oneof" json:"admin_role,omitempty"` diff --git a/go/metalstack/infra/v2/boot.pb.go b/go/metalstack/infra/v2/boot.pb.go index 760bce20..8973ac90 100644 --- a/go/metalstack/infra/v2/boot.pb.go +++ b/go/metalstack/infra/v2/boot.pb.go @@ -747,20 +747,16 @@ const file_metalstack_infra_v2_boot_proto_rawDesc = "" + "$BootServiceSuperUserPasswordResponse\x12)\n" + "\x10feature_disabled\x18\x01 \x01(\bR\x0ffeatureDisabled\x12:\n" + "\x13super_user_password\x18\x02 \x01(\tB\n" + - "\xbaH\ar\x05\x10\x02\x18\x80\x01R\x11superUserPassword2\xe3\x05\n" + + "\xbaH\ar\x05\x10\x02\x18\x80\x01R\x11superUserPassword2\xdf\x05\n" + "\vBootService\x12m\n" + "\x04Dhcp\x12+.metalstack.infra.v2.BootServiceDhcpRequest\x1a,.metalstack.infra.v2.BootServiceDhcpResponse\"\n" + "\xe0\xf3\x18\x02\xea\xf3\x18\x02\x01\x02\x12m\n" + "\x04Boot\x12+.metalstack.infra.v2.BootServiceBootRequest\x1a,.metalstack.infra.v2.BootServiceBootResponse\"\n" + - "\xe0\xf3\x18\x02\xea\xf3\x18\x02\x01\x02\x12\x94\x01\n" + - "\x11SuperUserPassword\x128.metalstack.infra.v2.BootServiceSuperUserPasswordRequest\x1a9.metalstack.infra.v2.BootServiceSuperUserPasswordResponse\"\n" + - "\xe0\xf3\x18\x02\xf2\xf3\x18\x02\x01\x02\x12y\n" + - "\bRegister\x12/.metalstack.infra.v2.BootServiceRegisterRequest\x1a0.metalstack.infra.v2.BootServiceRegisterResponse\"\n" + - "\xe0\xf3\x18\x02\xf2\xf3\x18\x02\x01\x02\x12o\n" + - "\x04Wait\x12+.metalstack.infra.v2.BootServiceWaitRequest\x1a,.metalstack.infra.v2.BootServiceWaitResponse\"\n" + - "\xe0\xf3\x18\x02\xf2\xf3\x18\x02\x01\x020\x01\x12s\n" + - "\x06Report\x12-.metalstack.infra.v2.BootServiceReportRequest\x1a..metalstack.infra.v2.BootServiceReportResponse\"\n" + - "\xe0\xf3\x18\x02\xf2\xf3\x18\x02\x01\x02B\xcd\x01\n" + + "\xe0\xf3\x18\x02\xea\xf3\x18\x02\x01\x02\x12\x93\x01\n" + + "\x11SuperUserPassword\x128.metalstack.infra.v2.BootServiceSuperUserPasswordRequest\x1a9.metalstack.infra.v2.BootServiceSuperUserPasswordResponse\"\t\xe0\xf3\x18\x02\xf2\xf3\x18\x01\x01\x12x\n" + + "\bRegister\x12/.metalstack.infra.v2.BootServiceRegisterRequest\x1a0.metalstack.infra.v2.BootServiceRegisterResponse\"\t\xe0\xf3\x18\x02\xf2\xf3\x18\x01\x01\x12n\n" + + "\x04Wait\x12+.metalstack.infra.v2.BootServiceWaitRequest\x1a,.metalstack.infra.v2.BootServiceWaitResponse\"\t\xe0\xf3\x18\x02\xf2\xf3\x18\x01\x010\x01\x12r\n" + + "\x06Report\x12-.metalstack.infra.v2.BootServiceReportRequest\x1a..metalstack.infra.v2.BootServiceReportResponse\"\t\xe0\xf3\x18\x02\xf2\xf3\x18\x01\x01B\xcd\x01\n" + "\x17com.metalstack.infra.v2B\tBootProtoP\x01Z9github.com/metal-stack/api/go/metalstack/infra/v2;infrav2\xa2\x02\x03MIX\xaa\x02\x13Metalstack.Infra.V2\xca\x02\x13Metalstack\\Infra\\V2\xe2\x02\x1fMetalstack\\Infra\\V2\\GPBMetadata\xea\x02\x15Metalstack::Infra::V2b\x06proto3" var ( diff --git a/go/permissions/servicepermissions.go b/go/permissions/servicepermissions.go index 2bcc9d0b..661b973f 100755 --- a/go/permissions/servicepermissions.go +++ b/go/permissions/servicepermissions.go @@ -111,10 +111,6 @@ func GetServicePermissions() *ServicePermissions { "/metalstack.infra.v2.EventService/Send", }, "MACHINE_ROLE_VIEWER": []string{ - "/metalstack.infra.v2.BootService/SuperUserPassword", - "/metalstack.infra.v2.BootService/Register", - "/metalstack.infra.v2.BootService/Wait", - "/metalstack.infra.v2.BootService/Report", "/metalstack.infra.v2.EventService/Send", }, }, diff --git a/proto/metalstack/api/v2/token.proto b/proto/metalstack/api/v2/token.proto index 2b250d59..5b9c7d58 100644 --- a/proto/metalstack/api/v2/token.proto +++ b/proto/metalstack/api/v2/token.proto @@ -62,8 +62,10 @@ message Token { // TenantRoles associates a tenant id with the corresponding role of the token owner map tenant_roles = 10; // MachineRoles associates a machine uuid with the corresponding role of the token owner + // TODO: decide if we need this map from machine.uuid->role, we could instead use the subject in the token instead map machine_roles = 11; // InfraRoles associates a infra service with the corresponding role of the token owner + // TODO: decide if we need this map from service.name->role, we could instead use the subject in the token instead map infra_roles = 12; // AdminRole defines the admin role of the token owner optional AdminRole admin_role = 13 [(buf.validate.field).enum.defined_only = true]; diff --git a/proto/metalstack/infra/v2/boot.proto b/proto/metalstack/infra/v2/boot.proto index a93e8ba4..f8180cb7 100644 --- a/proto/metalstack/infra/v2/boot.proto +++ b/proto/metalstack/infra/v2/boot.proto @@ -28,19 +28,16 @@ service BootService { // SuperUserPassword metal-hammer takes the configured root password for the bmc from metal-api and configure the bmc accordingly rpc SuperUserPassword(BootServiceSuperUserPasswordRequest) returns (BootServiceSuperUserPasswordResponse) { option (metalstack.api.v2.machine_roles) = MACHINE_ROLE_EDITOR; - option (metalstack.api.v2.machine_roles) = MACHINE_ROLE_VIEWER; option (metalstack.api.v2.auditing) = AUDITING_EXCLUDED; } // Register is called from metal-hammer after hardware inventory is finished, tells metal-api all glory details about that machine rpc Register(BootServiceRegisterRequest) returns (BootServiceRegisterResponse) { option (metalstack.api.v2.machine_roles) = MACHINE_ROLE_EDITOR; - option (metalstack.api.v2.machine_roles) = MACHINE_ROLE_VIEWER; option (metalstack.api.v2.auditing) = AUDITING_EXCLUDED; } // Wait is a hanging call that waits until the machine gets allocated by a user rpc Wait(BootServiceWaitRequest) returns (stream BootServiceWaitResponse) { option (metalstack.api.v2.machine_roles) = MACHINE_ROLE_EDITOR; - option (metalstack.api.v2.machine_roles) = MACHINE_ROLE_VIEWER; option (metalstack.api.v2.auditing) = AUDITING_EXCLUDED; } @@ -50,7 +47,6 @@ service BootService { // Report tells metal-api installation was either successful or failed rpc Report(BootServiceReportRequest) returns (BootServiceReportResponse) { option (metalstack.api.v2.machine_roles) = MACHINE_ROLE_EDITOR; - option (metalstack.api.v2.machine_roles) = MACHINE_ROLE_VIEWER; option (metalstack.api.v2.auditing) = AUDITING_EXCLUDED; } } diff --git a/python/metalstack/infra/v2/boot_pb2.py b/python/metalstack/infra/v2/boot_pb2.py index d8d71c56..a63ab194 100644 --- a/python/metalstack/infra/v2/boot_pb2.py +++ b/python/metalstack/infra/v2/boot_pb2.py @@ -27,7 +27,7 @@ from metalstack.api.v2 import machine_pb2 as metalstack_dot_api_dot_v2_dot_machine__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1emetalstack/infra/v2/boot.proto\x12\x13metalstack.infra.v2\x1a\x1b\x62uf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a\x1fmetalstack/api/v2/machine.proto\"`\n\x16\x42ootServiceDhcpRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12(\n\tpartition\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\tpartition\"\x19\n\x17\x42ootServiceDhcpResponse\"\xc1\x01\n\x16\x42ootServiceBootRequest\x12}\n\x03mac\x18\x01 \x01(\tBk\xbaHh\xba\x01\x65\n\x03mac\x12\x1fmac must be a valid mac address\x1a=this.matches(\'^(?:[0-9A-Fa-f]{2}[:-]){5}(?:[0-9A-Fa-f]{2})$\')R\x03mac\x12(\n\tpartition\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\tpartition\"\xd2\x01\n\x17\x42ootServiceBootResponse\x12Z\n\x06kernel\x18\x01 \x01(\tBB\xbaH?\xba\x01<\n\x10valid_kernel_uri\x12\x1akernel must be a valid URI\x1a\x0cthis.isUri()R\x06kernel\x12$\n\x0einit_ram_disks\x18\x02 \x03(\tR\x0cinitRamDisks\x12)\n\x07\x63mdline\x18\x03 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01H\x00R\x07\x63mdline\x88\x01\x01\x42\n\n\x08_cmdline\"\xde\x02\n\x1a\x42ootServiceRegisterRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12>\n\x08hardware\x18\x02 \x01(\x0b\x32\".metalstack.api.v2.MachineHardwareR\x08hardware\x12\x32\n\x04\x62ios\x18\x03 \x01(\x0b\x32\x1e.metalstack.api.v2.MachineBiosR\x04\x62ios\x12\x32\n\x04ipmi\x18\x04 \x01(\x0b\x32\x1e.metalstack.api.v2.MachineIPMIR\x04ipmi\x12\x12\n\x04tags\x18\x05 \x03(\tR\x04tags\x12<\n\x14metal_hammer_version\x18\x06 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x12metalHammerVersion\x12(\n\tpartition\x18\x07 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\tpartition\"\x85\x01\n\x1b\x42ootServiceRegisterResponse\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12\x1e\n\x04size\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x04size\x12(\n\tpartition\x18\x03 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\tpartition\"6\n\x16\x42ootServiceWaitRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\"\x19\n\x17\x42ootServiceWaitResponse\"\xaf\x01\n\x18\x42ootServiceReportRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12\x35\n\x10\x63onsole_password\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x0f\x63onsolePassword\x12\x18\n\x07success\x18\x04 \x01(\x08R\x07success\x12$\n\x07message\x18\x05 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x04R\x07message\"\x1b\n\x19\x42ootServiceReportResponse\"C\n#BootServiceSuperUserPasswordRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\"\x8d\x01\n$BootServiceSuperUserPasswordResponse\x12)\n\x10\x66\x65\x61ture_disabled\x18\x01 \x01(\x08R\x0f\x66\x65\x61tureDisabled\x12:\n\x13super_user_password\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x11superUserPassword2\xe3\x05\n\x0b\x42ootService\x12m\n\x04\x44hcp\x12+.metalstack.infra.v2.BootServiceDhcpRequest\x1a,.metalstack.infra.v2.BootServiceDhcpResponse\"\n\xe0\xf3\x18\x02\xea\xf3\x18\x02\x01\x02\x12m\n\x04\x42oot\x12+.metalstack.infra.v2.BootServiceBootRequest\x1a,.metalstack.infra.v2.BootServiceBootResponse\"\n\xe0\xf3\x18\x02\xea\xf3\x18\x02\x01\x02\x12\x94\x01\n\x11SuperUserPassword\x12\x38.metalstack.infra.v2.BootServiceSuperUserPasswordRequest\x1a\x39.metalstack.infra.v2.BootServiceSuperUserPasswordResponse\"\n\xe0\xf3\x18\x02\xf2\xf3\x18\x02\x01\x02\x12y\n\x08Register\x12/.metalstack.infra.v2.BootServiceRegisterRequest\x1a\x30.metalstack.infra.v2.BootServiceRegisterResponse\"\n\xe0\xf3\x18\x02\xf2\xf3\x18\x02\x01\x02\x12o\n\x04Wait\x12+.metalstack.infra.v2.BootServiceWaitRequest\x1a,.metalstack.infra.v2.BootServiceWaitResponse\"\n\xe0\xf3\x18\x02\xf2\xf3\x18\x02\x01\x02\x30\x01\x12s\n\x06Report\x12-.metalstack.infra.v2.BootServiceReportRequest\x1a..metalstack.infra.v2.BootServiceReportResponse\"\n\xe0\xf3\x18\x02\xf2\xf3\x18\x02\x01\x02\x42\xcd\x01\n\x17\x63om.metalstack.infra.v2B\tBootProtoP\x01Z9github.com/metal-stack/api/go/metalstack/infra/v2;infrav2\xa2\x02\x03MIX\xaa\x02\x13Metalstack.Infra.V2\xca\x02\x13Metalstack\\Infra\\V2\xe2\x02\x1fMetalstack\\Infra\\V2\\GPBMetadata\xea\x02\x15Metalstack::Infra::V2b\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1emetalstack/infra/v2/boot.proto\x12\x13metalstack.infra.v2\x1a\x1b\x62uf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a\x1fmetalstack/api/v2/machine.proto\"`\n\x16\x42ootServiceDhcpRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12(\n\tpartition\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\tpartition\"\x19\n\x17\x42ootServiceDhcpResponse\"\xc1\x01\n\x16\x42ootServiceBootRequest\x12}\n\x03mac\x18\x01 \x01(\tBk\xbaHh\xba\x01\x65\n\x03mac\x12\x1fmac must be a valid mac address\x1a=this.matches(\'^(?:[0-9A-Fa-f]{2}[:-]){5}(?:[0-9A-Fa-f]{2})$\')R\x03mac\x12(\n\tpartition\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\tpartition\"\xd2\x01\n\x17\x42ootServiceBootResponse\x12Z\n\x06kernel\x18\x01 \x01(\tBB\xbaH?\xba\x01<\n\x10valid_kernel_uri\x12\x1akernel must be a valid URI\x1a\x0cthis.isUri()R\x06kernel\x12$\n\x0einit_ram_disks\x18\x02 \x03(\tR\x0cinitRamDisks\x12)\n\x07\x63mdline\x18\x03 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01H\x00R\x07\x63mdline\x88\x01\x01\x42\n\n\x08_cmdline\"\xde\x02\n\x1a\x42ootServiceRegisterRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12>\n\x08hardware\x18\x02 \x01(\x0b\x32\".metalstack.api.v2.MachineHardwareR\x08hardware\x12\x32\n\x04\x62ios\x18\x03 \x01(\x0b\x32\x1e.metalstack.api.v2.MachineBiosR\x04\x62ios\x12\x32\n\x04ipmi\x18\x04 \x01(\x0b\x32\x1e.metalstack.api.v2.MachineIPMIR\x04ipmi\x12\x12\n\x04tags\x18\x05 \x03(\tR\x04tags\x12<\n\x14metal_hammer_version\x18\x06 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x12metalHammerVersion\x12(\n\tpartition\x18\x07 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\tpartition\"\x85\x01\n\x1b\x42ootServiceRegisterResponse\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12\x1e\n\x04size\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x04size\x12(\n\tpartition\x18\x03 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\tpartition\"6\n\x16\x42ootServiceWaitRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\"\x19\n\x17\x42ootServiceWaitResponse\"\xaf\x01\n\x18\x42ootServiceReportRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12\x35\n\x10\x63onsole_password\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x0f\x63onsolePassword\x12\x18\n\x07success\x18\x04 \x01(\x08R\x07success\x12$\n\x07message\x18\x05 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x04R\x07message\"\x1b\n\x19\x42ootServiceReportResponse\"C\n#BootServiceSuperUserPasswordRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\"\x8d\x01\n$BootServiceSuperUserPasswordResponse\x12)\n\x10\x66\x65\x61ture_disabled\x18\x01 \x01(\x08R\x0f\x66\x65\x61tureDisabled\x12:\n\x13super_user_password\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x11superUserPassword2\xdf\x05\n\x0b\x42ootService\x12m\n\x04\x44hcp\x12+.metalstack.infra.v2.BootServiceDhcpRequest\x1a,.metalstack.infra.v2.BootServiceDhcpResponse\"\n\xe0\xf3\x18\x02\xea\xf3\x18\x02\x01\x02\x12m\n\x04\x42oot\x12+.metalstack.infra.v2.BootServiceBootRequest\x1a,.metalstack.infra.v2.BootServiceBootResponse\"\n\xe0\xf3\x18\x02\xea\xf3\x18\x02\x01\x02\x12\x93\x01\n\x11SuperUserPassword\x12\x38.metalstack.infra.v2.BootServiceSuperUserPasswordRequest\x1a\x39.metalstack.infra.v2.BootServiceSuperUserPasswordResponse\"\t\xe0\xf3\x18\x02\xf2\xf3\x18\x01\x01\x12x\n\x08Register\x12/.metalstack.infra.v2.BootServiceRegisterRequest\x1a\x30.metalstack.infra.v2.BootServiceRegisterResponse\"\t\xe0\xf3\x18\x02\xf2\xf3\x18\x01\x01\x12n\n\x04Wait\x12+.metalstack.infra.v2.BootServiceWaitRequest\x1a,.metalstack.infra.v2.BootServiceWaitResponse\"\t\xe0\xf3\x18\x02\xf2\xf3\x18\x01\x01\x30\x01\x12r\n\x06Report\x12-.metalstack.infra.v2.BootServiceReportRequest\x1a..metalstack.infra.v2.BootServiceReportResponse\"\t\xe0\xf3\x18\x02\xf2\xf3\x18\x01\x01\x42\xcd\x01\n\x17\x63om.metalstack.infra.v2B\tBootProtoP\x01Z9github.com/metal-stack/api/go/metalstack/infra/v2;infrav2\xa2\x02\x03MIX\xaa\x02\x13Metalstack.Infra.V2\xca\x02\x13Metalstack\\Infra\\V2\xe2\x02\x1fMetalstack\\Infra\\V2\\GPBMetadata\xea\x02\x15Metalstack::Infra::V2b\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -76,13 +76,13 @@ _globals['_BOOTSERVICE'].methods_by_name['Boot']._loaded_options = None _globals['_BOOTSERVICE'].methods_by_name['Boot']._serialized_options = b'\340\363\030\002\352\363\030\002\001\002' _globals['_BOOTSERVICE'].methods_by_name['SuperUserPassword']._loaded_options = None - _globals['_BOOTSERVICE'].methods_by_name['SuperUserPassword']._serialized_options = b'\340\363\030\002\362\363\030\002\001\002' + _globals['_BOOTSERVICE'].methods_by_name['SuperUserPassword']._serialized_options = b'\340\363\030\002\362\363\030\001\001' _globals['_BOOTSERVICE'].methods_by_name['Register']._loaded_options = None - _globals['_BOOTSERVICE'].methods_by_name['Register']._serialized_options = b'\340\363\030\002\362\363\030\002\001\002' + _globals['_BOOTSERVICE'].methods_by_name['Register']._serialized_options = b'\340\363\030\002\362\363\030\001\001' _globals['_BOOTSERVICE'].methods_by_name['Wait']._loaded_options = None - _globals['_BOOTSERVICE'].methods_by_name['Wait']._serialized_options = b'\340\363\030\002\362\363\030\002\001\002' + _globals['_BOOTSERVICE'].methods_by_name['Wait']._serialized_options = b'\340\363\030\002\362\363\030\001\001' _globals['_BOOTSERVICE'].methods_by_name['Report']._loaded_options = None - _globals['_BOOTSERVICE'].methods_by_name['Report']._serialized_options = b'\340\363\030\002\362\363\030\002\001\002' + _globals['_BOOTSERVICE'].methods_by_name['Report']._serialized_options = b'\340\363\030\002\362\363\030\001\001' _globals['_BOOTSERVICEDHCPREQUEST']._serialized_start=149 _globals['_BOOTSERVICEDHCPREQUEST']._serialized_end=245 _globals['_BOOTSERVICEDHCPRESPONSE']._serialized_start=247 @@ -108,5 +108,5 @@ _globals['_BOOTSERVICESUPERUSERPASSWORDRESPONSE']._serialized_start=1532 _globals['_BOOTSERVICESUPERUSERPASSWORDRESPONSE']._serialized_end=1673 _globals['_BOOTSERVICE']._serialized_start=1676 - _globals['_BOOTSERVICE']._serialized_end=2415 + _globals['_BOOTSERVICE']._serialized_end=2411 # @@protoc_insertion_point(module_scope) From e47e7741b17a12a10fa51ad8e71eb5eb6d75b124 Mon Sep 17 00:00:00 2001 From: Stefan Majer Date: Sat, 6 Sep 2025 14:34:26 +0200 Subject: [PATCH 20/27] Return the machine allocation as wait response --- doc/index.html | 17 ++++++++ go/metalstack/infra/v2/boot.pb.go | 54 ++++++++++++++++--------- proto/metalstack/infra/v2/boot.proto | 5 ++- python/metalstack/infra/v2/boot_pb2.py | 24 +++++------ python/metalstack/infra/v2/boot_pb2.pyi | 6 ++- 5 files changed, 71 insertions(+), 35 deletions(-) diff --git a/doc/index.html b/doc/index.html index 206fe8e2..d5050612 100644 --- a/doc/index.html +++ b/doc/index.html @@ -19495,6 +19495,23 @@

    BootServiceWaitResponse

    BootServiceWaitResponse response to a wait request

    + + + + + + + + + + + + + + +
    FieldTypeLabelDescription
    allocationmetalstack.api.v2.MachineAllocation

    Allocation contains the machine.allocation to actually install the machine

    + + diff --git a/go/metalstack/infra/v2/boot.pb.go b/go/metalstack/infra/v2/boot.pb.go index 8973ac90..fbde70e9 100644 --- a/go/metalstack/infra/v2/boot.pb.go +++ b/go/metalstack/infra/v2/boot.pb.go @@ -446,7 +446,9 @@ func (x *BootServiceWaitRequest) GetUuid() string { // BootServiceWaitResponse response to a wait request type BootServiceWaitResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` + state protoimpl.MessageState `protogen:"open.v1"` + // Allocation contains the machine.allocation to actually install the machine + Allocation *v2.MachineAllocation `protobuf:"bytes,1,opt,name=allocation,proto3" json:"allocation,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -481,6 +483,13 @@ func (*BootServiceWaitResponse) Descriptor() ([]byte, []int) { return file_metalstack_infra_v2_boot_proto_rawDescGZIP(), []int{7} } +func (x *BootServiceWaitResponse) GetAllocation() *v2.MachineAllocation { + if x != nil { + return x.Allocation + } + return nil +} + // BootServiceReportRequest is sent from metal-hammer to the api to report the outcome of the register type BootServiceReportRequest struct { state protoimpl.MessageState `protogen:"open.v1"` @@ -732,8 +741,11 @@ const file_metalstack_infra_v2_boot_proto_rawDesc = "" + "\tpartition\x18\x03 \x01(\tB\n" + "\xbaH\ar\x05\x10\x02\x18\x80\x01R\tpartition\"6\n" + "\x16BootServiceWaitRequest\x12\x1c\n" + - "\x04uuid\x18\x01 \x01(\tB\b\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\"\x19\n" + - "\x17BootServiceWaitResponse\"\xaf\x01\n" + + "\x04uuid\x18\x01 \x01(\tB\b\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\"_\n" + + "\x17BootServiceWaitResponse\x12D\n" + + "\n" + + "allocation\x18\x01 \x01(\v2$.metalstack.api.v2.MachineAllocationR\n" + + "allocation\"\xaf\x01\n" + "\x18BootServiceReportRequest\x12\x1c\n" + "\x04uuid\x18\x01 \x01(\tB\b\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x125\n" + "\x10console_password\x18\x02 \x01(\tB\n" + @@ -788,28 +800,30 @@ var file_metalstack_infra_v2_boot_proto_goTypes = []any{ (*v2.MachineHardware)(nil), // 12: metalstack.api.v2.MachineHardware (*v2.MachineBios)(nil), // 13: metalstack.api.v2.MachineBios (*v2.MachineIPMI)(nil), // 14: metalstack.api.v2.MachineIPMI + (*v2.MachineAllocation)(nil), // 15: metalstack.api.v2.MachineAllocation } var file_metalstack_infra_v2_boot_proto_depIdxs = []int32{ 12, // 0: metalstack.infra.v2.BootServiceRegisterRequest.hardware:type_name -> metalstack.api.v2.MachineHardware 13, // 1: metalstack.infra.v2.BootServiceRegisterRequest.bios:type_name -> metalstack.api.v2.MachineBios 14, // 2: metalstack.infra.v2.BootServiceRegisterRequest.ipmi:type_name -> metalstack.api.v2.MachineIPMI - 0, // 3: metalstack.infra.v2.BootService.Dhcp:input_type -> metalstack.infra.v2.BootServiceDhcpRequest - 2, // 4: metalstack.infra.v2.BootService.Boot:input_type -> metalstack.infra.v2.BootServiceBootRequest - 10, // 5: metalstack.infra.v2.BootService.SuperUserPassword:input_type -> metalstack.infra.v2.BootServiceSuperUserPasswordRequest - 4, // 6: metalstack.infra.v2.BootService.Register:input_type -> metalstack.infra.v2.BootServiceRegisterRequest - 6, // 7: metalstack.infra.v2.BootService.Wait:input_type -> metalstack.infra.v2.BootServiceWaitRequest - 8, // 8: metalstack.infra.v2.BootService.Report:input_type -> metalstack.infra.v2.BootServiceReportRequest - 1, // 9: metalstack.infra.v2.BootService.Dhcp:output_type -> metalstack.infra.v2.BootServiceDhcpResponse - 3, // 10: metalstack.infra.v2.BootService.Boot:output_type -> metalstack.infra.v2.BootServiceBootResponse - 11, // 11: metalstack.infra.v2.BootService.SuperUserPassword:output_type -> metalstack.infra.v2.BootServiceSuperUserPasswordResponse - 5, // 12: metalstack.infra.v2.BootService.Register:output_type -> metalstack.infra.v2.BootServiceRegisterResponse - 7, // 13: metalstack.infra.v2.BootService.Wait:output_type -> metalstack.infra.v2.BootServiceWaitResponse - 9, // 14: metalstack.infra.v2.BootService.Report:output_type -> metalstack.infra.v2.BootServiceReportResponse - 9, // [9:15] is the sub-list for method output_type - 3, // [3:9] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name + 15, // 3: metalstack.infra.v2.BootServiceWaitResponse.allocation:type_name -> metalstack.api.v2.MachineAllocation + 0, // 4: metalstack.infra.v2.BootService.Dhcp:input_type -> metalstack.infra.v2.BootServiceDhcpRequest + 2, // 5: metalstack.infra.v2.BootService.Boot:input_type -> metalstack.infra.v2.BootServiceBootRequest + 10, // 6: metalstack.infra.v2.BootService.SuperUserPassword:input_type -> metalstack.infra.v2.BootServiceSuperUserPasswordRequest + 4, // 7: metalstack.infra.v2.BootService.Register:input_type -> metalstack.infra.v2.BootServiceRegisterRequest + 6, // 8: metalstack.infra.v2.BootService.Wait:input_type -> metalstack.infra.v2.BootServiceWaitRequest + 8, // 9: metalstack.infra.v2.BootService.Report:input_type -> metalstack.infra.v2.BootServiceReportRequest + 1, // 10: metalstack.infra.v2.BootService.Dhcp:output_type -> metalstack.infra.v2.BootServiceDhcpResponse + 3, // 11: metalstack.infra.v2.BootService.Boot:output_type -> metalstack.infra.v2.BootServiceBootResponse + 11, // 12: metalstack.infra.v2.BootService.SuperUserPassword:output_type -> metalstack.infra.v2.BootServiceSuperUserPasswordResponse + 5, // 13: metalstack.infra.v2.BootService.Register:output_type -> metalstack.infra.v2.BootServiceRegisterResponse + 7, // 14: metalstack.infra.v2.BootService.Wait:output_type -> metalstack.infra.v2.BootServiceWaitResponse + 9, // 15: metalstack.infra.v2.BootService.Report:output_type -> metalstack.infra.v2.BootServiceReportResponse + 10, // [10:16] is the sub-list for method output_type + 4, // [4:10] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name } func init() { file_metalstack_infra_v2_boot_proto_init() } diff --git a/proto/metalstack/infra/v2/boot.proto b/proto/metalstack/infra/v2/boot.proto index f8180cb7..233d27b9 100644 --- a/proto/metalstack/infra/v2/boot.proto +++ b/proto/metalstack/infra/v2/boot.proto @@ -147,7 +147,10 @@ message BootServiceWaitRequest { } // BootServiceWaitResponse response to a wait request -message BootServiceWaitResponse {} +message BootServiceWaitResponse { + // Allocation contains the machine.allocation to actually install the machine + metalstack.api.v2.MachineAllocation allocation = 1; +} // BootServiceReportRequest is sent from metal-hammer to the api to report the outcome of the register message BootServiceReportRequest { diff --git a/python/metalstack/infra/v2/boot_pb2.py b/python/metalstack/infra/v2/boot_pb2.py index a63ab194..831b8df6 100644 --- a/python/metalstack/infra/v2/boot_pb2.py +++ b/python/metalstack/infra/v2/boot_pb2.py @@ -27,7 +27,7 @@ from metalstack.api.v2 import machine_pb2 as metalstack_dot_api_dot_v2_dot_machine__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1emetalstack/infra/v2/boot.proto\x12\x13metalstack.infra.v2\x1a\x1b\x62uf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a\x1fmetalstack/api/v2/machine.proto\"`\n\x16\x42ootServiceDhcpRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12(\n\tpartition\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\tpartition\"\x19\n\x17\x42ootServiceDhcpResponse\"\xc1\x01\n\x16\x42ootServiceBootRequest\x12}\n\x03mac\x18\x01 \x01(\tBk\xbaHh\xba\x01\x65\n\x03mac\x12\x1fmac must be a valid mac address\x1a=this.matches(\'^(?:[0-9A-Fa-f]{2}[:-]){5}(?:[0-9A-Fa-f]{2})$\')R\x03mac\x12(\n\tpartition\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\tpartition\"\xd2\x01\n\x17\x42ootServiceBootResponse\x12Z\n\x06kernel\x18\x01 \x01(\tBB\xbaH?\xba\x01<\n\x10valid_kernel_uri\x12\x1akernel must be a valid URI\x1a\x0cthis.isUri()R\x06kernel\x12$\n\x0einit_ram_disks\x18\x02 \x03(\tR\x0cinitRamDisks\x12)\n\x07\x63mdline\x18\x03 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01H\x00R\x07\x63mdline\x88\x01\x01\x42\n\n\x08_cmdline\"\xde\x02\n\x1a\x42ootServiceRegisterRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12>\n\x08hardware\x18\x02 \x01(\x0b\x32\".metalstack.api.v2.MachineHardwareR\x08hardware\x12\x32\n\x04\x62ios\x18\x03 \x01(\x0b\x32\x1e.metalstack.api.v2.MachineBiosR\x04\x62ios\x12\x32\n\x04ipmi\x18\x04 \x01(\x0b\x32\x1e.metalstack.api.v2.MachineIPMIR\x04ipmi\x12\x12\n\x04tags\x18\x05 \x03(\tR\x04tags\x12<\n\x14metal_hammer_version\x18\x06 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x12metalHammerVersion\x12(\n\tpartition\x18\x07 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\tpartition\"\x85\x01\n\x1b\x42ootServiceRegisterResponse\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12\x1e\n\x04size\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x04size\x12(\n\tpartition\x18\x03 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\tpartition\"6\n\x16\x42ootServiceWaitRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\"\x19\n\x17\x42ootServiceWaitResponse\"\xaf\x01\n\x18\x42ootServiceReportRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12\x35\n\x10\x63onsole_password\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x0f\x63onsolePassword\x12\x18\n\x07success\x18\x04 \x01(\x08R\x07success\x12$\n\x07message\x18\x05 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x04R\x07message\"\x1b\n\x19\x42ootServiceReportResponse\"C\n#BootServiceSuperUserPasswordRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\"\x8d\x01\n$BootServiceSuperUserPasswordResponse\x12)\n\x10\x66\x65\x61ture_disabled\x18\x01 \x01(\x08R\x0f\x66\x65\x61tureDisabled\x12:\n\x13super_user_password\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x11superUserPassword2\xdf\x05\n\x0b\x42ootService\x12m\n\x04\x44hcp\x12+.metalstack.infra.v2.BootServiceDhcpRequest\x1a,.metalstack.infra.v2.BootServiceDhcpResponse\"\n\xe0\xf3\x18\x02\xea\xf3\x18\x02\x01\x02\x12m\n\x04\x42oot\x12+.metalstack.infra.v2.BootServiceBootRequest\x1a,.metalstack.infra.v2.BootServiceBootResponse\"\n\xe0\xf3\x18\x02\xea\xf3\x18\x02\x01\x02\x12\x93\x01\n\x11SuperUserPassword\x12\x38.metalstack.infra.v2.BootServiceSuperUserPasswordRequest\x1a\x39.metalstack.infra.v2.BootServiceSuperUserPasswordResponse\"\t\xe0\xf3\x18\x02\xf2\xf3\x18\x01\x01\x12x\n\x08Register\x12/.metalstack.infra.v2.BootServiceRegisterRequest\x1a\x30.metalstack.infra.v2.BootServiceRegisterResponse\"\t\xe0\xf3\x18\x02\xf2\xf3\x18\x01\x01\x12n\n\x04Wait\x12+.metalstack.infra.v2.BootServiceWaitRequest\x1a,.metalstack.infra.v2.BootServiceWaitResponse\"\t\xe0\xf3\x18\x02\xf2\xf3\x18\x01\x01\x30\x01\x12r\n\x06Report\x12-.metalstack.infra.v2.BootServiceReportRequest\x1a..metalstack.infra.v2.BootServiceReportResponse\"\t\xe0\xf3\x18\x02\xf2\xf3\x18\x01\x01\x42\xcd\x01\n\x17\x63om.metalstack.infra.v2B\tBootProtoP\x01Z9github.com/metal-stack/api/go/metalstack/infra/v2;infrav2\xa2\x02\x03MIX\xaa\x02\x13Metalstack.Infra.V2\xca\x02\x13Metalstack\\Infra\\V2\xe2\x02\x1fMetalstack\\Infra\\V2\\GPBMetadata\xea\x02\x15Metalstack::Infra::V2b\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1emetalstack/infra/v2/boot.proto\x12\x13metalstack.infra.v2\x1a\x1b\x62uf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a\x1fmetalstack/api/v2/machine.proto\"`\n\x16\x42ootServiceDhcpRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12(\n\tpartition\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\tpartition\"\x19\n\x17\x42ootServiceDhcpResponse\"\xc1\x01\n\x16\x42ootServiceBootRequest\x12}\n\x03mac\x18\x01 \x01(\tBk\xbaHh\xba\x01\x65\n\x03mac\x12\x1fmac must be a valid mac address\x1a=this.matches(\'^(?:[0-9A-Fa-f]{2}[:-]){5}(?:[0-9A-Fa-f]{2})$\')R\x03mac\x12(\n\tpartition\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\tpartition\"\xd2\x01\n\x17\x42ootServiceBootResponse\x12Z\n\x06kernel\x18\x01 \x01(\tBB\xbaH?\xba\x01<\n\x10valid_kernel_uri\x12\x1akernel must be a valid URI\x1a\x0cthis.isUri()R\x06kernel\x12$\n\x0einit_ram_disks\x18\x02 \x03(\tR\x0cinitRamDisks\x12)\n\x07\x63mdline\x18\x03 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01H\x00R\x07\x63mdline\x88\x01\x01\x42\n\n\x08_cmdline\"\xde\x02\n\x1a\x42ootServiceRegisterRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12>\n\x08hardware\x18\x02 \x01(\x0b\x32\".metalstack.api.v2.MachineHardwareR\x08hardware\x12\x32\n\x04\x62ios\x18\x03 \x01(\x0b\x32\x1e.metalstack.api.v2.MachineBiosR\x04\x62ios\x12\x32\n\x04ipmi\x18\x04 \x01(\x0b\x32\x1e.metalstack.api.v2.MachineIPMIR\x04ipmi\x12\x12\n\x04tags\x18\x05 \x03(\tR\x04tags\x12<\n\x14metal_hammer_version\x18\x06 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x12metalHammerVersion\x12(\n\tpartition\x18\x07 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\tpartition\"\x85\x01\n\x1b\x42ootServiceRegisterResponse\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12\x1e\n\x04size\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x04size\x12(\n\tpartition\x18\x03 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\tpartition\"6\n\x16\x42ootServiceWaitRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\"_\n\x17\x42ootServiceWaitResponse\x12\x44\n\nallocation\x18\x01 \x01(\x0b\x32$.metalstack.api.v2.MachineAllocationR\nallocation\"\xaf\x01\n\x18\x42ootServiceReportRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12\x35\n\x10\x63onsole_password\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x0f\x63onsolePassword\x12\x18\n\x07success\x18\x04 \x01(\x08R\x07success\x12$\n\x07message\x18\x05 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x04R\x07message\"\x1b\n\x19\x42ootServiceReportResponse\"C\n#BootServiceSuperUserPasswordRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\"\x8d\x01\n$BootServiceSuperUserPasswordResponse\x12)\n\x10\x66\x65\x61ture_disabled\x18\x01 \x01(\x08R\x0f\x66\x65\x61tureDisabled\x12:\n\x13super_user_password\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x11superUserPassword2\xdf\x05\n\x0b\x42ootService\x12m\n\x04\x44hcp\x12+.metalstack.infra.v2.BootServiceDhcpRequest\x1a,.metalstack.infra.v2.BootServiceDhcpResponse\"\n\xe0\xf3\x18\x02\xea\xf3\x18\x02\x01\x02\x12m\n\x04\x42oot\x12+.metalstack.infra.v2.BootServiceBootRequest\x1a,.metalstack.infra.v2.BootServiceBootResponse\"\n\xe0\xf3\x18\x02\xea\xf3\x18\x02\x01\x02\x12\x93\x01\n\x11SuperUserPassword\x12\x38.metalstack.infra.v2.BootServiceSuperUserPasswordRequest\x1a\x39.metalstack.infra.v2.BootServiceSuperUserPasswordResponse\"\t\xe0\xf3\x18\x02\xf2\xf3\x18\x01\x01\x12x\n\x08Register\x12/.metalstack.infra.v2.BootServiceRegisterRequest\x1a\x30.metalstack.infra.v2.BootServiceRegisterResponse\"\t\xe0\xf3\x18\x02\xf2\xf3\x18\x01\x01\x12n\n\x04Wait\x12+.metalstack.infra.v2.BootServiceWaitRequest\x1a,.metalstack.infra.v2.BootServiceWaitResponse\"\t\xe0\xf3\x18\x02\xf2\xf3\x18\x01\x01\x30\x01\x12r\n\x06Report\x12-.metalstack.infra.v2.BootServiceReportRequest\x1a..metalstack.infra.v2.BootServiceReportResponse\"\t\xe0\xf3\x18\x02\xf2\xf3\x18\x01\x01\x42\xcd\x01\n\x17\x63om.metalstack.infra.v2B\tBootProtoP\x01Z9github.com/metal-stack/api/go/metalstack/infra/v2;infrav2\xa2\x02\x03MIX\xaa\x02\x13Metalstack.Infra.V2\xca\x02\x13Metalstack\\Infra\\V2\xe2\x02\x1fMetalstack\\Infra\\V2\\GPBMetadata\xea\x02\x15Metalstack::Infra::V2b\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -98,15 +98,15 @@ _globals['_BOOTSERVICEWAITREQUEST']._serialized_start=1172 _globals['_BOOTSERVICEWAITREQUEST']._serialized_end=1226 _globals['_BOOTSERVICEWAITRESPONSE']._serialized_start=1228 - _globals['_BOOTSERVICEWAITRESPONSE']._serialized_end=1253 - _globals['_BOOTSERVICEREPORTREQUEST']._serialized_start=1256 - _globals['_BOOTSERVICEREPORTREQUEST']._serialized_end=1431 - _globals['_BOOTSERVICEREPORTRESPONSE']._serialized_start=1433 - _globals['_BOOTSERVICEREPORTRESPONSE']._serialized_end=1460 - _globals['_BOOTSERVICESUPERUSERPASSWORDREQUEST']._serialized_start=1462 - _globals['_BOOTSERVICESUPERUSERPASSWORDREQUEST']._serialized_end=1529 - _globals['_BOOTSERVICESUPERUSERPASSWORDRESPONSE']._serialized_start=1532 - _globals['_BOOTSERVICESUPERUSERPASSWORDRESPONSE']._serialized_end=1673 - _globals['_BOOTSERVICE']._serialized_start=1676 - _globals['_BOOTSERVICE']._serialized_end=2411 + _globals['_BOOTSERVICEWAITRESPONSE']._serialized_end=1323 + _globals['_BOOTSERVICEREPORTREQUEST']._serialized_start=1326 + _globals['_BOOTSERVICEREPORTREQUEST']._serialized_end=1501 + _globals['_BOOTSERVICEREPORTRESPONSE']._serialized_start=1503 + _globals['_BOOTSERVICEREPORTRESPONSE']._serialized_end=1530 + _globals['_BOOTSERVICESUPERUSERPASSWORDREQUEST']._serialized_start=1532 + _globals['_BOOTSERVICESUPERUSERPASSWORDREQUEST']._serialized_end=1599 + _globals['_BOOTSERVICESUPERUSERPASSWORDRESPONSE']._serialized_start=1602 + _globals['_BOOTSERVICESUPERUSERPASSWORDRESPONSE']._serialized_end=1743 + _globals['_BOOTSERVICE']._serialized_start=1746 + _globals['_BOOTSERVICE']._serialized_end=2481 # @@protoc_insertion_point(module_scope) diff --git a/python/metalstack/infra/v2/boot_pb2.pyi b/python/metalstack/infra/v2/boot_pb2.pyi index 51f65461..e2ca25d3 100644 --- a/python/metalstack/infra/v2/boot_pb2.pyi +++ b/python/metalstack/infra/v2/boot_pb2.pyi @@ -74,8 +74,10 @@ class BootServiceWaitRequest(_message.Message): def __init__(self, uuid: _Optional[str] = ...) -> None: ... class BootServiceWaitResponse(_message.Message): - __slots__ = () - def __init__(self) -> None: ... + __slots__ = ("allocation",) + ALLOCATION_FIELD_NUMBER: _ClassVar[int] + allocation: _machine_pb2.MachineAllocation + def __init__(self, allocation: _Optional[_Union[_machine_pb2.MachineAllocation, _Mapping]] = ...) -> None: ... class BootServiceReportRequest(_message.Message): __slots__ = ("uuid", "console_password", "success", "message") From 7052ad1d6253311f54862d8d73aaafce35752c82 Mon Sep 17 00:00:00 2001 From: Stefan Majer Date: Sat, 6 Sep 2025 14:36:50 +0200 Subject: [PATCH 21/27] Less priviledges --- go/metalstack/infra/v2/boot.pb.go | 7 +++---- go/permissions/servicepermissions.go | 1 - proto/metalstack/infra/v2/boot.proto | 4 ---- python/metalstack/infra/v2/boot_pb2.py | 6 +++--- python/metalstack/infra/v2/boot_pb2_grpc.py | 5 +---- 5 files changed, 7 insertions(+), 16 deletions(-) diff --git a/go/metalstack/infra/v2/boot.pb.go b/go/metalstack/infra/v2/boot.pb.go index fbde70e9..7a369511 100644 --- a/go/metalstack/infra/v2/boot.pb.go +++ b/go/metalstack/infra/v2/boot.pb.go @@ -759,10 +759,9 @@ const file_metalstack_infra_v2_boot_proto_rawDesc = "" + "$BootServiceSuperUserPasswordResponse\x12)\n" + "\x10feature_disabled\x18\x01 \x01(\bR\x0ffeatureDisabled\x12:\n" + "\x13super_user_password\x18\x02 \x01(\tB\n" + - "\xbaH\ar\x05\x10\x02\x18\x80\x01R\x11superUserPassword2\xdf\x05\n" + - "\vBootService\x12m\n" + - "\x04Dhcp\x12+.metalstack.infra.v2.BootServiceDhcpRequest\x1a,.metalstack.infra.v2.BootServiceDhcpResponse\"\n" + - "\xe0\xf3\x18\x02\xea\xf3\x18\x02\x01\x02\x12m\n" + + "\xbaH\ar\x05\x10\x02\x18\x80\x01R\x11superUserPassword2\xde\x05\n" + + "\vBootService\x12l\n" + + "\x04Dhcp\x12+.metalstack.infra.v2.BootServiceDhcpRequest\x1a,.metalstack.infra.v2.BootServiceDhcpResponse\"\t\xe0\xf3\x18\x02\xea\xf3\x18\x01\x01\x12m\n" + "\x04Boot\x12+.metalstack.infra.v2.BootServiceBootRequest\x1a,.metalstack.infra.v2.BootServiceBootResponse\"\n" + "\xe0\xf3\x18\x02\xea\xf3\x18\x02\x01\x02\x12\x93\x01\n" + "\x11SuperUserPassword\x128.metalstack.infra.v2.BootServiceSuperUserPasswordRequest\x1a9.metalstack.infra.v2.BootServiceSuperUserPasswordResponse\"\t\xe0\xf3\x18\x02\xf2\xf3\x18\x01\x01\x12x\n" + diff --git a/go/permissions/servicepermissions.go b/go/permissions/servicepermissions.go index 661b973f..ab7ae057 100755 --- a/go/permissions/servicepermissions.go +++ b/go/permissions/servicepermissions.go @@ -96,7 +96,6 @@ func GetServicePermissions() *ServicePermissions { }, "INFRA_ROLE_VIEWER": []string{ "/metalstack.infra.v2.BMCService/UpdateBMCInfo", - "/metalstack.infra.v2.BootService/Dhcp", "/metalstack.infra.v2.BootService/Boot", "/metalstack.infra.v2.EventService/SendMulti", "/metalstack.infra.v2.SwitchService/Register", diff --git a/proto/metalstack/infra/v2/boot.proto b/proto/metalstack/infra/v2/boot.proto index 233d27b9..7e199dce 100644 --- a/proto/metalstack/infra/v2/boot.proto +++ b/proto/metalstack/infra/v2/boot.proto @@ -13,7 +13,6 @@ service BootService { // Dhcp is the first dhcp request (option 97). A ProvisioningEventPXEBooting is fired rpc Dhcp(BootServiceDhcpRequest) returns (BootServiceDhcpResponse) { option (metalstack.api.v2.infra_roles) = INFRA_ROLE_EDITOR; - option (metalstack.api.v2.infra_roles) = INFRA_ROLE_VIEWER; option (metalstack.api.v2.auditing) = AUDITING_EXCLUDED; } // Boot is called from pixie once the machine got the first dhcp response and ipxie asks for subsequent kernel and initrd @@ -41,9 +40,6 @@ service BootService { option (metalstack.api.v2.auditing) = AUDITING_EXCLUDED; } - // FIXME after wait finished a MachineServiceGetRequest is required which must be possible with a machine_role_viewer - // This should be part of machine.proto - // Report tells metal-api installation was either successful or failed rpc Report(BootServiceReportRequest) returns (BootServiceReportResponse) { option (metalstack.api.v2.machine_roles) = MACHINE_ROLE_EDITOR; diff --git a/python/metalstack/infra/v2/boot_pb2.py b/python/metalstack/infra/v2/boot_pb2.py index 831b8df6..53600585 100644 --- a/python/metalstack/infra/v2/boot_pb2.py +++ b/python/metalstack/infra/v2/boot_pb2.py @@ -27,7 +27,7 @@ from metalstack.api.v2 import machine_pb2 as metalstack_dot_api_dot_v2_dot_machine__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1emetalstack/infra/v2/boot.proto\x12\x13metalstack.infra.v2\x1a\x1b\x62uf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a\x1fmetalstack/api/v2/machine.proto\"`\n\x16\x42ootServiceDhcpRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12(\n\tpartition\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\tpartition\"\x19\n\x17\x42ootServiceDhcpResponse\"\xc1\x01\n\x16\x42ootServiceBootRequest\x12}\n\x03mac\x18\x01 \x01(\tBk\xbaHh\xba\x01\x65\n\x03mac\x12\x1fmac must be a valid mac address\x1a=this.matches(\'^(?:[0-9A-Fa-f]{2}[:-]){5}(?:[0-9A-Fa-f]{2})$\')R\x03mac\x12(\n\tpartition\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\tpartition\"\xd2\x01\n\x17\x42ootServiceBootResponse\x12Z\n\x06kernel\x18\x01 \x01(\tBB\xbaH?\xba\x01<\n\x10valid_kernel_uri\x12\x1akernel must be a valid URI\x1a\x0cthis.isUri()R\x06kernel\x12$\n\x0einit_ram_disks\x18\x02 \x03(\tR\x0cinitRamDisks\x12)\n\x07\x63mdline\x18\x03 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01H\x00R\x07\x63mdline\x88\x01\x01\x42\n\n\x08_cmdline\"\xde\x02\n\x1a\x42ootServiceRegisterRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12>\n\x08hardware\x18\x02 \x01(\x0b\x32\".metalstack.api.v2.MachineHardwareR\x08hardware\x12\x32\n\x04\x62ios\x18\x03 \x01(\x0b\x32\x1e.metalstack.api.v2.MachineBiosR\x04\x62ios\x12\x32\n\x04ipmi\x18\x04 \x01(\x0b\x32\x1e.metalstack.api.v2.MachineIPMIR\x04ipmi\x12\x12\n\x04tags\x18\x05 \x03(\tR\x04tags\x12<\n\x14metal_hammer_version\x18\x06 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x12metalHammerVersion\x12(\n\tpartition\x18\x07 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\tpartition\"\x85\x01\n\x1b\x42ootServiceRegisterResponse\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12\x1e\n\x04size\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x04size\x12(\n\tpartition\x18\x03 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\tpartition\"6\n\x16\x42ootServiceWaitRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\"_\n\x17\x42ootServiceWaitResponse\x12\x44\n\nallocation\x18\x01 \x01(\x0b\x32$.metalstack.api.v2.MachineAllocationR\nallocation\"\xaf\x01\n\x18\x42ootServiceReportRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12\x35\n\x10\x63onsole_password\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x0f\x63onsolePassword\x12\x18\n\x07success\x18\x04 \x01(\x08R\x07success\x12$\n\x07message\x18\x05 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x04R\x07message\"\x1b\n\x19\x42ootServiceReportResponse\"C\n#BootServiceSuperUserPasswordRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\"\x8d\x01\n$BootServiceSuperUserPasswordResponse\x12)\n\x10\x66\x65\x61ture_disabled\x18\x01 \x01(\x08R\x0f\x66\x65\x61tureDisabled\x12:\n\x13super_user_password\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x11superUserPassword2\xdf\x05\n\x0b\x42ootService\x12m\n\x04\x44hcp\x12+.metalstack.infra.v2.BootServiceDhcpRequest\x1a,.metalstack.infra.v2.BootServiceDhcpResponse\"\n\xe0\xf3\x18\x02\xea\xf3\x18\x02\x01\x02\x12m\n\x04\x42oot\x12+.metalstack.infra.v2.BootServiceBootRequest\x1a,.metalstack.infra.v2.BootServiceBootResponse\"\n\xe0\xf3\x18\x02\xea\xf3\x18\x02\x01\x02\x12\x93\x01\n\x11SuperUserPassword\x12\x38.metalstack.infra.v2.BootServiceSuperUserPasswordRequest\x1a\x39.metalstack.infra.v2.BootServiceSuperUserPasswordResponse\"\t\xe0\xf3\x18\x02\xf2\xf3\x18\x01\x01\x12x\n\x08Register\x12/.metalstack.infra.v2.BootServiceRegisterRequest\x1a\x30.metalstack.infra.v2.BootServiceRegisterResponse\"\t\xe0\xf3\x18\x02\xf2\xf3\x18\x01\x01\x12n\n\x04Wait\x12+.metalstack.infra.v2.BootServiceWaitRequest\x1a,.metalstack.infra.v2.BootServiceWaitResponse\"\t\xe0\xf3\x18\x02\xf2\xf3\x18\x01\x01\x30\x01\x12r\n\x06Report\x12-.metalstack.infra.v2.BootServiceReportRequest\x1a..metalstack.infra.v2.BootServiceReportResponse\"\t\xe0\xf3\x18\x02\xf2\xf3\x18\x01\x01\x42\xcd\x01\n\x17\x63om.metalstack.infra.v2B\tBootProtoP\x01Z9github.com/metal-stack/api/go/metalstack/infra/v2;infrav2\xa2\x02\x03MIX\xaa\x02\x13Metalstack.Infra.V2\xca\x02\x13Metalstack\\Infra\\V2\xe2\x02\x1fMetalstack\\Infra\\V2\\GPBMetadata\xea\x02\x15Metalstack::Infra::V2b\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1emetalstack/infra/v2/boot.proto\x12\x13metalstack.infra.v2\x1a\x1b\x62uf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a\x1fmetalstack/api/v2/machine.proto\"`\n\x16\x42ootServiceDhcpRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12(\n\tpartition\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\tpartition\"\x19\n\x17\x42ootServiceDhcpResponse\"\xc1\x01\n\x16\x42ootServiceBootRequest\x12}\n\x03mac\x18\x01 \x01(\tBk\xbaHh\xba\x01\x65\n\x03mac\x12\x1fmac must be a valid mac address\x1a=this.matches(\'^(?:[0-9A-Fa-f]{2}[:-]){5}(?:[0-9A-Fa-f]{2})$\')R\x03mac\x12(\n\tpartition\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\tpartition\"\xd2\x01\n\x17\x42ootServiceBootResponse\x12Z\n\x06kernel\x18\x01 \x01(\tBB\xbaH?\xba\x01<\n\x10valid_kernel_uri\x12\x1akernel must be a valid URI\x1a\x0cthis.isUri()R\x06kernel\x12$\n\x0einit_ram_disks\x18\x02 \x03(\tR\x0cinitRamDisks\x12)\n\x07\x63mdline\x18\x03 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01H\x00R\x07\x63mdline\x88\x01\x01\x42\n\n\x08_cmdline\"\xde\x02\n\x1a\x42ootServiceRegisterRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12>\n\x08hardware\x18\x02 \x01(\x0b\x32\".metalstack.api.v2.MachineHardwareR\x08hardware\x12\x32\n\x04\x62ios\x18\x03 \x01(\x0b\x32\x1e.metalstack.api.v2.MachineBiosR\x04\x62ios\x12\x32\n\x04ipmi\x18\x04 \x01(\x0b\x32\x1e.metalstack.api.v2.MachineIPMIR\x04ipmi\x12\x12\n\x04tags\x18\x05 \x03(\tR\x04tags\x12<\n\x14metal_hammer_version\x18\x06 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x12metalHammerVersion\x12(\n\tpartition\x18\x07 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\tpartition\"\x85\x01\n\x1b\x42ootServiceRegisterResponse\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12\x1e\n\x04size\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x04size\x12(\n\tpartition\x18\x03 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\tpartition\"6\n\x16\x42ootServiceWaitRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\"_\n\x17\x42ootServiceWaitResponse\x12\x44\n\nallocation\x18\x01 \x01(\x0b\x32$.metalstack.api.v2.MachineAllocationR\nallocation\"\xaf\x01\n\x18\x42ootServiceReportRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12\x35\n\x10\x63onsole_password\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x0f\x63onsolePassword\x12\x18\n\x07success\x18\x04 \x01(\x08R\x07success\x12$\n\x07message\x18\x05 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x04R\x07message\"\x1b\n\x19\x42ootServiceReportResponse\"C\n#BootServiceSuperUserPasswordRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\"\x8d\x01\n$BootServiceSuperUserPasswordResponse\x12)\n\x10\x66\x65\x61ture_disabled\x18\x01 \x01(\x08R\x0f\x66\x65\x61tureDisabled\x12:\n\x13super_user_password\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x11superUserPassword2\xde\x05\n\x0b\x42ootService\x12l\n\x04\x44hcp\x12+.metalstack.infra.v2.BootServiceDhcpRequest\x1a,.metalstack.infra.v2.BootServiceDhcpResponse\"\t\xe0\xf3\x18\x02\xea\xf3\x18\x01\x01\x12m\n\x04\x42oot\x12+.metalstack.infra.v2.BootServiceBootRequest\x1a,.metalstack.infra.v2.BootServiceBootResponse\"\n\xe0\xf3\x18\x02\xea\xf3\x18\x02\x01\x02\x12\x93\x01\n\x11SuperUserPassword\x12\x38.metalstack.infra.v2.BootServiceSuperUserPasswordRequest\x1a\x39.metalstack.infra.v2.BootServiceSuperUserPasswordResponse\"\t\xe0\xf3\x18\x02\xf2\xf3\x18\x01\x01\x12x\n\x08Register\x12/.metalstack.infra.v2.BootServiceRegisterRequest\x1a\x30.metalstack.infra.v2.BootServiceRegisterResponse\"\t\xe0\xf3\x18\x02\xf2\xf3\x18\x01\x01\x12n\n\x04Wait\x12+.metalstack.infra.v2.BootServiceWaitRequest\x1a,.metalstack.infra.v2.BootServiceWaitResponse\"\t\xe0\xf3\x18\x02\xf2\xf3\x18\x01\x01\x30\x01\x12r\n\x06Report\x12-.metalstack.infra.v2.BootServiceReportRequest\x1a..metalstack.infra.v2.BootServiceReportResponse\"\t\xe0\xf3\x18\x02\xf2\xf3\x18\x01\x01\x42\xcd\x01\n\x17\x63om.metalstack.infra.v2B\tBootProtoP\x01Z9github.com/metal-stack/api/go/metalstack/infra/v2;infrav2\xa2\x02\x03MIX\xaa\x02\x13Metalstack.Infra.V2\xca\x02\x13Metalstack\\Infra\\V2\xe2\x02\x1fMetalstack\\Infra\\V2\\GPBMetadata\xea\x02\x15Metalstack::Infra::V2b\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -72,7 +72,7 @@ _globals['_BOOTSERVICESUPERUSERPASSWORDRESPONSE'].fields_by_name['super_user_password']._loaded_options = None _globals['_BOOTSERVICESUPERUSERPASSWORDRESPONSE'].fields_by_name['super_user_password']._serialized_options = b'\272H\007r\005\020\002\030\200\001' _globals['_BOOTSERVICE'].methods_by_name['Dhcp']._loaded_options = None - _globals['_BOOTSERVICE'].methods_by_name['Dhcp']._serialized_options = b'\340\363\030\002\352\363\030\002\001\002' + _globals['_BOOTSERVICE'].methods_by_name['Dhcp']._serialized_options = b'\340\363\030\002\352\363\030\001\001' _globals['_BOOTSERVICE'].methods_by_name['Boot']._loaded_options = None _globals['_BOOTSERVICE'].methods_by_name['Boot']._serialized_options = b'\340\363\030\002\352\363\030\002\001\002' _globals['_BOOTSERVICE'].methods_by_name['SuperUserPassword']._loaded_options = None @@ -108,5 +108,5 @@ _globals['_BOOTSERVICESUPERUSERPASSWORDRESPONSE']._serialized_start=1602 _globals['_BOOTSERVICESUPERUSERPASSWORDRESPONSE']._serialized_end=1743 _globals['_BOOTSERVICE']._serialized_start=1746 - _globals['_BOOTSERVICE']._serialized_end=2481 + _globals['_BOOTSERVICE']._serialized_end=2480 # @@protoc_insertion_point(module_scope) diff --git a/python/metalstack/infra/v2/boot_pb2_grpc.py b/python/metalstack/infra/v2/boot_pb2_grpc.py index 6c17f13f..ed944d32 100644 --- a/python/metalstack/infra/v2/boot_pb2_grpc.py +++ b/python/metalstack/infra/v2/boot_pb2_grpc.py @@ -91,10 +91,7 @@ def Wait(self, request, context): raise NotImplementedError('Method not implemented!') def Report(self, request, context): - """FIXME after wait finished a MachineServiceGetRequest is required which must be possible with a machine_role_viewer - This should be part of machine.proto - - Report tells metal-api installation was either successful or failed + """Report tells metal-api installation was either successful or failed """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') From 6dce6fb2d9e0c4defc45ab21ee08559dbae29c4a Mon Sep 17 00:00:00 2001 From: Stefan Majer Date: Mon, 8 Sep 2025 12:19:06 +0200 Subject: [PATCH 22/27] Even simpler --- generate/generate.go | 3 +-- go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/generate/generate.go b/generate/generate.go index a695b4aa..c04e7d1a 100644 --- a/generate/generate.go +++ b/generate/generate.go @@ -141,8 +141,7 @@ func servicePermissions(root string) (*permissions.ServicePermissions, error) { } auditable[methodName] = true - role := *methodOpt.IdentifierValue - switch role { + switch role := *methodOpt.IdentifierValue; role { // Tenant case v1.TenantRole_TENANT_ROLE_OWNER.String(), v1.TenantRole_TENANT_ROLE_EDITOR.String(), v1.TenantRole_TENANT_ROLE_VIEWER.String(), v1.TenantRole_TENANT_ROLE_GUEST.String(): roles.Tenant[role] = append(roles.Tenant[role], methodName) diff --git a/go.mod b/go.mod index c19251c5..84f7bac2 100644 --- a/go.mod +++ b/go.mod @@ -26,7 +26,7 @@ require ( github.com/stoewer/go-strcase v1.3.1 // indirect github.com/stretchr/objx v0.5.2 // indirect golang.org/x/exp v0.0.0-20250819193227-8b4c13bb791b // indirect - golang.org/x/text v0.28.0 // indirect + golang.org/x/text v0.29.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20250826171959-ef028d996bc1 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20250826171959-ef028d996bc1 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect diff --git a/go.sum b/go.sum index 372905de..7036b7e3 100644 --- a/go.sum +++ b/go.sum @@ -54,8 +54,8 @@ golang.org/x/exp v0.0.0-20250819193227-8b4c13bb791b h1:DXr+pvt3nC887026GRP39Ej11 golang.org/x/exp v0.0.0-20250819193227-8b4c13bb791b/go.mod h1:4QTo5u+SEIbbKW1RacMZq1YEfOBqeXa19JeshGi+zc4= golang.org/x/net v0.37.0 h1:1zLorHbz+LYj7MQlSf1+2tPIIgibq2eL5xkrGk6f+2c= golang.org/x/net v0.37.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8= -golang.org/x/text v0.28.0 h1:rhazDwis8INMIwQ4tpjLDzUhx6RlXqZNPEM0huQojng= -golang.org/x/text v0.28.0/go.mod h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU= +golang.org/x/text v0.29.0 h1:1neNs90w9YzJ9BocxfsQNHKuAT4pkghyXc4nhZ6sJvk= +golang.org/x/text v0.29.0/go.mod h1:7MhJOA9CD2qZyOKYazxdYMF85OwPdEr9jTtBpO7ydH4= google.golang.org/genproto/googleapis/api v0.0.0-20250826171959-ef028d996bc1 h1:APHvLLYBhtZvsbnpkfknDZ7NyH4z5+ub/I0u8L3Oz6g= google.golang.org/genproto/googleapis/api v0.0.0-20250826171959-ef028d996bc1/go.mod h1:xUjFWUnWDpZ/C0Gu0qloASKFb6f8/QXiiXhSPFsD668= google.golang.org/genproto/googleapis/rpc v0.0.0-20250826171959-ef028d996bc1 h1:pmJpJEvT846VzausCQ5d7KreSROcDqmO388w5YbnltA= From baf5c6056a7a25f467be779bfe23d42cd3767d19 Mon Sep 17 00:00:00 2001 From: Stefan Majer Date: Wed, 10 Sep 2025 07:16:59 +0200 Subject: [PATCH 23/27] Shift --- proto/metalstack/api/v2/common.proto | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/proto/metalstack/api/v2/common.proto b/proto/metalstack/api/v2/common.proto index 3549e2d8..fc41df2a 100644 --- a/proto/metalstack/api/v2/common.proto +++ b/proto/metalstack/api/v2/common.proto @@ -119,6 +119,19 @@ message Paging { optional uint64 count = 2; } +// Meta of a message +message Meta { + // Tags on this entity + optional Labels labels = 1; + // CreatedAt is the date when this ip was created + google.protobuf.Timestamp created_at = 2; + // UpdatedAt is the date when this ip was updated + google.protobuf.Timestamp updated_at = 3; + // Generation identifies the last updated time as uuidv7 field + // must be part of the update request to ensure optimistic locking + optional string generation = 4 [(buf.validate.field).string.uuid = true]; +} + // Labels define additional information to a entity message Labels { // Labels consists labels @@ -138,19 +151,6 @@ message Labels { }]; } -// Meta of a message -message Meta { - // Tags on this entity - optional Labels labels = 1; - // CreatedAt is the date when this ip was created - google.protobuf.Timestamp created_at = 2; - // UpdatedAt is the date when this ip was updated - google.protobuf.Timestamp updated_at = 3; - // Generation identifies the last updated time as uuidv7 field - // must be part of the update request to ensure optimistic locking - optional string generation = 4 [(buf.validate.field).string.uuid = true]; -} - // UpdateLabels is a message to update labels message UpdateLabels { // Update labels. New ones will be added, existing ones overwritten From afb64723acc473ac49e31c2d8a414413f9a2b2db Mon Sep 17 00:00:00 2001 From: Stefan Majer Date: Mon, 6 Oct 2025 07:51:19 +0200 Subject: [PATCH 24/27] Fix test --- go/tests/api_scopes_test.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/go/tests/api_scopes_test.go b/go/tests/api_scopes_test.go index 1f093687..5ec5ea2f 100644 --- a/go/tests/api_scopes_test.go +++ b/go/tests/api_scopes_test.go @@ -120,12 +120,8 @@ func Test_APIScopes(t *testing.T) { errs := errors.Join( errors.New("api service method: \"/metalstack.api.v2.WrongProjectService/Add\" has apiv2.TenantRole but request payload \"WrongProjectServiceAddRequest\" does not have a login field"), errors.New("api service method: \"/metalstack.api.v2.WrongProjectService/Get\" has apiv2.ProjectRole but request payload \"WrongProjectServiceGetRequest\" does not have a project field"), -<<<<<<< HEAD - errors.New("api service method: \"/metalstack.api.v2.WrongProjectService/List\" has no scope defined. one scope needs to be defined though. use one of the following scopes: [apiv2.AdminRole apiv2.InfraRole apiv2.MachineRole apiv2.ProjectRole apiv2.TenantRole apiv2.Visibility]"), -======= errors.New("api service method: \"/metalstack.api.v2.WrongProjectService/List\" has no scope defined. one scope needs to be defined though. use one of the following scopes: [apiv2.AdminRole apiv2.InfraRole apiv2.ProjectRole apiv2.TenantRole apiv2.Visibility]"), errors.New("api service method: \"/metalstack.api.v2.WrongProjectService/Update\" does not have a update_meta field in WrongProjectServiceUpdateRequest"), ->>>>>>> 8753899a94b07daf5854489573c0c7ba7c5f0e54 errors.New("api service method: \"/metalstack.api.v2.WrongProjectService/Update\" can not have apiv2.AdminRole ([ADMIN_ROLE_VIEWER]) and apiv2.ProjectRole ([PROJECT_ROLE_OWNER]) at the same time. only one scope is allowed."), errors.New("api service method: \"/metalstack.api.v2.WrongProjectService/Delete\" can not have apiv2.AdminRole ([ADMIN_ROLE_VIEWER]) and apiv2.Visibility ([VISIBILITY_PUBLIC]) at the same time. only one scope is allowed."), errors.New("api service method: \"/metalstack.api.v2.WrongProjectService/Charge\" has no scope defined. one scope needs to be defined though. use one of the following scopes: [apiv2.AdminRole apiv2.InfraRole apiv2.MachineRole apiv2.ProjectRole apiv2.TenantRole apiv2.Visibility]"), From 613fca085dbed0e7658ea48b4cc28bfc738491c8 Mon Sep 17 00:00:00 2001 From: Stefan Majer Date: Mon, 6 Oct 2025 07:54:44 +0200 Subject: [PATCH 25/27] Fix test --- go/tests/api_scopes_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go/tests/api_scopes_test.go b/go/tests/api_scopes_test.go index 5ec5ea2f..df7d89a5 100644 --- a/go/tests/api_scopes_test.go +++ b/go/tests/api_scopes_test.go @@ -120,7 +120,7 @@ func Test_APIScopes(t *testing.T) { errs := errors.Join( errors.New("api service method: \"/metalstack.api.v2.WrongProjectService/Add\" has apiv2.TenantRole but request payload \"WrongProjectServiceAddRequest\" does not have a login field"), errors.New("api service method: \"/metalstack.api.v2.WrongProjectService/Get\" has apiv2.ProjectRole but request payload \"WrongProjectServiceGetRequest\" does not have a project field"), - errors.New("api service method: \"/metalstack.api.v2.WrongProjectService/List\" has no scope defined. one scope needs to be defined though. use one of the following scopes: [apiv2.AdminRole apiv2.InfraRole apiv2.ProjectRole apiv2.TenantRole apiv2.Visibility]"), + errors.New("api service method: \"/metalstack.api.v2.WrongProjectService/List\" has no scope defined. one scope needs to be defined though. use one of the following scopes: [apiv2.AdminRole apiv2.InfraRole apiv2.MachineRole apiv2.ProjectRole apiv2.TenantRole apiv2.Visibility]"), errors.New("api service method: \"/metalstack.api.v2.WrongProjectService/Update\" does not have a update_meta field in WrongProjectServiceUpdateRequest"), errors.New("api service method: \"/metalstack.api.v2.WrongProjectService/Update\" can not have apiv2.AdminRole ([ADMIN_ROLE_VIEWER]) and apiv2.ProjectRole ([PROJECT_ROLE_OWNER]) at the same time. only one scope is allowed."), errors.New("api service method: \"/metalstack.api.v2.WrongProjectService/Delete\" can not have apiv2.AdminRole ([ADMIN_ROLE_VIEWER]) and apiv2.Visibility ([VISIBILITY_PUBLIC]) at the same time. only one scope is allowed."), From e5f26018a255f7bd04319bba3b112d94d1b33a49 Mon Sep 17 00:00:00 2001 From: Stefan Majer Date: Thu, 16 Oct 2025 11:40:28 +0200 Subject: [PATCH 26/27] Merge main --- .../infra/v2/infrav2connect/boot.connect.go | 92 +++++++++++-------- .../infra/v2/infrav2connect/event.connect.go | 32 ++++--- .../v2/infrav2connect/BootServiceClient.go | 68 +++++++------- .../v2/infrav2connect/BootServiceHandler.go | 64 ++++++------- .../v2/infrav2connect/EventServiceClient.go | 27 +++--- .../v2/infrav2connect/EventServiceHandler.go | 27 +++--- 6 files changed, 166 insertions(+), 144 deletions(-) diff --git a/go/metalstack/infra/v2/infrav2connect/boot.connect.go b/go/metalstack/infra/v2/infrav2connect/boot.connect.go index b00eb074..c89fa64d 100644 --- a/go/metalstack/infra/v2/infrav2connect/boot.connect.go +++ b/go/metalstack/infra/v2/infrav2connect/boot.connect.go @@ -51,17 +51,17 @@ const ( // BootServiceClient is a client for the metalstack.infra.v2.BootService service. type BootServiceClient interface { // Dhcp is the first dhcp request (option 97). A ProvisioningEventPXEBooting is fired - Dhcp(context.Context, *connect.Request[v2.BootServiceDhcpRequest]) (*connect.Response[v2.BootServiceDhcpResponse], error) + Dhcp(context.Context, *v2.BootServiceDhcpRequest) (*v2.BootServiceDhcpResponse, error) // Boot is called from pixie once the machine got the first dhcp response and ipxie asks for subsequent kernel and initrd - Boot(context.Context, *connect.Request[v2.BootServiceBootRequest]) (*connect.Response[v2.BootServiceBootResponse], error) + Boot(context.Context, *v2.BootServiceBootRequest) (*v2.BootServiceBootResponse, error) // SuperUserPassword metal-hammer takes the configured root password for the bmc from metal-api and configure the bmc accordingly - SuperUserPassword(context.Context, *connect.Request[v2.BootServiceSuperUserPasswordRequest]) (*connect.Response[v2.BootServiceSuperUserPasswordResponse], error) + SuperUserPassword(context.Context, *v2.BootServiceSuperUserPasswordRequest) (*v2.BootServiceSuperUserPasswordResponse, error) // Register is called from metal-hammer after hardware inventory is finished, tells metal-api all glory details about that machine - Register(context.Context, *connect.Request[v2.BootServiceRegisterRequest]) (*connect.Response[v2.BootServiceRegisterResponse], error) + Register(context.Context, *v2.BootServiceRegisterRequest) (*v2.BootServiceRegisterResponse, error) // Wait is a hanging call that waits until the machine gets allocated by a user - Wait(context.Context, *connect.Request[v2.BootServiceWaitRequest]) (*connect.ServerStreamForClient[v2.BootServiceWaitResponse], error) + Wait(context.Context, *v2.BootServiceWaitRequest) (*connect.ServerStreamForClient[v2.BootServiceWaitResponse], error) // Report tells metal-api installation was either successful or failed - Report(context.Context, *connect.Request[v2.BootServiceReportRequest]) (*connect.Response[v2.BootServiceReportResponse], error) + Report(context.Context, *v2.BootServiceReportRequest) (*v2.BootServiceReportResponse, error) } // NewBootServiceClient constructs a client for the metalstack.infra.v2.BootService service. By @@ -125,49 +125,69 @@ type bootServiceClient struct { } // Dhcp calls metalstack.infra.v2.BootService.Dhcp. -func (c *bootServiceClient) Dhcp(ctx context.Context, req *connect.Request[v2.BootServiceDhcpRequest]) (*connect.Response[v2.BootServiceDhcpResponse], error) { - return c.dhcp.CallUnary(ctx, req) +func (c *bootServiceClient) Dhcp(ctx context.Context, req *v2.BootServiceDhcpRequest) (*v2.BootServiceDhcpResponse, error) { + response, err := c.dhcp.CallUnary(ctx, connect.NewRequest(req)) + if response != nil { + return response.Msg, err + } + return nil, err } // Boot calls metalstack.infra.v2.BootService.Boot. -func (c *bootServiceClient) Boot(ctx context.Context, req *connect.Request[v2.BootServiceBootRequest]) (*connect.Response[v2.BootServiceBootResponse], error) { - return c.boot.CallUnary(ctx, req) +func (c *bootServiceClient) Boot(ctx context.Context, req *v2.BootServiceBootRequest) (*v2.BootServiceBootResponse, error) { + response, err := c.boot.CallUnary(ctx, connect.NewRequest(req)) + if response != nil { + return response.Msg, err + } + return nil, err } // SuperUserPassword calls metalstack.infra.v2.BootService.SuperUserPassword. -func (c *bootServiceClient) SuperUserPassword(ctx context.Context, req *connect.Request[v2.BootServiceSuperUserPasswordRequest]) (*connect.Response[v2.BootServiceSuperUserPasswordResponse], error) { - return c.superUserPassword.CallUnary(ctx, req) +func (c *bootServiceClient) SuperUserPassword(ctx context.Context, req *v2.BootServiceSuperUserPasswordRequest) (*v2.BootServiceSuperUserPasswordResponse, error) { + response, err := c.superUserPassword.CallUnary(ctx, connect.NewRequest(req)) + if response != nil { + return response.Msg, err + } + return nil, err } // Register calls metalstack.infra.v2.BootService.Register. -func (c *bootServiceClient) Register(ctx context.Context, req *connect.Request[v2.BootServiceRegisterRequest]) (*connect.Response[v2.BootServiceRegisterResponse], error) { - return c.register.CallUnary(ctx, req) +func (c *bootServiceClient) Register(ctx context.Context, req *v2.BootServiceRegisterRequest) (*v2.BootServiceRegisterResponse, error) { + response, err := c.register.CallUnary(ctx, connect.NewRequest(req)) + if response != nil { + return response.Msg, err + } + return nil, err } // Wait calls metalstack.infra.v2.BootService.Wait. -func (c *bootServiceClient) Wait(ctx context.Context, req *connect.Request[v2.BootServiceWaitRequest]) (*connect.ServerStreamForClient[v2.BootServiceWaitResponse], error) { - return c.wait.CallServerStream(ctx, req) +func (c *bootServiceClient) Wait(ctx context.Context, req *v2.BootServiceWaitRequest) (*connect.ServerStreamForClient[v2.BootServiceWaitResponse], error) { + return c.wait.CallServerStream(ctx, connect.NewRequest(req)) } // Report calls metalstack.infra.v2.BootService.Report. -func (c *bootServiceClient) Report(ctx context.Context, req *connect.Request[v2.BootServiceReportRequest]) (*connect.Response[v2.BootServiceReportResponse], error) { - return c.report.CallUnary(ctx, req) +func (c *bootServiceClient) Report(ctx context.Context, req *v2.BootServiceReportRequest) (*v2.BootServiceReportResponse, error) { + response, err := c.report.CallUnary(ctx, connect.NewRequest(req)) + if response != nil { + return response.Msg, err + } + return nil, err } // BootServiceHandler is an implementation of the metalstack.infra.v2.BootService service. type BootServiceHandler interface { // Dhcp is the first dhcp request (option 97). A ProvisioningEventPXEBooting is fired - Dhcp(context.Context, *connect.Request[v2.BootServiceDhcpRequest]) (*connect.Response[v2.BootServiceDhcpResponse], error) + Dhcp(context.Context, *v2.BootServiceDhcpRequest) (*v2.BootServiceDhcpResponse, error) // Boot is called from pixie once the machine got the first dhcp response and ipxie asks for subsequent kernel and initrd - Boot(context.Context, *connect.Request[v2.BootServiceBootRequest]) (*connect.Response[v2.BootServiceBootResponse], error) + Boot(context.Context, *v2.BootServiceBootRequest) (*v2.BootServiceBootResponse, error) // SuperUserPassword metal-hammer takes the configured root password for the bmc from metal-api and configure the bmc accordingly - SuperUserPassword(context.Context, *connect.Request[v2.BootServiceSuperUserPasswordRequest]) (*connect.Response[v2.BootServiceSuperUserPasswordResponse], error) + SuperUserPassword(context.Context, *v2.BootServiceSuperUserPasswordRequest) (*v2.BootServiceSuperUserPasswordResponse, error) // Register is called from metal-hammer after hardware inventory is finished, tells metal-api all glory details about that machine - Register(context.Context, *connect.Request[v2.BootServiceRegisterRequest]) (*connect.Response[v2.BootServiceRegisterResponse], error) + Register(context.Context, *v2.BootServiceRegisterRequest) (*v2.BootServiceRegisterResponse, error) // Wait is a hanging call that waits until the machine gets allocated by a user - Wait(context.Context, *connect.Request[v2.BootServiceWaitRequest], *connect.ServerStream[v2.BootServiceWaitResponse]) error + Wait(context.Context, *v2.BootServiceWaitRequest, *connect.ServerStream[v2.BootServiceWaitResponse]) error // Report tells metal-api installation was either successful or failed - Report(context.Context, *connect.Request[v2.BootServiceReportRequest]) (*connect.Response[v2.BootServiceReportResponse], error) + Report(context.Context, *v2.BootServiceReportRequest) (*v2.BootServiceReportResponse, error) } // NewBootServiceHandler builds an HTTP handler from the service implementation. It returns the path @@ -177,37 +197,37 @@ type BootServiceHandler interface { // and JSON codecs. They also support gzip compression. func NewBootServiceHandler(svc BootServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { bootServiceMethods := v2.File_metalstack_infra_v2_boot_proto.Services().ByName("BootService").Methods() - bootServiceDhcpHandler := connect.NewUnaryHandler( + bootServiceDhcpHandler := connect.NewUnaryHandlerSimple( BootServiceDhcpProcedure, svc.Dhcp, connect.WithSchema(bootServiceMethods.ByName("Dhcp")), connect.WithHandlerOptions(opts...), ) - bootServiceBootHandler := connect.NewUnaryHandler( + bootServiceBootHandler := connect.NewUnaryHandlerSimple( BootServiceBootProcedure, svc.Boot, connect.WithSchema(bootServiceMethods.ByName("Boot")), connect.WithHandlerOptions(opts...), ) - bootServiceSuperUserPasswordHandler := connect.NewUnaryHandler( + bootServiceSuperUserPasswordHandler := connect.NewUnaryHandlerSimple( BootServiceSuperUserPasswordProcedure, svc.SuperUserPassword, connect.WithSchema(bootServiceMethods.ByName("SuperUserPassword")), connect.WithHandlerOptions(opts...), ) - bootServiceRegisterHandler := connect.NewUnaryHandler( + bootServiceRegisterHandler := connect.NewUnaryHandlerSimple( BootServiceRegisterProcedure, svc.Register, connect.WithSchema(bootServiceMethods.ByName("Register")), connect.WithHandlerOptions(opts...), ) - bootServiceWaitHandler := connect.NewServerStreamHandler( + bootServiceWaitHandler := connect.NewServerStreamHandlerSimple( BootServiceWaitProcedure, svc.Wait, connect.WithSchema(bootServiceMethods.ByName("Wait")), connect.WithHandlerOptions(opts...), ) - bootServiceReportHandler := connect.NewUnaryHandler( + bootServiceReportHandler := connect.NewUnaryHandlerSimple( BootServiceReportProcedure, svc.Report, connect.WithSchema(bootServiceMethods.ByName("Report")), @@ -236,26 +256,26 @@ func NewBootServiceHandler(svc BootServiceHandler, opts ...connect.HandlerOption // UnimplementedBootServiceHandler returns CodeUnimplemented from all methods. type UnimplementedBootServiceHandler struct{} -func (UnimplementedBootServiceHandler) Dhcp(context.Context, *connect.Request[v2.BootServiceDhcpRequest]) (*connect.Response[v2.BootServiceDhcpResponse], error) { +func (UnimplementedBootServiceHandler) Dhcp(context.Context, *v2.BootServiceDhcpRequest) (*v2.BootServiceDhcpResponse, error) { return nil, connect.NewError(connect.CodeUnimplemented, errors.New("metalstack.infra.v2.BootService.Dhcp is not implemented")) } -func (UnimplementedBootServiceHandler) Boot(context.Context, *connect.Request[v2.BootServiceBootRequest]) (*connect.Response[v2.BootServiceBootResponse], error) { +func (UnimplementedBootServiceHandler) Boot(context.Context, *v2.BootServiceBootRequest) (*v2.BootServiceBootResponse, error) { return nil, connect.NewError(connect.CodeUnimplemented, errors.New("metalstack.infra.v2.BootService.Boot is not implemented")) } -func (UnimplementedBootServiceHandler) SuperUserPassword(context.Context, *connect.Request[v2.BootServiceSuperUserPasswordRequest]) (*connect.Response[v2.BootServiceSuperUserPasswordResponse], error) { +func (UnimplementedBootServiceHandler) SuperUserPassword(context.Context, *v2.BootServiceSuperUserPasswordRequest) (*v2.BootServiceSuperUserPasswordResponse, error) { return nil, connect.NewError(connect.CodeUnimplemented, errors.New("metalstack.infra.v2.BootService.SuperUserPassword is not implemented")) } -func (UnimplementedBootServiceHandler) Register(context.Context, *connect.Request[v2.BootServiceRegisterRequest]) (*connect.Response[v2.BootServiceRegisterResponse], error) { +func (UnimplementedBootServiceHandler) Register(context.Context, *v2.BootServiceRegisterRequest) (*v2.BootServiceRegisterResponse, error) { return nil, connect.NewError(connect.CodeUnimplemented, errors.New("metalstack.infra.v2.BootService.Register is not implemented")) } -func (UnimplementedBootServiceHandler) Wait(context.Context, *connect.Request[v2.BootServiceWaitRequest], *connect.ServerStream[v2.BootServiceWaitResponse]) error { +func (UnimplementedBootServiceHandler) Wait(context.Context, *v2.BootServiceWaitRequest, *connect.ServerStream[v2.BootServiceWaitResponse]) error { return connect.NewError(connect.CodeUnimplemented, errors.New("metalstack.infra.v2.BootService.Wait is not implemented")) } -func (UnimplementedBootServiceHandler) Report(context.Context, *connect.Request[v2.BootServiceReportRequest]) (*connect.Response[v2.BootServiceReportResponse], error) { +func (UnimplementedBootServiceHandler) Report(context.Context, *v2.BootServiceReportRequest) (*v2.BootServiceReportResponse, error) { return nil, connect.NewError(connect.CodeUnimplemented, errors.New("metalstack.infra.v2.BootService.Report is not implemented")) } diff --git a/go/metalstack/infra/v2/infrav2connect/event.connect.go b/go/metalstack/infra/v2/infrav2connect/event.connect.go index f3b6e495..79c2c490 100644 --- a/go/metalstack/infra/v2/infrav2connect/event.connect.go +++ b/go/metalstack/infra/v2/infrav2connect/event.connect.go @@ -42,9 +42,9 @@ const ( // EventServiceClient is a client for the metalstack.infra.v2.EventService service. type EventServiceClient interface { // Send an event of a single machine to the api - Send(context.Context, *connect.Request[v2.EventServiceSendRequest]) (*connect.Response[v2.EventServiceSendResponse], error) + Send(context.Context, *v2.EventServiceSendRequest) (*v2.EventServiceSendResponse, error) // SendMulti sends events of a bunch of machines in one request to the api - SendMulti(context.Context, *connect.Request[v2.EventServiceSendMultiRequest]) (*connect.Response[v2.EventServiceSendMultiResponse], error) + SendMulti(context.Context, *v2.EventServiceSendMultiRequest) (*v2.EventServiceSendMultiResponse, error) } // NewEventServiceClient constructs a client for the metalstack.infra.v2.EventService service. By @@ -80,21 +80,29 @@ type eventServiceClient struct { } // Send calls metalstack.infra.v2.EventService.Send. -func (c *eventServiceClient) Send(ctx context.Context, req *connect.Request[v2.EventServiceSendRequest]) (*connect.Response[v2.EventServiceSendResponse], error) { - return c.send.CallUnary(ctx, req) +func (c *eventServiceClient) Send(ctx context.Context, req *v2.EventServiceSendRequest) (*v2.EventServiceSendResponse, error) { + response, err := c.send.CallUnary(ctx, connect.NewRequest(req)) + if response != nil { + return response.Msg, err + } + return nil, err } // SendMulti calls metalstack.infra.v2.EventService.SendMulti. -func (c *eventServiceClient) SendMulti(ctx context.Context, req *connect.Request[v2.EventServiceSendMultiRequest]) (*connect.Response[v2.EventServiceSendMultiResponse], error) { - return c.sendMulti.CallUnary(ctx, req) +func (c *eventServiceClient) SendMulti(ctx context.Context, req *v2.EventServiceSendMultiRequest) (*v2.EventServiceSendMultiResponse, error) { + response, err := c.sendMulti.CallUnary(ctx, connect.NewRequest(req)) + if response != nil { + return response.Msg, err + } + return nil, err } // EventServiceHandler is an implementation of the metalstack.infra.v2.EventService service. type EventServiceHandler interface { // Send an event of a single machine to the api - Send(context.Context, *connect.Request[v2.EventServiceSendRequest]) (*connect.Response[v2.EventServiceSendResponse], error) + Send(context.Context, *v2.EventServiceSendRequest) (*v2.EventServiceSendResponse, error) // SendMulti sends events of a bunch of machines in one request to the api - SendMulti(context.Context, *connect.Request[v2.EventServiceSendMultiRequest]) (*connect.Response[v2.EventServiceSendMultiResponse], error) + SendMulti(context.Context, *v2.EventServiceSendMultiRequest) (*v2.EventServiceSendMultiResponse, error) } // NewEventServiceHandler builds an HTTP handler from the service implementation. It returns the @@ -104,13 +112,13 @@ type EventServiceHandler interface { // and JSON codecs. They also support gzip compression. func NewEventServiceHandler(svc EventServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { eventServiceMethods := v2.File_metalstack_infra_v2_event_proto.Services().ByName("EventService").Methods() - eventServiceSendHandler := connect.NewUnaryHandler( + eventServiceSendHandler := connect.NewUnaryHandlerSimple( EventServiceSendProcedure, svc.Send, connect.WithSchema(eventServiceMethods.ByName("Send")), connect.WithHandlerOptions(opts...), ) - eventServiceSendMultiHandler := connect.NewUnaryHandler( + eventServiceSendMultiHandler := connect.NewUnaryHandlerSimple( EventServiceSendMultiProcedure, svc.SendMulti, connect.WithSchema(eventServiceMethods.ByName("SendMulti")), @@ -131,10 +139,10 @@ func NewEventServiceHandler(svc EventServiceHandler, opts ...connect.HandlerOpti // UnimplementedEventServiceHandler returns CodeUnimplemented from all methods. type UnimplementedEventServiceHandler struct{} -func (UnimplementedEventServiceHandler) Send(context.Context, *connect.Request[v2.EventServiceSendRequest]) (*connect.Response[v2.EventServiceSendResponse], error) { +func (UnimplementedEventServiceHandler) Send(context.Context, *v2.EventServiceSendRequest) (*v2.EventServiceSendResponse, error) { return nil, connect.NewError(connect.CodeUnimplemented, errors.New("metalstack.infra.v2.EventService.Send is not implemented")) } -func (UnimplementedEventServiceHandler) SendMulti(context.Context, *connect.Request[v2.EventServiceSendMultiRequest]) (*connect.Response[v2.EventServiceSendMultiResponse], error) { +func (UnimplementedEventServiceHandler) SendMulti(context.Context, *v2.EventServiceSendMultiRequest) (*v2.EventServiceSendMultiResponse, error) { return nil, connect.NewError(connect.CodeUnimplemented, errors.New("metalstack.infra.v2.EventService.SendMulti is not implemented")) } diff --git a/go/tests/mocks/metalstack/infra/v2/infrav2connect/BootServiceClient.go b/go/tests/mocks/metalstack/infra/v2/infrav2connect/BootServiceClient.go index 4b91b8e5..02ac890c 100644 --- a/go/tests/mocks/metalstack/infra/v2/infrav2connect/BootServiceClient.go +++ b/go/tests/mocks/metalstack/infra/v2/infrav2connect/BootServiceClient.go @@ -18,27 +18,27 @@ type BootServiceClient struct { } // Boot provides a mock function with given fields: _a0, _a1 -func (_m *BootServiceClient) Boot(_a0 context.Context, _a1 *connect.Request[infrav2.BootServiceBootRequest]) (*connect.Response[infrav2.BootServiceBootResponse], error) { +func (_m *BootServiceClient) Boot(_a0 context.Context, _a1 *infrav2.BootServiceBootRequest) (*infrav2.BootServiceBootResponse, error) { ret := _m.Called(_a0, _a1) if len(ret) == 0 { panic("no return value specified for Boot") } - var r0 *connect.Response[infrav2.BootServiceBootResponse] + var r0 *infrav2.BootServiceBootResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.BootServiceBootRequest]) (*connect.Response[infrav2.BootServiceBootResponse], error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *infrav2.BootServiceBootRequest) (*infrav2.BootServiceBootResponse, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.BootServiceBootRequest]) *connect.Response[infrav2.BootServiceBootResponse]); ok { + if rf, ok := ret.Get(0).(func(context.Context, *infrav2.BootServiceBootRequest) *infrav2.BootServiceBootResponse); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*connect.Response[infrav2.BootServiceBootResponse]) + r0 = ret.Get(0).(*infrav2.BootServiceBootResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[infrav2.BootServiceBootRequest]) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *infrav2.BootServiceBootRequest) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -48,27 +48,27 @@ func (_m *BootServiceClient) Boot(_a0 context.Context, _a1 *connect.Request[infr } // Dhcp provides a mock function with given fields: _a0, _a1 -func (_m *BootServiceClient) Dhcp(_a0 context.Context, _a1 *connect.Request[infrav2.BootServiceDhcpRequest]) (*connect.Response[infrav2.BootServiceDhcpResponse], error) { +func (_m *BootServiceClient) Dhcp(_a0 context.Context, _a1 *infrav2.BootServiceDhcpRequest) (*infrav2.BootServiceDhcpResponse, error) { ret := _m.Called(_a0, _a1) if len(ret) == 0 { panic("no return value specified for Dhcp") } - var r0 *connect.Response[infrav2.BootServiceDhcpResponse] + var r0 *infrav2.BootServiceDhcpResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.BootServiceDhcpRequest]) (*connect.Response[infrav2.BootServiceDhcpResponse], error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *infrav2.BootServiceDhcpRequest) (*infrav2.BootServiceDhcpResponse, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.BootServiceDhcpRequest]) *connect.Response[infrav2.BootServiceDhcpResponse]); ok { + if rf, ok := ret.Get(0).(func(context.Context, *infrav2.BootServiceDhcpRequest) *infrav2.BootServiceDhcpResponse); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*connect.Response[infrav2.BootServiceDhcpResponse]) + r0 = ret.Get(0).(*infrav2.BootServiceDhcpResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[infrav2.BootServiceDhcpRequest]) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *infrav2.BootServiceDhcpRequest) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -78,27 +78,27 @@ func (_m *BootServiceClient) Dhcp(_a0 context.Context, _a1 *connect.Request[infr } // Register provides a mock function with given fields: _a0, _a1 -func (_m *BootServiceClient) Register(_a0 context.Context, _a1 *connect.Request[infrav2.BootServiceRegisterRequest]) (*connect.Response[infrav2.BootServiceRegisterResponse], error) { +func (_m *BootServiceClient) Register(_a0 context.Context, _a1 *infrav2.BootServiceRegisterRequest) (*infrav2.BootServiceRegisterResponse, error) { ret := _m.Called(_a0, _a1) if len(ret) == 0 { panic("no return value specified for Register") } - var r0 *connect.Response[infrav2.BootServiceRegisterResponse] + var r0 *infrav2.BootServiceRegisterResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.BootServiceRegisterRequest]) (*connect.Response[infrav2.BootServiceRegisterResponse], error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *infrav2.BootServiceRegisterRequest) (*infrav2.BootServiceRegisterResponse, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.BootServiceRegisterRequest]) *connect.Response[infrav2.BootServiceRegisterResponse]); ok { + if rf, ok := ret.Get(0).(func(context.Context, *infrav2.BootServiceRegisterRequest) *infrav2.BootServiceRegisterResponse); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*connect.Response[infrav2.BootServiceRegisterResponse]) + r0 = ret.Get(0).(*infrav2.BootServiceRegisterResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[infrav2.BootServiceRegisterRequest]) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *infrav2.BootServiceRegisterRequest) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -108,27 +108,27 @@ func (_m *BootServiceClient) Register(_a0 context.Context, _a1 *connect.Request[ } // Report provides a mock function with given fields: _a0, _a1 -func (_m *BootServiceClient) Report(_a0 context.Context, _a1 *connect.Request[infrav2.BootServiceReportRequest]) (*connect.Response[infrav2.BootServiceReportResponse], error) { +func (_m *BootServiceClient) Report(_a0 context.Context, _a1 *infrav2.BootServiceReportRequest) (*infrav2.BootServiceReportResponse, error) { ret := _m.Called(_a0, _a1) if len(ret) == 0 { panic("no return value specified for Report") } - var r0 *connect.Response[infrav2.BootServiceReportResponse] + var r0 *infrav2.BootServiceReportResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.BootServiceReportRequest]) (*connect.Response[infrav2.BootServiceReportResponse], error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *infrav2.BootServiceReportRequest) (*infrav2.BootServiceReportResponse, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.BootServiceReportRequest]) *connect.Response[infrav2.BootServiceReportResponse]); ok { + if rf, ok := ret.Get(0).(func(context.Context, *infrav2.BootServiceReportRequest) *infrav2.BootServiceReportResponse); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*connect.Response[infrav2.BootServiceReportResponse]) + r0 = ret.Get(0).(*infrav2.BootServiceReportResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[infrav2.BootServiceReportRequest]) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *infrav2.BootServiceReportRequest) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -138,27 +138,27 @@ func (_m *BootServiceClient) Report(_a0 context.Context, _a1 *connect.Request[in } // SuperUserPassword provides a mock function with given fields: _a0, _a1 -func (_m *BootServiceClient) SuperUserPassword(_a0 context.Context, _a1 *connect.Request[infrav2.BootServiceSuperUserPasswordRequest]) (*connect.Response[infrav2.BootServiceSuperUserPasswordResponse], error) { +func (_m *BootServiceClient) SuperUserPassword(_a0 context.Context, _a1 *infrav2.BootServiceSuperUserPasswordRequest) (*infrav2.BootServiceSuperUserPasswordResponse, error) { ret := _m.Called(_a0, _a1) if len(ret) == 0 { panic("no return value specified for SuperUserPassword") } - var r0 *connect.Response[infrav2.BootServiceSuperUserPasswordResponse] + var r0 *infrav2.BootServiceSuperUserPasswordResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.BootServiceSuperUserPasswordRequest]) (*connect.Response[infrav2.BootServiceSuperUserPasswordResponse], error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *infrav2.BootServiceSuperUserPasswordRequest) (*infrav2.BootServiceSuperUserPasswordResponse, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.BootServiceSuperUserPasswordRequest]) *connect.Response[infrav2.BootServiceSuperUserPasswordResponse]); ok { + if rf, ok := ret.Get(0).(func(context.Context, *infrav2.BootServiceSuperUserPasswordRequest) *infrav2.BootServiceSuperUserPasswordResponse); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*connect.Response[infrav2.BootServiceSuperUserPasswordResponse]) + r0 = ret.Get(0).(*infrav2.BootServiceSuperUserPasswordResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[infrav2.BootServiceSuperUserPasswordRequest]) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *infrav2.BootServiceSuperUserPasswordRequest) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -168,7 +168,7 @@ func (_m *BootServiceClient) SuperUserPassword(_a0 context.Context, _a1 *connect } // Wait provides a mock function with given fields: _a0, _a1 -func (_m *BootServiceClient) Wait(_a0 context.Context, _a1 *connect.Request[infrav2.BootServiceWaitRequest]) (*connect.ServerStreamForClient[infrav2.BootServiceWaitResponse], error) { +func (_m *BootServiceClient) Wait(_a0 context.Context, _a1 *infrav2.BootServiceWaitRequest) (*connect.ServerStreamForClient[infrav2.BootServiceWaitResponse], error) { ret := _m.Called(_a0, _a1) if len(ret) == 0 { @@ -177,10 +177,10 @@ func (_m *BootServiceClient) Wait(_a0 context.Context, _a1 *connect.Request[infr var r0 *connect.ServerStreamForClient[infrav2.BootServiceWaitResponse] var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.BootServiceWaitRequest]) (*connect.ServerStreamForClient[infrav2.BootServiceWaitResponse], error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *infrav2.BootServiceWaitRequest) (*connect.ServerStreamForClient[infrav2.BootServiceWaitResponse], error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.BootServiceWaitRequest]) *connect.ServerStreamForClient[infrav2.BootServiceWaitResponse]); ok { + if rf, ok := ret.Get(0).(func(context.Context, *infrav2.BootServiceWaitRequest) *connect.ServerStreamForClient[infrav2.BootServiceWaitResponse]); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { @@ -188,7 +188,7 @@ func (_m *BootServiceClient) Wait(_a0 context.Context, _a1 *connect.Request[infr } } - if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[infrav2.BootServiceWaitRequest]) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *infrav2.BootServiceWaitRequest) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) diff --git a/go/tests/mocks/metalstack/infra/v2/infrav2connect/BootServiceHandler.go b/go/tests/mocks/metalstack/infra/v2/infrav2connect/BootServiceHandler.go index 7b622a13..378bbc89 100644 --- a/go/tests/mocks/metalstack/infra/v2/infrav2connect/BootServiceHandler.go +++ b/go/tests/mocks/metalstack/infra/v2/infrav2connect/BootServiceHandler.go @@ -18,27 +18,27 @@ type BootServiceHandler struct { } // Boot provides a mock function with given fields: _a0, _a1 -func (_m *BootServiceHandler) Boot(_a0 context.Context, _a1 *connect.Request[infrav2.BootServiceBootRequest]) (*connect.Response[infrav2.BootServiceBootResponse], error) { +func (_m *BootServiceHandler) Boot(_a0 context.Context, _a1 *infrav2.BootServiceBootRequest) (*infrav2.BootServiceBootResponse, error) { ret := _m.Called(_a0, _a1) if len(ret) == 0 { panic("no return value specified for Boot") } - var r0 *connect.Response[infrav2.BootServiceBootResponse] + var r0 *infrav2.BootServiceBootResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.BootServiceBootRequest]) (*connect.Response[infrav2.BootServiceBootResponse], error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *infrav2.BootServiceBootRequest) (*infrav2.BootServiceBootResponse, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.BootServiceBootRequest]) *connect.Response[infrav2.BootServiceBootResponse]); ok { + if rf, ok := ret.Get(0).(func(context.Context, *infrav2.BootServiceBootRequest) *infrav2.BootServiceBootResponse); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*connect.Response[infrav2.BootServiceBootResponse]) + r0 = ret.Get(0).(*infrav2.BootServiceBootResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[infrav2.BootServiceBootRequest]) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *infrav2.BootServiceBootRequest) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -48,27 +48,27 @@ func (_m *BootServiceHandler) Boot(_a0 context.Context, _a1 *connect.Request[inf } // Dhcp provides a mock function with given fields: _a0, _a1 -func (_m *BootServiceHandler) Dhcp(_a0 context.Context, _a1 *connect.Request[infrav2.BootServiceDhcpRequest]) (*connect.Response[infrav2.BootServiceDhcpResponse], error) { +func (_m *BootServiceHandler) Dhcp(_a0 context.Context, _a1 *infrav2.BootServiceDhcpRequest) (*infrav2.BootServiceDhcpResponse, error) { ret := _m.Called(_a0, _a1) if len(ret) == 0 { panic("no return value specified for Dhcp") } - var r0 *connect.Response[infrav2.BootServiceDhcpResponse] + var r0 *infrav2.BootServiceDhcpResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.BootServiceDhcpRequest]) (*connect.Response[infrav2.BootServiceDhcpResponse], error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *infrav2.BootServiceDhcpRequest) (*infrav2.BootServiceDhcpResponse, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.BootServiceDhcpRequest]) *connect.Response[infrav2.BootServiceDhcpResponse]); ok { + if rf, ok := ret.Get(0).(func(context.Context, *infrav2.BootServiceDhcpRequest) *infrav2.BootServiceDhcpResponse); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*connect.Response[infrav2.BootServiceDhcpResponse]) + r0 = ret.Get(0).(*infrav2.BootServiceDhcpResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[infrav2.BootServiceDhcpRequest]) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *infrav2.BootServiceDhcpRequest) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -78,27 +78,27 @@ func (_m *BootServiceHandler) Dhcp(_a0 context.Context, _a1 *connect.Request[inf } // Register provides a mock function with given fields: _a0, _a1 -func (_m *BootServiceHandler) Register(_a0 context.Context, _a1 *connect.Request[infrav2.BootServiceRegisterRequest]) (*connect.Response[infrav2.BootServiceRegisterResponse], error) { +func (_m *BootServiceHandler) Register(_a0 context.Context, _a1 *infrav2.BootServiceRegisterRequest) (*infrav2.BootServiceRegisterResponse, error) { ret := _m.Called(_a0, _a1) if len(ret) == 0 { panic("no return value specified for Register") } - var r0 *connect.Response[infrav2.BootServiceRegisterResponse] + var r0 *infrav2.BootServiceRegisterResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.BootServiceRegisterRequest]) (*connect.Response[infrav2.BootServiceRegisterResponse], error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *infrav2.BootServiceRegisterRequest) (*infrav2.BootServiceRegisterResponse, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.BootServiceRegisterRequest]) *connect.Response[infrav2.BootServiceRegisterResponse]); ok { + if rf, ok := ret.Get(0).(func(context.Context, *infrav2.BootServiceRegisterRequest) *infrav2.BootServiceRegisterResponse); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*connect.Response[infrav2.BootServiceRegisterResponse]) + r0 = ret.Get(0).(*infrav2.BootServiceRegisterResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[infrav2.BootServiceRegisterRequest]) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *infrav2.BootServiceRegisterRequest) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -108,27 +108,27 @@ func (_m *BootServiceHandler) Register(_a0 context.Context, _a1 *connect.Request } // Report provides a mock function with given fields: _a0, _a1 -func (_m *BootServiceHandler) Report(_a0 context.Context, _a1 *connect.Request[infrav2.BootServiceReportRequest]) (*connect.Response[infrav2.BootServiceReportResponse], error) { +func (_m *BootServiceHandler) Report(_a0 context.Context, _a1 *infrav2.BootServiceReportRequest) (*infrav2.BootServiceReportResponse, error) { ret := _m.Called(_a0, _a1) if len(ret) == 0 { panic("no return value specified for Report") } - var r0 *connect.Response[infrav2.BootServiceReportResponse] + var r0 *infrav2.BootServiceReportResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.BootServiceReportRequest]) (*connect.Response[infrav2.BootServiceReportResponse], error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *infrav2.BootServiceReportRequest) (*infrav2.BootServiceReportResponse, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.BootServiceReportRequest]) *connect.Response[infrav2.BootServiceReportResponse]); ok { + if rf, ok := ret.Get(0).(func(context.Context, *infrav2.BootServiceReportRequest) *infrav2.BootServiceReportResponse); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*connect.Response[infrav2.BootServiceReportResponse]) + r0 = ret.Get(0).(*infrav2.BootServiceReportResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[infrav2.BootServiceReportRequest]) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *infrav2.BootServiceReportRequest) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -138,27 +138,27 @@ func (_m *BootServiceHandler) Report(_a0 context.Context, _a1 *connect.Request[i } // SuperUserPassword provides a mock function with given fields: _a0, _a1 -func (_m *BootServiceHandler) SuperUserPassword(_a0 context.Context, _a1 *connect.Request[infrav2.BootServiceSuperUserPasswordRequest]) (*connect.Response[infrav2.BootServiceSuperUserPasswordResponse], error) { +func (_m *BootServiceHandler) SuperUserPassword(_a0 context.Context, _a1 *infrav2.BootServiceSuperUserPasswordRequest) (*infrav2.BootServiceSuperUserPasswordResponse, error) { ret := _m.Called(_a0, _a1) if len(ret) == 0 { panic("no return value specified for SuperUserPassword") } - var r0 *connect.Response[infrav2.BootServiceSuperUserPasswordResponse] + var r0 *infrav2.BootServiceSuperUserPasswordResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.BootServiceSuperUserPasswordRequest]) (*connect.Response[infrav2.BootServiceSuperUserPasswordResponse], error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *infrav2.BootServiceSuperUserPasswordRequest) (*infrav2.BootServiceSuperUserPasswordResponse, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.BootServiceSuperUserPasswordRequest]) *connect.Response[infrav2.BootServiceSuperUserPasswordResponse]); ok { + if rf, ok := ret.Get(0).(func(context.Context, *infrav2.BootServiceSuperUserPasswordRequest) *infrav2.BootServiceSuperUserPasswordResponse); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*connect.Response[infrav2.BootServiceSuperUserPasswordResponse]) + r0 = ret.Get(0).(*infrav2.BootServiceSuperUserPasswordResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[infrav2.BootServiceSuperUserPasswordRequest]) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *infrav2.BootServiceSuperUserPasswordRequest) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -168,7 +168,7 @@ func (_m *BootServiceHandler) SuperUserPassword(_a0 context.Context, _a1 *connec } // Wait provides a mock function with given fields: _a0, _a1, _a2 -func (_m *BootServiceHandler) Wait(_a0 context.Context, _a1 *connect.Request[infrav2.BootServiceWaitRequest], _a2 *connect.ServerStream[infrav2.BootServiceWaitResponse]) error { +func (_m *BootServiceHandler) Wait(_a0 context.Context, _a1 *infrav2.BootServiceWaitRequest, _a2 *connect.ServerStream[infrav2.BootServiceWaitResponse]) error { ret := _m.Called(_a0, _a1, _a2) if len(ret) == 0 { @@ -176,7 +176,7 @@ func (_m *BootServiceHandler) Wait(_a0 context.Context, _a1 *connect.Request[inf } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.BootServiceWaitRequest], *connect.ServerStream[infrav2.BootServiceWaitResponse]) error); ok { + if rf, ok := ret.Get(0).(func(context.Context, *infrav2.BootServiceWaitRequest, *connect.ServerStream[infrav2.BootServiceWaitResponse]) error); ok { r0 = rf(_a0, _a1, _a2) } else { r0 = ret.Error(0) diff --git a/go/tests/mocks/metalstack/infra/v2/infrav2connect/EventServiceClient.go b/go/tests/mocks/metalstack/infra/v2/infrav2connect/EventServiceClient.go index 83bb5acd..4d72752c 100644 --- a/go/tests/mocks/metalstack/infra/v2/infrav2connect/EventServiceClient.go +++ b/go/tests/mocks/metalstack/infra/v2/infrav2connect/EventServiceClient.go @@ -5,10 +5,7 @@ package infrav2connect import ( context "context" - connect "connectrpc.com/connect" - infrav2 "github.com/metal-stack/api/go/metalstack/infra/v2" - mock "github.com/stretchr/testify/mock" ) @@ -18,27 +15,27 @@ type EventServiceClient struct { } // Send provides a mock function with given fields: _a0, _a1 -func (_m *EventServiceClient) Send(_a0 context.Context, _a1 *connect.Request[infrav2.EventServiceSendRequest]) (*connect.Response[infrav2.EventServiceSendResponse], error) { +func (_m *EventServiceClient) Send(_a0 context.Context, _a1 *infrav2.EventServiceSendRequest) (*infrav2.EventServiceSendResponse, error) { ret := _m.Called(_a0, _a1) if len(ret) == 0 { panic("no return value specified for Send") } - var r0 *connect.Response[infrav2.EventServiceSendResponse] + var r0 *infrav2.EventServiceSendResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.EventServiceSendRequest]) (*connect.Response[infrav2.EventServiceSendResponse], error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *infrav2.EventServiceSendRequest) (*infrav2.EventServiceSendResponse, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.EventServiceSendRequest]) *connect.Response[infrav2.EventServiceSendResponse]); ok { + if rf, ok := ret.Get(0).(func(context.Context, *infrav2.EventServiceSendRequest) *infrav2.EventServiceSendResponse); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*connect.Response[infrav2.EventServiceSendResponse]) + r0 = ret.Get(0).(*infrav2.EventServiceSendResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[infrav2.EventServiceSendRequest]) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *infrav2.EventServiceSendRequest) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -48,27 +45,27 @@ func (_m *EventServiceClient) Send(_a0 context.Context, _a1 *connect.Request[inf } // SendMulti provides a mock function with given fields: _a0, _a1 -func (_m *EventServiceClient) SendMulti(_a0 context.Context, _a1 *connect.Request[infrav2.EventServiceSendMultiRequest]) (*connect.Response[infrav2.EventServiceSendMultiResponse], error) { +func (_m *EventServiceClient) SendMulti(_a0 context.Context, _a1 *infrav2.EventServiceSendMultiRequest) (*infrav2.EventServiceSendMultiResponse, error) { ret := _m.Called(_a0, _a1) if len(ret) == 0 { panic("no return value specified for SendMulti") } - var r0 *connect.Response[infrav2.EventServiceSendMultiResponse] + var r0 *infrav2.EventServiceSendMultiResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.EventServiceSendMultiRequest]) (*connect.Response[infrav2.EventServiceSendMultiResponse], error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *infrav2.EventServiceSendMultiRequest) (*infrav2.EventServiceSendMultiResponse, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.EventServiceSendMultiRequest]) *connect.Response[infrav2.EventServiceSendMultiResponse]); ok { + if rf, ok := ret.Get(0).(func(context.Context, *infrav2.EventServiceSendMultiRequest) *infrav2.EventServiceSendMultiResponse); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*connect.Response[infrav2.EventServiceSendMultiResponse]) + r0 = ret.Get(0).(*infrav2.EventServiceSendMultiResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[infrav2.EventServiceSendMultiRequest]) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *infrav2.EventServiceSendMultiRequest) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) diff --git a/go/tests/mocks/metalstack/infra/v2/infrav2connect/EventServiceHandler.go b/go/tests/mocks/metalstack/infra/v2/infrav2connect/EventServiceHandler.go index 3627e6be..67219cad 100644 --- a/go/tests/mocks/metalstack/infra/v2/infrav2connect/EventServiceHandler.go +++ b/go/tests/mocks/metalstack/infra/v2/infrav2connect/EventServiceHandler.go @@ -5,10 +5,7 @@ package infrav2connect import ( context "context" - connect "connectrpc.com/connect" - infrav2 "github.com/metal-stack/api/go/metalstack/infra/v2" - mock "github.com/stretchr/testify/mock" ) @@ -18,27 +15,27 @@ type EventServiceHandler struct { } // Send provides a mock function with given fields: _a0, _a1 -func (_m *EventServiceHandler) Send(_a0 context.Context, _a1 *connect.Request[infrav2.EventServiceSendRequest]) (*connect.Response[infrav2.EventServiceSendResponse], error) { +func (_m *EventServiceHandler) Send(_a0 context.Context, _a1 *infrav2.EventServiceSendRequest) (*infrav2.EventServiceSendResponse, error) { ret := _m.Called(_a0, _a1) if len(ret) == 0 { panic("no return value specified for Send") } - var r0 *connect.Response[infrav2.EventServiceSendResponse] + var r0 *infrav2.EventServiceSendResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.EventServiceSendRequest]) (*connect.Response[infrav2.EventServiceSendResponse], error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *infrav2.EventServiceSendRequest) (*infrav2.EventServiceSendResponse, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.EventServiceSendRequest]) *connect.Response[infrav2.EventServiceSendResponse]); ok { + if rf, ok := ret.Get(0).(func(context.Context, *infrav2.EventServiceSendRequest) *infrav2.EventServiceSendResponse); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*connect.Response[infrav2.EventServiceSendResponse]) + r0 = ret.Get(0).(*infrav2.EventServiceSendResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[infrav2.EventServiceSendRequest]) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *infrav2.EventServiceSendRequest) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -48,27 +45,27 @@ func (_m *EventServiceHandler) Send(_a0 context.Context, _a1 *connect.Request[in } // SendMulti provides a mock function with given fields: _a0, _a1 -func (_m *EventServiceHandler) SendMulti(_a0 context.Context, _a1 *connect.Request[infrav2.EventServiceSendMultiRequest]) (*connect.Response[infrav2.EventServiceSendMultiResponse], error) { +func (_m *EventServiceHandler) SendMulti(_a0 context.Context, _a1 *infrav2.EventServiceSendMultiRequest) (*infrav2.EventServiceSendMultiResponse, error) { ret := _m.Called(_a0, _a1) if len(ret) == 0 { panic("no return value specified for SendMulti") } - var r0 *connect.Response[infrav2.EventServiceSendMultiResponse] + var r0 *infrav2.EventServiceSendMultiResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.EventServiceSendMultiRequest]) (*connect.Response[infrav2.EventServiceSendMultiResponse], error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *infrav2.EventServiceSendMultiRequest) (*infrav2.EventServiceSendMultiResponse, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[infrav2.EventServiceSendMultiRequest]) *connect.Response[infrav2.EventServiceSendMultiResponse]); ok { + if rf, ok := ret.Get(0).(func(context.Context, *infrav2.EventServiceSendMultiRequest) *infrav2.EventServiceSendMultiResponse); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*connect.Response[infrav2.EventServiceSendMultiResponse]) + r0 = ret.Get(0).(*infrav2.EventServiceSendMultiResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[infrav2.EventServiceSendMultiRequest]) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *infrav2.EventServiceSendMultiRequest) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) From efbc5dedfd9645314c619022807a2fec39ebff9b Mon Sep 17 00:00:00 2001 From: Stefan Majer Date: Mon, 27 Oct 2025 11:26:15 +0100 Subject: [PATCH 27/27] Updates --- go.mod | 11 ++++++----- go.sum | 22 ++++++++++++---------- proto/Makefile | 2 +- 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/go.mod b/go.mod index 24bb4f2d..d0d8ba57 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/go-task/slim-sprig/v3 v3.0.0 github.com/golang-jwt/jwt/v5 v5.3.0 github.com/google/go-cmp v0.7.0 - github.com/klauspost/connect-compress/v2 v2.0.0 + github.com/klauspost/connect-compress/v2 v2.1.0 github.com/stretchr/testify v1.11.1 google.golang.org/protobuf v1.36.10 ) @@ -20,15 +20,16 @@ require ( github.com/antlr4-go/antlr/v4 v4.13.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/google/cel-go v0.26.1 // indirect - github.com/klauspost/compress v1.18.0 // indirect + github.com/klauspost/compress v1.18.1 // indirect github.com/kr/pretty v0.3.1 // indirect + github.com/minio/minlz v1.0.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/stoewer/go-strcase v1.3.1 // indirect github.com/stretchr/objx v0.5.3 // indirect - golang.org/x/exp v0.0.0-20251009144603-d2f985daa21b // indirect + golang.org/x/exp v0.0.0-20251023183803-a4bb9ffd2546 // indirect golang.org/x/text v0.30.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20251007200510-49b9836ed3ff // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20251007200510-49b9836ed3ff // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20251022142026-3a174f9686a8 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20251022142026-3a174f9686a8 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 0d816771..0daccd5e 100644 --- a/go.sum +++ b/go.sum @@ -22,10 +22,10 @@ github.com/google/cel-go v0.26.1 h1:iPbVVEdkhTX++hpe3lzSk7D3G3QSYqLGoHOcEio+UXQ= github.com/google/cel-go v0.26.1/go.mod h1:A9O8OU9rdvrK5MQyrqfIxo1a0u4g3sF8KB6PUIaryMM= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= -github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo= -github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ= -github.com/klauspost/connect-compress/v2 v2.0.0 h1:L7TVsLa6Oo9Hkkb6r3DwSrhBbcWlXjneqBj7fCRXviU= -github.com/klauspost/connect-compress/v2 v2.0.0/go.mod h1:604CD9JSAjGqtVzCM4SRgM/9TFTkWBcp+2wlQfGyJ6c= +github.com/klauspost/compress v1.18.1 h1:bcSGx7UbpBqMChDtsF28Lw6v/G94LPrrbMbdC3JH2co= +github.com/klauspost/compress v1.18.1/go.mod h1:ZQFFVG+MdnR0P+l6wpXgIL4NTtwiKIdBnrBd8Nrxr+0= +github.com/klauspost/connect-compress/v2 v2.1.0 h1:8fM8QrVeHT69e5VVSh4yjDaQASYIvOp2uMZq7nVLj2U= +github.com/klauspost/connect-compress/v2 v2.1.0/go.mod h1:Ayurh2wscMMx3AwdGGVL+ylSR5316WfApREDgsqHyH8= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= @@ -33,6 +33,8 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/minio/minlz v1.0.1 h1:OUZUzXcib8diiX+JYxyRLIdomyZYzHct6EShOKtQY2A= +github.com/minio/minlz v1.0.1/go.mod h1:qT0aEB35q79LLornSzeDH75LBf3aH1MV+jB5w9Wasec= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= @@ -50,14 +52,14 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= -golang.org/x/exp v0.0.0-20251009144603-d2f985daa21b h1:18qgiDvlvH7kk8Ioa8Ov+K6xCi0GMvmGfGW0sgd/SYA= -golang.org/x/exp v0.0.0-20251009144603-d2f985daa21b/go.mod h1:j/pmGrbnkbPtQfxEe5D0VQhZC6qKbfKifgD0oM7sR70= +golang.org/x/exp v0.0.0-20251023183803-a4bb9ffd2546 h1:mgKeJMpvi0yx/sU5GsxQ7p6s2wtOnGAHZWCHUM4KGzY= +golang.org/x/exp v0.0.0-20251023183803-a4bb9ffd2546/go.mod h1:j/pmGrbnkbPtQfxEe5D0VQhZC6qKbfKifgD0oM7sR70= golang.org/x/text v0.30.0 h1:yznKA/E9zq54KzlzBEAWn1NXSQ8DIp/NYMy88xJjl4k= golang.org/x/text v0.30.0/go.mod h1:yDdHFIX9t+tORqspjENWgzaCVXgk0yYnYuSZ8UzzBVM= -google.golang.org/genproto/googleapis/api v0.0.0-20251007200510-49b9836ed3ff h1:8Zg5TdmcbU8A7CXGjGXF1Slqu/nIFCRaR3S5gT2plIA= -google.golang.org/genproto/googleapis/api v0.0.0-20251007200510-49b9836ed3ff/go.mod h1:dbWfpVPvW/RqafStmRWBUpMN14puDezDMHxNYiRfQu0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20251007200510-49b9836ed3ff h1:A90eA31Wq6HOMIQlLfzFwzqGKBTuaVztYu/g8sn+8Zc= -google.golang.org/genproto/googleapis/rpc v0.0.0-20251007200510-49b9836ed3ff/go.mod h1:7i2o+ce6H/6BluujYR+kqX3GKH+dChPTQU19wjRPiGk= +google.golang.org/genproto/googleapis/api v0.0.0-20251022142026-3a174f9686a8 h1:mepRgnBZa07I4TRuomDE4sTIYieg/osKmzIf4USdWS4= +google.golang.org/genproto/googleapis/api v0.0.0-20251022142026-3a174f9686a8/go.mod h1:fDMmzKV90WSg1NbozdqrE64fkuTv6mlq2zxo9ad+3yo= +google.golang.org/genproto/googleapis/rpc v0.0.0-20251022142026-3a174f9686a8 h1:M1rk8KBnUsBDg1oPGHNCxG4vc1f49epmTO7xscSajMk= +google.golang.org/genproto/googleapis/rpc v0.0.0-20251022142026-3a174f9686a8/go.mod h1:7i2o+ce6H/6BluujYR+kqX3GKH+dChPTQU19wjRPiGk= google.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE= google.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/proto/Makefile b/proto/Makefile index 1fbc4e7d..9b70a685 100644 --- a/proto/Makefile +++ b/proto/Makefile @@ -1,5 +1,5 @@ MAKEFLAGS += --no-print-directory -BUF_VERSION := 1.58.0 +BUF_VERSION := 1.59.0 _buf: docker run --rm \