service

package
v1.4.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 29, 2026 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Overview

* SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: LicenseRef-NvidiaProprietary * * NVIDIA CORPORATION, its affiliates and licensors retain all intellectual * property and proprietary rights in and to this material, related * documentation and any modifications thereto. Any use, reproduction, * disclosure or distribution of this material and related documentation * without an express license agreement from NVIDIA CORPORATION or * its affiliates is strictly prohibited.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildDBConfigFromEnv

func BuildDBConfigFromEnv() (*db.Config, error)

BuildDBConfigFromEnv builds db.Config from environment variables.

func BuildVaultConfigFromEnv

func BuildVaultConfigFromEnv() (*credentials.VaultConfig, error)

BuildVaultConfigFromEnv builds credentials.VaultConfig from environment variables.

Types

type Config

type Config struct {
	Port          int
	DataStoreType nvswitchmanager.DataStoreType
	VaultConf     credentials.VaultConfig
	DBConf        db.Config
	FirmwareConf  FirmwareConfig
}

Config captures runtime settings for running the gRPC service.

func (*Config) ToNsmConf

func (c *Config) ToNsmConf() (*nvswitchmanager.Config, error)

ToNsmConf converts the service Config into a nvswitchmanager.Config. The DB connection must be set separately by the caller.

type FirmwareConfig

type FirmwareConfig struct {
	PackagesDir       string        // Directory containing firmware package YAML definitions
	FirmwareDir       string        // Directory containing firmware files
	NumWorkers        int           // Number of concurrent update workers
	SchedulerInterval time.Duration // How often the scheduler queries for pending updates
}

FirmwareConfig contains firmware manager configuration.

func (*FirmwareConfig) ToFirmwareManagerConfig

func (c *FirmwareConfig) ToFirmwareManagerConfig() firmwaremanager.Config

ToFirmwareManagerConfig converts FirmwareConfig to firmwaremanager.Config.

type NVSwitchManagerServerImpl

type NVSwitchManagerServerImpl struct {
	pb.UnimplementedNVSwitchManagerServer
	// contains filtered or unexported fields
}

NVSwitchManagerServerImpl implements the v1.NVSwitchManager gRPC service.

func (*NVSwitchManagerServerImpl) CancelUpdate

CancelUpdate cancels an in-progress firmware update.

func (*NVSwitchManagerServerImpl) GetAllUpdates

GetAllUpdates returns all firmware updates across all switches.

func (*NVSwitchManagerServerImpl) GetNVSwitches

GetNVSwitches returns NV-Switch information for the specified switches.

func (*NVSwitchManagerServerImpl) GetUpdate

GetUpdate returns the status of a specific firmware update by ID.

func (*NVSwitchManagerServerImpl) GetUpdatesForSwitch

GetUpdatesForSwitch returns all firmware updates for a switch.

func (*NVSwitchManagerServerImpl) ListBundles

ListBundles returns all available firmware bundles.

func (*NVSwitchManagerServerImpl) PowerControl

PowerControl performs a power action on the specified NV-Switch trays.

func (*NVSwitchManagerServerImpl) QueueUpdate

QueueUpdate queues a firmware update for a specific switch and component.

func (*NVSwitchManagerServerImpl) QueueUpdates

QueueUpdates queues firmware updates for multiple switches in a single call.

func (*NVSwitchManagerServerImpl) RegisterNVSwitches

RegisterNVSwitches registers multiple NV-Switch trays.

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service owns the gRPC server lifecycle and an NVSwitchManager orchestrator.

func New

func New(ctx context.Context, c Config) (*Service, error)

New initializes an NVSwitchManager and constructs a Service from the Config.

func (*Service) Start

func (s *Service) Start(ctx context.Context) error

Start begins the NVSwitchManager, binds the gRPC server on the configured port, and serves until the listener is closed.

func (*Service) Stop

func (s *Service) Stop(ctx context.Context)

Stop gracefully shuts down the gRPC server and stops the NVSwitchManager.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL