util

package
v0.0.0-...-338812b Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AcquireVPCPowerLock

func AcquireVPCPowerLock(ctx context.Context, tx *cdb.Tx, vpcID uuid.UUID) error

AcquireVPCPowerLock serializes DPS operations for one VPC transaction.

func GetIntPtrToUint32Ptr

func GetIntPtrToUint32Ptr(i *int) (*uint32, error)

A convenience function for converting a pointer to a native Go integer to a pointer to a uint32 for use with a protobuf message. Accepts a pointer to an int and returns a uint32 pointer.

If the input is nil, nil will be returned. If a pointer to a value greater than uint32 max is submitted, an error will be returned.

func ProvisionMachineBatchPower

func ProvisionMachineBatchPower(ctx context.Context, provisioner dpsclient.PowerProvisioner, resourceGroup string, assignments []MachinePowerAssignment) (func() error, error)

ProvisionMachineBatchPower authorizes and assigns machines to a DPS resource group.

func ProvisionMachinePower

func ProvisionMachinePower(ctx context.Context, provisioner dpsclient.PowerProvisioner, resourceGroup string, assignment MachinePowerAssignment) (func() error, error)

ProvisionMachinePower authorizes and assigns one machine to a DPS resource group.

func StringPtrToPortRangeUint32PtrPair

func StringPtrToPortRangeUint32PtrPair(s *string) (start *uint32, end *uint32, err error)

A convenience function for converting a *string hold a string of the form "<start>-<end>"to a pair of *uint32 representing the start and end of a port range.

Spaces will be stripped automatically. If nil is passed in, the resulting *uint32 values will be nil.

func StringToPortRangeUint32PtrPair

func StringToPortRangeUint32PtrPair(s string) (start *uint32, end *uint32, err error)

A convenience function for converting a string of the form "<start>-<end>"to a pair of *uint32 representing the start and end of a port range.

Spaces will be stripped automatically.

func StringToUint32Ptr

func StringToUint32Ptr(s string) (*uint32, error)

A convenience function for converting a string to a *uint32 for use with a protobuf message.

func UpdateMachinePower

func UpdateMachinePower(ctx context.Context, provisioner dpsclient.PowerProvisioner, resourceGroup string, assignment MachinePowerAssignment, previousProfile string) (func() error, error)

UpdateMachinePower authorizes and updates one machine's DPS power profile.

Types

type MachinePowerAssignment

type MachinePowerAssignment struct {
	MachineID    string
	PowerProfile string
}

MachinePowerAssignment describes one machine's DPS policy assignment.

type PowerChange

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

PowerChange contains the compensation and completion actions for a prepared DPS resource-group change.

func PreparePowerResourceGroupChange

func PreparePowerResourceGroupChange(ctx context.Context, provisioner dpsclient.PowerProvisioner, externalID int64, oldGroup, newGroup string, assignments []MachinePowerAssignment) (*PowerChange, error)

PreparePowerResourceGroupChange prepares a VPC's DPS resource-group migration.

func (*PowerChange) Complete

func (change *PowerChange) Complete() error

Complete performs cleanup after a prepared DPS resource-group change commits.

func (*PowerChange) Rollback

func (change *PowerChange) Rollback() error

Rollback compensates a prepared DPS resource-group change.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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