client

package
v1.3.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCarbideClientInvalidAddress    = errors.New("CarbideClient: invalid address")
	ErrCarbideClientInvalidDialOpts   = errors.New("CarbideClient: invalid dial options")
	ErrCarbideClientInvalidSecureOpts = errors.New("CarbideClient: invalid secure options")
	ErrCarbideClientInvalidServerCA   = errors.New("CarbideClient: invalid server CA")
	ErrCarbideClientInvalidClientCA   = errors.New("CarbideClient: invalid client CA")
	ErrCarbideClientInvalidClientKey  = errors.New("CarbideClient: invalid client key")
	ErrCarbideClientInvalidClientCert = errors.New("CarbideClient: invalid client cert")
	ErrClientNotConnected             = errors.New("gRPC client is not connected to the server")
)

Errors

View Source
var (
	ErrInvalidInstanceName = errors.New("gRPC-lib: Instance - invalid name")
	ErrInvalidInstanceID   = errors.New("gRPC-lib: Instance - invalid instance id")
	ErrInvalidMachineID    = errors.New("gRPC-lib: Instance - invalid machine id")
	ErrInvalidSegmentID    = errors.New("gRPC-lib: Instance - invalid segment id")
	ErrInvalidIPxe         = errors.New("gRPC-lib: Instance - invalid custom ipxe")
	ErrInvalidRequest      = errors.New("gRPC-lib: Instance - invalid request")
)
View Source
var (
	ErrRlaClientInvalidAddress    = errors.New("RlaClient: invalid address")
	ErrRlaClientInvalidDialOpts   = errors.New("RlaClient: invalid dial options")
	ErrRlaClientInvalidSecureOpts = errors.New("RlaClient: invalid secure options")
	ErrRlaClientInvalidServerCA   = errors.New("RlaClient: invalid server CA")
	ErrRlaClientInvalidClientCA   = errors.New("RlaClient: invalid client CA")
	ErrRlaClientInvalidClientKey  = errors.New("RlaClient: invalid client key")
	ErrRlaClientInvalidClientCert = errors.New("RlaClient: invalid client cert")
)

Errors

View Source
var (
	// ErrInvalidName subnet - invalid name
	ErrInvalidName = errors.New("gRPC-lib: subnet - invalid name")
	// ErrInvalidID subnet - invalid id"
	ErrInvalidID = errors.New("gRPC-lib: subnet - invalid id")
	// ErrInvalidVPCId subnet - invalid vpc
	ErrInvalidVPCId = errors.New("gRPC-lib: subnet - invalid vpc")
	// ErrEmptyPrefixes subnet - empty prefix list
	ErrEmptyPrefixes = errors.New("gRPC-lib: subnet - empty prefix list")
	// ErrEmptyPrefix  subnet - empty prefix
	ErrEmptyPrefix = errors.New("gRPC-lib: subnet - empty prefix ")
	// ErrInvalidCIDR subnet - invalid CIDR
	ErrInvalidCIDR = errors.New("gRPC-lib: subnet - invalid CIDR ")
)
View Source
var (
	ErrInvalidTenantRequest        = errors.New("gRPC-lib: Tenant - invalid request")
	ErrInvalidTenantOrganizationID = errors.New("gRPC-lib: Tenant - invalid Organization ID")
	ErrInvalidTenantName           = errors.New("gRPC-lib: Tenant - invalid name")
)

Functions

func SliceToChunks

func SliceToChunks[T any](slice []T, chunkSize int) (chunks [][]T)

Types

type CarbideAtomicClient

type CarbideAtomicClient struct {
	Config *CarbideClientConfig
	// contains filtered or unexported fields
}

CarbideAtomicClient is an atomic wrapper around the CarbideClient

func NewCarbideAtomicClient

func NewCarbideAtomicClient(config *CarbideClientConfig) *CarbideAtomicClient

NewCarbideAtomicClient creates a new CarbideAtomicClient

func (*CarbideAtomicClient) CheckAndReloadCerts

func (cac *CarbideAtomicClient) CheckAndReloadCerts(initialClientCertMD5, initialServerCAMD5 []byte)

