client

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2023 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Overview

Package client contains the implementation of CRUD operations on MAAS resources.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIClient

type APIClient struct {
	AuthClient gomaasapi.Client
	*gomaasapi.MAASObject
}

func GetAPIClient deprecated

func GetAPIClient(apiURL string, apiKey string, apiVersion string) (*APIClient, error)

GetAPIClient returns a MAAS API client.

Deprecated: The gomaasapi client will be no longer exposed. Instead, please use GetClient which instantiate all MAAS resources endpoints with gomaasapi client.

func (APIClient) Get

func (c APIClient) Get(op string, params url.Values, f func([]byte) error) error

func (APIClient) GetSubObject

func (c APIClient) GetSubObject(name string) APIClient

func (APIClient) Post

func (c APIClient) Post(op string, params url.Values, f func([]byte) error) error

func (APIClient) Put

func (c APIClient) Put(params url.Values, f func([]byte) error) error

type BlockDevice

type BlockDevice struct {
	APIClient APIClient
}

BlockDevice implements the api.BlockDevice interface

func (*BlockDevice) AddTag

func (b *BlockDevice) AddTag(systemID string, id int, tag string) (*entity.BlockDevice, error)

AddTag adds a tag to a given BlockDevice

func (*BlockDevice) Delete

func (b *BlockDevice) Delete(systemID string, id int) error

Delete deletes a given BlockDevice

func (*BlockDevice) Format

func (b *BlockDevice) Format(systemID string, id int, fsType string) (*entity.BlockDevice, error)

Format configures a BlockDevice to be formatted for a new file system

func (*BlockDevice) Get

func (b *BlockDevice) Get(systemID string, id int) (*entity.BlockDevice, error)

Get fetches a given BlockDevice based on the given Node's system_id and BlockDevice's id

func (*BlockDevice) Mount

func (b *BlockDevice) Mount(systemID string, id int, mountPoint string, mountOptions string) (*entity.BlockDevice, error)

Mount sets the mount point and options of a given BlockDevice

func (*BlockDevice) RemoveTag

func (b *BlockDevice) RemoveTag(systemID string, id int, tag string) (*entity.BlockDevice, error)

RemoveTag removes a tag from a given BlockDevice

func (*BlockDevice) SetBootDisk

func (b *BlockDevice) SetBootDisk(systemID string, id int) error

SetBootDisk configures the given BlockDevice as the boot disk

func (*BlockDevice) Unformat

func (b *BlockDevice) Unformat(systemID string, id int) (*entity.BlockDevice, error)

Unformat removes the configured file system

func (*BlockDevice) Unmount

func (b *BlockDevice) Unmount(systemID string, id int) (*entity.BlockDevice, error)

Unmount unsets the mount of a BlockDevice

func (*BlockDevice) Update

func (b *BlockDevice) Update(systemID string, id int, params *entity.BlockDeviceParams) (*entity.BlockDevice, error)

Update updates a given BlockDevice

type BlockDevicePartition

type BlockDevicePartition struct {
	APIClient APIClient
}

BlockDevicePartition implements the api.BlockDevicePartition interface

func (*BlockDevicePartition) AddTag

func (p *BlockDevicePartition) AddTag(systemID string, blockDeviceID int, id int, tag string) (*entity.BlockDevicePartition, error)

AddTag adds a tag to a given BlockDevicePartition

func (*BlockDevicePartition) Delete

func (p *BlockDevicePartition) Delete(systemID string, blockDeviceID int, id int) error

Delete deletes a given BlockDevicePartition

func (*BlockDevicePartition) Format

func (p *BlockDevicePartition) Format(systemID string, blockDeviceID int, id int, fsType string, label string) (*entity.BlockDevicePartition, error)

Format sets the BlockDevicePartition to be formatted with a given file system

func (*BlockDevicePartition) Get

func (p *BlockDevicePartition) Get(systemID string, blockDeviceID int, id int) (*entity.BlockDevicePartition, error)

