service

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BooleanIntegerConversion

func BooleanIntegerConversion(i *float32) bool

func IntToBool

func IntToBool(i int) bool

func PtrFloatToInt64

func PtrFloatToInt64(i *float32) int64

func PtrIntToInt

func PtrIntToInt(i *int) int

func PtrStringToString

func PtrStringToString(s *string) string

func SliceToStringCommaList

func SliceToStringCommaList(s []string) string

func StringCommaListToSlice

func StringCommaListToSlice(s string) []string

func StringCommaPtrListToSlice

func StringCommaPtrListToSlice(s *string) []string

func StringSemiColonListToSlice

func StringSemiColonListToSlice(s string) []string

func StringSemiColonPtrListToSlice

func StringSemiColonPtrListToSlice(s *string) []string

func StringSliceToStringSpacePtr added in v0.0.2

func StringSliceToStringSpacePtr(l []string) *string

func StringSpaceListToSlice

func StringSpaceListToSlice(s string) []string

func StringSpacePtrListToSlice

func StringSpacePtrListToSlice(s *string) []string

Types

type ClientConfig

type ClientConfig struct {
	Endpoint   string
	Token      string
	SkipVerify bool
	Username   string
	Password   string
}

type CreateLVMInput added in v0.0.5

type CreateLVMInput struct {
	Node   string
	Name   string
	Device string
}

type CreateLVMThinpoolInput added in v0.0.5

type CreateLVMThinpoolInput struct {
	Node   string
	Name   string
	Device string
}

type CreateNetworkBondInput added in v0.0.2

type CreateNetworkBondInput struct {
	Interfaces []string
	Name       string
	Node       string
	Mode       proxmox.NetworkInterfaceBondMode
	// optional
	HashPolicy  *proxmox.NetworkInterfaceBondHashPolicy
	BondPrimary *string
	AutoStart   *bool
	IPv4        *IP
	IPv6        *IP
	IPv4Gateway *string
	IPv6Gateway *string
	Comments    *string
}

type CreateNetworkBridgeInput added in v0.0.3

type CreateNetworkBridgeInput struct {
	Interfaces []string
	Name       string
	Node       string
	// optional
	IPv4        *IP
	IPv6        *IP
	IPv4Gateway *string
	IPv6Gateway *string
	VLANAware   *bool
	AutoStart   *bool
	Comments    *string
}

type CreatePoolInput

type CreatePoolInput struct {
	PoolId  string
	Comment *string
}

type CreateZFSPoolInput added in v0.0.4

type CreateZFSPoolInput struct {
	Node      string
	Name      string
	Disks     []string
	RaidLevel proxmox.ZFSRaidLevel
}

type Disk

type Disk struct {
	Device string
	IDLink string
	Size   int64
	Model  string
	Serial string
	Vendor string
	Type   proxmox.DiskType
}

type IP added in v0.0.3

type IP struct {
	Address string
	Netmask string
}

func Ipv4FromInterface

func Ipv4FromInterface(iface proxmox.NetworkInterfaceSummary) *IP

func Ipv6FromInterface

func Ipv6FromInterface(iface proxmox.NetworkInterfaceSummary) *IP

type LVM added in v0.0.5

type LVM struct {
	Name   string
	Node   string
	Size   int64
	Device string
}

type LVMThinpool added in v0.0.5

type LVMThinpool struct {
	Name         string
	Node         string
	Size         int64
	MetadataSize int64
	VolumeGroup  string
	Device       string
}

type NetworkBond

type NetworkBond struct {
	Active      bool
	Autostart   bool
	HashPolicy  *proxmox.NetworkInterfaceBondHashPolicy
	BondPrimary *string
	Mode        proxmox.NetworkInterfaceBondMode
	MiiMon      *string
	Interfaces  []string
	Name        string
	Node        string
	IPv4        *IP
	IPv6        *IP
	IPv4Gateway *string
	IPv6Gateway *string
	Comments    *string
}

type NetworkBridge