CheckAndReloadCerts continuously monitors the TLS certificates for changes. If a change is detected, it reinitializes the CarbideClient with the new certificates to ensure secure communication.

func (*CarbideAtomicClient) CheckCertificates

func (cac *CarbideAtomicClient) CheckCertificates(lastClientCertMD5, lastServerCAMD5 []byte) (bool, []byte, []byte, error)

CheckCertificates checks if the client and server CA certificates have changed

func (*CarbideAtomicClient) GetClient

func (cac *CarbideAtomicClient) GetClient() *CarbideClient

GetClient returns the current version of Carbide client from the atomic value. Returns nil if the client has not been initialized yet.

func (*CarbideAtomicClient) GetInitialCertMD5

func (cac *CarbideAtomicClient) GetInitialCertMD5() (clientCertMD5, serverCAMD5 []byte, err error)

GetInitialCertMD5 retrieves the MD5 hash of the initial set of certificate that the client is Using

func (*CarbideAtomicClient) SwapClient

func (cac *CarbideAtomicClient) SwapClient(newClient *CarbideClient) *CarbideClient

SwapClient atomically replaces the current CarbideClient with a new one, returning the old client for the caller to manage.

func (*CarbideAtomicClient) Version

func (cac *CarbideAtomicClient) Version() int64

Version returns the current version of the CarbideClient

type CarbideClient

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

CarbideClient is the data structure for the client

func NewCarbideClient

func NewCarbideClient(config *CarbideClientConfig) (client *CarbideClient, err error)

NewCarbideClient creates a new CarbideClient

func NewMockCarbideClient

func NewMockCarbideClient() *CarbideClient

NewMockCarbideClient creates a new mock CarbideClient

func (*CarbideClient) Carbide

func (client *CarbideClient) Carbide() wflows.ForgeClient

Carbide client getter

func (*CarbideClient) Close

func (cc *CarbideClient) Close() error

Close gracefully shuts down the client's gRPC connection.

func (*CarbideClient) Compute

func (client *CarbideClient) Compute() ComputeInterface

Compute Getter

func (*CarbideClient) Networks

func (client *CarbideClient) Networks() NetworkInterface

Networks Getter

type CarbideClientConfig

type CarbideClientConfig struct {
	// The address of the server <host>:<port>
	Address string
	// Secure flag
	Secure SecureOptions
	// Skip Server Auth
	SkipServerAuth bool
	// The TLS certificate for the server
	ServerCAPath string
	// The TLS certificate for the client
	ClientCertPath string
	// The TLS key for the client
	ClientKeyPath string
	// client metrics interface
	ClientMetrics Metrics
}

CarbideClientConfig is the data structure for the client configuration

type CarbideInterface

type CarbideInterface interface {
	ComputeGetter
	NetworkGetter
	StorageGetter
}

CarbideInterface is the interface for the Carbide client

type ComputeGetter

type ComputeGetter interface {
	Compute() ComputeInterface
}

ComputeGetter is the interface for compute workflows

type ComputeInterface

type ComputeInterface interface {
	MachineInterface
	// Instance Interface
	InstanceInterface
	// SSHKeyGroup Interface
	SSHKeyGroupInterface
	// OperatingSystem Interface
	OperatingSystemInterface
	// Tenant Interface
	TenantInterface
}

ComputeInterface for machine gRPC apis

type InfiniBandPartitionInterface

type InfiniBandPartitionInterface interface {
	CreateInfiniBandPartition(ctx context.Context, request *wflows.CreateInfiniBandPartitionRequest) (response *wflows.IBPartition, err error)
	DeleteInfiniBandPartition(ctx context.Context, request *wflows.DeleteInfiniBandPartitionRequest) (response *wflows.IBPartitionDeletionResult, err error)
	GetAllInfiniBandPartitions(ctx context.Context, request *wflows.IBPartitionSearchFilter, pageSize int) (response *wflows.IBPartitionList, err error)
	FindInfinibandPartitionIDs(ctx context.Context, request *wflows.IBPartitionSearchFilter) (response *wflows.IBPartitionIdList, err error)
	FindInfinibandPartitionsByIDs(ctx context.Context, request *wflows.IBPartitionsByIdsRequest) (response *wflows.IBPartitionList, err error)
}

InfiniBandPartitionInterface is the interface for the InfiniBandPartition client

type InstanceInterface

type InstanceInterface interface {
	// Instance Interfaces
	CreateInstance(ctx context.Context, request *wflows.CreateInstanceRequest) (response *wflows.Instance, err error)
	CreateInstances(ctx context.Context, request *wflows.BatchInstanceAllocationRequest) (response *wflows.BatchInstanceAllocationResponse, err error)
	DeleteInstance(ctx context.Context, request *wflows.DeleteInstanceRequest) (response *wflows.InstanceReleaseResult, err error)
	RebootInstance(ctx context.Context, request *wflows.RebootInstanceRequest) (response *wflows.InstancePowerResult, err error)

	FindInstanceIDs(ctx context.Context, request *wflows.InstanceSearchFilter) (response *wflows.InstanceIdList, err error)
	FindInstancesByIDs(ctx context.Context, request *wflows.InstancesByIdsRequest) (response *wflows.InstanceList, err error)

	GetAllInstances(ctx context.Context, request *wflows.InstanceSearchFilter, pageSize int) (response *wflows.InstanceList, err error)
}

type MachineInterface

type MachineInterface interface {
	// Machine Interfaces
	GetAllMachines(ctx context.Context, request *wflows.MachineSearchConfig, pageSize int) (response *wflows.MachineList, err error)
	FindMachineIDs(ctx context.Context, request *wflows.MachineSearchConfig) (response *wflows.MachineIdList, err error)
	FindMachinesByIDs(ctx context.Context, request *wflows.MachinesByIdsRequest) (response *wflows.MachineList, err error)
}

MachineInterface grpc client interface

type Metrics

type Metrics interface {
	// RecordRpcResponse call-back method that includes rpc method, response code, and duration
	RecordRpcResponse(method, code string, duration time.Duration)
}

Metrics interface that defines call-back functions for RPC metrics

type MockForgeClient

type MockForgeClient struct {
	wflows.ForgeClient
}

MockForgeClient is a mock implementation of Forge gRPC protobuf Client

func (*MockForgeClient) AddExpectedMachine

func (c *MockForgeClient) AddExpectedMachine(ctx context.Context, in *wflows.ExpectedMachine, opts ...grpc.CallOption) (*emptypb.Empty, error)

Expected Machine mock methods

func (*MockForgeClient) AddExpectedPowerShelf

func (c *MockForgeClient) AddExpectedPowerShelf(ctx context.Context, in *wflows.ExpectedPowerShelf, opts ...grpc.CallOption) (*emptypb.Empty, error)

Expected Power Shelf mock methods

func (*MockForgeClient) AddExpectedSwitch

func (c *MockForgeClient) AddExpectedSwitch(ctx context.Context, in *wflows.ExpectedSwitch, opts ...grpc.CallOption) (*emptypb.Empty, error)

Expected Switch mock methods

func (*MockForgeClient) AddMachineValidationTest

Machine Validation Test mock methods

func (*MockForgeClient) AddUpdateMachineValidationExternalConfig

func (c *MockForgeClient) AddUpdateMachineValidationExternalConfig(ctx context.Context, in *wflows.AddUpdateMachineValidationExternalConfigRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)

func (*MockForgeClient) AllocateInstance

Instance mock methods

func (*MockForgeClient) CreateDpuExtensionService

DPU Extension Service mock methods

func (*MockForgeClient) CreateIBPartition

InfiniBand Partition mock methods

func (*MockForgeClient) CreateInstanceType

Instance Type mock methods

func (*MockForgeClient) CreateNVLinkLogicalPartition

NVLink Logical Partition Mocks

func (*MockForgeClient) CreateNetworkSegment

func (*MockForgeClient) CreateOsImage

func (c *MockForgeClient) CreateOsImage(ctx context.Context, in *wflows.OsImageAttributes, opts ...grpc.CallOption) (*wflows.OsImage, error)

OS Image mock methods

func (*MockForgeClient) CreateTenant

Tenant mock methods

func (*MockForgeClient) CreateTenantKeyset

Tenant Keyset mock methods

func (*MockForgeClient) CreateVpc

