virtualization

package
v0.0.17 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(netboxClient client.NetBox) Client

func (Client) ClusterGetByID

func (c Client) ClusterGetByID(clusterID int64) (*models.Cluster, error)

ClusterGetByID retrieves a cluster by it's id

func (Client) InterfaceConvertFromNetbox

func (c Client) InterfaceConvertFromNetbox(netboxInterface models.VirtualMachineInterface) (*types.NetworkInterface, error)

func (Client) InterfaceConvertToNetbox

func (c Client) InterfaceConvertToNetbox(vmID int64, intf types.NetworkInterface) (out *models.WritableVirtualMachineInterface, err error)

InterfaceConvertToNetbox allows to convert a NetworkInterface to a netbox compatible device interface

func (Client) InterfaceCreate

func (c Client) InterfaceCreate(vmID int64, intf types.NetworkInterface) (machineInterface *types.NetworkInterface, err error)

InterfaceCreate creates a VM interface in Netbox.

func (Client) InterfaceFind

func (c Client) InterfaceFind(vmID int64, interfaceName string) (out *types.NetworkInterface, err error)

InterfaceFind retrieves an existing VM interface object.

func (Client) InterfaceFindAll

func (c Client) InterfaceFindAll(vmID int64) ([]*models.VirtualMachineInterface, error)

InterfaceFindAll returns all interfaces of a virtual machine identified by it's id

func (Client) InterfaceGet

func (c Client) InterfaceGet(interfaceID int64) (out *types.NetworkInterface, err error)

InterfaceGet fetches an interface from netbox

func (Client) InterfaceGetCreate

func (c Client) InterfaceGetCreate(vmID int64, intf types.NetworkInterface) (machineInterface *types.NetworkInterface, err error)

InterfaceGetCreate is a convenience method to retrieve an existing VM interface or otherwise to create it.

func (Client) VirtualMachineConvertFromNetbox

func (c Client) VirtualMachineConvertFromNetbox(netboxVM interface{}, interfaces []*models.VirtualMachineInterface) (out *types.VirtualServer, err error)

VirtualMachineConvertFromNetbox converts a netbox virtual machine entity to a VirtualServer entity

func (Client) VirtualMachineCreate

func (c Client) VirtualMachineCreate(clusterID int64, vm types.VirtualServer) (*types.VirtualServer, error)

VirtualMachineCreate creates a new VM object in Netbox.

func (Client) VirtualMachineDelete

func (c Client) VirtualMachineDelete(vmID int64) (err error)

VirtualMachineDelete deletes a virtual machine in Netbox

func (Client) VirtualMachineFind

func (c Client) VirtualMachineFind(hostname string) (out *types.VirtualServer, err error)

VirtualMachineFind returns the first found virtual machines

func (Client) VirtualMachineFindAll

func (c Client) VirtualMachineFindAll(limit int64, offset int64) (int64, []*models.VirtualMachineWithConfigContext, error)

VirtualMachineFindAll returns all found virtual machines

func (Client) VirtualMachineGet

func (c Client) VirtualMachineGet(vmID int64) (out *types.VirtualServer, err error)

VirtualMachineGet retrieves an existing VM object from netbox by it's hostname.

func (Client) VirtualMachineGetCreate

func (c Client) VirtualMachineGetCreate(clusterID int64, vm types.VirtualServer) (*types.VirtualServer, error)

VirtualMachineGetCreate is a convenience wrapper for retrieving an existing VM object or creating it instead.

func (Client) VirtualMachineUpdate

func (c Client) VirtualMachineUpdate(vm types.VirtualServer) (updated bool, err error)

VirtualMachineUpdate returns true if the vm was actually updated

Jump to

Keyboard shortcuts

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