type NetworkBridge struct {
	Active      bool
	Autostart   bool
	VLANAware   bool
	Interfaces  []string
	Name        string
	Node        string
	IPv4        *IP
	IPv6        *IP
	IPv4Gateway *string
	IPv6Gateway *string
	Comments    *string
}

type NetworkInterface

type NetworkInterface struct {
	Name string
}

type Node

type Node struct {
	Id                string
	Node              string
	Cores             int
	SslFingerprint    string
	Memory            int64
	DiskSpace         int64
	Disks             []Disk
	NetworkInterfaces []NetworkInterface
}

type Pool

type Pool struct {
	Id      string
	Comment string
	Members []PoolMember
}

type PoolMember

type PoolMember struct {
	Id   string
	Type proxmox.PoolMemberType
}

type Proxmox

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

func New

func New(c ClientConfig) (*Proxmox, error)

func (*Proxmox) ApplyChanges added in v0.0.2

func (c *Proxmox) ApplyChanges(ctx context.Context, node string) error

func (*Proxmox) CreateLVM added in v0.0.5

func (c *Proxmox) CreateLVM(ctx context.Context, input *CreateLVMInput) error

func (*Proxmox) CreateLVMThinpool added in v0.0.5

func (c *Proxmox) CreateLVMThinpool(ctx context.Context, input *CreateLVMThinpoolInput) error

func (*Proxmox) CreateNetworkBond added in v0.0.2

func (c *Proxmox) CreateNetworkBond(ctx context.Context, input *CreateNetworkBondInput) error

func (*Proxmox) CreateNetworkBridge added in v0.0.3

func (c *Proxmox) CreateNetworkBridge(ctx context.Context, input *CreateNetworkBridgeInput) error

func (*Proxmox) CreatePool

func (c *Proxmox) CreatePool(ctx context.Context, input *CreatePoolInput) error

func (*Proxmox) CreateZFSPool added in v0.0.4

func (c *Proxmox) CreateZFSPool(ctx context.Context, input *CreateZFSPoolInput) error

func (*Proxmox) DeleteLVM added in v0.0.5

func (c *Proxmox) DeleteLVM(ctx context.Context, node string, pool string) error

func (*Proxmox) DeleteLVMThinpool added in v0.0.5

func (c *Proxmox) DeleteLVMThinpool(ctx context.Context, node string, pool string, vg string) error

func (*Proxmox) DeleteNetworkInterface added in v0.0.3

func (c *Proxmox) DeleteNetworkInterface(ctx context.Context, node string, name string) error

func (*Proxmox) DeletePool

func (c *Proxmox) DeletePool(ctx context.Context, poolId string) error

func (*Proxmox) DeleteZFSPool added in v0.0.4

func (c *Proxmox) DeleteZFSPool(ctx context.Context, node string, pool string) error

func (*Proxmox) DescribeLocalStorage

func (c *Proxmox) DescribeLocalStorage(ctx context.Context) ([]Storage, error)

deprecated

func (*Proxmox) DescribeNetworkBonds

func (c *Proxmox) DescribeNetworkBonds(ctx context.Context, node string) ([]NetworkBond, error)

func (*Proxmox) DescribeNetworkBridges

func (c *Proxmox) DescribeNetworkBridges(ctx context.Context, node string) ([]NetworkBridge, error)

func (*Proxmox) DescribeNode

func (c *Proxmox) DescribeNode(ctx context.Context, node string) (Node, error)

func (*Proxmox) DescribePools

func (c *Proxmox) DescribePools(ctx context.Context) ([]Pool, error)

func (*Proxmox) DescribeStorage

func (c *Proxmox) DescribeStorage(ctx context.Context) ([]Storage, error)

deprecated

func (*Proxmox) DescribeTemplates

func (c *Proxmox) DescribeTemplates(ctx context.Context, node string) ([]vm.VirtualMachine, error)

func (*Proxmox) DescribeVirtualMachines

func (c *Proxmox) DescribeVirtualMachines(ctx context.Context, node string) ([]vm.VirtualMachine, error)

func (*Proxmox) DescribeZFSNodeStorage added in v0.0.5

func (c *Proxmox) DescribeZFSNodeStorage(ctx context.Context, node string) ([]*ZFSNodeStorage, error)

func (*Proxmox) DescribeZFSPool added in v0.0.4

func (c *Proxmox) DescribeZFSPool(ctx context.Context, node string, pool string) (*ZFSPool, error)

An unefficient method of getting a single ZFS pool

func (*Proxmox) DescribeZFSPools added in v0.0.4

func (c *Proxmox) DescribeZFSPools(ctx context.Context, node string) ([]ZFSPool, error)

Describes a ZFS pool and the disks that makes it up This chains several API calls togther to build a ZFSPool struct

Process flow is:

  1. Get a list of all ZFS pools
  2. Get the status of each pool
  3. Get a list of all disks on node
  4. Match the disks to the pool
  5. Build a ZFSPool struct and append to a list
  6. Return a list of ZFSPool structs

func (*Proxmox) GetLVM added in v0.0.5

func (c *Proxmox) GetLVM(ctx context.Context, node string, pool string) (*LVM, error)

func (*Proxmox) GetLVMThinpool added in v0.0.5

func (c *Proxmox) GetLVMThinpool(ctx context.Context, node string, pool string) (*LVMThinpool, error)

func (*Proxmox) GetNetworkBond added in v0.0.2

func (c *Proxmox) GetNetworkBond(ctx context.Context, node string, name string) (*NetworkBond, error)

func (*Proxmox) GetNetworkBridge added in v0.0.3

func (c *Proxmox) GetNetworkBridge(ctx context.Context, node string, name string) (*NetworkBridge, error)

func (*Proxmox) GetNode

func (c *Proxmox) GetNode(ctx context.Context, node string) (*proxmox.NodeSummary, error)

func (*Proxmox) GetNodeStorage added in v0.0.5

func (c *Proxmox) GetNodeStorage(ctx context.Context, node string, storage string) (*proxmox.NodeStorageSummary, error)

func (*Proxmox) GetPool

func (c *Proxmox) GetPool(ctx context.Context, poolId string) (*proxmox.PoolConfigurationSummary, error)

func (*Proxmox) GetStorage

func (c *Proxmox) GetStorage(ctx context.Context, node string, storage string) (*proxmox.NodeStorageSummary, error)

deprecated

func (*Proxmox) GetStorageClass added in v0.0.5

func (c *Proxmox) GetStorageClass(ctx context.Context, storage string) (*proxmox.StorageSummary, error)

func (*Proxmox) GetVirtualMachineConfiguration

func (c *Proxmox) GetVirtualMachineConfiguration(ctx context.Context, node string, vmId int) (*proxmox.VirtualMachineConfigurationSummary, error)

func (*Proxmox) GetZFSPoolStatus added in v0.0.4

func (c *Proxmox) GetZFSPoolStatus(ctx context.Context, node string, pool string) (proxmox.ZFSPoolStatusSummary, error)

func (*Proxmox) GetZFSStorageClass added in v0.0.5

func (c *Proxmox) GetZFSStorageClass(ctx context.Context, name string) (*ZFSStorageClass, error)

func (*Proxmox) ListDisks

func (c *Proxmox) ListDisks(ctx context.Context, node string) ([]Disk, error)

func (*Proxmox) ListLVMThinpools added in v0.0.5

func (c *Proxmox) ListLVMThinpools(ctx context.Context, node string) ([]LVMThinpool, error)

func (*Proxmox) ListLVMs added in v0.0.5

func (c *Proxmox) ListLVMs(ctx context.Context, node string) ([]LVM, error)

func (*Proxmox) ListNetworkBonds

func (c *Proxmox) ListNetworkBonds(ctx context.Context, node string) ([]proxmox.NetworkInterfaceSummary, error)

func (*Proxmox) ListNetworkBridges