func (c *MockForgeClient) CreateVpc(ctx context.Context, in *wflows.VpcCreationRequest, opts ...grpc.CallOption) (*wflows.Vpc, error)

VPC mock methods

func (*MockForgeClient) CreateVpcPeering

VPC Peering mock methods

func (*MockForgeClient) CreateVpcPrefix

VPC Prefix mock methods

func (*MockForgeClient) DeleteExpectedMachine

func (c *MockForgeClient) DeleteExpectedMachine(ctx context.Context, in *wflows.ExpectedMachineRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)

func (*MockForgeClient) DeleteExpectedPowerShelf

func (c *MockForgeClient) DeleteExpectedPowerShelf(ctx context.Context, in *wflows.ExpectedPowerShelfRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)

func (*MockForgeClient) DeleteExpectedSwitch

func (c *MockForgeClient) DeleteExpectedSwitch(ctx context.Context, in *wflows.ExpectedSwitchRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)

func (*MockForgeClient) DeleteIBPartition

func (*MockForgeClient) DeleteInstanceType

func (*MockForgeClient) DeleteOsImage

func (*MockForgeClient) DeleteTenantKeyset

func (*MockForgeClient) DeleteVpc

func (*MockForgeClient) DeleteVpcPeering

func (*MockForgeClient) DeleteVpcPrefix

func (*MockForgeClient) FindDpuExtensionServiceIds

func (*MockForgeClient) FindDpuExtensionServicesByIds

func (*MockForgeClient) FindIBPartitionIds

func (*MockForgeClient) FindIBPartitionsByIds

func (c *MockForgeClient) FindIBPartitionsByIds(ctx context.Context, in *wflows.IBPartitionsByIdsRequest, opts ...grpc.CallOption) (*wflows.IBPartitionList, error)

func (*MockForgeClient) FindInstanceIds

func (*MockForgeClient) FindInstanceTypeIds

func (*MockForgeClient) FindInstancesByIds

func (c *MockForgeClient) FindInstancesByIds(ctx context.Context, in *wflows.InstancesByIdsRequest, opts ...grpc.CallOption) (*wflows.InstanceList, error)

func (*MockForgeClient) FindMachineIds

func (*MockForgeClient) FindMachinesByIds

func (c *MockForgeClient) FindMachinesByIds(ctx context.Context, in *wflows.MachinesByIdsRequest, opts ...grpc.CallOption) (*wflows.MachineList, error)

func (*MockForgeClient) FindNetworkSegmentIds

func (*MockForgeClient) FindNetworkSegmentsByIds

func (*MockForgeClient) FindSkusByIds

func (c *MockForgeClient) FindSkusByIds(ctx context.Context, in *wflows.SkusByIdsRequest, opts ...grpc.CallOption) (*wflows.SkuList, error)

SKU mock methods

func (*MockForgeClient) FindTenant

func (*MockForgeClient) FindTenantKeysetIds

func (*MockForgeClient) FindTenantKeysetsByIds

func (*MockForgeClient) FindTenantOrganizationIds

func (c *MockForgeClient) FindTenantOrganizationIds(ctx context.Context, in *wflows.TenantSearchFilter, opts ...grpc.CallOption) (*wflows.TenantOrganizationIdList, error)

func (*MockForgeClient) FindTenantsByOrganizationIds

func (c *MockForgeClient) FindTenantsByOrganizationIds(ctx context.Context, in *wflows.TenantByOrganizationIdsRequest, opts ...grpc.CallOption) (*wflows.TenantList, error)

func (*MockForgeClient) FindVpcIds

func (*MockForgeClient) FindVpcPeeringIds

func (*MockForgeClient) FindVpcPeeringsByIds

func (c *MockForgeClient) FindVpcPeeringsByIds(ctx context.Context, in *wflows.VpcPeeringsByIdsRequest, opts ...grpc.CallOption) (*wflows.VpcPeeringList, error)

func (*MockForgeClient) FindVpcsByIds

func (c *MockForgeClient) FindVpcsByIds(ctx context.Context, in *wflows.VpcsByIdsRequest, opts ...grpc.CallOption) (*wflows.VpcList, error)

func (*MockForgeClient) GetAllExpectedMachines

func (c *MockForgeClient) GetAllExpectedMachines(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*wflows.ExpectedMachineList, error)

func (*MockForgeClient) GetAllExpectedMachinesLinked

func (c *MockForgeClient) GetAllExpectedMachinesLinked(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*wflows.LinkedExpectedMachineList, error)

func (*MockForgeClient) GetAllExpectedPowerShelves

func (c *MockForgeClient) GetAllExpectedPowerShelves(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*wflows.ExpectedPowerShelfList, error)

func (*MockForgeClient) GetAllExpectedPowerShelvesLinked

func (c *MockForgeClient) GetAllExpectedPowerShelvesLinked(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*wflows.LinkedExpectedPowerShelfList, error)

func (*MockForgeClient) GetAllExpectedSwitches

func (c *MockForgeClient) GetAllExpectedSwitches(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*wflows.ExpectedSwitchList, error)

func (*MockForgeClient) GetAllExpectedSwitchesLinked

func (c *MockForgeClient) GetAllExpectedSwitchesLinked(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*wflows.LinkedExpectedSwitchList, error)

func (*MockForgeClient) GetAllSkuIds

func (c *MockForgeClient) GetAllSkuIds(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*wflows.SkuIdList, error)

func (*MockForgeClient) GetExpectedMachine

func (*MockForgeClient) GetMachineValidationResults

func (*MockForgeClient) GetVpcPrefixes

func (*MockForgeClient) InvokeInstancePower

func (*MockForgeClient) ListOsImage

func (*MockForgeClient) NVLinkLogicalPartitionsForTenant

func (c *MockForgeClient) NVLinkLogicalPartitionsForTenant(ctx context.Context, in *wflows.TenantSearchQuery, opts ...grpc.CallOption) (*wflows.NVLinkLogicalPartitionList, error)

func (*MockForgeClient) PersistValidationResult

func (c *MockForgeClient) PersistValidationResult(ctx context.Context, in *wflows.MachineValidationResultPostRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)

func (*MockForgeClient) ReleaseInstance

func (*MockForgeClient) RemoveMachineValidationExternalConfig

func (c *MockForgeClient) RemoveMachineValidationExternalConfig(ctx context.Context, in *wflows.RemoveMachineValidationExternalConfigRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)

func (*MockForgeClient) SearchVpcPrefixes

func (*MockForgeClient) SetMaintenance

func (c *MockForgeClient) SetMaintenance(ctx context.Context, in *wflows.MaintenanceRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)

Machine mock methods

func (*MockForgeClient) UpdateDpuExtensionService

func (*MockForgeClient) UpdateExpectedMachine

func (c *MockForgeClient) UpdateExpectedMachine(ctx context.Context, in *wflows.ExpectedMachine, opts ...grpc.CallOption) (*emptypb.Empty, error)

func (*MockForgeClient) UpdateExpectedPowerShelf

func (c *MockForgeClient) UpdateExpectedPowerShelf(ctx context.Context, in *wflows.ExpectedPowerShelf, opts ...grpc.CallOption) (*emptypb.Empty, error)

func (*MockForgeClient) UpdateExpectedSwitch

func (c *MockForgeClient) UpdateExpectedSwitch(ctx context.Context, in *wflows.ExpectedSwitch, opts ...grpc.CallOption) (*emptypb.Empty, error)

func (*MockForgeClient) UpdateIBPartition added in v1.3.0

func (*MockForgeClient) UpdateInstanceConfig

func (c *MockForgeClient) UpdateInstanceConfig(ctx context.Context, in *wflows.InstanceConfigUpdateRequest, opts ...grpc.CallOption) (*wflows.Instance, error)

func (*MockForgeClient) UpdateInstanceType

func (*MockForgeClient) UpdateMachineMetadata

func (c *MockForgeClient) UpdateMachineMetadata(ctx context.Context, in *wflows.MachineMetadataUpdateRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)

func (*MockForgeClient) UpdateMachineValidationRun

Network Security Group mock methods

func (*MockForgeClient) UpdateOsImage

func (c *MockForgeClient) UpdateOsImage(ctx context.Context, in *wflows.OsImageAttributes, opts ...grpc.CallOption) (*wflows.OsImage, error)

func (*MockForgeClient) UpdateTenant

func (*MockForgeClient) UpdateTenantKeyset

func (*MockForgeClient) UpdateVpc

func (*MockForgeClient) UpdateVpcPrefix

func (*MockForgeClient) Version

Version mock methods

type MockRLAClient

type MockRLAClient struct {
	rlav1.RLAClient
}

MockRLAClient is a mock implementation of RLA gRPC protobuf Client

func (*MockRLAClient) AddComponent added in v1.2.0

Component mutation mock methods

func (*MockRLAClient) AssociateRuleWithRack added in v1.2.0

func (c *MockRLAClient) AssociateRuleWithRack(ctx context.Context, in *rlav1.AssociateRuleWithRackRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)

Rack-rule association mock methods

func (*MockRLAClient) AttachRacksToNVLDomain

func (c *MockRLAClient) AttachRacksToNVLDomain(ctx context.Context, in *rlav1.AttachRacksToNVLDomainRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)

func (*MockRLAClient) BringUpRack

func (*MockRLAClient) CancelTask added in v1.2.0

func (*MockRLAClient) CreateExpectedRack

Rack mock methods

func (*MockRLAClient) CreateNVLDomain

NVL Domain mock methods

func (*MockRLAClient) CreateOperationRule added in v1.2.0

Operation rule mock methods

func (*MockRLAClient) DeleteComponent added in v1.2.0

func (*MockRLAClient) DeleteOperationRule added in v1.2.0

func (c *MockRLAClient) DeleteOperationRule(ctx context.Context, in *rlav1.DeleteOperationRuleRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)

func (*MockRLAClient) DetachRacksFromNVLDomain

func (c *MockRLAClient) DetachRacksFromNVLDomain(ctx context.Context, in *rlav1.DetachRacksFromNVLDomainRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)

func (*MockRLAClient) DisassociateRuleFromRack added in v1.2.0

func (c *MockRLAClient) DisassociateRuleFromRack(ctx context.Context, in *rlav1.DisassociateRuleFromRackRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)

func (*MockRLAClient) GetComponentInfoByID

Component mock methods

func (*MockRLAClient) GetComponentInfoBySerial

func (*MockRLAClient) GetComponents

func (*MockRLAClient) GetListOfNVLDomains

func (*MockRLAClient) GetListOfRacks

func (*MockRLAClient) GetOperationRule added in v1.2.0

func (*MockRLAClient) GetRackInfoByID

func (*MockRLAClient) GetRackInfoBySerial

func (*MockRLAClient) GetRackRuleAssociation added in v1.2.0

func (*MockRLAClient) GetRacksForNVLDomain

func (*MockRLAClient) GetTasksByIDs

func (*MockRLAClient) IngestRack added in v1.2.0

func (*MockRLAClient) ListOperationRules added in v1.2.0

func (*MockRLAClient) ListRackRuleAssociations added in v1.2.0

func (*MockRLAClient) ListTasks

func (*MockRLAClient) PatchComponent added in v1.2.0

func (*MockRLAClient) PatchRack

func (*MockRLAClient) PowerOffRack

func (*MockRLAClient) PowerOnRack

func (*MockRLAClient) PowerResetRack

func (*MockRLAClient) SetRuleAsDefault added in v1.2.0

func (c *MockRLAClient) SetRuleAsDefault(ctx context.Context, in *rlav1.SetRuleAsDefaultRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)

func (*MockRLAClient) UpdateOperationRule added in v1.2.0

func (c *MockRLAClient) UpdateOperationRule(ctx context.Context, in *rlav1.UpdateOperationRuleRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)

func (*MockRLAClient) UpgradeFirmware

Task mock methods

func (*MockRLAClient) ValidateComponents

func (*MockRLAClient) Version

Version mock methods

type NetworkGetter

type NetworkGetter interface {
	Network() NetworkInterface
}

NetworkGetter is the interface for the network workflows

type NetworkInterface

type NetworkInterface interface {

	// VPC Interface
	VPCInterface
	// Subnet Interface
	SubnetInterface
	// InfiniBandPartition Interface
	InfiniBandPartitionInterface
}

