diff --git a/.github/workflows/latest.yaml b/.github/workflows/latest.yaml index 2d2f8ac01..dc3ef2543 100644 --- a/.github/workflows/latest.yaml +++ b/.github/workflows/latest.yaml @@ -17,6 +17,15 @@ jobs: with: go-version: '1.18.x' + - name: setup buf + uses: bufbuild/buf-setup-action@v1 + with: + version: '1.5.0' + + - name: generate proto and lint + working-directory: proto + run: make protoc + - name: Docker Login uses: docker/login-action@v1 with: @@ -47,10 +56,10 @@ jobs: - name: Checkout uses: actions/checkout@v2 - - name: Set up Go 1.17 + - name: Set up Go 1.18 uses: actions/setup-go@v2 with: - go-version: '1.17.x' + go-version: '1.18.x' - name: Run integration tests run: | diff --git a/.github/workflows/pull_request.yaml b/.github/workflows/pull_request.yaml index d2fecd127..fafebed6e 100644 --- a/.github/workflows/pull_request.yaml +++ b/.github/workflows/pull_request.yaml @@ -17,6 +17,15 @@ jobs: with: go-version: '1.18.x' + - name: setup buf + uses: bufbuild/buf-setup-action@v1 + with: + version: '1.5.0' + + - name: generate proto and lint + working-directory: proto + run: make protoc + - name: Figure out if running fork PR id: fork run: '["${{ secrets.DOCKER_REGISTRY_TOKEN }}" == ""] && echo "::set-output name=is_fork_pr::true" || echo "::set-output name=is_fork_pr::false"' @@ -50,10 +59,10 @@ jobs: - name: Checkout uses: actions/checkout@v2 - - name: Set up Go 1.17 + - name: Set up Go 1.18 uses: actions/setup-go@v2 with: - go-version: '1.17.x' + go-version: '1.18.x' - name: Run integration tests run: | diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 6e7a54dc1..5ea3fc68e 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -17,6 +17,15 @@ jobs: with: go-version: '1.18.x' + - name: setup buf + uses: bufbuild/buf-setup-action@v1 + with: + version: '1.5.0' + + - name: generate proto and lint + working-directory: proto + run: make protoc + - name: Docker Login uses: docker/login-action@v1 with: diff --git a/.gitignore b/.gitignore index 503591b5f..564f528a0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ bin vendor .idea -.vscode/settings.json +.vscode generate coverage.out -__debug_bin \ No newline at end of file +__debug_bin diff --git a/Dockerfile b/Dockerfile index 03b6a308c..73eb832d2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM metalstack/builder:latest as builder -FROM alpine:3.15 +FROM alpine:3.16 RUN apk -U add ca-certificates COPY --from=builder /work/bin/metal-api /metal-api CMD ["/metal-api"] diff --git a/Makefile b/Makefile index f5d31c1dd..dea03b7a3 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ MINI_LAB_KUBECONFIG := $(shell pwd)/../mini-lab/.kubeconfig include $(COMMONDIR)/Makefile.inc -release:: protoc spec check-diff all ; +release:: spec check-diff all ; .PHONY: spec spec: all @@ -22,12 +22,13 @@ redoc: .PHONY: protoc protoc: - protoc -I pkg --go_out plugins=grpc:pkg pkg/api/v1/*.proto + rm -rf pkg/api/v1 + make -C proto protoc .PHONY: protoc-docker protoc-docker: - docker pull metalstack/builder - docker run --rm --user $$(id -u):$$(id -g) -v $(PWD):/work -w /work metalstack/builder protoc -I pkg --go_out plugins=grpc:pkg pkg/api/v1/*.proto + docker pull bufbuild/buf:1.5.0 + docker run --rm --user $$(id -u):$$(id -g) -v $(PWD):/work --tmpfs /.cache -w /work/proto bufbuild/buf:1.5.0 generate -v .PHONY: mini-lab-push mini-lab-push: diff --git a/cmd/metal-api/internal/datastore/size.go b/cmd/metal-api/internal/datastore/size.go index 4151b2aba..850e28d8e 100644 --- a/cmd/metal-api/internal/datastore/size.go +++ b/cmd/metal-api/internal/datastore/size.go @@ -48,7 +48,7 @@ func (rs *RethinkStore) FromHardware(hw metal.MachineHardware) (*metal.Size, []* // this should not happen, so we do not return a notfound return nil, nil, errors.New("no sizes found in database") } - var sizes []metal.Size + var sizes metal.Sizes for _, s := range sz { if len(s.Constraints) < 1 { rs.Error("missing constraints", "size", s) @@ -56,5 +56,5 @@ func (rs *RethinkStore) FromHardware(hw metal.MachineHardware) (*metal.Size, []* } sizes = append(sizes, s) } - return metal.Sizes(sizes).FromHardware(hw) + return sizes.FromHardware(hw) } diff --git a/cmd/metal-api/internal/datastore/switch.go b/cmd/metal-api/internal/datastore/switch.go index 3825eec08..8c67d8bfc 100644 --- a/cmd/metal-api/internal/datastore/switch.go +++ b/cmd/metal-api/internal/datastore/switch.go @@ -1,6 +1,8 @@ package datastore import ( + "fmt" + "github.com/metal-stack/metal-api/cmd/metal-api/internal/metal" r "gopkg.in/rethinkdb/rethinkdb-go.v6" ) @@ -64,6 +66,25 @@ func (rs *RethinkStore) SearchSwitches(rackid string, macs []string) ([]metal.Sw return ss, nil } +// SearchSwitchesByPartition searches for switches by the given partition. +func (rs *RethinkStore) SearchSwitchesByPartition(partitionID string) ([]metal.Switch, error) { + q := *rs.switchTable() + + if partitionID != "" { + q = q.Filter(func(row r.Term) r.Term { + return row.Field("partitionid").Eq(partitionID) + }) + } + + var ss []metal.Switch + err := rs.searchEntities(&q, &ss) + if err != nil { + return nil, err + } + + return ss, nil +} + // SearchSwitchesConnectedToMachine searches switches that are connected to the given machine. func (rs *RethinkStore) SearchSwitchesConnectedToMachine(m *metal.Machine) ([]metal.Switch, error) { switches, err := rs.SearchSwitches(m.RackID, nil) @@ -79,3 +100,83 @@ func (rs *RethinkStore) SearchSwitchesConnectedToMachine(m *metal.Machine) ([]me } return res, nil } + +// SetVrfAtSwitches finds the switches connected to the given machine and puts the switch ports into the given vrf. +// Returns the updated switches. +func (rs *RethinkStore) SetVrfAtSwitches(m *metal.Machine, vrf string) ([]metal.Switch, error) { + switches, err := rs.SearchSwitchesConnectedToMachine(m) + if err != nil { + return nil, err + } + newSwitches := make([]metal.Switch, 0) + for i := range switches { + sw := switches[i] + oldSwitch := sw + sw.SetVrfOfMachine(m, vrf) + err := rs.UpdateSwitch(&oldSwitch, &sw) + if err != nil { + return nil, err + } + newSwitches = append(newSwitches, sw) + } + return newSwitches, nil +} + +func (rs *RethinkStore) ConnectMachineWithSwitches(m *metal.Machine) error { + switches, err := rs.SearchSwitchesByPartition(m.PartitionID) + if err != nil { + return err + } + oldSwitches := []metal.Switch{} + newSwitches := []metal.Switch{} + for _, sw := range switches { + oldSwitch := sw + if cons := sw.ConnectMachine(m); cons > 0 { + oldSwitches = append(oldSwitches, oldSwitch) + newSwitches = append(newSwitches, sw) + } + } + + if len(newSwitches) != 2 { + return fmt.Errorf("machine %v is not connected to exactly two switches, found connections to %d switches", m.ID, len(newSwitches)) + } + + s1 := newSwitches[0] + s2 := newSwitches[1] + cons1 := s1.MachineConnections[m.ID] + cons2 := s2.MachineConnections[m.ID] + connectionMapError := fmt.Errorf("twin-switches do not have a connection map that is mirrored crosswise for machine %v, switch %v (connections: %v), switch %v (connections: %v)", m.ID, s1.Name, cons1, s2.Name, cons2) + if len(cons1) != len(cons2) { + return connectionMapError + } + + if s1.RackID != s2.RackID { + return fmt.Errorf("connected switches of a machine must reside in the same rack, rack of switch %s: %s, rack of switch %s: %s, machine: %s", s1.Name, s1.RackID, s2.Name, s2.RackID, m.ID) + } + // We detect the rackID of a machine by connections to leaf switches + m.RackID = s1.RackID + m.PartitionID = s1.PartitionID + + byNicName, err := s2.MachineConnections.ByNicName() + if err != nil { + return err + } + for _, con := range s1.MachineConnections[m.ID] { + if con2, has := byNicName[con.Nic.Name]; has { + if con.Nic.Name != con2.Nic.Name { + return connectionMapError + } + } else { + return connectionMapError + } + } + + for i := range oldSwitches { + err = rs.UpdateSwitch(&oldSwitches[i], &newSwitches[i]) + if err != nil { + return err + } + } + + return nil +} diff --git a/cmd/metal-api/internal/grpc/boot-service.go b/cmd/metal-api/internal/grpc/boot-service.go new file mode 100644 index 000000000..5e63c742e --- /dev/null +++ b/cmd/metal-api/internal/grpc/boot-service.go @@ -0,0 +1,419 @@ +package grpc + +import ( + "context" + "errors" + "fmt" + "os" + "strings" + + "github.com/avast/retry-go/v4" + "github.com/metal-stack/metal-api/cmd/metal-api/internal/datastore" + "github.com/metal-stack/metal-api/cmd/metal-api/internal/metal" + v1 "github.com/metal-stack/metal-api/pkg/api/v1" + "github.com/metal-stack/metal-lib/bus" + "go.uber.org/zap" +) + +type BootService struct { + log *zap.SugaredLogger + ds Datasource + superUserPassword *string + publisher bus.Publisher + eventService *EventService +} + +func NewBootService(cfg *ServerConfig, eventService *EventService) *BootService { + log := cfg.Logger.Named("boot-service") + + var superUserPassword *string + pwd, err := os.ReadFile(cfg.BMCSuperUserPasswordFile) + if err != nil { + log.Infow("superuserpassword not found, disabling feature", "error", err) + } else { + s := strings.TrimSpace(string(pwd)) + superUserPassword = &s + } + + return &BootService{ + ds: cfg.Datasource, + log: log, + publisher: cfg.Publisher, + superUserPassword: superUserPassword, + eventService: eventService, + } +} +func (b *BootService) Dhcp(ctx context.Context, req *v1.BootServiceDhcpRequest) (*v1.BootServiceDhcpResponse, error) { + b.log.Infow("dhcp", "req", req) + + _, err := b.eventService.Send(ctx, &v1.EventServiceSendRequest{Events: map[string]*v1.MachineProvisioningEvent{ + req.Uuid: { + Event: string(metal.ProvisioningEventPXEBooting), + Message: "machine sent extended dhcp request", + }, + }}) + if err != nil { + return nil, err + } + return &v1.BootServiceDhcpResponse{}, nil +} + +func (b *BootService) Boot(ctx context.Context, req *v1.BootServiceBootRequest) (*v1.BootServiceBootResponse, error) { + b.log.Infow("boot", "req", req) + + p, err := b.ds.FindPartition(req.PartitionId) + if err != nil || p == nil { + return nil, fmt.Errorf("no partition with id:%q found %w", req.PartitionId, err) + } + + resp := &v1.BootServiceBootResponse{ + Kernel: p.BootConfiguration.KernelURL, + InitRamDisks: []string{p.BootConfiguration.ImageURL}, + Cmdline: &p.BootConfiguration.CommandLine, + } + b.log.Infow("boot", "resp", resp) + return resp, nil +} + +func (b *BootService) Register(ctx context.Context, req *v1.BootServiceRegisterRequest) (*v1.BootServiceRegisterResponse, error) { + b.log.Infow("register", "req", req) + if req.Uuid == "" { + return nil, errors.New("uuid is empty") + } + + m, err := b.ds.FindMachineByID(req.Uuid) + if err != nil && !metal.IsNotFound(err) { + return nil, err + } + + if req.Hardware == nil { + return nil, errors.New("hardware is nil") + } + + disks := []metal.BlockDevice{} + for i := range req.Hardware.Disks { + d := req.Hardware.Disks[i] + disks = append(disks, metal.BlockDevice{ + Name: d.Name, + Size: d.Size, + }) + } + + nics := metal.Nics{} + for i := range req.Hardware.Nics { + nic := req.Hardware.Nics[i] + neighs := metal.Nics{} + for j := range nic.Neighbors { + neigh := nic.Neighbors[j] + neighs = append(neighs, metal.Nic{ + Name: neigh.Name, + MacAddress: metal.MacAddress(neigh.Mac), + }) + } + nics = append(nics, metal.Nic{ + Name: nic.Name, + MacAddress: metal.MacAddress(nic.Mac), + Neighbors: neighs, + }) + } + + machineHardware := metal.MachineHardware{ + Memory: req.Hardware.Memory, + CPUCores: int(req.Hardware.CpuCores), + Disks: disks, + Nics: nics, + } + + size, _, err := b.ds.FromHardware(machineHardware) + if err != nil { + size = metal.UnknownSize + b.log.Errorw("no size found for hardware, defaulting to unknown size", "hardware", machineHardware, "error", err) + } + + var ipmi metal.IPMI + if req.Ipmi != nil { + i := req.Ipmi + + ipmi = metal.IPMI{ + Address: i.Address, + MacAddress: i.Mac, + User: i.User, + Password: i.Password, + Interface: i.Interface, + BMCVersion: i.BmcVersion, + PowerState: i.PowerState, + } + if i.Fru != nil { + f := i.Fru + fru := metal.Fru{} + if f.ChassisPartNumber != nil { + fru.ChassisPartNumber = *f.ChassisPartNumber + } + if f.ChassisPartSerial != nil { + fru.ChassisPartSerial = *f.ChassisPartSerial + } + if f.BoardMfg != nil { + fru.BoardMfg = *f.BoardMfg + } + if f.BoardMfgSerial != nil { + fru.BoardMfgSerial = *f.BoardMfgSerial + } + if f.BoardPartNumber != nil { + fru.BoardPartNumber = *f.BoardPartNumber + } + if f.ProductManufacturer != nil { + fru.ProductManufacturer = *f.ProductManufacturer + } + if f.ProductPartNumber != nil { + fru.ProductPartNumber = *f.ProductPartNumber + } + if f.ProductSerial != nil { + fru.ProductSerial = *f.ProductSerial + } + ipmi.Fru = fru + } + + } + + if m == nil { + // machine is not in the database, create it + m = &metal.Machine{ + Base: metal.Base{ + ID: req.Uuid, + }, + Allocation: nil, + SizeID: size.ID, + Hardware: machineHardware, + BIOS: metal.BIOS{ + Version: req.Bios.Version, + Vendor: req.Bios.Vendor, + Date: req.Bios.Date, + }, + State: metal.MachineState{ + Value: metal.AvailableState, + MetalHammerVersion: req.MetalHammerVersion, + }, + LEDState: metal.ChassisIdentifyLEDState{ + Value: metal.LEDStateOff, + Description: "Machine registered", + }, + Tags: req.Tags, + IPMI: ipmi, + } + + err = b.ds.CreateMachine(m) + if err != nil { + return nil, err + } + } else { + // machine has already registered, update it + old := *m + + m.SizeID = size.ID + m.Hardware = machineHardware + m.BIOS.Version = req.Bios.Version + m.BIOS.Vendor = req.Bios.Vendor + m.BIOS.Date = req.Bios.Date + m.IPMI = ipmi + + err = b.ds.UpdateMachine(&old, m) + if err != nil { + return nil, err + } + } + + ec, err := b.ds.FindProvisioningEventContainer(m.ID) + if err != nil && !metal.IsNotFound(err) { + return nil, err + } + + if ec == nil { + err = b.ds.CreateProvisioningEventContainer(&metal.ProvisioningEventContainer{ + Base: metal.Base{ID: m.ID}, + Liveliness: metal.MachineLivelinessAlive, + IncompleteProvisioningCycles: "0", + }, + ) + if err != nil { + return nil, err + } + } + + old := *m + err = retry.Do( + func() error { + // RackID and PartitionID is set + err := b.ds.ConnectMachineWithSwitches(m) + if err != nil { + return err + } + return b.ds.UpdateMachine(&old, m) + }, + retry.Attempts(10), + retry.RetryIf(func(err error) bool { + return strings.Contains(err.Error(), datastore.EntityAlreadyModifiedErrorMessage) + }), + retry.DelayType(retry.CombineDelay(retry.BackOffDelay, retry.RandomDelay)), + retry.LastErrorOnly(true), + ) + + if err != nil { + return nil, err + } + + return &v1.BootServiceRegisterResponse{ + Uuid: req.Uuid, + Size: size.ID, + PartitionId: m.PartitionID, + }, nil +} + +func (b *BootService) SuperUserPassword(ctx context.Context, req *v1.BootServiceSuperUserPasswordRequest) (*v1.BootServiceSuperUserPasswordResponse, error) { + b.log.Infow("superuserpassword", "req", req) + defer ctx.Done() + + resp := &v1.BootServiceSuperUserPasswordResponse{ + FeatureDisabled: true, + } + if b.superUserPassword == nil { + return resp, nil + } + + resp.FeatureDisabled = false + resp.SuperUserPassword = *b.superUserPassword + return resp, nil +} + +func (b *BootService) Report(ctx context.Context, req *v1.BootServiceReportRequest) (*v1.BootServiceReportResponse, error) { + b.log.Infow("report", "req", req) + + // FIXME implement success handling + + m, err := b.ds.FindMachineByID(req.Uuid) + if err != nil { + return nil, err + } + if m.Allocation == nil { + return nil, fmt.Errorf("the machine %q is not allocated", req.Uuid) + } + if req.BootInfo == nil { + return nil, fmt.Errorf("the machine %q bootinfo is nil", req.Uuid) + } + + old := *m + + bootInfo := req.BootInfo + + m.Allocation.ConsolePassword = req.ConsolePassword + m.Allocation.MachineSetup = &metal.MachineSetup{ + ImageID: m.Allocation.ImageID, + PrimaryDisk: bootInfo.PrimaryDisk, + OSPartition: bootInfo.OsPartition, + Initrd: bootInfo.Initrd, + Cmdline: bootInfo.Cmdline, + Kernel: bootInfo.Kernel, + BootloaderID: bootInfo.BootloaderId, + } + m.Allocation.Reinstall = false + + err = b.ds.UpdateMachine(&old, m) + if err != nil { + return nil, err + } + + vrf := "" + switch role := m.Allocation.Role; role { + case metal.RoleFirewall: + // firewalls are not enslaved into tenant vrfs + vrf = "default" + case metal.RoleFirewall: + for _, mn := range m.Allocation.MachineNetworks { + if mn.Private { + vrf = fmt.Sprintf("vrf%d", mn.Vrf) + break + } + } + default: + return nil, fmt.Errorf("unknown allocation role:%q found", role) + } + if vrf == "" { + return nil, fmt.Errorf("the machine %q could not be enslaved into the vrf because no vrf was found, error: %w", req.Uuid, err) + } + + err = retry.Do( + func() error { + _, err := b.ds.SetVrfAtSwitches(m, vrf) + return err + }, + retry.Attempts(10), + retry.RetryIf(func(err error) bool { + return strings.Contains(err.Error(), datastore.EntityAlreadyModifiedErrorMessage) + }), + retry.DelayType(retry.CombineDelay(retry.BackOffDelay, retry.RandomDelay)), + retry.LastErrorOnly(true), + ) + if err != nil { + return nil, fmt.Errorf("the machine %q could not be enslaved into the vrf %s, error: %w", req.Uuid, vrf, err) + } + + b.setBootOrderDisk(m.ID, m.PartitionID) + return &v1.BootServiceReportResponse{}, nil +} + +func (b *BootService) AbortReinstall(ctx context.Context, req *v1.BootServiceAbortReinstallRequest) (*v1.BootServiceAbortReinstallResponse, error) { + b.log.Infow("abortreinstall", "req", req) + m, err := b.ds.FindMachineByID(req.Uuid) + if err != nil { + return nil, err + } + + var bootInfo *v1.BootInfo + + if m.Allocation != nil && !req.PrimaryDiskWiped { + old := *m + + m.Allocation.Reinstall = false + if m.Allocation.MachineSetup != nil { + m.Allocation.ImageID = m.Allocation.MachineSetup.ImageID + } + + err = b.ds.UpdateMachine(&old, m) + if err != nil { + return nil, err + } + b.log.Infow("removed reinstall mark", "machineID", m.ID) + + if m.Allocation.MachineSetup != nil { + bootInfo = &v1.BootInfo{ + ImageId: m.Allocation.MachineSetup.ImageID, + PrimaryDisk: m.Allocation.MachineSetup.PrimaryDisk, + OsPartition: m.Allocation.MachineSetup.OSPartition, + Initrd: m.Allocation.MachineSetup.Initrd, + Cmdline: m.Allocation.MachineSetup.Cmdline, + Kernel: m.Allocation.MachineSetup.Kernel, + BootloaderId: m.Allocation.MachineSetup.BootloaderID, + } + } + } + b.setBootOrderDisk(m.ID, m.PartitionID) + // FIXME what to do in the else case ? + + return &v1.BootServiceAbortReinstallResponse{BootInfo: bootInfo}, nil +} + +func (b *BootService) setBootOrderDisk(machineID, partitionID string) { + evt := metal.MachineEvent{ + Type: metal.COMMAND, + Cmd: &metal.MachineExecCommand{ + Command: metal.MachineDiskCmd, + Params: nil, + TargetMachineID: machineID, + }, + } + + b.log.Infow("publish event", "event", evt, "command", *evt.Cmd) + err := b.publisher.Publish(metal.TopicMachine.GetFQN(partitionID), evt) + if err != nil { + b.log.Errorw("unable to send boot via hd, continue anyway", "error", err) + } +} diff --git a/cmd/metal-api/internal/grpc/grpc-server.go b/cmd/metal-api/internal/grpc/grpc-server.go index e909cda00..e674a374a 100644 --- a/cmd/metal-api/internal/grpc/grpc-server.go +++ b/cmd/metal-api/internal/grpc/grpc-server.go @@ -1,11 +1,13 @@ package grpc import ( + "context" "crypto/tls" "crypto/x509" "fmt" "net" "os" + "runtime/debug" "time" grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware" @@ -15,8 +17,11 @@ import ( grpc_prometheus "github.com/grpc-ecosystem/go-grpc-prometheus" "github.com/metal-stack/masterdata-api/pkg/interceptors/grpc_internalerror" "google.golang.org/grpc" + "google.golang.org/grpc/codes" "google.golang.org/grpc/keepalive" + "google.golang.org/grpc/status" + "github.com/metal-stack/metal-api/cmd/metal-api/internal/datastore" "github.com/metal-stack/metal-api/cmd/metal-api/internal/metal" v1 "github.com/metal-stack/metal-api/pkg/api/v1" "github.com/metal-stack/metal-lib/bus" @@ -30,9 +35,16 @@ const ( type Datasource interface { FindMachineByID(machineID string) (*metal.Machine, error) + FindMachine(q *datastore.MachineSearchQuery, ms *metal.Machine) error + FindPartition(partitionID string) (*metal.Partition, error) CreateMachine(*metal.Machine) error UpdateMachine(old, new *metal.Machine) error + FindProvisioningEventContainer(id string) (*metal.ProvisioningEventContainer, error) + CreateProvisioningEventContainer(ec *metal.ProvisioningEventContainer) error ProvisioningEventForMachine(log *zap.SugaredLogger, machineID, event, message string) (*metal.ProvisioningEventContainer, error) + SetVrfAtSwitches(m *metal.Machine, vrf string) ([]metal.Switch, error) + ConnectMachineWithSwitches(m *metal.Machine) error + FromHardware(hw metal.MachineHardware) (*metal.Size, []*metal.SizeMatchingLog, error) } type ServerConfig struct { @@ -53,8 +65,8 @@ type ServerConfig struct { type Server struct { *WaitService - *SupwdService *EventService + *BootService ds Datasource logger *zap.SugaredLogger server *grpc.Server @@ -77,14 +89,14 @@ func NewServer(cfg *ServerConfig) (*Server, error) { if err != nil { return nil, err } - supwdService := NewSupwdService(cfg) eventService := NewEventService(cfg) + bootService := NewBootService(cfg, eventService) s := &Server{ WaitService: waitService, - SupwdService: supwdService, EventService: eventService, + BootService: bootService, ds: cfg.Datasource, logger: cfg.Logger, grpcPort: cfg.GrpcPort, @@ -111,6 +123,14 @@ func (s *Server) Serve() error { grpcLogger := s.logger.Named("grpc").Desugar() grpc_zap.ReplaceGrpcLoggerV2(grpcLogger) + + recoveryOpt := grpc_recovery.WithRecoveryHandlerContext( + func(ctx context.Context, p any) error { + grpcLogger.Sugar().Errorf("[PANIC] %s stack:%s", p, string(debug.Stack())) + return status.Errorf(codes.Internal, "%s", p) + }, + ) + s.server = grpc.NewServer( grpc.KeepaliveEnforcementPolicy(kaep), grpc.KeepaliveParams(kasp), @@ -119,21 +139,21 @@ func (s *Server) Serve() error { grpc_prometheus.StreamServerInterceptor, grpc_zap.StreamServerInterceptor(grpcLogger), grpc_internalerror.StreamServerInterceptor(), - grpc_recovery.StreamServerInterceptor(), + grpc_recovery.StreamServerInterceptor(recoveryOpt), )), grpc.UnaryInterceptor(grpc_middleware.ChainUnaryServer( grpc_ctxtags.UnaryServerInterceptor(), grpc_prometheus.UnaryServerInterceptor, grpc_zap.UnaryServerInterceptor(grpcLogger), grpc_internalerror.UnaryServerInterceptor(), - grpc_recovery.UnaryServerInterceptor(), + grpc_recovery.UnaryServerInterceptor(recoveryOpt), )), ) grpc_prometheus.Register(s.server) - v1.RegisterSuperUserPasswordServer(s.server, s.SupwdService) v1.RegisterWaitServer(s.server, s.WaitService) v1.RegisterEventServiceServer(s.server, s.EventService) + v1.RegisterBootServiceServer(s.server, s.BootService) listener, err := net.Listen("tcp", addr) if err != nil { diff --git a/cmd/metal-api/internal/grpc/supwd-service.go b/cmd/metal-api/internal/grpc/supwd-service.go deleted file mode 100644 index 71a16c9e2..000000000 --- a/cmd/metal-api/internal/grpc/supwd-service.go +++ /dev/null @@ -1,41 +0,0 @@ -package grpc - -import ( - "context" - "os" - "strings" - - v1 "github.com/metal-stack/metal-api/pkg/api/v1" - "go.uber.org/zap" -) - -type SupwdService struct { - logger *zap.SugaredLogger - pwdFile string -} - -func NewSupwdService(cfg *ServerConfig) *SupwdService { - return &SupwdService{ - logger: cfg.Logger, - pwdFile: cfg.BMCSuperUserPasswordFile, - } -} - -func (s *SupwdService) FetchSuperUserPassword(ctx context.Context, req *v1.SuperUserPasswordRequest) (*v1.SuperUserPasswordResponse, error) { - defer ctx.Done() - - resp := &v1.SuperUserPasswordResponse{} - if s.pwdFile == "" { - resp.FeatureDisabled = true - return resp, nil - } - - bb, err := os.ReadFile(s.pwdFile) - if err != nil { - s.logger.Errorw("failed to lookup BMC superuser password", "password file", s.pwdFile, "error", err) - return nil, err - } - resp.FeatureDisabled = false - resp.SuperUserPassword = strings.TrimSpace(string(bb)) - return resp, nil -} diff --git a/cmd/metal-api/internal/grpc/wait-service.go b/cmd/metal-api/internal/grpc/wait-service.go index 78aee8f0e..c390d4b88 100644 --- a/cmd/metal-api/internal/grpc/wait-service.go +++ b/cmd/metal-api/internal/grpc/wait-service.go @@ -97,7 +97,7 @@ func (s *WaitService) timeoutHandler(err bus.TimeoutError) error { } func (s *WaitService) Wait(req *v1.WaitRequest, srv v1.Wait_WaitServer) error { - machineID := req.MachineID + machineID := req.MachineId s.Logger.Infow("wait for allocation called by", "machineID", machineID) m, err := s.ds.FindMachineByID(machineID) diff --git a/cmd/metal-api/internal/grpc/wait-service_int_test.go b/cmd/metal-api/internal/grpc/wait-service_int_test.go index 8bf6ac5db..f586273ac 100644 --- a/cmd/metal-api/internal/grpc/wait-service_int_test.go +++ b/cmd/metal-api/internal/grpc/wait-service_int_test.go @@ -12,6 +12,7 @@ import ( "testing" "time" + "github.com/metal-stack/metal-api/cmd/metal-api/internal/datastore" "github.com/metal-stack/metal-api/cmd/metal-api/internal/metal" v1 "github.com/metal-stack/metal-api/pkg/api/v1" "github.com/stretchr/testify/require" @@ -83,6 +84,14 @@ type datasource struct { wait map[string]bool } +func (ds *datasource) FindMachine(q *datastore.MachineSearchQuery, ms *metal.Machine) error { + return nil +} + +func (ds *datasource) FindPartition(partitionID string) (*metal.Partition, error) { + return nil, nil +} + func (ds *datasource) FindMachineByID(machineID string) (*metal.Machine, error) { return &metal.Machine{ Base: metal.Base{ @@ -97,6 +106,9 @@ func (ds *datasource) UpdateMachine(old, new *metal.Machine) error { ds.wait[new.ID] = new.Waiting return nil } +func (ds *datasource) FromHardware(hw metal.MachineHardware) (*metal.Size, []*metal.SizeMatchingLog, error) { + return nil, nil, nil +} func (ds *datasource) CreateMachine(new *metal.Machine) error { return nil @@ -104,6 +116,18 @@ func (ds *datasource) CreateMachine(new *metal.Machine) error { func (ds *datasource) ProvisioningEventForMachine(log *zap.SugaredLogger, machineID, event, message string) (*metal.ProvisioningEventContainer, error) { return nil, nil } +func (ds *datasource) FindProvisioningEventContainer(id string) (*metal.ProvisioningEventContainer, error) { + return nil, nil +} +func (ds *datasource) CreateProvisioningEventContainer(ec *metal.ProvisioningEventContainer) error { + return nil +} +func (ds *datasource) SetVrfAtSwitches(m *metal.Machine, vrf string) ([]metal.Switch, error) { + return nil, nil +} +func (ds *datasource) ConnectMachineWithSwitches(m *metal.Machine) error { + return nil +} func (t *test) run() { defer t.shutdown() @@ -255,7 +279,7 @@ func (t *test) startMachineInstances() { func (t *test) waitForAllocation(machineID string, c v1.WaitClient, ctx context.Context) error { req := &v1.WaitRequest{ - MachineID: machineID, + MachineId: machineID, } for { diff --git a/cmd/metal-api/internal/metal/machine.go b/cmd/metal-api/internal/metal/machine.go index 0026f0c97..10ab07fad 100644 --- a/cmd/metal-api/internal/metal/machine.go +++ b/cmd/metal-api/internal/metal/machine.go @@ -44,8 +44,9 @@ var ( // the machine will be available for allocation. In all other cases the allocation // must explicitly point to this machine. type MachineState struct { - Value MState `rethinkdb:"value" json:"value"` - Description string `rethinkdb:"description" json:"description"` + Value MState `rethinkdb:"value" json:"value"` + Description string `rethinkdb:"description" json:"description"` + MetalHammerVersion string `rethinkdb:"metal_hammer_version" json:"metal_hammer_version"` } // MachineStateFrom converts a machineState string to the type diff --git a/cmd/metal-api/internal/metal/switch.go b/cmd/metal-api/internal/metal/switch.go index cbd7b25ff..e27b265c5 100644 --- a/cmd/metal-api/internal/metal/switch.go +++ b/cmd/metal-api/internal/metal/switch.go @@ -101,3 +101,26 @@ func (s *Switch) ConnectMachine(machine *Machine) int { } return len(s.MachineConnections[machine.ID]) } + +// SetVrfOfMachine set port on switch where machine is connected to given vrf +func (s *Switch) SetVrfOfMachine(m *Machine, vrf string) { + affectedMacs := map[MacAddress]bool{} + for _, c := range s.MachineConnections[m.ID] { + mac := c.Nic.MacAddress + affectedMacs[mac] = true + } + + if len(affectedMacs) == 0 { + return + } + + nics := Nics{} + for mac, old := range s.Nics.ByMac() { + e := old + if _, ok := affectedMacs[mac]; ok { + e.Vrf = vrf + } + nics = append(nics, *e) + } + s.Nics = nics +} diff --git a/cmd/metal-api/internal/service/integration_test.go b/cmd/metal-api/internal/service/integration_test.go index fa5142d1c..cb66e2911 100644 --- a/cmd/metal-api/internal/service/integration_test.go +++ b/cmd/metal-api/internal/service/integration_test.go @@ -420,7 +420,7 @@ func (te *testEnv) machineWait(uuid string) error { func waitForAllocation(machineID string, c grpcv1.WaitClient, ctx context.Context) { req := &grpcv1.WaitRequest{ - MachineID: machineID, + MachineId: machineID, } for { diff --git a/cmd/metal-api/internal/service/machine-service.go b/cmd/metal-api/internal/service/machine-service.go index 354f3e862..0d75145b0 100644 --- a/cmd/metal-api/internal/service/machine-service.go +++ b/cmd/metal-api/internal/service/machine-service.go @@ -191,6 +191,7 @@ func (r machineResource) webService() *restful.WebService { Returns(http.StatusConflict, "Conflict", httperrors.HTTPErrorResponse{}). DefaultReturns("Error", httperrors.HTTPErrorResponse{})) + // FIXME can be removed once https://github.com/metal-stack/metal-api/pull/279 is merged ws.Route(ws.POST("/register"). To(editor(r.registerMachine)). Operation("registerMachine"). @@ -212,6 +213,7 @@ func (r machineResource) webService() *restful.WebService { Returns(http.StatusOK, "OK", v1.MachineResponse{}). DefaultReturns("Error", httperrors.HTTPErrorResponse{})) + // FIXME can be removed once https://github.com/metal-stack/metal-api/pull/279 is merged ws.Route(ws.POST("/{id}/finalize-allocation"). To(editor(r.finalizeAllocation)). Operation("finalizeAllocation"). @@ -307,6 +309,7 @@ func (r machineResource) webService() *restful.WebService { Returns(http.StatusBadRequest, "Bad Request", httperrors.HTTPErrorResponse{}). DefaultReturns("Error", httperrors.HTTPErrorResponse{})) + // FIXME can be removed once https://github.com/metal-stack/metal-api/pull/279 is merged ws.Route(ws.POST("/{id}/abort-reinstall"). To(editor(r.abortReinstallMachine)). Operation("abortReinstallMachine"). @@ -318,6 +321,7 @@ func (r machineResource) webService() *restful.WebService { Returns(http.StatusOK, "OK", v1.BootInfo{}). DefaultReturns("Error", httperrors.HTTPErrorResponse{})) + // FIXME can be removed once metal-hammer and metal-core are updated with events via grpc ws.Route(ws.GET("/{id}/event"). To(viewer(r.getProvisioningEventContainer)). Operation("getProvisioningEventContainer"). @@ -822,7 +826,7 @@ func (r machineResource) registerMachine(request *restful.Request, response *res old := *m err = retry.Do( func() error { - err := connectMachineWithSwitches(r.ds, m) + err := r.ds.ConnectMachineWithSwitches(m) if err != nil { return err } @@ -1790,7 +1794,7 @@ func (r machineResource) finalizeAllocation(request *restful.Request, response * err = retry.Do( func() error { - _, err := setVrfAtSwitches(r.ds, m, vrf) + _, err := r.ds.SetVrfAtSwitches(m, vrf) return err }, retry.Attempts(10), @@ -2065,7 +2069,7 @@ func deleteVRFSwitches(ds *datastore.RethinkStore, m *metal.Machine, logger *zap logger.Info("set VRF at switch", zap.String("machineID", m.ID)) err := retry.Do( func() error { - _, err := setVrfAtSwitches(ds, m, "") + _, err := ds.SetVrfAtSwitches(m, "") return err }, retry.Attempts(10), @@ -2308,39 +2312,39 @@ func ResurrectMachines(ds *datastore.RethinkStore, publisher bus.Publisher, ep * } func (r machineResource) machineOn(request *restful.Request, response *restful.Response) { - r.machineCmd("machineOn", metal.MachineOnCmd, request, response) + r.machineCmd(metal.MachineOnCmd, request, response) } func (r machineResource) machineOff(request *restful.Request, response *restful.Response) { - r.machineCmd("machineOff", metal.MachineOffCmd, request, response) + r.machineCmd(metal.MachineOffCmd, request, response) } func (r machineResource) machineReset(request *restful.Request, response *restful.Response) { - r.machineCmd("machineReset", metal.MachineResetCmd, request, response) + r.machineCmd(metal.MachineResetCmd, request, response) } func (r machineResource) machineCycle(request *restful.Request, response *restful.Response) { - r.machineCmd("machineCycle", metal.MachineCycleCmd, request, response) + r.machineCmd(metal.MachineCycleCmd, request, response) } func (r machineResource) machineBios(request *restful.Request, response *restful.Response) { - r.machineCmd("machineBios", metal.MachineBiosCmd, request, response) + r.machineCmd(metal.MachineBiosCmd, request, response) } func (r machineResource) machineDisk(request *restful.Request, response *restful.Response) { - r.machineCmd("machineDisk", metal.MachineDiskCmd, request, response) + r.machineCmd(metal.MachineDiskCmd, request, response) } func (r machineResource) machinePxe(request *restful.Request, response *restful.Response) { - r.machineCmd("machinePxe", metal.MachinePxeCmd, request, response) + r.machineCmd(metal.MachinePxeCmd, request, response) } func (r machineResource) chassisIdentifyLEDOn(request *restful.Request, response *restful.Response) { - r.machineCmd("chassisIdentifyLEDOn", metal.ChassisIdentifyLEDOnCmd, request, response, request.QueryParameter("description")) + r.machineCmd(metal.ChassisIdentifyLEDOnCmd, request, response, request.QueryParameter("description")) } func (r machineResource) chassisIdentifyLEDOff(request *restful.Request, response *restful.Response) { - r.machineCmd("chassisIdentifyLEDOff", metal.ChassisIdentifyLEDOffCmd, request, response, request.QueryParameter("description")) + r.machineCmd(metal.ChassisIdentifyLEDOffCmd, request, response, request.QueryParameter("description")) } func (r machineResource) updateFirmware(request *restful.Request, response *restful.Response) { @@ -2387,22 +2391,22 @@ func (r machineResource) updateFirmware(request *restful.Request, response *rest return } - r.machineCmd("updateFirmware", metal.UpdateFirmwareCmd, request, response, p.Kind, p.Revision, p.Description, r.s3Client.Url, r.s3Client.Key, r.s3Client.Secret, r.s3Client.FirmwareBucket) + r.machineCmd(metal.UpdateFirmwareCmd, request, response, p.Kind, p.Revision, p.Description, r.s3Client.Url, r.s3Client.Key, r.s3Client.Secret, r.s3Client.FirmwareBucket) } -func (r machineResource) machineCmd(op string, cmd metal.MachineCommand, request *restful.Request, response *restful.Response, params ...string) { +func (r machineResource) machineCmd(cmd metal.MachineCommand, request *restful.Request, response *restful.Response, params ...string) { logger := utils.Logger(request).Sugar() id := request.PathParameter("id") m, err := r.ds.FindMachineByID(id) - if checkError(request, response, op, err) { + if checkError(request, response, string(cmd), err) { return } - switch op { - case "machineReset", "machineOff", "machineCycle": + switch cmd { // nolint:exhaustive + case metal.MachineResetCmd, metal.MachineOffCmd, metal.MachineCycleCmd: event := string(metal.ProvisioningEventPlannedReboot) - _, err = r.ds.ProvisioningEventForMachine(logger, id, event, op) + _, err = r.ds.ProvisioningEventForMachine(logger, id, event, string(cmd)) if checkError(request, response, utils.CurrentFuncName(), err) { return } @@ -2426,17 +2430,11 @@ func (r machineResource) machineCmd(op string, cmd metal.MachineCommand, request } func publishMachineCmd(logger *zap.SugaredLogger, m *metal.Machine, publisher bus.Publisher, cmd metal.MachineCommand, params ...string) error { - pp := []string{} - for _, p := range params { - if len(p) > 0 { - pp = append(pp, p) - } - } evt := metal.MachineEvent{ Type: metal.COMMAND, Cmd: &metal.MachineExecCommand{ Command: cmd, - Params: pp, + Params: params, TargetMachineID: m.ID, }, } diff --git a/cmd/metal-api/internal/service/machine-service_allocation_test.go b/cmd/metal-api/internal/service/machine-service_allocation_test.go index c26077ad5..dfdc9af26 100644 --- a/cmd/metal-api/internal/service/machine-service_allocation_test.go +++ b/cmd/metal-api/internal/service/machine-service_allocation_test.go @@ -259,34 +259,26 @@ func createMachineRegisterRequest(i int) v1.MachineRegisterRequest { return v1.MachineRegisterRequest{ UUID: fmt.Sprintf("WaitingMachine%d", i), PartitionID: "p1", - Hardware: v1.MachineHardwareExtended{ + Hardware: v1.MachineHardware{ MachineHardwareBase: v1.MachineHardwareBase{Memory: 4, CPUCores: 4}, - Nics: v1.MachineNicsExtended{ + Nics: v1.MachineNics{ { - MachineNic: v1.MachineNic{ - Name: "lan0", - MacAddress: fmt.Sprintf("aa:ba:%d", i), - }, - Neighbors: v1.MachineNicsExtended{ + Name: "lan0", + MacAddress: fmt.Sprintf("aa:ba:%d", i), + Neighbors: v1.MachineNics{ { - MachineNic: v1.MachineNic{ - Name: fmt.Sprintf("swp-%d", i), - MacAddress: fmt.Sprintf("%s:%d", swp1MacPrefix, i), - }, + Name: fmt.Sprintf("swp-%d", i), + MacAddress: fmt.Sprintf("%s:%d", swp1MacPrefix, i), }, }, }, { - MachineNic: v1.MachineNic{ - Name: "lan1", - MacAddress: fmt.Sprintf("aa:bb:%d", i), - }, - Neighbors: v1.MachineNicsExtended{ + Name: "lan1", + MacAddress: fmt.Sprintf("aa:bb:%d", i), + Neighbors: v1.MachineNics{ { - MachineNic: v1.MachineNic{ - Name: fmt.Sprintf("swp-%d", i), - MacAddress: fmt.Sprintf("%s:%d", swp2MacPrefix, i), - }, + Name: fmt.Sprintf("swp-%d", i), + MacAddress: fmt.Sprintf("%s:%d", swp2MacPrefix, i), }, }, }, diff --git a/cmd/metal-api/internal/service/machine-service_integration_test.go b/cmd/metal-api/internal/service/machine-service_integration_test.go index 1c4082298..e3ceb8eb5 100644 --- a/cmd/metal-api/internal/service/machine-service_integration_test.go +++ b/cmd/metal-api/internal/service/machine-service_integration_test.go @@ -23,7 +23,7 @@ func TestMachineAllocationIntegrationFullCycle(t *testing.T) { mrr := v1.MachineRegisterRequest{ UUID: "test-uuid", PartitionID: "test-partition", - Hardware: v1.MachineHardwareExtended{ + Hardware: v1.MachineHardware{ MachineHardwareBase: v1.MachineHardwareBase{ CPUCores: 8, Memory: 1500, @@ -34,34 +34,26 @@ func TestMachineAllocationIntegrationFullCycle(t *testing.T) { }, }, }, - Nics: v1.MachineNicsExtended{ + Nics: v1.MachineNics{ { - MachineNic: v1.MachineNic{ - Name: "eth0", - MacAddress: "aa:aa:aa:aa:aa:aa", - }, - Neighbors: v1.MachineNicsExtended{ + Name: "eth0", + MacAddress: "aa:aa:aa:aa:aa:aa", + Neighbors: v1.MachineNics{ { - MachineNic: v1.MachineNic{ - Name: "swp1", - MacAddress: "bb:aa:aa:aa:aa:aa", - }, - Neighbors: v1.MachineNicsExtended{}, + Name: "swp1", + MacAddress: "bb:aa:aa:aa:aa:aa", + Neighbors: v1.MachineNics{}, }, }, }, { - MachineNic: v1.MachineNic{ - Name: "eth1", - MacAddress: "aa:aa:aa:aa:aa:aa", - }, - Neighbors: v1.MachineNicsExtended{ + Name: "eth1", + MacAddress: "aa:aa:aa:aa:aa:aa", + Neighbors: v1.MachineNics{ { - MachineNic: v1.MachineNic{ - Name: "swp1", - MacAddress: "aa:bb:aa:aa:aa:aa", - }, - Neighbors: v1.MachineNicsExtended{}, + Name: "swp1", + MacAddress: "aa:bb:aa:aa:aa:aa", + Neighbors: v1.MachineNics{}, }, }, }, @@ -76,7 +68,7 @@ func TestMachineAllocationIntegrationFullCycle(t *testing.T) { assert.Equal(t, mrr.PartitionID, registeredMachine.Partition.ID) assert.Equal(t, registeredMachine.RackID, "test-rack") assert.Len(t, mrr.Hardware.Nics, 2) - assert.Equal(t, mrr.Hardware.Nics[0].MachineNic.MacAddress, registeredMachine.Hardware.Nics[0].MacAddress) + assert.Equal(t, mrr.Hardware.Nics[0].MacAddress, registeredMachine.Hardware.Nics[0].MacAddress) err := te.machineWait("test-uuid") require.Nil(t, err) diff --git a/cmd/metal-api/internal/service/machine-service_test.go b/cmd/metal-api/internal/service/machine-service_test.go index c245f232c..327cf3289 100644 --- a/cmd/metal-api/internal/service/machine-service_test.go +++ b/cmd/metal-api/internal/service/machine-service_test.go @@ -200,27 +200,23 @@ func TestRegisterMachine(t *testing.T) { ProductSerial: &testdata.IPMI1.Fru.ProductSerial, }, }, - Hardware: v1.MachineHardwareExtended{ + Hardware: v1.MachineHardware{ MachineHardwareBase: v1.MachineHardwareBase{ CPUCores: tt.numcores, Memory: uint64(tt.memory), }, - Nics: v1.MachineNicsExtended{ - v1.MachineNicExtended{ - Neighbors: v1.MachineNicsExtended{ - v1.MachineNicExtended{ - MachineNic: v1.MachineNic{ - MacAddress: string(tt.neighbormac1), - }, + Nics: v1.MachineNics{ + v1.MachineNic{ + Neighbors: v1.MachineNics{ + v1.MachineNic{ + MacAddress: string(tt.neighbormac1), }, }, }, - v1.MachineNicExtended{ - Neighbors: v1.MachineNicsExtended{ - v1.MachineNicExtended{ - MachineNic: v1.MachineNic{ - MacAddress: string(tt.neighbormac2), - }, + v1.MachineNic{ + Neighbors: v1.MachineNics{ + v1.MachineNic{ + MacAddress: string(tt.neighbormac2), }, }, }, diff --git a/cmd/metal-api/internal/service/size-service.go b/cmd/metal-api/internal/service/size-service.go index 933755294..ac38d09e1 100644 --- a/cmd/metal-api/internal/service/size-service.go +++ b/cmd/metal-api/internal/service/size-service.go @@ -94,7 +94,7 @@ func (r sizeResource) webService() *restful.WebService { Operation("fromHardware"). Doc("Searches all sizes for one to match the given hardwarespecs. If nothing is found, a list of entries is returned which describe the constraint which did not match"). Metadata(restfulspec.KeyOpenAPITags, tags). - Reads(v1.MachineHardwareExtended{}). + Reads(v1.MachineHardware{}). Returns(http.StatusOK, "OK", v1.SizeMatchingLog{}). DefaultReturns("Error", httperrors.HTTPErrorResponse{})) @@ -274,7 +274,7 @@ func (r sizeResource) updateSize(request *restful.Request, response *restful.Res } func (r sizeResource) fromHardware(request *restful.Request, response *restful.Response) { - var requestPayload v1.MachineHardwareExtended + var requestPayload v1.MachineHardware err := request.ReadEntity(&requestPayload) if checkError(request, response, utils.CurrentFuncName(), err) { return diff --git a/cmd/metal-api/internal/service/switch-service.go b/cmd/metal-api/internal/service/switch-service.go index 3cbd60d02..a0a9f2982 100644 --- a/cmd/metal-api/internal/service/switch-service.go +++ b/cmd/metal-api/internal/service/switch-service.go @@ -564,106 +564,7 @@ func updateSwitchNics(oldNics metal.NicMap, newNics metal.NicMap, currentConnect return finalNics, nil } -// SetVrfAtSwitches finds the switches connected to the given machine and puts the switch ports into the given vrf. -// Returns the updated switches. -func setVrfAtSwitches(ds *datastore.RethinkStore, m *metal.Machine, vrf string) ([]metal.Switch, error) { - switches, err := ds.SearchSwitchesConnectedToMachine(m) - if err != nil { - return nil, err - } - newSwitches := make([]metal.Switch, 0) - for i := range switches { - sw := switches[i] - oldSwitch := sw - setVrf(&sw, m.ID, vrf) - err := ds.UpdateSwitch(&oldSwitch, &sw) - if err != nil { - return nil, err - } - newSwitches = append(newSwitches, sw) - } - return newSwitches, nil -} - -func setVrf(s *metal.Switch, mid, vrf string) { - affectedMacs := map[metal.MacAddress]bool{} - for _, c := range s.MachineConnections[mid] { - mac := c.Nic.MacAddress - affectedMacs[mac] = true - } - - if len(affectedMacs) == 0 { - return - } - - nics := metal.Nics{} - for mac, old := range s.Nics.ByMac() { - e := old - if _, ok := affectedMacs[mac]; ok { - e.Vrf = vrf - } - nics = append(nics, *e) - } - s.Nics = nics -} - -func connectMachineWithSwitches(ds *datastore.RethinkStore, m *metal.Machine) error { - switches, err := ds.SearchSwitches("", nil) - if err != nil { - return err - } - oldSwitches := []metal.Switch{} - newSwitches := []metal.Switch{} - for _, sw := range switches { - oldSwitch := sw - if cons := sw.ConnectMachine(m); cons > 0 { - oldSwitches = append(oldSwitches, oldSwitch) - newSwitches = append(newSwitches, sw) - } - } - - if len(newSwitches) != 2 { - return fmt.Errorf("machine %v is not connected to exactly two switches, found connections to %d switches", m.ID, len(newSwitches)) - } - s1 := newSwitches[0] - s2 := newSwitches[1] - cons1 := s1.MachineConnections[m.ID] - cons2 := s2.MachineConnections[m.ID] - connectionMapError := fmt.Errorf("twin-switches do not have a connection map that is mirrored crosswise for machine %v, switch %v (connections: %v), switch %v (connections: %v)", m.ID, s1.Name, cons1, s2.Name, cons2) - if len(cons1) != len(cons2) { - return connectionMapError - } - - if s1.RackID != s2.RackID { - return fmt.Errorf("connected switches of a machine must reside in the same rack, rack of switch %s: %s, rack of switch %s: %s, machine: %s", s1.Name, s1.RackID, s2.Name, s2.RackID, m.ID) - } - // We detect the rackID of a machine by connections to leaf switches - m.RackID = s1.RackID - - byNicName, err := s2.MachineConnections.ByNicName() - if err != nil { - return err - } - for _, con := range s1.MachineConnections[m.ID] { - if con2, has := byNicName[con.Nic.Name]; has { - if con.Nic.Name != con2.Nic.Name { - return connectionMapError - } - } else { - return connectionMapError - } - } - - for i := range oldSwitches { - err = ds.UpdateSwitch(&oldSwitches[i], &newSwitches[i]) - if err != nil { - return err - } - } - - return nil -} func makeSwitchResponse(s *metal.Switch, ds *datastore.RethinkStore) (*v1.SwitchResponse, error) { p, ips, machines, err := findSwitchReferencedEntites(s, ds) diff --git a/cmd/metal-api/internal/service/switch-service_test.go b/cmd/metal-api/internal/service/switch-service_test.go index 7dd0eaeac..21adad692 100644 --- a/cmd/metal-api/internal/service/switch-service_test.go +++ b/cmd/metal-api/internal/service/switch-service_test.go @@ -260,11 +260,11 @@ func TestConnectMachineWithSwitches(t *testing.T) { for i := range tests { tt := tests[i] ds, mock := datastore.InitMockDB() - mock.On(r.DB("mockdb").Table("switch")).Return(testSwitches, nil) + mock.On(r.DB("mockdb").Table("switch").Filter(r.MockAnything())).Return(testSwitches, nil) mock.On(r.DB("mockdb").Table("switch").Get(r.MockAnything()).Replace(r.MockAnything())).Return(testdata.EmptyResult, nil) t.Run(tt.name, func(t *testing.T) { - if err := connectMachineWithSwitches(ds, tt.machine); (err != nil) != tt.wantErr { + if err := ds.ConnectMachineWithSwitches(tt.machine); (err != nil) != tt.wantErr { t.Errorf("RethinkStore.connectMachineWithSwitches() error = %v, wantErr %v", err, tt.wantErr) } }) @@ -303,7 +303,7 @@ func TestSetVrfAtSwitch(t *testing.T) { Base: metal.Base{ID: "1"}, PartitionID: "1", } - switches, err := setVrfAtSwitches(ds, m, vrf) + switches, err := ds.SetVrfAtSwitches(m, vrf) require.NoError(t, err, "no error was expected: got %v", err) require.Len(t, switches, 1) for _, s := range switches { diff --git a/cmd/metal-api/internal/service/v1/machine.go b/cmd/metal-api/internal/service/v1/machine.go index 9b03bbe5e..1d0238591 100644 --- a/cmd/metal-api/internal/service/v1/machine.go +++ b/cmd/metal-api/internal/service/v1/machine.go @@ -83,14 +83,10 @@ type MachineHardware struct { Nics MachineNics `json:"nics" description:"the list of network interfaces of this machine"` } -type MachineHardwareExtended struct { - MachineHardwareBase - Nics MachineNicsExtended `json:"nics" description:"the list of network interfaces of this machine with extended information"` -} - type MachineState struct { - Value string `json:"value" description:"the state of this machine. empty means available for all"` - Description string `json:"description" description:"a description why this machine is in the given state"` + Value string `json:"value" description:"the state of this machine. empty means available for all"` + Description string `json:"description" description:"a description why this machine is in the given state"` + MetalHammerVersion string `json:"metal_hammer_version" description:"the version of metal hammer which put the machine in waiting state"` } type ChassisIdentifyLEDState struct { @@ -125,15 +121,9 @@ type MachineProvisioningEvents map[string]MachineProvisioningEvent type MachineNics []MachineNic type MachineNic struct { - MacAddress string `json:"mac" description:"the mac address of this network interface"` - Name string `json:"name" description:"the name of this network interface"` -} - -type MachineNicsExtended []MachineNicExtended - -type MachineNicExtended struct { - MachineNic - Neighbors MachineNicsExtended `json:"neighbors" description:"the neighbors visible to this network interface"` + MacAddress string `json:"mac" description:"the mac address of this network interface"` + Name string `json:"name" description:"the name of this network interface"` + Neighbors MachineNics `json:"neighbors" description:"the neighbors visible to this network interface"` } type MachineBIOS struct { @@ -168,11 +158,11 @@ type MachineRegisterRequest struct { UUID string `json:"uuid" description:"the product uuid of the machine to register"` PartitionID string `json:"partitionid" description:"the partition id to register this machine with"` // Deprecated: RackID is not used any longer, it is calculated by the switch connections of a machine. A metal-core instance might respond to pxe requests from all racks - RackID string `json:"rackid" description:"the rack id where this machine is connected to"` - Hardware MachineHardwareExtended `json:"hardware" description:"the hardware of this machine"` - BIOS MachineBIOS `json:"bios" description:"bios information of this machine"` - IPMI MachineIPMI `json:"ipmi" description:"the ipmi access infos"` - Tags []string `json:"tags" description:"tags for this machine"` + RackID string `json:"rackid" description:"the rack id where this machine is connected to"` + Hardware MachineHardware `json:"hardware" description:"the hardware of this machine"` + BIOS MachineBIOS `json:"bios" description:"bios information of this machine"` + IPMI MachineIPMI `json:"ipmi" description:"the ipmi access infos"` + Tags []string `json:"tags" description:"tags for this machine"` } type MachineAllocateRequest struct { @@ -267,7 +257,7 @@ type MachineAbortReinstallRequest struct { PrimaryDiskWiped bool `json:"primary_disk_wiped" description:"indicates whether the primary disk is already wiped"` } -func NewMetalMachineHardware(r *MachineHardwareExtended) metal.MachineHardware { +func NewMetalMachineHardware(r *MachineHardware) metal.MachineHardware { nics := metal.Nics{} for i := range r.Nics { var neighbors metal.Nics @@ -389,9 +379,16 @@ func NewMachineResponse(m *metal.Machine, s *metal.Size, p *metal.Partition, i * nics := MachineNics{} for i := range m.Hardware.Nics { + n := m.Hardware.Nics[i] + neighs := MachineNics{} + for j := range n.Neighbors { + neigh := n.Neighbors[j] + neighs = append(neighs, MachineNic{MacAddress: string(neigh.MacAddress), Name: neigh.Name}) + } nic := MachineNic{ - MacAddress: string(m.Hardware.Nics[i].MacAddress), - Name: m.Hardware.Nics[i].Name, + MacAddress: string(n.MacAddress), + Name: n.Name, + Neighbors: neighs, } nics = append(nics, nic) } diff --git a/go.mod b/go.mod index 1eb6aeee6..9632c9bae 100644 --- a/go.mod +++ b/go.mod @@ -4,13 +4,13 @@ go 1.18 require ( github.com/Masterminds/semver/v3 v3.1.1 - github.com/avast/retry-go/v4 v4.0.4 - github.com/aws/aws-sdk-go v1.44.3 + github.com/avast/retry-go/v4 v4.0.5 + github.com/aws/aws-sdk-go v1.44.24 github.com/dustin/go-humanize v1.0.0 github.com/emicklei/go-restful-openapi/v2 v2.9.0 - github.com/emicklei/go-restful/v3 v3.7.4 + github.com/emicklei/go-restful/v3 v3.8.0 github.com/go-logr/zapr v1.2.3 - github.com/go-openapi/spec v0.20.5 + github.com/go-openapi/spec v0.20.6 github.com/go-stack/stack v1.8.1 github.com/google/go-cmp v0.5.8 github.com/google/uuid v1.3.0 @@ -22,16 +22,16 @@ require ( github.com/metal-stack/security v0.6.4 github.com/metal-stack/v v1.0.3 github.com/nsqio/go-nsq v1.1.0 - github.com/prometheus/client_golang v1.12.1 + github.com/prometheus/client_golang v1.12.2 github.com/spf13/cobra v1.4.0 - github.com/spf13/viper v1.11.0 - github.com/stretchr/testify v1.7.1 + github.com/spf13/viper v1.12.0 + github.com/stretchr/testify v1.7.2 github.com/testcontainers/testcontainers-go v0.13.0 go.uber.org/multierr v1.8.0 go.uber.org/zap v1.21.0 - golang.org/x/crypto v0.0.0-20220427172511-eb4f295cb31f - golang.org/x/sync v0.0.0-20210220032951-036812b2e83c - google.golang.org/grpc v1.46.0 + golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e + golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f + google.golang.org/grpc v1.47.0 google.golang.org/protobuf v1.28.0 gopkg.in/rethinkdb/rethinkdb-go.v6 v6.2.1 ) @@ -55,7 +55,7 @@ require ( github.com/docker/docker v20.10.12+incompatible // indirect github.com/docker/go-connections v0.4.0 // indirect github.com/docker/go-units v0.4.0 // indirect - github.com/fsnotify/fsnotify v1.5.1 // indirect + github.com/fsnotify/fsnotify v1.5.4 // indirect github.com/go-logr/logr v1.2.2 // indirect github.com/go-openapi/errors v0.20.2 // indirect github.com/go-openapi/jsonpointer v0.19.5 // indirect @@ -88,7 +88,7 @@ require ( github.com/magiconair/properties v1.8.6 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect - github.com/mitchellh/mapstructure v1.4.3 // indirect + github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/moby/sys/mount v0.2.0 // indirect github.com/moby/sys/mountinfo v0.5.0 // indirect github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6 // indirect @@ -100,8 +100,8 @@ require ( github.com/opencontainers/image-spec v1.0.2 // indirect github.com/opencontainers/runc v1.1.0 // indirect github.com/opentracing/opentracing-go v1.2.0 // indirect - github.com/pelletier/go-toml v1.9.4 // indirect - github.com/pelletier/go-toml/v2 v2.0.0-beta.8 // indirect + github.com/pelletier/go-toml v1.9.5 // indirect + github.com/pelletier/go-toml/v2 v2.0.1 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_model v0.2.0 // indirect @@ -109,26 +109,26 @@ require ( github.com/prometheus/procfs v0.7.3 // indirect github.com/sirupsen/logrus v1.8.1 // indirect github.com/spf13/afero v1.8.2 // indirect - github.com/spf13/cast v1.4.1 // indirect + github.com/spf13/cast v1.5.0 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/stretchr/objx v0.2.0 // indirect - github.com/subosito/gotenv v1.2.0 // indirect + github.com/subosito/gotenv v1.3.0 // indirect go.mongodb.org/mongo-driver v1.9.0 // indirect go.opencensus.io v0.23.0 // indirect go.uber.org/atomic v1.7.0 // indirect go4.org/intern v0.0.0-20210108033219-3eb7198706b2 // indirect go4.org/unsafe/assume-no-moving-gc v0.0.0-20211027215541-db492cf91b37 // indirect - golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect + golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2 // indirect golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 // indirect - golang.org/x/sys v0.0.0-20220422013727-9388b58f7150 // indirect + golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect golang.org/x/text v0.3.7 // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac // indirect + google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd // indirect gopkg.in/cenkalti/backoff.v2 v2.2.1 // indirect gopkg.in/ini.v1 v1.66.4 // indirect gopkg.in/square/go-jose.v2 v2.6.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect - gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect inet.af/netaddr v0.0.0-20210511181906-37180328850c // indirect ) diff --git a/go.sum b/go.sum index d05ee41eb..3bc2e4b2e 100644 --- a/go.sum +++ b/go.sum @@ -103,11 +103,11 @@ github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d h1:Byv0BzEl github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= github.com/avast/retry-go v3.0.0+incompatible h1:4SOWQ7Qs+oroOTQOYnAHqelpCO0biHSxpiH9JdtuBj0= github.com/avast/retry-go v3.0.0+incompatible/go.mod h1:XtSnn+n/sHqQIpZ10K1qAevBhOOCWBLXXy3hyiqqBrY= -github.com/avast/retry-go/v4 v4.0.4 h1:38hLf0DsRXh+hOF6HbTni0+5QGTNdw9zbaMD7KAO830= -github.com/avast/retry-go/v4 v4.0.4/go.mod h1:HqmLvS2VLdStPCGDFjSuZ9pzlTqVRldCI4w2dO4m1Ms= +github.com/avast/retry-go/v4 v4.0.5 h1:C0Fm9MjPCmgLW6Jb1zBTVRx0ycr+VUaaUZO5wpqYjqg= +github.com/avast/retry-go/v4 v4.0.5/go.mod h1:HqmLvS2VLdStPCGDFjSuZ9pzlTqVRldCI4w2dO4m1Ms= github.com/aws/aws-sdk-go v1.15.11/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0= -github.com/aws/aws-sdk-go v1.44.3 h1:GA9bJsWeJdwPtcKK9Uq3jfMaPko0ROWzVuqwFM7BBP0= -github.com/aws/aws-sdk-go v1.44.3/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= +github.com/aws/aws-sdk-go v1.44.24 h1:3nOkwJBJLiGBmJKWp3z0utyXuBkxyGkRRwWjrTItJaY= +github.com/aws/aws-sdk-go v1.44.24/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20160804104726-4c0e84591b9a/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= @@ -160,7 +160,6 @@ github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnht github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= @@ -339,15 +338,14 @@ github.com/emicklei/go-restful-openapi/v2 v2.9.0/go.mod h1:VKNgZyYviM1hnyrjD9RDz github.com/emicklei/go-restful/v3 v3.7.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/emicklei/go-restful/v3 v3.7.1/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/emicklei/go-restful/v3 v3.7.3/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= -github.com/emicklei/go-restful/v3 v3.7.4 h1:PVGUqKvvMzQYiO89TdXrH9EMks+okTaRIMQ3jgMdZ30= -github.com/emicklei/go-restful/v3 v3.7.4/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/emicklei/go-restful/v3 v3.8.0 h1:eCZ8ulSerjdAiaNpF7GxXIE7ZCMo1moN1qX+S609eVw= +github.com/emicklei/go-restful/v3 v3.8.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= -github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= @@ -355,10 +353,11 @@ github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5Kwzbycv github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= +github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/fsnotify/fsnotify v1.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWpgI= -github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= +github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= +github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= github.com/fullsailor/pkcs7 v0.0.0-20190404230743-d7302db945fa/go.mod h1:KnogPXtdwXqoenmZCw6S+25EAm2MkxbG0deNDu4cbSA= github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -439,8 +438,8 @@ github.com/go-openapi/spec v0.19.5/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHK github.com/go-openapi/spec v0.19.6/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk= github.com/go-openapi/spec v0.19.8/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk= github.com/go-openapi/spec v0.20.4/go.mod h1:faYFR1CvsJZ0mNsmsphTMSoRrNV3TEDoAM7FOEWeq8I= -github.com/go-openapi/spec v0.20.5 h1:skHa8av4VnAtJU5zyAUXrrdK/NDiVX8lchbG+BfcdrE= -github.com/go-openapi/spec v0.20.5/go.mod h1:QbfOSIVt3/sac+a1wzmKbbcLXm5NdZnyBZYtCijp43o= +github.com/go-openapi/spec v0.20.6 h1:ich1RQ3WDbfoeTqTAb+5EIxNmpKVJZWBNah9RAT0jIQ= +github.com/go-openapi/spec v0.20.6/go.mod h1:2OpW+JddWPrpXSCIX8eOx7lZ5iyuWj3RYR6VaaBKcWA= github.com/go-openapi/strfmt v0.17.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= github.com/go-openapi/strfmt v0.18.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= github.com/go-openapi/strfmt v0.19.0/go.mod h1:+uW+93UVvGGq2qGaZxdDeJqSAqBqBdl+ZPMF/cC8nDY= @@ -693,8 +692,8 @@ github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= @@ -771,8 +770,9 @@ github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh github.com/mitchellh/mapstructure v1.3.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.4.3 h1:OVowDSCllw/YjdLkam3/sm7wEtOy59d8ndGgCcyj8cs= github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= +github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/osext v0.0.0-20151018003038-5e2d6d41470f/go.mod h1:OkQIRizQZAeMln+1tSwduZz7+Af5oFlKirV/MSYes2A= github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc= github.com/moby/sys/mount v0.2.0 h1:WhCW5B355jtxndN5ovugJlMFJawbUODuW8fSnEH6SSM= @@ -870,10 +870,10 @@ github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/9 github.com/pelletier/go-toml v1.4.0/go.mod h1:PN7xzY2wHTK0K9p34ErDQMlFxa51Fk0OUruD3k1mMwo= github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= github.com/pelletier/go-toml v1.8.1/go.mod h1:T2/BmBdy8dvIRq1a/8aqjN41wvWlN4lrapLU/GW4pbc= -github.com/pelletier/go-toml v1.9.4 h1:tjENF6MfZAg8e4ZmZTeWaWiT2vXtsoO6+iuOjFhECwM= -github.com/pelletier/go-toml v1.9.4/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= -github.com/pelletier/go-toml/v2 v2.0.0-beta.8 h1:dy81yyLYJDwMTifq24Oi/IslOslRrDSb3jwDggjz3Z0= -github.com/pelletier/go-toml/v2 v2.0.0-beta.8/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= +github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= +github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= +github.com/pelletier/go-toml/v2 v2.0.1 h1:8e3L2cCQzLFi2CR4g7vGFuFxX7Jl1kKX8gW+iV0GUKU= +github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/pierrre/gotestcover v0.0.0-20160517101806-924dca7d15f0/go.mod h1:4xpMLz7RBWyB+ElzHu8Llua96TRCB3YwX+l5EP1wmHk= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -892,8 +892,8 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.12.1 h1:ZiaPsmm9uiBeaSMRznKsCDNtPCS0T3JVDGF+06gjBzk= -github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= +github.com/prometheus/client_golang v1.12.2 h1:51L9cDoUHVrXx4zWYlcLQIZ+d+VXHgqnYKkIuq4g/34= +github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= github.com/prometheus/client_model v0.0.0-20171117100541-99fa1f4be8e5/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -929,6 +929,7 @@ github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6L github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/safchain/ethtool v0.0.0-20190326074333-42ed695e3de8/go.mod h1:Z0q5wiBQGYcxhMZ6gUqHn6pYNLypFAvaL3UvgZLR0U4= @@ -956,8 +957,8 @@ github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTd github.com/spf13/afero v1.8.2 h1:xehSyVa0YnHWsJ49JFljMpg1HX19V6NDZ1fkm1Xznbo= github.com/spf13/afero v1.8.2/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.4.1 h1:s0hze+J0196ZfEMTs80N7UlFt0BDuQ7Q+JDnHiMWKdA= -github.com/spf13/cast v1.4.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= +github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= github.com/spf13/cobra v0.0.2-0.20171109065643-2da4a54c5cee/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= @@ -973,8 +974,8 @@ github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnIn github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= -github.com/spf13/viper v1.11.0 h1:7OX/1FS6n7jHD1zGrZTM7WtY13ZELRyosK4k93oPr44= -github.com/spf13/viper v1.11.0/go.mod h1:djo0X/bA5+tYVoCn+C7cAYJGcVn/qYLFTG8gdUsX7Zk= +github.com/spf13/viper v1.12.0 h1:CZ7eSOd3kZoaYDLbXnmzgQI5RlciuXBMA+18HwHRfZQ= +github.com/spf13/viper v1.12.0/go.mod h1:b6COn30jlNxbm/V2IqWiNWkJ+vZNiMNksliPCiuKtSI= github.com/stefanberger/go-pkcs11uri v0.0.0-20201008174630-78d3cae3a980/go.mod h1:AO3tvPzVZ/ayst6UlUKUv6rcPQInYe3IknH3jYhAKu8= github.com/stretchr/objx v0.0.0-20180129172003-8a3f7159479f/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -988,10 +989,11 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= -github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= +github.com/stretchr/testify v1.7.2 h1:4jaiDzPyXQvSd7D0EjG45355tLlV3VOECpq10pLC+8s= +github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= +github.com/subosito/gotenv v1.3.0 h1:mjC+YW8QpAdXibNi+vNWgzmgBH4+5l5dCXv8cNysBLI= +github.com/subosito/gotenv v1.3.0/go.mod h1:YzJjq/33h7nrwdY+iHMhEOEEbW0ovIz0tB6t6PwAXzs= github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= @@ -1108,8 +1110,8 @@ golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm golang.org/x/crypto v0.0.0-20210813211128-0a44fdfbc16e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220427172511-eb4f295cb31f h1:OeJjE6G4dgCY4PIXvIRQbE8+RX+uXZyGhUy/ksMGJoc= -golang.org/x/crypto v0.0.0-20220427172511-eb4f295cb31f/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e h1:T8NU3HyQ8ClP4SEE+KbFlg6n0NhuTsN4MyznaarGsZM= +golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1201,8 +1203,8 @@ golang.org/x/net v0.0.0-20210825183410-e898025ed96a/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20211108170745-6635138e15ea/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 h1:HVyaeDAYux4pnY+D/SiwmLOR36ewZ4iGQIIrtnuCjFA= -golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2 h1:NWy5+hlRbC7HK+PmcXVUmW1IMyFce7to56IUvhUFm7Y= +golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1228,8 +1230,9 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f h1:Ax0t5p6N38Ga0dThY21weqDEyz2oklo4IvDkpigvkD8= +golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1316,7 +1319,6 @@ golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210906170528-6f6e22806c34/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1325,8 +1327,9 @@ golang.org/x/sys v0.0.0-20211116061358-0a5406a5449c/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220422013727-9388b58f7150 h1:xHms4gcpe1YE7A3yIllJXP16CMAGuqwO2lX1mTyyRRc= -golang.org/x/sys v0.0.0-20220422013727-9388b58f7150/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbufYwmzD3LfVPLKsKg+0k= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= @@ -1493,8 +1496,8 @@ google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac h1:qSNTkEN+L2mvWcLgJOR+8bdHX9rN/IdU3A1Ghpfb1Rg= -google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd h1:e0TwkXOdbnH/1x5rc5MZ/VYyiZ4v+RdVfrGMqEwT68I= +google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= google.golang.org/grpc v0.0.0-20160317175043-d3ddb4469d5a/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= @@ -1518,9 +1521,9 @@ google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA5 google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= -google.golang.org/grpc v1.46.0 h1:oCjezcn6g6A75TGoKYBPgKmVBLexhYLM6MebdrPApP8= google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.47.0 h1:9n77onPX5F3qfFCqjy9dhn8PbNQsIKeVU04J9G7umt8= +google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -1576,8 +1579,9 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= gotest.tools/gotestsum v1.7.0/go.mod h1:V1m4Jw3eBerhI/A6qCxUE07RnCg7ACkKj9BYcAm09V8= diff --git a/pkg/api/v1/boot.pb.go b/pkg/api/v1/boot.pb.go new file mode 100644 index 000000000..37aaf86d3 --- /dev/null +++ b/pkg/api/v1/boot.pb.go @@ -0,0 +1,1769 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1 +// protoc (unknown) +// source: api/v1/boot.proto + +package v1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +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) +) + +type BootServiceDhcpRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` +} + +func (x *BootServiceDhcpRequest) Reset() { + *x = BootServiceDhcpRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v1_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_api_v1_boot_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BootServiceDhcpRequest.ProtoReflect.Descriptor instead. +func (*BootServiceDhcpRequest) Descriptor() ([]byte, []int) { + return file_api_v1_boot_proto_rawDescGZIP(), []int{0} +} + +func (x *BootServiceDhcpRequest) GetUuid() string { + if x != nil { + return x.Uuid + } + return "" +} + +type BootServiceDhcpResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *BootServiceDhcpResponse) Reset() { + *x = BootServiceDhcpResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v1_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_api_v1_boot_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BootServiceDhcpResponse.ProtoReflect.Descriptor instead. +func (*BootServiceDhcpResponse) Descriptor() ([]byte, []int) { + return file_api_v1_boot_proto_rawDescGZIP(), []int{1} +} + +type BootServiceBootRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Mac string `protobuf:"bytes,1,opt,name=mac,proto3" json:"mac,omitempty"` + PartitionId string `protobuf:"bytes,2,opt,name=partition_id,json=partitionId,proto3" json:"partition_id,omitempty"` +} + +func (x *BootServiceBootRequest) Reset() { + *x = BootServiceBootRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v1_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_api_v1_boot_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BootServiceBootRequest.ProtoReflect.Descriptor instead. +func (*BootServiceBootRequest) Descriptor() ([]byte, []int) { + return file_api_v1_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 "" +} + +type BootServiceBootResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Kernel string `protobuf:"bytes,1,opt,name=kernel,proto3" json:"kernel,omitempty"` + InitRamDisks []string `protobuf:"bytes,2,rep,name=init_ram_disks,json=initRamDisks,proto3" json:"init_ram_disks,omitempty"` + Cmdline *string `protobuf:"bytes,3,opt,name=cmdline,proto3,oneof" json:"cmdline,omitempty"` +} + +func (x *BootServiceBootResponse) Reset() { + *x = BootServiceBootResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v1_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_api_v1_boot_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BootServiceBootResponse.ProtoReflect.Descriptor instead. +func (*BootServiceBootResponse) Descriptor() ([]byte, []int) { + return file_api_v1_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 "" +} + +type BootServiceRegisterRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` + Hardware *MachineHardware `protobuf:"bytes,2,opt,name=hardware,proto3" json:"hardware,omitempty"` + Bios *MachineBIOS `protobuf:"bytes,3,opt,name=bios,proto3" json:"bios,omitempty"` + Ipmi *MachineIPMI `protobuf:"bytes,4,opt,name=ipmi,proto3" json:"ipmi,omitempty"` + Tags []string `protobuf:"bytes,5,rep,name=tags,proto3" json:"tags,omitempty"` + MetalHammerVersion string `protobuf:"bytes,6,opt,name=metal_hammer_version,json=metalHammerVersion,proto3" json:"metal_hammer_version,omitempty"` +} + +func (x *BootServiceRegisterRequest) Reset() { + *x = BootServiceRegisterRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v1_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_api_v1_boot_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BootServiceRegisterRequest.ProtoReflect.Descriptor instead. +func (*BootServiceRegisterRequest) Descriptor() ([]byte, []int) { + return file_api_v1_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 "" +} + +type BootServiceRegisterResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` + Size string `protobuf:"bytes,2,opt,name=size,proto3" json:"size,omitempty"` + PartitionId string `protobuf:"bytes,3,opt,name=partition_id,json=partitionId,proto3" json:"partition_id,omitempty"` +} + +func (x *BootServiceRegisterResponse) Reset() { + *x = BootServiceRegisterResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v1_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_api_v1_boot_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BootServiceRegisterResponse.ProtoReflect.Descriptor instead. +func (*BootServiceRegisterResponse) Descriptor() ([]byte, []int) { + return file_api_v1_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 "" +} + +type MachineHardware struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Memory uint64 `protobuf:"varint,1,opt,name=memory,proto3" json:"memory,omitempty"` + CpuCores uint32 `protobuf:"varint,2,opt,name=cpu_cores,json=cpuCores,proto3" json:"cpu_cores,omitempty"` + Disks []*MachineBlockDevice `protobuf:"bytes,3,rep,name=disks,proto3" json:"disks,omitempty"` + Nics []*MachineNic `protobuf:"bytes,4,rep,name=nics,proto3" json:"nics,omitempty"` +} + +func (x *MachineHardware) Reset() { + *x = MachineHardware{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v1_boot_proto_msgTypes[6] + 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_api_v1_boot_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MachineHardware.ProtoReflect.Descriptor instead. +func (*MachineHardware) Descriptor() ([]byte, []int) { + return file_api_v1_boot_proto_rawDescGZIP(), []int{6} +} + +func (x *MachineHardware) GetMemory() uint64 { + if x != nil { + return x.Memory + } + return 0 +} + +func (x *MachineHardware) GetCpuCores() uint32 { + if x != nil { + return x.CpuCores + } + 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 +} + +type MachineNic struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Mac string `protobuf:"bytes,1,opt,name=mac,proto3" json:"mac,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Neighbors []*MachineNic `protobuf:"bytes,3,rep,name=neighbors,proto3" json:"neighbors,omitempty"` +} + +func (x *MachineNic) Reset() { + *x = MachineNic{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v1_boot_proto_msgTypes[7] + 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_api_v1_boot_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MachineNic.ProtoReflect.Descriptor instead. +func (*MachineNic) Descriptor() ([]byte, []int) { + return file_api_v1_boot_proto_rawDescGZIP(), []int{7} +} + +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) GetNeighbors() []*MachineNic { + if x != nil { + return x.Neighbors + } + return nil +} + +type MachineBlockDevice struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Size uint64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"` +} + +func (x *MachineBlockDevice) Reset() { + *x = MachineBlockDevice{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v1_boot_proto_msgTypes[8] + 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_api_v1_boot_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MachineBlockDevice.ProtoReflect.Descriptor instead. +func (*MachineBlockDevice) Descriptor() ([]byte, []int) { + return file_api_v1_boot_proto_rawDescGZIP(), []int{8} +} + +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 +} + +type MachineBIOS struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` + Vendor string `protobuf:"bytes,2,opt,name=vendor,proto3" json:"vendor,omitempty"` + Date string `protobuf:"bytes,3,opt,name=date,proto3" json:"date,omitempty"` +} + +func (x *MachineBIOS) Reset() { + *x = MachineBIOS{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v1_boot_proto_msgTypes[9] + 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_api_v1_boot_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MachineBIOS.ProtoReflect.Descriptor instead. +func (*MachineBIOS) Descriptor() ([]byte, []int) { + return file_api_v1_boot_proto_rawDescGZIP(), []int{9} +} + +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 "" +} + +type MachineIPMI struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Mac string `protobuf:"bytes,2,opt,name=mac,proto3" json:"mac,omitempty"` + User string `protobuf:"bytes,3,opt,name=user,proto3" json:"user,omitempty"` + Password string `protobuf:"bytes,4,opt,name=password,proto3" json:"password,omitempty"` + Interface string `protobuf:"bytes,5,opt,name=interface,proto3" json:"interface,omitempty"` + Fru *MachineFRU `protobuf:"bytes,6,opt,name=fru,proto3" json:"fru,omitempty"` + BmcVersion string `protobuf:"bytes,7,opt,name=bmc_version,json=bmcVersion,proto3" json:"bmc_version,omitempty"` + PowerState string `protobuf:"bytes,8,opt,name=power_state,json=powerState,proto3" json:"power_state,omitempty"` +} + +func (x *MachineIPMI) Reset() { + *x = MachineIPMI{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v1_boot_proto_msgTypes[10] + 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_api_v1_boot_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MachineIPMI.ProtoReflect.Descriptor instead. +func (*MachineIPMI) Descriptor() ([]byte, []int) { + return file_api_v1_boot_proto_rawDescGZIP(), []int{10} +} + +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 "" +} + +type MachineFRU struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ChassisPartNumber *string `protobuf:"bytes,1,opt,name=chassis_part_number,json=chassisPartNumber,proto3,oneof" json:"chassis_part_number,omitempty"` + ChassisPartSerial *string `protobuf:"bytes,2,opt,name=chassis_part_serial,json=chassisPartSerial,proto3,oneof" json:"chassis_part_serial,omitempty"` + BoardMfg *string `protobuf:"bytes,3,opt,name=board_mfg,json=boardMfg,proto3,oneof" json:"board_mfg,omitempty"` + BoardMfgSerial *string `protobuf:"bytes,4,opt,name=board_mfg_serial,json=boardMfgSerial,proto3,oneof" json:"board_mfg_serial,omitempty"` + BoardPartNumber *string `protobuf:"bytes,5,opt,name=board_part_number,json=boardPartNumber,proto3,oneof" json:"board_part_number,omitempty"` + ProductManufacturer *string `protobuf:"bytes,6,opt,name=product_manufacturer,json=productManufacturer,proto3,oneof" json:"product_manufacturer,omitempty"` + ProductPartNumber *string `protobuf:"bytes,7,opt,name=product_part_number,json=productPartNumber,proto3,oneof" json:"product_part_number,omitempty"` + ProductSerial *string `protobuf:"bytes,8,opt,name=product_serial,json=productSerial,proto3,oneof" json:"product_serial,omitempty"` +} + +func (x *MachineFRU) Reset() { + *x = MachineFRU{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v1_boot_proto_msgTypes[11] + 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_api_v1_boot_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MachineFRU.ProtoReflect.Descriptor instead. +func (*MachineFRU) Descriptor() ([]byte, []int) { + return file_api_v1_boot_proto_rawDescGZIP(), []int{11} +} + +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 "" +} + +type BootServiceReportRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` + ConsolePassword string `protobuf:"bytes,2,opt,name=console_password,json=consolePassword,proto3" json:"console_password,omitempty"` + BootInfo *BootInfo `protobuf:"bytes,3,opt,name=boot_info,json=bootInfo,proto3" json:"boot_info,omitempty"` + Success bool `protobuf:"varint,4,opt,name=success,proto3" json:"success,omitempty"` + Message string `protobuf:"bytes,5,opt,name=message,proto3" json:"message,omitempty"` +} + +func (x *BootServiceReportRequest) Reset() { + *x = BootServiceReportRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v1_boot_proto_msgTypes[12] + 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_api_v1_boot_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BootServiceReportRequest.ProtoReflect.Descriptor instead. +func (*BootServiceReportRequest) Descriptor() ([]byte, []int) { + return file_api_v1_boot_proto_rawDescGZIP(), []int{12} +} + +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 "" +} + +type BootServiceReportResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *BootServiceReportResponse) Reset() { + *x = BootServiceReportResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v1_boot_proto_msgTypes[13] + 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_api_v1_boot_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BootServiceReportResponse.ProtoReflect.Descriptor instead. +func (*BootServiceReportResponse) Descriptor() ([]byte, []int) { + return file_api_v1_boot_proto_rawDescGZIP(), []int{13} +} + +type BootInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ImageId string `protobuf:"bytes,1,opt,name=image_id,json=imageId,proto3" json:"image_id,omitempty"` + PrimaryDisk string `protobuf:"bytes,2,opt,name=primary_disk,json=primaryDisk,proto3" json:"primary_disk,omitempty"` + OsPartition string `protobuf:"bytes,3,opt,name=os_partition,json=osPartition,proto3" json:"os_partition,omitempty"` + Initrd string `protobuf:"bytes,4,opt,name=initrd,proto3" json:"initrd,omitempty"` + Cmdline string `protobuf:"bytes,5,opt,name=cmdline,proto3" json:"cmdline,omitempty"` + Kernel string `protobuf:"bytes,6,opt,name=kernel,proto3" json:"kernel,omitempty"` + BootloaderId string `protobuf:"bytes,8,opt,name=bootloader_id,json=bootloaderId,proto3" json:"bootloader_id,omitempty"` +} + +func (x *BootInfo) Reset() { + *x = BootInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v1_boot_proto_msgTypes[14] + 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_api_v1_boot_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BootInfo.ProtoReflect.Descriptor instead. +func (*BootInfo) Descriptor() ([]byte, []int) { + return file_api_v1_boot_proto_rawDescGZIP(), []int{14} +} + +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 "" +} + +type BootServiceAbortReinstallRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` + PrimaryDiskWiped bool `protobuf:"varint,2,opt,name=primary_disk_wiped,json=primaryDiskWiped,proto3" json:"primary_disk_wiped,omitempty"` +} + +func (x *BootServiceAbortReinstallRequest) Reset() { + *x = BootServiceAbortReinstallRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v1_boot_proto_msgTypes[15] + 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_api_v1_boot_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BootServiceAbortReinstallRequest.ProtoReflect.Descriptor instead. +func (*BootServiceAbortReinstallRequest) Descriptor() ([]byte, []int) { + return file_api_v1_boot_proto_rawDescGZIP(), []int{15} +} + +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 +} + +type BootServiceAbortReinstallResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + BootInfo *BootInfo `protobuf:"bytes,1,opt,name=boot_info,json=bootInfo,proto3" json:"boot_info,omitempty"` +} + +func (x *BootServiceAbortReinstallResponse) Reset() { + *x = BootServiceAbortReinstallResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v1_boot_proto_msgTypes[16] + 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_api_v1_boot_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BootServiceAbortReinstallResponse.ProtoReflect.Descriptor instead. +func (*BootServiceAbortReinstallResponse) Descriptor() ([]byte, []int) { + return file_api_v1_boot_proto_rawDescGZIP(), []int{16} +} + +func (x *BootServiceAbortReinstallResponse) GetBootInfo() *BootInfo { + if x != nil { + return x.BootInfo + } + return nil +} + +type BootServiceSuperUserPasswordRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *BootServiceSuperUserPasswordRequest) Reset() { + *x = BootServiceSuperUserPasswordRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v1_boot_proto_msgTypes[17] + 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_api_v1_boot_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BootServiceSuperUserPasswordRequest.ProtoReflect.Descriptor instead. +func (*BootServiceSuperUserPasswordRequest) Descriptor() ([]byte, []int) { + return file_api_v1_boot_proto_rawDescGZIP(), []int{17} +} + +type BootServiceSuperUserPasswordResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + FeatureDisabled bool `protobuf:"varint,1,opt,name=feature_disabled,json=featureDisabled,proto3" json:"feature_disabled,omitempty"` + SuperUserPassword string `protobuf:"bytes,2,opt,name=super_user_password,json=superUserPassword,proto3" json:"super_user_password,omitempty"` +} + +func (x *BootServiceSuperUserPasswordResponse) Reset() { + *x = BootServiceSuperUserPasswordResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v1_boot_proto_msgTypes[18] + 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_api_v1_boot_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BootServiceSuperUserPasswordResponse.ProtoReflect.Descriptor instead. +func (*BootServiceSuperUserPasswordResponse) Descriptor() ([]byte, []int) { + return file_api_v1_boot_proto_rawDescGZIP(), []int{18} +} + +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_api_v1_boot_proto protoreflect.FileDescriptor + +var file_api_v1_boot_proto_rawDesc = []byte{ + 0x0a, 0x11, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x6f, 0x6f, 0x74, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x22, 0x2c, 0x0a, 0x16, 0x42, + 0x6f, 0x6f, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x44, 0x68, 0x63, 0x70, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x22, 0x19, 0x0a, 0x17, 0x42, 0x6f, 0x6f, + 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x44, 0x68, 0x63, 0x70, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4d, 0x0a, 0x16, 0x42, 0x6f, 0x6f, 0x74, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x42, 0x6f, 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, + 0x0a, 0x03, 0x6d, 0x61, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x61, 0x63, + 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x49, 0x64, 0x22, 0x82, 0x01, 0x0a, 0x17, 0x42, 0x6f, 0x6f, 0x74, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x42, 0x6f, 0x6f, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x16, 0x0a, 0x06, 0x6b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x6b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x12, 0x24, 0x0a, 0x0e, 0x69, 0x6e, 0x69, 0x74, 0x5f, + 0x72, 0x61, 0x6d, 0x5f, 0x64, 0x69, 0x73, 0x6b, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x0c, 0x69, 0x6e, 0x69, 0x74, 0x52, 0x61, 0x6d, 0x44, 0x69, 0x73, 0x6b, 0x73, 0x12, 0x1d, 0x0a, + 0x07, 0x63, 0x6d, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, + 0x52, 0x07, 0x63, 0x6d, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x88, 0x01, 0x01, 0x42, 0x0a, 0x0a, 0x08, + 0x5f, 0x63, 0x6d, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x22, 0xfd, 0x01, 0x0a, 0x1a, 0x42, 0x6f, 0x6f, + 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x12, 0x33, 0x0a, 0x08, 0x68, + 0x61, 0x72, 0x64, 0x77, 0x61, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x48, 0x61, + 0x72, 0x64, 0x77, 0x61, 0x72, 0x65, 0x52, 0x08, 0x68, 0x61, 0x72, 0x64, 0x77, 0x61, 0x72, 0x65, + 0x12, 0x27, 0x0a, 0x04, 0x62, 0x69, 0x6f, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x42, + 0x49, 0x4f, 0x53, 0x52, 0x04, 0x62, 0x69, 0x6f, 0x73, 0x12, 0x27, 0x0a, 0x04, 0x69, 0x70, 0x6d, + 0x69, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, + 0x2e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x49, 0x50, 0x4d, 0x49, 0x52, 0x04, 0x69, 0x70, + 0x6d, 0x69, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x61, 0x67, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x04, 0x74, 0x61, 0x67, 0x73, 0x12, 0x30, 0x0a, 0x14, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5f, + 0x68, 0x61, 0x6d, 0x6d, 0x65, 0x72, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x48, 0x61, 0x6d, 0x6d, 0x65, + 0x72, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x68, 0x0a, 0x1b, 0x42, 0x6f, 0x6f, 0x74, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x73, + 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, + 0x21, 0x0a, 0x0c, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x49, 0x64, 0x22, 0xa0, 0x01, 0x0a, 0x0f, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x48, 0x61, + 0x72, 0x64, 0x77, 0x61, 0x72, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x12, 0x1b, + 0x0a, 0x09, 0x63, 0x70, 0x75, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x08, 0x63, 0x70, 0x75, 0x43, 0x6f, 0x72, 0x65, 0x73, 0x12, 0x30, 0x0a, 0x05, 0x64, + 0x69, 0x73, 0x6b, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x05, 0x64, 0x69, 0x73, 0x6b, 0x73, 0x12, 0x26, 0x0a, + 0x04, 0x6e, 0x69, 0x63, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x4e, 0x69, 0x63, 0x52, + 0x04, 0x6e, 0x69, 0x63, 0x73, 0x22, 0x64, 0x0a, 0x0a, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, + 0x4e, 0x69, 0x63, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x61, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6d, 0x61, 0x63, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x30, 0x0a, 0x09, 0x6e, 0x65, 0x69, + 0x67, 0x68, 0x62, 0x6f, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x4e, 0x69, 0x63, + 0x52, 0x09, 0x6e, 0x65, 0x69, 0x67, 0x68, 0x62, 0x6f, 0x72, 0x73, 0x22, 0x3c, 0x0a, 0x12, 0x4d, + 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x76, 0x69, 0x63, + 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x22, 0x53, 0x0a, 0x0b, 0x4d, 0x61, 0x63, + 0x68, 0x69, 0x6e, 0x65, 0x42, 0x49, 0x4f, 0x53, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, + 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x61, 0x74, 0x65, 0x22, 0xef, + 0x01, 0x0a, 0x0b, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x49, 0x50, 0x4d, 0x49, 0x12, 0x18, + 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x61, 0x63, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x61, 0x63, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x73, + 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x1a, + 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x6e, + 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x69, + 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x12, 0x24, 0x0a, 0x03, 0x66, 0x72, 0x75, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4d, + 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x46, 0x52, 0x55, 0x52, 0x03, 0x66, 0x72, 0x75, 0x12, 0x1f, + 0x0a, 0x0b, 0x62, 0x6d, 0x63, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0a, 0x62, 0x6d, 0x63, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, + 0x1f, 0x0a, 0x0b, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x65, + 0x22, 0xbe, 0x04, 0x0a, 0x0a, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x46, 0x52, 0x55, 0x12, + 0x33, 0x0a, 0x13, 0x63, 0x68, 0x61, 0x73, 0x73, 0x69, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x5f, + 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x11, + 0x63, 0x68, 0x61, 0x73, 0x73, 0x69, 0x73, 0x50, 0x61, 0x72, 0x74, 0x4e, 0x75, 0x6d, 0x62, 0x65, + 0x72, 0x88, 0x01, 0x01, 0x12, 0x33, 0x0a, 0x13, 0x63, 0x68, 0x61, 0x73, 0x73, 0x69, 0x73, 0x5f, + 0x70, 0x61, 0x72, 0x74, 0x5f, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x48, 0x01, 0x52, 0x11, 0x63, 0x68, 0x61, 0x73, 0x73, 0x69, 0x73, 0x50, 0x61, 0x72, 0x74, + 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x88, 0x01, 0x01, 0x12, 0x20, 0x0a, 0x09, 0x62, 0x6f, 0x61, + 0x72, 0x64, 0x5f, 0x6d, 0x66, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x02, 0x52, 0x08, + 0x62, 0x6f, 0x61, 0x72, 0x64, 0x4d, 0x66, 0x67, 0x88, 0x01, 0x01, 0x12, 0x2d, 0x0a, 0x10, 0x62, + 0x6f, 0x61, 0x72, 0x64, 0x5f, 0x6d, 0x66, 0x67, 0x5f, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x03, 0x52, 0x0e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x4d, 0x66, + 0x67, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x88, 0x01, 0x01, 0x12, 0x2f, 0x0a, 0x11, 0x62, 0x6f, + 0x61, 0x72, 0x64, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x09, 0x48, 0x04, 0x52, 0x0f, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x50, 0x61, + 0x72, 0x74, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x88, 0x01, 0x01, 0x12, 0x36, 0x0a, 0x14, 0x70, + 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x6d, 0x61, 0x6e, 0x75, 0x66, 0x61, 0x63, 0x74, 0x75, + 0x72, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x48, 0x05, 0x52, 0x13, 0x70, 0x72, 0x6f, + 0x64, 0x75, 0x63, 0x74, 0x4d, 0x61, 0x6e, 0x75, 0x66, 0x61, 0x63, 0x74, 0x75, 0x72, 0x65, 0x72, + 0x88, 0x01, 0x01, 0x12, 0x33, 0x0a, 0x13, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x70, + 0x61, 0x72, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, + 0x48, 0x06, 0x52, 0x11, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x50, 0x61, 0x72, 0x74, 0x4e, + 0x75, 0x6d, 0x62, 0x65, 0x72, 0x88, 0x01, 0x01, 0x12, 0x2a, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x64, + 0x75, 0x63, 0x74, 0x5f, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, + 0x48, 0x07, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x53, 0x65, 0x72, 0x69, 0x61, + 0x6c, 0x88, 0x01, 0x01, 0x42, 0x16, 0x0a, 0x14, 0x5f, 0x63, 0x68, 0x61, 0x73, 0x73, 0x69, 0x73, + 0x5f, 0x70, 0x61, 0x72, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x42, 0x16, 0x0a, 0x14, + 0x5f, 0x63, 0x68, 0x61, 0x73, 0x73, 0x69, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x5f, 0x73, 0x65, + 0x72, 0x69, 0x61, 0x6c, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x5f, 0x6d, + 0x66, 0x67, 0x42, 0x13, 0x0a, 0x11, 0x5f, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x5f, 0x6d, 0x66, 0x67, + 0x5f, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x42, 0x14, 0x0a, 0x12, 0x5f, 0x62, 0x6f, 0x61, 0x72, + 0x64, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x42, 0x17, 0x0a, + 0x15, 0x5f, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x6d, 0x61, 0x6e, 0x75, 0x66, 0x61, + 0x63, 0x74, 0x75, 0x72, 0x65, 0x72, 0x42, 0x16, 0x0a, 0x14, 0x5f, 0x70, 0x72, 0x6f, 0x64, 0x75, + 0x63, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x42, 0x11, + 0x0a, 0x0f, 0x5f, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x73, 0x65, 0x72, 0x69, 0x61, + 0x6c, 0x22, 0xbc, 0x01, 0x0a, 0x18, 0x42, 0x6f, 0x6f, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, + 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x75, + 0x69, 0x64, 0x12, 0x29, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x5f, 0x70, 0x61, + 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x63, 0x6f, + 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x2d, 0x0a, + 0x09, 0x62, 0x6f, 0x6f, 0x74, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6f, 0x6f, 0x74, 0x49, 0x6e, + 0x66, 0x6f, 0x52, 0x08, 0x62, 0x6f, 0x6f, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x18, 0x0a, 0x07, + 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, + 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x22, 0x1b, 0x0a, 0x19, 0x42, 0x6f, 0x6f, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, + 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xda, 0x01, + 0x0a, 0x08, 0x42, 0x6f, 0x6f, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x6d, + 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x69, 0x6d, + 0x61, 0x67, 0x65, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, + 0x5f, 0x64, 0x69, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x69, + 0x6d, 0x61, 0x72, 0x79, 0x44, 0x69, 0x73, 0x6b, 0x12, 0x21, 0x0a, 0x0c, 0x6f, 0x73, 0x5f, 0x70, + 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x6f, 0x73, 0x50, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x69, + 0x6e, 0x69, 0x74, 0x72, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x6e, 0x69, + 0x74, 0x72, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6d, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6d, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x16, 0x0a, + 0x06, 0x6b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6b, + 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x12, 0x23, 0x0a, 0x0d, 0x62, 0x6f, 0x6f, 0x74, 0x6c, 0x6f, 0x61, + 0x64, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x62, 0x6f, + 0x6f, 0x74, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x72, 0x49, 0x64, 0x22, 0x64, 0x0a, 0x20, 0x42, 0x6f, + 0x6f, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x41, 0x62, 0x6f, 0x72, 0x74, 0x52, 0x65, + 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, + 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x75, + 0x69, 0x64, 0x12, 0x2c, 0x0a, 0x12, 0x70, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x5f, 0x64, 0x69, + 0x73, 0x6b, 0x5f, 0x77, 0x69, 0x70, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, + 0x70, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x44, 0x69, 0x73, 0x6b, 0x57, 0x69, 0x70, 0x65, 0x64, + 0x22, 0x52, 0x0a, 0x21, 0x42, 0x6f, 0x6f, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x41, + 0x62, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x09, 0x62, 0x6f, 0x6f, 0x74, 0x5f, 0x69, 0x6e, + 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x31, 0x2e, 0x42, 0x6f, 0x6f, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x62, 0x6f, 0x6f, 0x74, + 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x25, 0x0a, 0x23, 0x42, 0x6f, 0x6f, 0x74, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x53, 0x75, 0x70, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x50, 0x61, 0x73, 0x73, + 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x81, 0x01, 0x0a, 0x24, + 0x42, 0x6f, 0x6f, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x53, 0x75, 0x70, 0x65, 0x72, + 0x55, 0x73, 0x65, 0x72, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, + 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, + 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, + 0x2e, 0x0a, 0x13, 0x73, 0x75, 0x70, 0x65, 0x72, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x70, 0x61, + 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x73, 0x75, + 0x70, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x32, + 0xa4, 0x04, 0x0a, 0x0b, 0x42, 0x6f, 0x6f, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, + 0x49, 0x0a, 0x04, 0x44, 0x68, 0x63, 0x70, 0x12, 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, + 0x2e, 0x42, 0x6f, 0x6f, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x44, 0x68, 0x63, 0x70, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, + 0x2e, 0x42, 0x6f, 0x6f, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x44, 0x68, 0x63, 0x70, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x49, 0x0a, 0x04, 0x42, 0x6f, + 0x6f, 0x74, 0x12, 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6f, 0x6f, 0x74, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x42, 0x6f, 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6f, 0x6f, 0x74, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x42, 0x6f, 0x6f, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x6e, 0x0a, 0x11, 0x53, 0x75, 0x70, 0x65, 0x72, 0x55, 0x73, + 0x65, 0x72, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x2b, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6f, 0x6f, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x53, + 0x75, 0x70, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, + 0x2e, 0x42, 0x6f, 0x6f, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x53, 0x75, 0x70, 0x65, + 0x72, 0x55, 0x73, 0x65, 0x72, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x55, 0x0a, 0x08, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, + 0x72, 0x12, 0x22, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6f, 0x6f, 0x74, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x42, + 0x6f, 0x6f, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, + 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4f, 0x0a, 0x06, + 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x20, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, + 0x42, 0x6f, 0x6f, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x72, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x31, 0x2e, 0x42, 0x6f, 0x6f, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x70, + 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x67, 0x0a, + 0x0e, 0x41, 0x62, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x12, + 0x28, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6f, 0x6f, 0x74, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x41, 0x62, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x69, 0x6e, 0x73, 0x74, 0x61, + 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x2e, 0x42, 0x6f, 0x6f, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x41, 0x62, + 0x6f, 0x72, 0x74, 0x52, 0x65, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x76, 0x31, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_api_v1_boot_proto_rawDescOnce sync.Once + file_api_v1_boot_proto_rawDescData = file_api_v1_boot_proto_rawDesc +) + +func file_api_v1_boot_proto_rawDescGZIP() []byte { + file_api_v1_boot_proto_rawDescOnce.Do(func() { + file_api_v1_boot_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_v1_boot_proto_rawDescData) + }) + return file_api_v1_boot_proto_rawDescData +} + +var file_api_v1_boot_proto_msgTypes = make([]protoimpl.MessageInfo, 19) +var file_api_v1_boot_proto_goTypes = []interface{}{ + (*BootServiceDhcpRequest)(nil), // 0: api.v1.BootServiceDhcpRequest + (*BootServiceDhcpResponse)(nil), // 1: api.v1.BootServiceDhcpResponse + (*BootServiceBootRequest)(nil), // 2: api.v1.BootServiceBootRequest + (*BootServiceBootResponse)(nil), // 3: api.v1.BootServiceBootResponse + (*BootServiceRegisterRequest)(nil), // 4: api.v1.BootServiceRegisterRequest + (*BootServiceRegisterResponse)(nil), // 5: api.v1.BootServiceRegisterResponse + (*MachineHardware)(nil), // 6: api.v1.MachineHardware + (*MachineNic)(nil), // 7: api.v1.MachineNic + (*MachineBlockDevice)(nil), // 8: api.v1.MachineBlockDevice + (*MachineBIOS)(nil), // 9: api.v1.MachineBIOS + (*MachineIPMI)(nil), // 10: api.v1.MachineIPMI + (*MachineFRU)(nil), // 11: api.v1.MachineFRU + (*BootServiceReportRequest)(nil), // 12: api.v1.BootServiceReportRequest + (*BootServiceReportResponse)(nil), // 13: api.v1.BootServiceReportResponse + (*BootInfo)(nil), // 14: api.v1.BootInfo + (*BootServiceAbortReinstallRequest)(nil), // 15: api.v1.BootServiceAbortReinstallRequest + (*BootServiceAbortReinstallResponse)(nil), // 16: api.v1.BootServiceAbortReinstallResponse + (*BootServiceSuperUserPasswordRequest)(nil), // 17: api.v1.BootServiceSuperUserPasswordRequest + (*BootServiceSuperUserPasswordResponse)(nil), // 18: api.v1.BootServiceSuperUserPasswordResponse +} +var file_api_v1_boot_proto_depIdxs = []int32{ + 6, // 0: api.v1.BootServiceRegisterRequest.hardware:type_name -> api.v1.MachineHardware + 9, // 1: api.v1.BootServiceRegisterRequest.bios:type_name -> api.v1.MachineBIOS + 10, // 2: api.v1.BootServiceRegisterRequest.ipmi:type_name -> api.v1.MachineIPMI + 8, // 3: api.v1.MachineHardware.disks:type_name -> api.v1.MachineBlockDevice + 7, // 4: api.v1.MachineHardware.nics:type_name -> api.v1.MachineNic + 7, // 5: api.v1.MachineNic.neighbors:type_name -> api.v1.MachineNic + 11, // 6: api.v1.MachineIPMI.fru:type_name -> api.v1.MachineFRU + 14, // 7: api.v1.BootServiceReportRequest.boot_info:type_name -> api.v1.BootInfo + 14, // 8: api.v1.BootServiceAbortReinstallResponse.boot_info:type_name -> api.v1.BootInfo + 0, // 9: api.v1.BootService.Dhcp:input_type -> api.v1.BootServiceDhcpRequest + 2, // 10: api.v1.BootService.Boot:input_type -> api.v1.BootServiceBootRequest + 17, // 11: api.v1.BootService.SuperUserPassword:input_type -> api.v1.BootServiceSuperUserPasswordRequest + 4, // 12: api.v1.BootService.Register:input_type -> api.v1.BootServiceRegisterRequest + 12, // 13: api.v1.BootService.Report:input_type -> api.v1.BootServiceReportRequest + 15, // 14: api.v1.BootService.AbortReinstall:input_type -> api.v1.BootServiceAbortReinstallRequest + 1, // 15: api.v1.BootService.Dhcp:output_type -> api.v1.BootServiceDhcpResponse + 3, // 16: api.v1.BootService.Boot:output_type -> api.v1.BootServiceBootResponse + 18, // 17: api.v1.BootService.SuperUserPassword:output_type -> api.v1.BootServiceSuperUserPasswordResponse + 5, // 18: api.v1.BootService.Register:output_type -> api.v1.BootServiceRegisterResponse + 13, // 19: api.v1.BootService.Report:output_type -> api.v1.BootServiceReportResponse + 16, // 20: api.v1.BootService.AbortReinstall:output_type -> api.v1.BootServiceAbortReinstallResponse + 15, // [15:21] is the sub-list for method output_type + 9, // [9:15] is the sub-list for method input_type + 9, // [9:9] is the sub-list for extension type_name + 9, // [9:9] is the sub-list for extension extendee + 0, // [0:9] is the sub-list for field type_name +} + +func init() { file_api_v1_boot_proto_init() } +func file_api_v1_boot_proto_init() { + if File_api_v1_boot_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_api_v1_boot_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BootServiceDhcpRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_v1_boot_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BootServiceDhcpResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_v1_boot_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BootServiceBootRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_v1_boot_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BootServiceBootResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_v1_boot_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BootServiceRegisterRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_v1_boot_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BootServiceRegisterResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_v1_boot_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MachineHardware); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_v1_boot_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MachineNic); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_v1_boot_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MachineBlockDevice); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_v1_boot_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MachineBIOS); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_v1_boot_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MachineIPMI); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_v1_boot_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MachineFRU); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_v1_boot_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BootServiceReportRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_v1_boot_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BootServiceReportResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_v1_boot_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BootInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_v1_boot_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BootServiceAbortReinstallRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_v1_boot_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BootServiceAbortReinstallResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_v1_boot_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BootServiceSuperUserPasswordRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_v1_boot_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BootServiceSuperUserPasswordResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_api_v1_boot_proto_msgTypes[3].OneofWrappers = []interface{}{} + file_api_v1_boot_proto_msgTypes[11].OneofWrappers = []interface{}{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_api_v1_boot_proto_rawDesc, + NumEnums: 0, + NumMessages: 19, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_api_v1_boot_proto_goTypes, + DependencyIndexes: file_api_v1_boot_proto_depIdxs, + MessageInfos: file_api_v1_boot_proto_msgTypes, + }.Build() + File_api_v1_boot_proto = out.File + file_api_v1_boot_proto_rawDesc = nil + file_api_v1_boot_proto_goTypes = nil + file_api_v1_boot_proto_depIdxs = nil +} diff --git a/pkg/api/v1/boot_grpc.pb.go b/pkg/api/v1/boot_grpc.pb.go new file mode 100644 index 000000000..48dae38c2 --- /dev/null +++ b/pkg/api/v1/boot_grpc.pb.go @@ -0,0 +1,291 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +package v1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// BootServiceClient is the client API for BootService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type BootServiceClient interface { + // Dhcp is the first dhcp request (option 97). A ProvisioningEventPXEBooting is fired + Dhcp(ctx context.Context, in *BootServiceDhcpRequest, opts ...grpc.CallOption) (*BootServiceDhcpResponse, error) + // Boot is called from pixie once the machine got the first dhcp response and ipxie asks for subsequent kernel and initrd + Boot(ctx context.Context, in *BootServiceBootRequest, opts ...grpc.CallOption) (*BootServiceBootResponse, error) + // SuperUserPassword metal-hammer takes the configured root password for the bmc from metal-api and configure the bmc accordingly + SuperUserPassword(ctx context.Context, in *BootServiceSuperUserPasswordRequest, opts ...grpc.CallOption) (*BootServiceSuperUserPasswordResponse, error) + // Register is called from metal-hammer after hardware inventory is finished, tells metal-api all glory details about that machine + Register(ctx context.Context, in *BootServiceRegisterRequest, opts ...grpc.CallOption) (*BootServiceRegisterResponse, error) + // Report tells metal-api installation was either sucessful or failed + Report(ctx context.Context, in *BootServiceReportRequest, opts ...grpc.CallOption) (*BootServiceReportResponse, error) + // If reinstall failed and tell metal-api to restore to previous state + AbortReinstall(ctx context.Context, in *BootServiceAbortReinstallRequest, opts ...grpc.CallOption) (*BootServiceAbortReinstallResponse, error) +} + +type bootServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewBootServiceClient(cc grpc.ClientConnInterface) BootServiceClient { + return &bootServiceClient{cc} +} + +func (c *bootServiceClient) Dhcp(ctx context.Context, in *BootServiceDhcpRequest, opts ...grpc.CallOption) (*BootServiceDhcpResponse, error) { + out := new(BootServiceDhcpResponse) + err := c.cc.Invoke(ctx, "/api.v1.BootService/Dhcp", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *bootServiceClient) Boot(ctx context.Context, in *BootServiceBootRequest, opts ...grpc.CallOption) (*BootServiceBootResponse, error) { + out := new(BootServiceBootResponse) + err := c.cc.Invoke(ctx, "/api.v1.BootService/Boot", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *bootServiceClient) SuperUserPassword(ctx context.Context, in *BootServiceSuperUserPasswordRequest, opts ...grpc.CallOption) (*BootServiceSuperUserPasswordResponse, error) { + out := new(BootServiceSuperUserPasswordResponse) + err := c.cc.Invoke(ctx, "/api.v1.BootService/SuperUserPassword", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *bootServiceClient) Register(ctx context.Context, in *BootServiceRegisterRequest, opts ...grpc.CallOption) (*BootServiceRegisterResponse, error) { + out := new(BootServiceRegisterResponse) + err := c.cc.Invoke(ctx, "/api.v1.BootService/Register", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *bootServiceClient) Report(ctx context.Context, in *BootServiceReportRequest, opts ...grpc.CallOption) (*BootServiceReportResponse, error) { + out := new(BootServiceReportResponse) + err := c.cc.Invoke(ctx, "/api.v1.BootService/Report", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *bootServiceClient) AbortReinstall(ctx context.Context, in *BootServiceAbortReinstallRequest, opts ...grpc.CallOption) (*BootServiceAbortReinstallResponse, error) { + out := new(BootServiceAbortReinstallResponse) + err := c.cc.Invoke(ctx, "/api.v1.BootService/AbortReinstall", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// BootServiceServer is the server API for BootService service. +// All implementations should embed UnimplementedBootServiceServer +// for forward compatibility +type BootServiceServer interface { + // Dhcp is the first dhcp request (option 97). A ProvisioningEventPXEBooting is fired + Dhcp(context.Context, *BootServiceDhcpRequest) (*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, *BootServiceBootRequest) (*BootServiceBootResponse, error) + // SuperUserPassword metal-hammer takes the configured root password for the bmc from metal-api and configure the bmc accordingly + SuperUserPassword(context.Context, *BootServiceSuperUserPasswordRequest) (*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, *BootServiceRegisterRequest) (*BootServiceRegisterResponse, error) + // Report tells metal-api installation was either sucessful or failed + Report(context.Context, *BootServiceReportRequest) (*BootServiceReportResponse, error) + // If reinstall failed and tell metal-api to restore to previous state + AbortReinstall(context.Context, *BootServiceAbortReinstallRequest) (*BootServiceAbortReinstallResponse, error) +} + +// UnimplementedBootServiceServer should be embedded to have forward compatible implementations. +type UnimplementedBootServiceServer struct { +} + +func (UnimplementedBootServiceServer) Dhcp(context.Context, *BootServiceDhcpRequest) (*BootServiceDhcpResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Dhcp not implemented") +} +func (UnimplementedBootServiceServer) Boot(context.Context, *BootServiceBootRequest) (*BootServiceBootResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Boot not implemented") +} +func (UnimplementedBootServiceServer) SuperUserPassword(context.Context, *BootServiceSuperUserPasswordRequest) (*BootServiceSuperUserPasswordResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SuperUserPassword not implemented") +} +func (UnimplementedBootServiceServer) Register(context.Context, *BootServiceRegisterRequest) (*BootServiceRegisterResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Register not implemented") +} +func (UnimplementedBootServiceServer) Report(context.Context, *BootServiceReportRequest) (*BootServiceReportResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Report not implemented") +} +func (UnimplementedBootServiceServer) AbortReinstall(context.Context, *BootServiceAbortReinstallRequest) (*BootServiceAbortReinstallResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AbortReinstall not implemented") +} + +// UnsafeBootServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to BootServiceServer will +// result in compilation errors. +type UnsafeBootServiceServer interface { + mustEmbedUnimplementedBootServiceServer() +} + +func RegisterBootServiceServer(s grpc.ServiceRegistrar, srv BootServiceServer) { + s.RegisterService(&BootService_ServiceDesc, srv) +} + +func _BootService_Dhcp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BootServiceDhcpRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BootServiceServer).Dhcp(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.BootService/Dhcp", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BootServiceServer).Dhcp(ctx, req.(*BootServiceDhcpRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BootService_Boot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BootServiceBootRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BootServiceServer).Boot(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.BootService/Boot", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BootServiceServer).Boot(ctx, req.(*BootServiceBootRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BootService_SuperUserPassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BootServiceSuperUserPasswordRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BootServiceServer).SuperUserPassword(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.BootService/SuperUserPassword", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BootServiceServer).SuperUserPassword(ctx, req.(*BootServiceSuperUserPasswordRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BootService_Register_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BootServiceRegisterRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BootServiceServer).Register(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.BootService/Register", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BootServiceServer).Register(ctx, req.(*BootServiceRegisterRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BootService_Report_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BootServiceReportRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BootServiceServer).Report(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.BootService/Report", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BootServiceServer).Report(ctx, req.(*BootServiceReportRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BootService_AbortReinstall_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BootServiceAbortReinstallRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BootServiceServer).AbortReinstall(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.BootService/AbortReinstall", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BootServiceServer).AbortReinstall(ctx, req.(*BootServiceAbortReinstallRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// BootService_ServiceDesc is the grpc.ServiceDesc for BootService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var BootService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "api.v1.BootService", + HandlerType: (*BootServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Dhcp", + Handler: _BootService_Dhcp_Handler, + }, + { + MethodName: "Boot", + Handler: _BootService_Boot_Handler, + }, + { + MethodName: "SuperUserPassword", + Handler: _BootService_SuperUserPassword_Handler, + }, + { + MethodName: "Register", + Handler: _BootService_Register_Handler, + }, + { + MethodName: "Report", + Handler: _BootService_Report_Handler, + }, + { + MethodName: "AbortReinstall", + Handler: _BootService_AbortReinstall_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "api/v1/boot.proto", +} diff --git a/pkg/api/v1/event.pb.go b/pkg/api/v1/event.pb.go index 7f2150c35..9ce265635 100644 --- a/pkg/api/v1/event.pb.go +++ b/pkg/api/v1/event.pb.go @@ -1,16 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.26.0 -// protoc v3.20.0 +// protoc-gen-go v1.27.1 +// protoc (unknown) // source: api/v1/event.proto package v1 import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" timestamppb "google.golang.org/protobuf/types/known/timestamppb" @@ -234,8 +230,7 @@ var file_api_v1_event_proto_rawDesc = []byte{ 0x65, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, - 0x42, 0x0a, 0x5a, 0x08, 0x2e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -333,83 +328,3 @@ func file_api_v1_event_proto_init() { file_api_v1_event_proto_goTypes = nil file_api_v1_event_proto_depIdxs = nil } - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// EventServiceClient is the client API for EventService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type EventServiceClient interface { - Send(ctx context.Context, in *EventServiceSendRequest, opts ...grpc.CallOption) (*EventServiceSendResponse, error) -} - -type eventServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewEventServiceClient(cc grpc.ClientConnInterface) EventServiceClient { - return &eventServiceClient{cc} -} - -func (c *eventServiceClient) Send(ctx context.Context, in *EventServiceSendRequest, opts ...grpc.CallOption) (*EventServiceSendResponse, error) { - out := new(EventServiceSendResponse) - err := c.cc.Invoke(ctx, "/api.v1.EventService/Send", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// EventServiceServer is the server API for EventService service. -type EventServiceServer interface { - Send(context.Context, *EventServiceSendRequest) (*EventServiceSendResponse, error) -} - -// UnimplementedEventServiceServer can be embedded to have forward compatible implementations. -type UnimplementedEventServiceServer struct { -} - -func (*UnimplementedEventServiceServer) Send(context.Context, *EventServiceSendRequest) (*EventServiceSendResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Send not implemented") -} - -func RegisterEventServiceServer(s *grpc.Server, srv EventServiceServer) { - s.RegisterService(&_EventService_serviceDesc, srv) -} - -func _EventService_Send_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(EventServiceSendRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(EventServiceServer).Send(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/api.v1.EventService/Send", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(EventServiceServer).Send(ctx, req.(*EventServiceSendRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _EventService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "api.v1.EventService", - HandlerType: (*EventServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Send", - Handler: _EventService_Send_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "api/v1/event.proto", -} diff --git a/pkg/api/v1/event.proto b/pkg/api/v1/event.proto deleted file mode 100644 index 7485140b7..000000000 --- a/pkg/api/v1/event.proto +++ /dev/null @@ -1,35 +0,0 @@ -syntax = "proto3"; - -package api.v1; - -option go_package = "./api/v1"; - -import "google/protobuf/timestamp.proto"; - - -service EventService { - rpc Send(EventServiceSendRequest) returns (EventServiceSendResponse) {} -} - -message EventServiceSendRequest { - map events = 1; -} - -message EventServiceSendResponse { - // number of events stored - uint64 events = 1; - // slice of machineIDs for which event was not published - repeated string failed = 2; - -} - -message MachineProvisioningEvent { - // timestamp when the event occured - google.protobuf.Timestamp time= 1; - // the event type - // must be one of metal.ProvisioningEventType, otherwise event will be skipped - // TODO should be migrated to be an enum - string event = 2; - // an additional message describing the event more detailed - string message = 3; -} diff --git a/pkg/api/v1/event_grpc.pb.go b/pkg/api/v1/event_grpc.pb.go new file mode 100644 index 000000000..fff0974fb --- /dev/null +++ b/pkg/api/v1/event_grpc.pb.go @@ -0,0 +1,99 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +package v1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// EventServiceClient is the client API for EventService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type EventServiceClient interface { + Send(ctx context.Context, in *EventServiceSendRequest, opts ...grpc.CallOption) (*EventServiceSendResponse, error) +} + +type eventServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewEventServiceClient(cc grpc.ClientConnInterface) EventServiceClient { + return &eventServiceClient{cc} +} + +func (c *eventServiceClient) Send(ctx context.Context, in *EventServiceSendRequest, opts ...grpc.CallOption) (*EventServiceSendResponse, error) { + out := new(EventServiceSendResponse) + err := c.cc.Invoke(ctx, "/api.v1.EventService/Send", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// EventServiceServer is the server API for EventService service. +// All implementations should embed UnimplementedEventServiceServer +// for forward compatibility +type EventServiceServer interface { + Send(context.Context, *EventServiceSendRequest) (*EventServiceSendResponse, error) +} + +// UnimplementedEventServiceServer should be embedded to have forward compatible implementations. +type UnimplementedEventServiceServer struct { +} + +func (UnimplementedEventServiceServer) Send(context.Context, *EventServiceSendRequest) (*EventServiceSendResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Send not implemented") +} + +// UnsafeEventServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to EventServiceServer will +// result in compilation errors. +type UnsafeEventServiceServer interface { + mustEmbedUnimplementedEventServiceServer() +} + +func RegisterEventServiceServer(s grpc.ServiceRegistrar, srv EventServiceServer) { + s.RegisterService(&EventService_ServiceDesc, srv) +} + +func _EventService_Send_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EventServiceSendRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(EventServiceServer).Send(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.EventService/Send", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(EventServiceServer).Send(ctx, req.(*EventServiceSendRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// EventService_ServiceDesc is the grpc.ServiceDesc for EventService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var EventService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "api.v1.EventService", + HandlerType: (*EventServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Send", + Handler: _EventService_Send_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "api/v1/event.proto", +} diff --git a/pkg/api/v1/supwd.pb.go b/pkg/api/v1/supwd.pb.go deleted file mode 100644 index e1596f3a3..000000000 --- a/pkg/api/v1/supwd.pb.go +++ /dev/null @@ -1,300 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.26.0 -// protoc v3.20.0 -// source: api/v1/supwd.proto - -package v1 - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -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) -) - -type SuperUserPasswordRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *SuperUserPasswordRequest) Reset() { - *x = SuperUserPasswordRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_api_v1_supwd_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SuperUserPasswordRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SuperUserPasswordRequest) ProtoMessage() {} - -func (x *SuperUserPasswordRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_v1_supwd_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SuperUserPasswordRequest.ProtoReflect.Descriptor instead. -func (*SuperUserPasswordRequest) Descriptor() ([]byte, []int) { - return file_api_v1_supwd_proto_rawDescGZIP(), []int{0} -} - -type SuperUserPasswordResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - FeatureDisabled bool `protobuf:"varint,1,opt,name=featureDisabled,proto3" json:"featureDisabled,omitempty"` - SuperUserPassword string `protobuf:"bytes,2,opt,name=superUserPassword,proto3" json:"superUserPassword,omitempty"` -} - -func (x *SuperUserPasswordResponse) Reset() { - *x = SuperUserPasswordResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_api_v1_supwd_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SuperUserPasswordResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SuperUserPasswordResponse) ProtoMessage() {} - -func (x *SuperUserPasswordResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_v1_supwd_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SuperUserPasswordResponse.ProtoReflect.Descriptor instead. -func (*SuperUserPasswordResponse) Descriptor() ([]byte, []int) { - return file_api_v1_supwd_proto_rawDescGZIP(), []int{1} -} - -func (x *SuperUserPasswordResponse) GetFeatureDisabled() bool { - if x != nil { - return x.FeatureDisabled - } - return false -} - -func (x *SuperUserPasswordResponse) GetSuperUserPassword() string { - if x != nil { - return x.SuperUserPassword - } - return "" -} - -var File_api_v1_supwd_proto protoreflect.FileDescriptor - -var file_api_v1_supwd_proto_rawDesc = []byte{ - 0x0a, 0x12, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x75, 0x70, 0x77, 0x64, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x76, 0x31, 0x22, 0x1a, 0x0a, 0x18, 0x53, 0x75, 0x70, 0x65, - 0x72, 0x55, 0x73, 0x65, 0x72, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x22, 0x73, 0x0a, 0x19, 0x53, 0x75, 0x70, 0x65, 0x72, 0x55, 0x73, 0x65, - 0x72, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x44, 0x69, 0x73, 0x61, - 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x66, 0x65, 0x61, 0x74, - 0x75, 0x72, 0x65, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x2c, 0x0a, 0x11, 0x73, - 0x75, 0x70, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x73, 0x75, 0x70, 0x65, 0x72, 0x55, 0x73, 0x65, - 0x72, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x32, 0x6a, 0x0a, 0x11, 0x53, 0x75, 0x70, - 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x55, - 0x0a, 0x16, 0x46, 0x65, 0x74, 0x63, 0x68, 0x53, 0x75, 0x70, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, - 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x1c, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, - 0x70, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, 0x70, 0x65, - 0x72, 0x55, 0x73, 0x65, 0x72, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x08, 0x5a, 0x06, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_api_v1_supwd_proto_rawDescOnce sync.Once - file_api_v1_supwd_proto_rawDescData = file_api_v1_supwd_proto_rawDesc -) - -func file_api_v1_supwd_proto_rawDescGZIP() []byte { - file_api_v1_supwd_proto_rawDescOnce.Do(func() { - file_api_v1_supwd_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_v1_supwd_proto_rawDescData) - }) - return file_api_v1_supwd_proto_rawDescData -} - -var file_api_v1_supwd_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_api_v1_supwd_proto_goTypes = []interface{}{ - (*SuperUserPasswordRequest)(nil), // 0: v1.SuperUserPasswordRequest - (*SuperUserPasswordResponse)(nil), // 1: v1.SuperUserPasswordResponse -} -var file_api_v1_supwd_proto_depIdxs = []int32{ - 0, // 0: v1.SuperUserPassword.FetchSuperUserPassword:input_type -> v1.SuperUserPasswordRequest - 1, // 1: v1.SuperUserPassword.FetchSuperUserPassword:output_type -> v1.SuperUserPasswordResponse - 1, // [1:2] is the sub-list for method output_type - 0, // [0:1] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_api_v1_supwd_proto_init() } -func file_api_v1_supwd_proto_init() { - if File_api_v1_supwd_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_api_v1_supwd_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SuperUserPasswordRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_api_v1_supwd_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SuperUserPasswordResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_api_v1_supwd_proto_rawDesc, - NumEnums: 0, - NumMessages: 2, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_api_v1_supwd_proto_goTypes, - DependencyIndexes: file_api_v1_supwd_proto_depIdxs, - MessageInfos: file_api_v1_supwd_proto_msgTypes, - }.Build() - File_api_v1_supwd_proto = out.File - file_api_v1_supwd_proto_rawDesc = nil - file_api_v1_supwd_proto_goTypes = nil - file_api_v1_supwd_proto_depIdxs = nil -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// SuperUserPasswordClient is the client API for SuperUserPassword service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type SuperUserPasswordClient interface { - FetchSuperUserPassword(ctx context.Context, in *SuperUserPasswordRequest, opts ...grpc.CallOption) (*SuperUserPasswordResponse, error) -} - -type superUserPasswordClient struct { - cc grpc.ClientConnInterface -} - -func NewSuperUserPasswordClient(cc grpc.ClientConnInterface) SuperUserPasswordClient { - return &superUserPasswordClient{cc} -} - -func (c *superUserPasswordClient) FetchSuperUserPassword(ctx context.Context, in *SuperUserPasswordRequest, opts ...grpc.CallOption) (*SuperUserPasswordResponse, error) { - out := new(SuperUserPasswordResponse) - err := c.cc.Invoke(ctx, "/v1.SuperUserPassword/FetchSuperUserPassword", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// SuperUserPasswordServer is the server API for SuperUserPassword service. -type SuperUserPasswordServer interface { - FetchSuperUserPassword(context.Context, *SuperUserPasswordRequest) (*SuperUserPasswordResponse, error) -} - -// UnimplementedSuperUserPasswordServer can be embedded to have forward compatible implementations. -type UnimplementedSuperUserPasswordServer struct { -} - -func (*UnimplementedSuperUserPasswordServer) FetchSuperUserPassword(context.Context, *SuperUserPasswordRequest) (*SuperUserPasswordResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method FetchSuperUserPassword not implemented") -} - -func RegisterSuperUserPasswordServer(s *grpc.Server, srv SuperUserPasswordServer) { - s.RegisterService(&_SuperUserPassword_serviceDesc, srv) -} - -func _SuperUserPassword_FetchSuperUserPassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SuperUserPasswordRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(SuperUserPasswordServer).FetchSuperUserPassword(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/v1.SuperUserPassword/FetchSuperUserPassword", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SuperUserPasswordServer).FetchSuperUserPassword(ctx, req.(*SuperUserPasswordRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _SuperUserPassword_serviceDesc = grpc.ServiceDesc{ - ServiceName: "v1.SuperUserPassword", - HandlerType: (*SuperUserPasswordServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "FetchSuperUserPassword", - Handler: _SuperUserPassword_FetchSuperUserPassword_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "api/v1/supwd.proto", -} diff --git a/pkg/api/v1/supwd.proto b/pkg/api/v1/supwd.proto deleted file mode 100644 index 74bbed179..000000000 --- a/pkg/api/v1/supwd.proto +++ /dev/null @@ -1,17 +0,0 @@ -syntax = "proto3"; - -package v1; - -option go_package = "api/v1"; - -message SuperUserPasswordRequest { -} - -message SuperUserPasswordResponse { - bool featureDisabled = 1; - string superUserPassword = 2; -} - -service SuperUserPassword { - rpc FetchSuperUserPassword (SuperUserPasswordRequest) returns (SuperUserPasswordResponse); -} diff --git a/pkg/api/v1/wait.pb.go b/pkg/api/v1/wait.pb.go index eb8965600..cdc597b6e 100644 --- a/pkg/api/v1/wait.pb.go +++ b/pkg/api/v1/wait.pb.go @@ -1,16 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.26.0 -// protoc v3.20.0 +// protoc-gen-go v1.27.1 +// protoc (unknown) // source: api/v1/wait.proto package v1 import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -29,7 +25,7 @@ type WaitRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - MachineID string `protobuf:"bytes,1,opt,name=machineID,proto3" json:"machineID,omitempty"` + MachineId string `protobuf:"bytes,1,opt,name=machine_id,json=machineId,proto3" json:"machine_id,omitempty"` } func (x *WaitRequest) Reset() { @@ -64,9 +60,9 @@ func (*WaitRequest) Descriptor() ([]byte, []int) { return file_api_v1_wait_proto_rawDescGZIP(), []int{0} } -func (x *WaitRequest) GetMachineID() string { +func (x *WaitRequest) GetMachineId() string { if x != nil { - return x.MachineID + return x.MachineId } return "" } @@ -113,16 +109,17 @@ var File_api_v1_wait_proto protoreflect.FileDescriptor var file_api_v1_wait_proto_rawDesc = []byte{ 0x0a, 0x11, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x77, 0x61, 0x69, 0x74, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x76, 0x31, 0x22, 0x2b, 0x0a, 0x0b, 0x57, 0x61, 0x69, 0x74, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, - 0x65, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x61, 0x63, 0x68, 0x69, - 0x6e, 0x65, 0x49, 0x44, 0x22, 0x15, 0x0a, 0x13, 0x4b, 0x65, 0x65, 0x70, 0x50, 0x61, 0x74, 0x69, - 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x3a, 0x0a, 0x04, 0x57, - 0x61, 0x69, 0x74, 0x12, 0x32, 0x0a, 0x04, 0x57, 0x61, 0x69, 0x74, 0x12, 0x0f, 0x2e, 0x76, 0x31, - 0x2e, 0x57, 0x61, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x76, - 0x31, 0x2e, 0x4b, 0x65, 0x65, 0x70, 0x50, 0x61, 0x74, 0x69, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x42, 0x08, 0x5a, 0x06, 0x61, 0x70, 0x69, 0x2f, 0x76, - 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x22, 0x2c, 0x0a, 0x0b, 0x57, + 0x61, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x61, + 0x63, 0x68, 0x69, 0x6e, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x49, 0x64, 0x22, 0x15, 0x0a, 0x13, 0x4b, 0x65, 0x65, + 0x70, 0x50, 0x61, 0x74, 0x69, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x32, 0x42, 0x0a, 0x04, 0x57, 0x61, 0x69, 0x74, 0x12, 0x3a, 0x0a, 0x04, 0x57, 0x61, 0x69, 0x74, + 0x12, 0x13, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x61, 0x69, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4b, + 0x65, 0x65, 0x70, 0x50, 0x61, 0x74, 0x69, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x30, 0x01, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -139,12 +136,12 @@ func file_api_v1_wait_proto_rawDescGZIP() []byte { var file_api_v1_wait_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_api_v1_wait_proto_goTypes = []interface{}{ - (*WaitRequest)(nil), // 0: v1.WaitRequest - (*KeepPatientResponse)(nil), // 1: v1.KeepPatientResponse + (*WaitRequest)(nil), // 0: api.v1.WaitRequest + (*KeepPatientResponse)(nil), // 1: api.v1.KeepPatientResponse } var file_api_v1_wait_proto_depIdxs = []int32{ - 0, // 0: v1.Wait.Wait:input_type -> v1.WaitRequest - 1, // 1: v1.Wait.Wait:output_type -> v1.KeepPatientResponse + 0, // 0: api.v1.Wait.Wait:input_type -> api.v1.WaitRequest + 1, // 1: api.v1.Wait.Wait:output_type -> api.v1.KeepPatientResponse 1, // [1:2] is the sub-list for method output_type 0, // [0:1] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name @@ -202,110 +199,3 @@ func file_api_v1_wait_proto_init() { file_api_v1_wait_proto_goTypes = nil file_api_v1_wait_proto_depIdxs = nil } - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// WaitClient is the client API for Wait service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type WaitClient interface { - Wait(ctx context.Context, in *WaitRequest, opts ...grpc.CallOption) (Wait_WaitClient, error) -} - -type waitClient struct { - cc grpc.ClientConnInterface -} - -func NewWaitClient(cc grpc.ClientConnInterface) WaitClient { - return &waitClient{cc} -} - -func (c *waitClient) Wait(ctx context.Context, in *WaitRequest, opts ...grpc.CallOption) (Wait_WaitClient, error) { - stream, err := c.cc.NewStream(ctx, &_Wait_serviceDesc.Streams[0], "/v1.Wait/Wait", opts...) - if err != nil { - return nil, err - } - x := &waitWaitClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type Wait_WaitClient interface { - Recv() (*KeepPatientResponse, error) - grpc.ClientStream -} - -type waitWaitClient struct { - grpc.ClientStream -} - -func (x *waitWaitClient) Recv() (*KeepPatientResponse, error) { - m := new(KeepPatientResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// WaitServer is the server API for Wait service. -type WaitServer interface { - Wait(*WaitRequest, Wait_WaitServer) error -} - -// UnimplementedWaitServer can be embedded to have forward compatible implementations. -type UnimplementedWaitServer struct { -} - -func (*UnimplementedWaitServer) Wait(*WaitRequest, Wait_WaitServer) error { - return status.Errorf(codes.Unimplemented, "method Wait not implemented") -} - -func RegisterWaitServer(s *grpc.Server, srv WaitServer) { - s.RegisterService(&_Wait_serviceDesc, srv) -} - -func _Wait_Wait_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(WaitRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(WaitServer).Wait(m, &waitWaitServer{stream}) -} - -type Wait_WaitServer interface { - Send(*KeepPatientResponse) error - grpc.ServerStream -} - -type waitWaitServer struct { - grpc.ServerStream -} - -func (x *waitWaitServer) Send(m *KeepPatientResponse) error { - return x.ServerStream.SendMsg(m) -} - -var _Wait_serviceDesc = grpc.ServiceDesc{ - ServiceName: "v1.Wait", - HandlerType: (*WaitServer)(nil), - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{ - { - StreamName: "Wait", - Handler: _Wait_Wait_Handler, - ServerStreams: true, - }, - }, - Metadata: "api/v1/wait.proto", -} diff --git a/pkg/api/v1/wait.proto b/pkg/api/v1/wait.proto deleted file mode 100644 index b7e4bfa37..000000000 --- a/pkg/api/v1/wait.proto +++ /dev/null @@ -1,15 +0,0 @@ -syntax = "proto3"; - -package v1; - -option go_package = "api/v1"; - -message WaitRequest { - string machineID = 1; -} - -message KeepPatientResponse {} - -service Wait { - rpc Wait (WaitRequest) returns (stream KeepPatientResponse); -} diff --git a/pkg/api/v1/wait_grpc.pb.go b/pkg/api/v1/wait_grpc.pb.go new file mode 100644 index 000000000..e1daa1040 --- /dev/null +++ b/pkg/api/v1/wait_grpc.pb.go @@ -0,0 +1,128 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +package v1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// WaitClient is the client API for Wait service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type WaitClient interface { + // FIXME move to boot.proto + Wait(ctx context.Context, in *WaitRequest, opts ...grpc.CallOption) (Wait_WaitClient, error) +} + +type waitClient struct { + cc grpc.ClientConnInterface +} + +func NewWaitClient(cc grpc.ClientConnInterface) WaitClient { + return &waitClient{cc} +} + +func (c *waitClient) Wait(ctx context.Context, in *WaitRequest, opts ...grpc.CallOption) (Wait_WaitClient, error) { + stream, err := c.cc.NewStream(ctx, &Wait_ServiceDesc.Streams[0], "/api.v1.Wait/Wait", opts...) + if err != nil { + return nil, err + } + x := &waitWaitClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type Wait_WaitClient interface { + Recv() (*KeepPatientResponse, error) + grpc.ClientStream +} + +type waitWaitClient struct { + grpc.ClientStream +} + +func (x *waitWaitClient) Recv() (*KeepPatientResponse, error) { + m := new(KeepPatientResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// WaitServer is the server API for Wait service. +// All implementations should embed UnimplementedWaitServer +// for forward compatibility +type WaitServer interface { + // FIXME move to boot.proto + Wait(*WaitRequest, Wait_WaitServer) error +} + +// UnimplementedWaitServer should be embedded to have forward compatible implementations. +type UnimplementedWaitServer struct { +} + +func (UnimplementedWaitServer) Wait(*WaitRequest, Wait_WaitServer) error { + return status.Errorf(codes.Unimplemented, "method Wait not implemented") +} + +// UnsafeWaitServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to WaitServer will +// result in compilation errors. +type UnsafeWaitServer interface { + mustEmbedUnimplementedWaitServer() +} + +func RegisterWaitServer(s grpc.ServiceRegistrar, srv WaitServer) { + s.RegisterService(&Wait_ServiceDesc, srv) +} + +func _Wait_Wait_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(WaitRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(WaitServer).Wait(m, &waitWaitServer{stream}) +} + +type Wait_WaitServer interface { + Send(*KeepPatientResponse) error + grpc.ServerStream +} + +type waitWaitServer struct { + grpc.ServerStream +} + +func (x *waitWaitServer) Send(m *KeepPatientResponse) error { + return x.ServerStream.SendMsg(m) +} + +// Wait_ServiceDesc is the grpc.ServiceDesc for Wait service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Wait_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "api.v1.Wait", + HandlerType: (*WaitServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{ + { + StreamName: "Wait", + Handler: _Wait_Wait_Handler, + ServerStreams: true, + }, + }, + Metadata: "api/v1/wait.proto", +} diff --git a/proto/Makefile b/proto/Makefile new file mode 100644 index 000000000..a0539e519 --- /dev/null +++ b/proto/Makefile @@ -0,0 +1,8 @@ +.PHONY: protoc +protoc: protolint + buf generate -v + +.PHONY: protolint +protolint: + buf format -w . + buf lint -v diff --git a/proto/api/v1/boot.proto b/proto/api/v1/boot.proto new file mode 100644 index 000000000..1a847b704 --- /dev/null +++ b/proto/api/v1/boot.proto @@ -0,0 +1,131 @@ +syntax = "proto3"; + +package api.v1; + +option go_package = "./v1"; + +service BootService { + // Dhcp is the first dhcp request (option 97). A ProvisioningEventPXEBooting is fired + rpc Dhcp(BootServiceDhcpRequest) returns (BootServiceDhcpResponse) {} + // 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) {} + // SuperUserPassword metal-hammer takes the configured root password for the bmc from metal-api and configure the bmc accordingly + rpc SuperUserPassword(BootServiceSuperUserPasswordRequest) returns (BootServiceSuperUserPasswordResponse); + // 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) {} + // Report tells metal-api installation was either sucessful or failed + rpc Report(BootServiceReportRequest) returns (BootServiceReportResponse) {} + // If reinstall failed and tell metal-api to restore to previous state + rpc AbortReinstall(BootServiceAbortReinstallRequest) returns (BootServiceAbortReinstallResponse) {} +} + +message BootServiceDhcpRequest { + string uuid = 1; +} + +message BootServiceDhcpResponse {} + +message BootServiceBootRequest { + string mac = 1; + string partition_id = 2; +} + +message BootServiceBootResponse { + string kernel = 1; + repeated string init_ram_disks = 2; + optional string cmdline = 3; +} + +message BootServiceRegisterRequest { + string uuid = 1; + MachineHardware hardware = 2; + MachineBIOS bios = 3; + MachineIPMI ipmi = 4; + repeated string tags = 5; + string metal_hammer_version = 6; +} + +message BootServiceRegisterResponse { + string uuid = 1; + string size = 2; + string partition_id = 3; +} + +message MachineHardware { + uint64 memory = 1; + uint32 cpu_cores = 2; + repeated MachineBlockDevice disks = 3; + repeated MachineNic nics = 4; +} + +message MachineNic { + string mac = 1; + string name = 2; + repeated MachineNic neighbors = 3; +} + +message MachineBlockDevice { + string name = 1; + uint64 size = 2; +} + +message MachineBIOS { + string version = 1; + string vendor = 2; + string date = 3; +} + +message MachineIPMI { + string address = 1; + string mac = 2; + string user = 3; + string password = 4; + string interface = 5; + MachineFRU fru = 6; + string bmc_version = 7; + string power_state = 8; +} + +message MachineFRU { + optional string chassis_part_number = 1; + optional string chassis_part_serial = 2; + optional string board_mfg = 3; + optional string board_mfg_serial = 4; + optional string board_part_number = 5; + optional string product_manufacturer = 6; + optional string product_part_number = 7; + optional string product_serial = 8; +} + +message BootServiceReportRequest { + string uuid = 1; + string console_password = 2; + BootInfo boot_info = 3; + bool success = 4; + string message = 5; +} +message BootServiceReportResponse {} + +message BootInfo { + string image_id = 1; + string primary_disk = 2; + string os_partition = 3; + string initrd = 4; + string cmdline = 5; + string kernel = 6; + string bootloader_id = 8; +} + +message BootServiceAbortReinstallRequest { + string uuid = 1; + bool primary_disk_wiped = 2; +} +message BootServiceAbortReinstallResponse { + BootInfo boot_info = 1; +} +message BootServiceSuperUserPasswordRequest {} + +message BootServiceSuperUserPasswordResponse { + bool feature_disabled = 1; + string super_user_password = 2; +} diff --git a/proto/api/v1/event.proto b/proto/api/v1/event.proto new file mode 100644 index 000000000..c5723dd76 --- /dev/null +++ b/proto/api/v1/event.proto @@ -0,0 +1,33 @@ +syntax = "proto3"; + +package api.v1; + +import "google/protobuf/timestamp.proto"; + +option go_package = "./v1"; + +service EventService { + rpc Send(EventServiceSendRequest) returns (EventServiceSendResponse) {} +} + +message EventServiceSendRequest { + map events = 1; +} + +message EventServiceSendResponse { + // number of events stored + uint64 events = 1; + // slice of machineIDs for which event was not published + repeated string failed = 2; +} + +message MachineProvisioningEvent { + // timestamp when the event occured + google.protobuf.Timestamp time = 1; + // the event type + // must be one of metal.ProvisioningEventType, otherwise event will be skipped + // TODO should be migrated to be an enum + string event = 2; + // an additional message describing the event more detailed + string message = 3; +} diff --git a/proto/api/v1/wait.proto b/proto/api/v1/wait.proto new file mode 100644 index 000000000..260e016c4 --- /dev/null +++ b/proto/api/v1/wait.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; + +package api.v1; + +option go_package = "./v1"; + +message WaitRequest { + string machine_id = 1; +} + +message KeepPatientResponse {} + +service Wait { + // FIXME move to boot.proto + rpc Wait(WaitRequest) returns (stream KeepPatientResponse); +} diff --git a/proto/buf.gen.yaml b/proto/buf.gen.yaml new file mode 100644 index 000000000..636c55e4b --- /dev/null +++ b/proto/buf.gen.yaml @@ -0,0 +1,10 @@ +version: v1 +plugins: + # generate go structs for protocol buffer definition + - remote: buf.build/library/plugins/go:v1.27.1-1 + out: ../pkg/api + # generate gRPC stubs in golang + - remote: buf.build/library/plugins/go-grpc:v1.1.0-2 + out: ../pkg/api + opt: + - require_unimplemented_servers=false diff --git a/proto/buf.yaml b/proto/buf.yaml new file mode 100644 index 000000000..309f21b9c --- /dev/null +++ b/proto/buf.yaml @@ -0,0 +1,9 @@ +version: v1 +lint: + use: + - DEFAULT + except: + # TODO remove these + - SERVICE_SUFFIX + - RPC_REQUEST_STANDARD_NAME + - RPC_RESPONSE_STANDARD_NAME diff --git a/spec/metal-api.json b/spec/metal-api.json index 61798b25e..8cce75046 100644 --- a/spec/metal-api.json +++ b/spec/metal-api.json @@ -2374,40 +2374,6 @@ "memory" ] }, - "v1.MachineHardwareExtended": { - "properties": { - "cpu_cores": { - "description": "the number of cpu cores", - "format": "int32", - "type": "integer" - }, - "disks": { - "description": "the list of block devices of this machine", - "items": { - "$ref": "#/definitions/v1.MachineBlockDevice" - }, - "type": "array" - }, - "memory": { - "description": "the total memory of the machine", - "format": "integer", - "type": "integer" - }, - "nics": { - "description": "the list of network interfaces of this machine with extended information", - "items": { - "$ref": "#/definitions/v1.MachineNicExtended" - }, - "type": "array" - } - }, - "required": [ - "cpu_cores", - "disks", - "memory", - "nics" - ] - }, "v1.MachineIPMI": { "description": "The IPMI connection data", "properties": { @@ -2673,22 +2639,6 @@ ] }, "v1.MachineNic": { - "properties": { - "mac": { - "description": "the mac address of this network interface", - "type": "string" - }, - "name": { - "description": "the name of this network interface", - "type": "string" - } - }, - "required": [ - "mac", - "name" - ] - }, - "v1.MachineNicExtended": { "properties": { "mac": { "description": "the mac address of this network interface", @@ -2701,7 +2651,7 @@ "neighbors": { "description": "the neighbors visible to this network interface", "items": { - "$ref": "#/definitions/v1.MachineNicExtended" + "$ref": "#/definitions/v1.MachineNic" }, "type": "array" } @@ -2790,7 +2740,7 @@ "description": "bios information of this machine" }, "hardware": { - "$ref": "#/definitions/v1.MachineHardwareExtended", + "$ref": "#/definitions/v1.MachineHardware", "description": "the hardware of this machine" }, "ipmi": { @@ -2947,6 +2897,10 @@ "description": "a description why this machine is in the given state", "type": "string" }, + "metal_hammer_version": { + "description": "the version of metal hammer which put the machine in waiting state", + "type": "string" + }, "value": { "description": "the state of this machine. empty means available for all", "type": "string" @@ -2954,6 +2908,7 @@ }, "required": [ "description", + "metal_hammer_version", "value" ] }, @@ -8269,7 +8224,7 @@ "name": "body", "required": true, "schema": { - "$ref": "#/definitions/v1.MachineHardwareExtended" + "$ref": "#/definitions/v1.MachineHardware" } } ],