Get fetches a given BlockDevicePartion for a given system_id, BlockDevice id and partition id

func (*BlockDevicePartition) Mount

func (p *BlockDevicePartition) Mount(systemID string, blockDeviceID int, id int, mountPoint string, mountOptions string) (*entity.BlockDevicePartition, error)

Mount sets a mount point and options for a given BlockDevicePartition

func (*BlockDevicePartition) RemoveTag

func (p *BlockDevicePartition) RemoveTag(systemID string, blockDeviceID int, id int, tag string) (*entity.BlockDevicePartition, error)

RemoveTag removes a tag from a given BlockDevicePartition

func (*BlockDevicePartition) Unformat

func (p *BlockDevicePartition) Unformat(systemID string, blockDeviceID int, id int) (*entity.BlockDevicePartition, error)

Unformat unsets a file system for a given BlockDevicePartition

func (*BlockDevicePartition) Unmount

func (p *BlockDevicePartition) Unmount(systemID string, blockDeviceID int, id int) (*entity.BlockDevicePartition, error)

Unmount unsets a mount point for a given BlockDevicePartition

type BlockDevicePartitions

type BlockDevicePartitions struct {
	APIClient APIClient
}

BlockDevicePartitions implements api.BlockDevicePartitions

func (*BlockDevicePartitions) Create

func (p *BlockDevicePartitions) Create(systemID string, blockDeviceID int, params *entity.BlockDevicePartitionParams) (*entity.BlockDevicePartition, error)

Create creats a new BlockDevicePartition for a given system_id and BlockDevice id

func (*BlockDevicePartitions) Get

func (p *BlockDevicePartitions) Get(systemID string, blockDeviceID int) ([]entity.BlockDevicePartition, error)

Get lists the BlockDevicePartition objects for a given system_id and BlockDevice id

type BlockDevices

type BlockDevices struct {
	APIClient APIClient
}

BlockDevices implements api.BlockDevices

func (*BlockDevices) Create

func (b *BlockDevices) Create(systemID string, params *entity.BlockDeviceParams) (*entity.BlockDevice, error)

Create creates a new BlockDevice for a given system_id

func (*BlockDevices) Get

func (b *BlockDevices) Get(systemID string) ([]entity.BlockDevice, error)

Get fetches a list of BlockDevices for a given system_id

type Client

type Client struct {
	Device                api.Device
	Devices               api.Devices
	DNSResource           api.DNSResource
	DNSResources          api.DNSResources
	DNSResourceRecord     api.DNSResourceRecord
	DNSResourceRecords    api.DNSResourceRecords
	Domain                api.Domain
	Domains               api.Domains
	Fabric                api.Fabric
	Fabrics               api.Fabrics
	VLAN                  api.VLAN
	VLANs                 api.VLANs
	Space                 api.Space
	Spaces                api.Spaces
	Machine               api.Machine
	Machines              api.Machines
	VMHost                api.VMHost
	VMHosts               api.VMHosts
	NetworkInterface      api.NetworkInterface
	NetworkInterfaces     api.NetworkInterfaces
	RAID                  api.RAID
	RAIDs                 api.RAIDs
	Subnet                api.Subnet
	Subnets               api.Subnets
	IPRange               api.IPRange
	IPRanges              api.IPRanges
	IPAddresses           api.IPAddresses
	Tag                   api.Tag
	Tags                  api.Tags
	BlockDevice           api.BlockDevice
	BlockDevices          api.BlockDevices
	BlockDevicePartition  api.BlockDevicePartition
	BlockDevicePartitions api.BlockDevicePartitions
	User                  api.User
	Users                 api.Users
	ResourcePool          api.ResourcePool
	ResourcePools         api.ResourcePools
}

Client is an object providing API interactions with a configured MAAS installation

func GetClient

func GetClient(apiURL string, apiKey string, apiVersion string) (*Client, error)

GetClient creates a client

func GetTLSClient