NetworkInterface is the interface for the network client

type OperatingSystemInterface

type OperatingSystemInterface interface {
	CreateOsImage(ctx context.Context, request *wflows.OsImageAttributes) (*wflows.OsImage, error)
	UpdateOsImage(ctx context.Context, request *wflows.OsImageAttributes) (*wflows.OsImage, error)
	DeleteOsImage(ctx context.Context, request *wflows.DeleteOsImageRequest) (*wflows.DeleteOsImageResponse, error)
	GetOsImage(ctx context.Context, request *wflows.UUID) (response *wflows.OsImage, err error)
	ListOsImage(ctx context.Context, request *wflows.ListOsImageRequest) (*wflows.ListOsImageResponse, error)
}

OperatingSystemInterface is the interface for OsImage related Carbide client operations

type RlaAtomicClient

type RlaAtomicClient struct {
	Config *RlaClientConfig
	// contains filtered or unexported fields
}

RlaAtomicClient is an atomic wrapper around the RlaClient

func NewRlaAtomicClient

func NewRlaAtomicClient(config *RlaClientConfig) *RlaAtomicClient

NewRlaAtomicClient creates a new RlaAtomicClient

func (*RlaAtomicClient) CheckAndReloadCerts

func (rac *RlaAtomicClient) CheckAndReloadCerts(initialClientCertMD5, initialServerCAMD5 []byte)

CheckAndReloadCerts continuously monitors the TLS certificates for changes. If a change is detected, it reinitializes the RlaClient with the new certificates to ensure secure communication.

func (*RlaAtomicClient) CheckCertificates

func (rac *RlaAtomicClient) CheckCertificates(lastClientCertMD5, lastServerCAMD5 []byte) (bool, []byte, []byte, error)

CheckCertificates checks if the client and server CA certificates have changed

func (*RlaAtomicClient) GetClient

func (rac *RlaAtomicClient) GetClient() *RlaClient

GetClient returns the current version of Rla client from the atomic value. Returns nil if the client has not been initialized yet.

func (*RlaAtomicClient) GetInitialCertMD5

func (rac *RlaAtomicClient) GetInitialCertMD5() (clientCertMD5, serverCAMD5 []byte, err error)

GetInitialCertMD5 retrieves the MD5 hash of the initial set of certificate that the client is Using

func (*RlaAtomicClient) SwapClient

func (rac *RlaAtomicClient) SwapClient(newClient *RlaClient) *RlaClient

SwapClient atomically replaces the current RlaClient with a new one, returning the old client for the caller to manage.

func (*RlaAtomicClient) Version

func (rac *RlaAtomicClient) Version() int64

Version returns the current version of the RlaClient

type RlaClient

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

RlaClient is the data structure for the client

func NewMockRlaClient

func NewMockRlaClient() *RlaClient

NewMockRlaClient creates a new mock RlaClient that can be used with RlaAtomicClient.SwapClient

func NewRlaClient

func NewRlaClient(config *RlaClientConfig) (client *RlaClient, err error)

NewRlaClient creates a new RlaClient

func (*RlaClient) Close

func (cc *RlaClient) Close() error

Close gracefully shuts down the client's gRPC connection.

func (*RlaClient) Rla

func (client *RlaClient) Rla() rlav1.RLAClient

Rla client getter

type RlaClientConfig

type RlaClientConfig struct {
	// The address of the server <host>:<port>
	Address string
	// Secure flag
	Secure RlaClientSecureOptions
	// Skip Server Auth
	SkipServerAuth bool
	// The TLS certificate for the server
	ServerCAPath string
	// The TLS certificate for the client
	ClientCertPath string
	// The TLS key for the client
	ClientKeyPath string
	// client metrics interface
	ClientMetrics Metrics
}

RlaClientConfig is the data structure for the client configuration

type RlaClientSecureOptions

type RlaClientSecureOptions int

SecureOptions is the enum for the secure options

const (
	// RlaInsecureGrpc is the insecure dial option
	RlaInsecureGrpc RlaClientSecureOptions = iota
	// RlaServerTLS is the secure dial option for server tls
	RlaServerTLS
	// RlaMutualTLS for mutual tls
	RlaMutualTLS
)

type SSHKeyGroupInterface

type SSHKeyGroupInterface interface {
	CreateSSHKeyGroup(ctx context.Context, request *wflows.CreateSSHKeyGroupRequest) (response *wflows.CreateTenantKeysetResponse, err error)
	UpdateSSHKeyGroup(ctx context.Context, request *wflows.UpdateSSHKeyGroupRequest) (response *wflows.UpdateTenantKeysetResponse, err error)
	DeleteSSHKeyGroup(ctx context.Context, request *wflows.DeleteSSHKeyGroupRequest) (response *wflows.DeleteTenantKeysetResponse, err error)
	GetAllSSHKeyGroups(ctx context.Context, request *wflows.TenantKeysetSearchFilter, pageSize int) (response *wflows.TenantKeySetList, err error)
	FindSSHKeyGroupIDs(ctx context.Context, request *wflows.TenantKeysetSearchFilter) (response *wflows.TenantKeysetIdList, err error)
	FindSSHKeyGroupsByIDs(ctx context.Context, request *wflows.TenantKeysetsByIdsRequest) (response *wflows.TenantKeySetList, err error)
}

SSHKeyGroupInterface is the interface for the SSHKeyGroup client

type SecureOptions

type SecureOptions int

SecureOptions is the enum for the secure options

const (
	// InsecuregRPC is the insecure dial option
	InsecuregRPC SecureOptions = iota
	// ServerTLS is the secure dial option for server tls
	ServerTLS
	// MutualTLS for mutual tls
	MutualTLS
)

type StorageGetter

type StorageGetter interface {
}

StorageGetter is the interface for the storage client

type SubnetInterface

type SubnetInterface interface {
	CreateNetworkSegment(ctx context.Context, request *wflows.CreateSubnetRequest) (response *wflows.NetworkSegment, err error)
	DeleteNetworkSegment(ctx context.Context, request *wflows.DeleteSubnetRequest) (response *wflows.NetworkSegmentDeletionResult, err error)

	GetAllNetworkSegments(ctx context.Context, request *wflows.NetworkSegmentSearchFilter, pageSize int) (response *wflows.NetworkSegmentList, err error)
	FindNetworkSegmentIds(ctx context.Context, request *wflows.NetworkSegmentSearchFilter) (response *wflows.NetworkSegmentIdList, err error)
	FindNetworkSegmentsByIds(ctx context.Context, request *wflows.NetworkSegmentsByIdsRequest) (response *wflows.NetworkSegmentList, err error)

	ValidatePrefixes(prefixes []*wflows.NetworkPrefixInfo) (err error)
	ValidatePrefix(prefix *wflows.NetworkPrefixInfo) (err error)
}

SubnetInterface Subnet Interface

type TenantInterface

type TenantInterface interface {
	// Tenant Interfaces
	CreateTenant(ctx context.Context, request *wflows.CreateTenantRequest) (response *wflows.CreateTenantResponse, err error)
	UpdateTenant(ctx context.Context, request *wflows.UpdateTenantRequest) (response *wflows.UpdateTenantResponse, err error)

	FindTenantOrganizationIDs(ctx context.Context, request *wflows.TenantSearchFilter) (response *wflows.TenantOrganizationIdList, err error)
	FindTenantsByOrganizationIDs(ctx context.Context, request *wflows.TenantByOrganizationIdsRequest) (response *wflows.TenantList, err error)
}

type VPCInterface

type VPCInterface interface {
	CreateVPC(ctx context.Context, request *wflows.Vpc) (response *wflows.Vpc, err error)
	DeleteVPC(ctx context.Context, id string) (response *wflows.VpcDeletionResult, err error)
	GetAllVPCs(ctx context.Context, request *wflows.VpcSearchFilter, pageSize int) (response *wflows.VpcList, err error)
	FindVPCIDs(ctx context.Context, request *wflows.VpcSearchFilter) (response *wflows.VpcIdList, err error)
	FindVPCsByIDs(ctx context.Context, request *wflows.VpcsByIdsRequest) (response *wflows.VpcList, err error)
}

VPCInterface is the interface for the VPC client

Jump to

Keyboard shortcuts

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