func (c *Proxmox) ListNetworkBridges(ctx context.Context, node string) ([]proxmox.NetworkInterfaceSummary, error)

func (*Proxmox) ListNetworkInterfaces

func (c *Proxmox) ListNetworkInterfaces(ctx context.Context, node string) ([]NetworkInterface, error)

func (*Proxmox) ListNodeStorage

func (c *Proxmox) ListNodeStorage(ctx context.Context, node string) ([]proxmox.NodeStorageSummary, error)

func (*Proxmox) ListNodes

func (c *Proxmox) ListNodes(ctx context.Context) ([]proxmox.NodeSummary, error)

func (*Proxmox) ListPools

func (c *Proxmox) ListPools(ctx context.Context) ([]proxmox.PoolSummary, error)

func (*Proxmox) ListStorage

func (c *Proxmox) ListStorage(ctx context.Context) ([]proxmox.StorageSummary, error)

func (*Proxmox) ListTemplates

func (c *Proxmox) ListTemplates(ctx context.Context, node string) ([]proxmox.VirtualMachineSummary, error)

func (*Proxmox) ListVirtualMachines

func (c *Proxmox) ListVirtualMachines(ctx context.Context, node string) ([]proxmox.VirtualMachineSummary, error)

func (*Proxmox) ListZFSPools added in v0.0.4

func (c *Proxmox) ListZFSPools(ctx context.Context, node string) ([]proxmox.ZFSPoolSummary, error)

func (*Proxmox) ListZFSStorageClasses added in v0.0.5

func (c *Proxmox) ListZFSStorageClasses(ctx context.Context) ([]ZFSStorageClass, error)

func (*Proxmox) UpdateNetworkBond added in v0.0.2

func (c *Proxmox) UpdateNetworkBond(ctx context.Context, input *UpdateNetworkBondInput) error

func (*Proxmox) UpdateNetworkBridge added in v0.0.3

func (c *Proxmox) UpdateNetworkBridge(ctx context.Context, input *UpdateNetworkBridgeInput) error

func (*Proxmox) UpdatePool

func (c *Proxmox) UpdatePool(ctx context.Context, input *UpdatePoolInput) error

type Storage

type Storage struct {
	Id          string
	SharedNodes []string
	Shared      bool
	Local       bool
	Size        int64
	Source      string
	Content     []string
	Type        proxmox.StorageType
}

type UpdateNetworkBondInput added in v0.0.2

type UpdateNetworkBondInput struct {
	Interfaces []string
	Name       string
	Node       string
	Mode       proxmox.NetworkInterfaceBondMode
	// optional
	IPv4        *IP
	IPv6        *IP
	IPv4Gateway *string
	IPv6Gateway *string
	HashPolicy  *proxmox.NetworkInterfaceBondHashPolicy
	BondPrimary *string
	AutoStart   *bool
	Comments    *string
}

type UpdateNetworkBridgeInput added in v0.0.3

type UpdateNetworkBridgeInput struct {
	Interfaces []string
	Name       string
	Node       string
	// optional
	IPv4        *IP
	IPv6        *IP
	IPv4Gateway *string
	IPv6Gateway *string
	VLANAware   *bool
	AutoStart   *bool
	Comments    *string
}

type UpdatePoolInput

type UpdatePoolInput struct {
	PoolId  string
	Comment *string
	Delete  bool
	Storage []string
	Vms     []string
}

type ZFSNodeStorage added in v0.0.5

type ZFSNodeStorage struct {
	Id           string
	Node         string
	Storage      string
	ContentTypes []string
	Size         int64
	ZFSPool      string
	Mount        string
}

type ZFSPool added in v0.0.4

type ZFSPool struct {
	Name      string
	Node      string
	Size      int64
	Health    string
	Disks     []string
	RaidLevel proxmox.ZFSRaidLevel
}

type ZFSStorageClass added in v0.0.5

type ZFSStorageClass struct {
	Id      string
	Nodes   []string
	Content []string
	ZFSPool string
	Mount   string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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