func GetTLSClient(apiURL string, apiKey string, apiVersion string, tlsConfig *tls.Config) (*Client, error)

GetTLSClient creates a Client configured with TLS

type DNSResource

type DNSResource struct {
	APIClient APIClient
}

DNSResource implements api.DNSResource

func (*DNSResource) Delete

func (d *DNSResource) Delete(id int) error

Delete deletes a given DNSResource

func (*DNSResource) Get

func (d *DNSResource) Get(id int) (*entity.DNSResource, error)

Get fetches a given DNSResource

func (*DNSResource) Update

func (d *DNSResource) Update(id int, params *entity.DNSResourceParams) (*entity.DNSResource, error)

Update updates a given DNSResource

type DNSResourceRecord

type DNSResourceRecord struct {
	APIClient APIClient
}

DNSResourceRecord implements api.DNSResourceRecord

func (*DNSResourceRecord) Delete

func (d *DNSResourceRecord) Delete(id int) error

Delete deletes a given DNSResourceRecord

func (*DNSResourceRecord) Get

Get fetches a given DNSResourceRecord

func (*DNSResourceRecord) Update

Update updates a given DNSResourceRecord

type DNSResourceRecords

type DNSResourceRecords struct {
	APIClient APIClient
}

DNSResourceRecords implements api.DNSResourceRecords

func (*DNSResourceRecords) Create

Create creates a new DNSResourceRecord

func (*DNSResourceRecords) Get

Get fetches a list of DNSResourceRecord objectts

type DNSResources

type DNSResources struct {
	APIClient APIClient
}

DNSResources implements api.DNSResources

func (*DNSResources) Create

Create creates a new DNSResource

func (*DNSResources) Get

func (d *DNSResources) Get() ([]entity.DNSResource, error)

Get fetches a list of DNSResource objects

type Device

type Device struct {
	APIClient APIClient
}

Device implements api.Device

func (*Device) Delete

func (d *Device) Delete(systemID string) error

Delete deletes a given Device

func (*Device) Get

func (d *Device) Get(systemID string) (*entity.Device, error)

Get fetches a device with a given system_id

func (*Device) Update

func (d *Device) Update(systemID string, deviceParams *entity.DeviceUpdateParams) (*entity.Device, error)

Update updates a given Device

type Devices

type Devices struct {
	APIClient APIClient
}

Devices implements api.Devices

func (*Devices) Create

func (d *Devices) Create(deviceParams *entity.DeviceCreateParams) (*entity.Device, error)

Create creates a new Device

func (*Devices) Get

func (d *Devices) Get() ([]entity.Device, error)

Get fetches a list of Devices

type Domain

type Domain struct {
	APIClient APIClient
}

Domain implements api.Domain

func (*Domain) Delete

func (d *Domain) Delete(id int) error

Delete deletes a given Domain

func (*Domain) Get

func (d *Domain) Get(id int) (*entity.Domain, error)

Get fetches a given Domain

func (*Domain) SetDefault

func (d *Domain) SetDefault(id int) (*entity.Domain, error)

SetDefault sets the given Domain as the default Domain

func (*Domain) Update

func (d *Domain) Update(id int, params *entity.DomainParams) (*entity.Domain, error)

Update updates the given Domain

type Domains

type Domains struct {
	APIClient APIClient
}

Domains implements api.Domains

func (*Domains) Create

func (d *Domains) Create(params *entity.DomainParams) (*entity.Domain, error)

Create creates a new Domain

func (*Domains) Get

func (d *Domains) Get() ([]entity.Domain, error)

Get fetches a list of Domain objects

func (*Domains) SetSerial

func (d *Domains) SetSerial(serial int) error

SetSerial sets the SOA serial for all domains

type Fabric

type Fabric struct {
	APIClient APIClient
}

Fabric implments api.Fabric

func (*Fabric) Delete

func (f *Fabric) Delete(id int) error

Delete deletes a given Fabric

func (*Fabric) Get

func (f *Fabric) Get(id int) (*entity.Fabric, error)

Get fetchs a Fabric object

func (*Fabric) Update

func (f *Fabric) Update(id int, fabricParams *entity.FabricParams) (*entity.Fabric, error)

Update updates a given Fabric

type Fabrics

type Fabrics struct {
	APIClient APIClient
}

Fabrics implements api.Fabrics

func (*Fabrics) Create

func (f *Fabrics) Create(fabricParams *entity.FabricParams) (*entity.Fabric, error)

Create creates a new Fabric object

func (*Fabrics) Get

func (f *Fabrics) Get() ([]entity.Fabric, error)

Get fetches a list of Fabric objects

type IPAddresses

type IPAddresses struct {
	APIClient APIClient
}

IPAddresses implements api.IPAddresses

func (*IPAddresses) Get

Get fetches a specified set of IPAddresses

func (*IPAddresses) Release

func (i *IPAddresses) Release(params *entity.IPAddressesParams) error

Release releases a set of allocated IPAddresses

func (*IPAddresses) Reserve

func (i *IPAddresses) Reserve(params *entity.IPAddressesParams) (*entity.IPAddress, error)

Reserve reserves a set of IPAddresses

type IPRange

type IPRange struct {
	APIClient APIClient
}

IPRange implements api.IPRange

func (*IPRange) Delete

func (i *IPRange) Delete(id int) error

Delete deletes a given IPRange

func (*IPRange) Get

func (i *IPRange) Get(id int) (*entity.IPRange, error)

Get fetches a given IPRange

func (*IPRange) Update

func (i *IPRange) Update(id int, params *entity.IPRangeParams) (*entity.IPRange, error)

Update updates a given IPRange

type IPRanges

type IPRanges struct {
	APIClient APIClient
}

IPRanges implements api.IPRanges

func (*IPRanges) Create

func (i *IPRanges) Create(params *entity.IPRangeParams) (*entity.IPRange, error)

Create creates a new IPRange object

func (*IPRanges) Get

func (i *IPRanges) Get() ([]entity.IPRange, error)

Get fetches a list of IPRange objects

type Machine

type Machine struct {
	APIClient APIClient
}

Machine contains functionality for manipulating the Machine entity.

func (*Machine) ClearDefaultGateways

func (m *Machine) ClearDefaultGateways(systemID string) (*entity.Machine, error)

ClearDefaultGateways clears default gateways.

func (*Machine) Commission

func (m *Machine) Commission(systemID string, params *entity.MachineCommissionParams) (*entity.Machine, error)

Commission machine.

func (*Machine) Delete

func (m *Machine) Delete(systemID string) error

Delete machine.

func (*Machine) Deploy

func (m *Machine) Deploy(systemID string, params *entity.MachineDeployParams) (*entity.Machine, error)

Deploy machine.

func (*Machine) Get

func (m *Machine) Get(systemID string) (*entity.Machine, error)

Get machine details.

func (*Machine) GetPowerParameters

func (m *Machine) GetPowerParameters(systemID string) (map[string]interface{}, error)

GetPowerParameters fetches the power parameters of a given Machine

func (*Machine) Lock

func (m *Machine) Lock(systemID string, comment string) (*entity.Machine, error)

Lock machine.

func (*Machine) Release

func (m *Machine) Release(systemID string, params *entity.MachineReleaseParams) (*entity.Machine, error)

Release machine.

func (*Machine) Update

func (m *Machine) Update(systemID string, machineParams *entity.MachineParams, powerParams map[string]interface{}) (*entity.Machine, error)

Update machine.

type Machines

type Machines struct {
	APIClient APIClient
}

Machines contains functionality for manipulating the Machines entity.

func (*Machines) AcceptAll

func (m *Machines) AcceptAll() error

AcceptAll accepts all pending enlistments

func (*Machines) Allocate

func (m *Machines) Allocate(params *entity.MachineAllocateParams) (*entity.Machine, error)

Allocate machine.

func (*Machines) Create

func (m *Machines) Create(machineParams *entity.MachineParams, powerParams map[string]interface{}) (*entity.Machine, error)

Create machine.

func (*Machines) Get

func (m *Machines) Get() ([]entity.Machine, error)

Get fetches a list machines.

func (*Machines) Release

func (m *Machines) Release(systemIDs []string, comment string) error

Release machine.

type NetworkInterface

type NetworkInterface struct {
	APIClient APIClient
}

NetworkInterface implements api.NetworkInterface

func (*NetworkInterface) AddTag

func (n *NetworkInterface) AddTag(systemID string, id int, tag string) (*entity.NetworkInterface, error)

AddTag adds a given tag to a given NetworkInterface

func (*NetworkInterface) Delete

func (n *NetworkInterface) Delete(systemID string, id int) error

Delete deletes a given NetworkInterface

func (*NetworkInterface) Disconnect

func (n *NetworkInterface) Disconnect(systemID string, id int) (*entity.NetworkInterface, error)

Disconnect marks a given NetworkInterface as disconnected

func (*NetworkInterface) Get

func (n *NetworkInterface) Get(systemID string, id int) (*entity.NetworkInterface, error)

Get fetches a NetworkInterface for the given system_id and NetworkInterface id

func (*NetworkInterface) LinkSubnet

func (n *NetworkInterface) LinkSubnet(systemID string, id int, params *entity.NetworkInterfaceLinkParams) (*entity.NetworkInterface, error)

LinkSubnet links a given Subnet to a given NetworkInterface

func (*NetworkInterface) RemoveTag

func (n *NetworkInterface) RemoveTag(systemID string, id int, tag string) (*entity.NetworkInterface, error)

RemoveTag removes a given tag from a given NetworkInterface

func (*NetworkInterface) SetDefaultGateway

func (n *NetworkInterface) SetDefaultGateway(systemID string, id int, linkID int) (*entity.NetworkInterface, error)

SetDefaultGateway sets the default gateway of the given NetworkInterface

func (*NetworkInterface) UnlinkSubnet

func (n *NetworkInterface) UnlinkSubnet(systemID string, id int, linkID int) (*entity.NetworkInterface, error)

UnlinkSubnet removes a given link

func (*NetworkInterface) Update

Update updates a give NetworkInterface

type NetworkInterfaces

type NetworkInterfaces struct {
	APIClient APIClient
}

NetworkInterfaces implements api.NetworkInterfaces

func (*NetworkInterfaces) CreateBond

CreateBond creates a Bond interface from two or more given NetworkInterface objects

func (*NetworkInterfaces) CreateBridge

CreateBridge creates a Bridge type interface

func (*NetworkInterfaces) CreatePhysical

CreatePhysical creates a new physical interface

func (*NetworkInterfaces) CreateVLAN

CreateVLAN creates an interface tagged for a given VLAN

func (*NetworkInterfaces) Get

func (n *NetworkInterfaces) Get(systemID string) ([]entity.NetworkInterface, error)

Get fetches a list of NetworkInterface objects

type RAID

type RAID struct {
	APIClient APIClient
}

RAID Contains functionality for manipulating the RAID entity.

func (*RAID) Delete

func (r *RAID) Delete(systemID string, id int) error

Delete RAID.

func (*RAID) Get

func (r *RAID) Get(systemID string, id int) (*entity.RAID, error)

Get RAID details.

func (*RAID) Update

func (r *RAID) Update(systemID string, id int, params *entity.RAIDUpdateParams) (*entity.RAID, error)

Update RAID.

type RAIDs

type RAIDs struct {
	APIClient APIClient
}

RAIDs contains functionality for manipulating the RAIDs entity.

func (*RAIDs) Create

func (r *RAIDs) Create(systemID string, params *entity.RAIDCreateParams) (*entity.RAID, error)

Create a RAID of a machine.

func (*RAIDs) Get

func (r *RAIDs) Get(systemID string) ([]entity.RAID, error)

Get RAIDs of a machine.

type ResourcePool

type ResourcePool struct {
	APIClient APIClient
}

ResourcePool implements api.ResourcePool

func (*ResourcePool) Delete

func (r *ResourcePool) Delete(id int) error

Delete deletes a given ResourcePool

func (*ResourcePool) Get

func (r *ResourcePool) Get(id int) (*entity.ResourcePool, error)

Get fetches a given ResourcePool

func (*ResourcePool) Update

func (r *ResourcePool) Update(id int, params *entity.ResourcePoolParams) (*entity.ResourcePool, error)

Update updates a given ResourcePool

type ResourcePools

type ResourcePools struct {
	APIClient APIClient
}

ResourcePools implements api.ResourcePools

func (*ResourcePools) Create

Create creates a new ResourcePool

func (*ResourcePools) Get

func (r *ResourcePools) Get() ([]entity.ResourcePool, error)

Get fetches a list of ResourcePool objects

type Space

type Space struct {
	APIClient APIClient
}

Space implements api.Space

func (*Space) Delete

func (s *Space) Delete(id int) error

Delete deletes a given Space

func (*Space) Get

func (s *Space) Get(id int) (*entity.Space, error)

Get fetches a given Space

func (*Space) Update

func (s *Space) Update(id int, name string) (*entity.Space, error)

Update updates a given Space

type Spaces

type Spaces struct {
	APIClient APIClient
}

Spaces implements api.Spaces

func (*Spaces) Create

func (s *Spaces) Create(name string) (*entity.Space, error)

Create creates a new Space

func (*Spaces) Get

func (s *Spaces) Get() ([]entity.Space, error)

Get fetches a list of Space objects

type Subnet

type Subnet struct {
	APIClient APIClient
}

Subnet implements api.Subnet

func (*Subnet) Delete

func (s *Subnet) Delete(id int) error

Delete deletes a given Subnet

func (*Subnet) Get

func (s *Subnet) Get(id int) (*entity.Subnet, error)

Get fetches a given Subnet

func (*Subnet) GetIPAddresses

func (s *Subnet) GetIPAddresses(id int) ([]subnet.IPAddress, error)

GetIPAddresses fetches the allocated IPAddresses in the given subnet

func (*Subnet) GetReservedIPRanges

func (s *Subnet) GetReservedIPRanges(id int) ([]subnet.ReservedIPRange, error)

GetReservedIPRanges fetches the reserved IPRange objects for the given Subnet

func (*Subnet) GetStatistics

func (s *Subnet) GetStatistics(id int) (*subnet.Statistics, error)

GetStatistics gets the stats of the given subnet

func (*Subnet) GetUnreservedIPRanges

func (s *Subnet) GetUnreservedIPRanges(id int) ([]subnet.IPRange, error)

GetUnreservedIPRanges gets the IPRange objects for allocation use

func (*Subnet) Update

func (s *Subnet) Update(id int, params *entity.SubnetParams) (*entity.Subnet, error)

Update updates the given Subnet

type Subnets

type Subnets struct {
	APIClient APIClient
}

Subnets contains functionality for manipulating the Subnets entity.

func (*Subnets) Create

func (s *Subnets) Create(params *entity.SubnetParams) (*entity.Subnet, error)

Create creates a new Subnet

func (*Subnets) Get

func (s *Subnets) Get() ([]entity.Subnet, error)

Get fetches a list of Subnet objects

type Tag

type Tag struct {
	APIClient APIClient
}

Tag implements api.Tag

func (*Tag) AddMachines

func (t *Tag) AddMachines(name string, machineIds []string) error

AddMachines adds a set of Machines to a given tag

func (*Tag) Delete

func (t *Tag) Delete(name string) error

Delete deletes a given tag

func (*Tag) Get

func (t *Tag) Get(name string) (*entity.Tag, error)

Get fetches a given tag by name

func (*Tag) GetMachines

func (t *Tag) GetMachines(name string) ([]entity.Machine, error)

GetMachines fetches a list of machines with a given tag

func (*Tag) RemoveMachines

func (t *Tag) RemoveMachines(name string, machineIds []string) error

RemoveMachines removes a set of Machines

func (*Tag) Update

func (t *Tag) Update(name string, tagParams *entity.TagParams) (*entity.Tag, error)

Update updates a given tag

type Tags

type Tags struct {
	APIClient APIClient
}

Tags implements api.Tags

func (*Tags) Create

func (t *Tags) Create(tagParams *entity.TagParams) (*entity.Tag, error)

Create creates a new Tag

func (*Tags) Get

func (t *Tags) Get() ([]entity.Tag, error)

Get fetches a list of Tag objects

type User

type User struct {
	APIClient APIClient
}

User implements api.User

func (*User) Delete

func (u *User) Delete(userName string) error

Delete deletes a given User

func (*User) Get

func (u *User) Get(userName string) (*entity.User, error)

Get fetches a User by username

type Users

type Users struct {
	APIClient APIClient
}

Users implements api.Users

func (*Users) Create

func (u *Users) Create(params *entity.UserParams) (*entity.User, error)

Create creates a new User

func (*Users) Get

func (u *Users) Get() ([]entity.User, error)

Get fetches a list of User objects

type VLAN

type VLAN struct {
	APIClient APIClient
}

VLAN implements api.VLAN

func (*VLAN) Delete

func (v *VLAN) Delete(fabricID int, vid int) error

Delete deletes a given VLAN

func (*VLAN) Get

func (v *VLAN) Get(fabricID int, vid int) (*entity.VLAN, error)

Get fetches a VLAN by fabric id and VLAN id

func (*VLAN) Update

func (v *VLAN) Update(fabricID int, vid int, params *entity.VLANParams) (*entity.VLAN, error)

Update updates a given VLAN

type VLANs

type VLANs struct {
	APIClient APIClient
}

VLANs implements api.VLANs

func (*VLANs) Create

func (v *VLANs) Create(fabricID int, params *entity.VLANParams) (*entity.VLAN, error)

Create creates a new VLAN

func (*VLANs) Get

func (v *VLANs) Get(fabricID int) ([]entity.VLAN, error)

Get fetches a list of VLAN objects

type VMHost

type VMHost struct {
	APIClient APIClient
	// contains filtered or unexported fields
}

VMHost contains functionality for manipulating the VMHost entity.

func (*VMHost) Compose

func (p *VMHost) Compose(id int, params *entity.VMHostMachineParams) (*entity.Machine, error)

Compose composes a VM on the given VMHost

func (*VMHost) Delete

func (p *VMHost) Delete(id int) error

Delete deletes a given VMHost

func (*VMHost) Get

func (p *VMHost) Get(id int) (*entity.VMHost, error)

Get fetches a given VMHost

func (*VMHost) GetParameters

func (p *VMHost) GetParameters(id int) (map[string]string, error)

GetParameters fetches the configured parameters of a given VMHost

func (*VMHost) Refresh

func (p *VMHost) Refresh(id int) (*entity.VMHost, error)

Refresh refreshes resource info and VM status of a given VMHost

func (*VMHost) Update

func (p *VMHost) Update(id int, params *entity.VMHostParams) (*entity.VMHost, error)

Update updates a given VMHost

type VMHosts

type VMHosts struct {
	APIClient APIClient
}

VMHosts contains functionality for manipulating the VMHosts entity.

func (*VMHosts) Create

func (p *VMHosts) Create(params *entity.VMHostParams) (*entity.VMHost, error)

Create creates a new VMHost

func (*VMHosts) Get

func (p *VMHosts) Get() ([]entity.VMHost, error)

Get fetches a list of VMHost objects

Jump to

Keyboard shortcuts

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