client

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2024 License: Apache-2.0 Imports: 14 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 Account added in v0.3.0

type Account struct {
	APIClient APIClient
}

Account implements api.Account

func (*Account) CreateAuthorisationToken added in v0.3.0

func (a *Account) CreateAuthorisationToken(name string) (*entity.AuthorisationToken, error)

CreateAuthorisationToken creates authorisation token with provided name

func (*Account) DeleteAuthorisationToken added in v0.3.0

func (a *Account) DeleteAuthorisationToken(key string) error

DeleteAuthorisationToken deletes authorisation token with provided key

func (*Account) ListAuthorisationTokens added in v0.3.0

func (a *Account) ListAuthorisationTokens() ([]entity.AuthorisationTokenListItem, error)

ListAuthorisationTokens Lists authorisation tokens

func (*Account) UpdateTokenName added in v0.3.0

func (a *Account) UpdateTokenName(name, token string) error

UpdateTokenName updates given token with provided name

type BCache added in v0.2.0

type BCache struct {
	APIClient APIClient
}

BCache Contains functionality for manipulating the BCache entity.

func (*BCache) Delete added in v0.2.0

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

Delete BCache.

func (*BCache) Get added in v0.2.0

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

Get BCache details.

func (*BCache) Update added in v0.2.0

func (b *BCache) Update(systemID string, id int, params *entity.BCacheParams) (*entity.BCache, error)

Update BCache.

type BCacheCacheSet added in v0.2.0

type BCacheCacheSet struct {
	APIClient APIClient
}

BCacheCacheSet Contains functionality for manipulating the BCacheCacheSet entity.

func (*BCacheCacheSet) Delete added in v0.2.0

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

Delete BCacheCacheSet.

func (*BCacheCacheSet) Get added in v0.2.0

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

Get BCacheCacheSet details.

func (*BCacheCacheSet) Update added in v0.2.0

func (b *BCacheCacheSet) Update(systemID string, id int, params *entity.BCacheCacheSetParams) (*entity.BCacheCacheSet, error)

Update BCacheCacheSet.

type BCacheCacheSets added in v0.2.0

type BCacheCacheSets struct {
	APIClient APIClient
}

BCacheCacheSets contains functionality for manipulating the BCacheCacheSets entity.

func (*BCacheCacheSets) Create added in v0.2.0

func (b *BCacheCacheSets) Create(systemID string, params *entity.BCacheCacheSetParams) (*entity.BCacheCacheSet, error)

Create a BCacheCacheSet of a machine.

func (*BCacheCacheSets) Get added in v0.2.0

func (b *BCacheCacheSets) Get(systemID string) ([]entity.BCacheCacheSet, error)

Get BCacheCacheSets of a machine.

type BCaches added in v0.2.0

type BCaches struct {
	APIClient APIClient
}

BCaches contains functionality for manipulating the BCaches entity.

func (*BCaches) Create added in v0.2.0

func (b *BCaches) Create(systemID string, params *entity.BCacheParams) (*entity.BCache, error)

Create a BCache of a machine.

func (*BCaches) Get added in v0.2.0

func (b *BCaches) Get(systemID string) ([]entity.BCache, error)

Get BCaches of a machine.

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 BootResource added in v0.2.0

type BootResource struct {
	APIClient APIClient
}

BootResource implements api.BootResource

func (*BootResource) Delete added in v0.2.0

func (b *BootResource) Delete(id int) error

Delete deletes a given boot resource

func (*BootResource) Get added in v0.2.0

func (b *BootResource) Get(id int) (*entity.BootResource, error)

Get fetches a boot resource with a given id

type BootResources added in v0.2.0

type BootResources struct {
	APIClient APIClient
}

BootResources implements api.BootResources

func (*BootResources) Create added in v0.2.0

Create creates a new boot source

func (*BootResources) Get added in v0.2.0

Get fetches a list of boot resources

func (*BootResources) Import added in v0.2.0

func (b *BootResources) Import() error

Import imports boot resources to rack controllers

func (*BootResources) IsImporting added in v0.2.0

func (b *BootResources) IsImporting() (bool, error)

IsImporting returns importing status of boot resources importing to rack controllers

func (*BootResources) StopImport added in v0.2.0

func (b *BootResources) StopImport() error

StopImport stops importing boot resources to rack controllers

type BootSource added in v0.2.0

type BootSource struct {
	APIClient APIClient
}

BootSource implements api.BootSource

func (*BootSource) Delete added in v0.2.0

func (b *BootSource) Delete(id int) error

Delete deletes a given boot source

func (*BootSource) Get added in v0.2.0

func (b *BootSource) Get(id int) (*entity.BootSource, error)

Get fetches a boot source with a given id

func (*BootSource) Update added in v0.2.0

func (b *BootSource) Update(id int, params *entity.BootSourceParams) (*entity.BootSource, error)

Update updates a given boot source

type BootSourceSelection added in v0.2.0

type BootSourceSelection struct {
	APIClient APIClient
}

BootSourceSelection implements api.BootSourceSelection

func (*BootSourceSelection) Delete added in v0.2.0

func (b *BootSourceSelection) Delete(bootSourceID int, id int) error

Delete deletes a given BootSourceSelection

func (*BootSourceSelection) Get added in v0.2.0

func (b *BootSourceSelection) Get(bootSourceID int, id int) (*entity.BootSourceSelection, error)

Get fetches a BootSourceSelection for the given bootSourceID and BootSourceSelection id

func (*BootSourceSelection) Update added in v0.2.0

Update updates a given BootSourceSelection

type BootSourceSelections added in v0.2.0

type BootSourceSelections struct {
	APIClient APIClient
}

BootSourceSelections implements api.BootSourceSelections

func (*BootSourceSelections) Create added in v0.2.0

Create creates a BootSourceSelection object

func (*BootSourceSelections) Get added in v0.2.0

func (b *BootSourceSelections) Get(bootSourceID int) ([]entity.BootSourceSelection, error)

Get fetches a list of BootSourceSelection objects

type BootSources added in v0.2.0

type BootSources struct {
	APIClient APIClient
}

BootSources implements api.BootSources

func (*BootSources) Create added in v0.2.0

func (b *BootSources) Create(params *entity.BootSourceParams) (*entity.BootSource, error)

Create creates a new boot source

func (*BootSources) Get added in v0.2.0

func (b *BootSources) Get() ([]entity.BootSource, error)

Get fetches a list of boot sources

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
	Events                api.Events
	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
	NodeDevice            api.NodeDevice
	NodeDevices           api.NodeDevices
	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
	MAASServer            api.MAASServer
	PackageRepository     api.PackageRepository
	PackageRepositories   api.PackageRepositories
	BootSource            api.BootSource
	BootSources           api.BootSources
	BootSourceSelection   api.BootSourceSelection
	BootSourceSelections  api.BootSourceSelections
	BootResource          api.BootResource
	BootResources         api.BootResources
	Zone                  api.Zone
	Zones                 api.Zones
	BCache                api.BCache
	BCaches               api.BCaches
	BCacheCacheSet        api.BCacheCacheSet
	BCacheCacheSets       api.BCacheCacheSets
	SSHKey                api.SSHKey
	SSHKeys               api.SSHKeys
	SSLKey                api.SSLKey
	SSLKeys               api.SSLKeys
	Account               api.Account
}

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 GetClientWithTransport added in v0.4.0

func GetClientWithTransport(apiURL string, apiKey string, apiVersion string, tr http.RoundTripper) (*Client, error)

GetClientWithTransport creates a Client configured with the specified http.Transport

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) SetWorkloadAnnotations added in v0.2.0

func (d *Device) SetWorkloadAnnotations(systemID string, params map[string]string) (*entity.Device, error)

SetWorkloadAnnotations add, modify or remove workload annotations for given Device

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 Discoveries added in v0.4.0

type Discoveries struct {
	APIClient APIClient
}

Discoveries implements api.Discoveries

func (*Discoveries) Clear added in v0.4.0

func (d *Discoveries) Clear(params *entity.DiscoveryClearParams) error

Clear deletes all discovered neighbours and/or mDNS entries.

func (*Discoveries) ClearByMACAndIP added in v0.4.0

func (d *Discoveries) ClearByMACAndIP(mac, ip string) error

ClearByMACAndIP delete discoveries that match a MAC and IP

func (*Discoveries) Get added in v0.4.0

func (d *Discoveries) Get() ([]entity.Discovery, error)

Get complete discovery list

func (*Discoveries) GetByUnknownIP added in v0.4.0

func (d *Discoveries) GetByUnknownIP() ([]entity.Discovery, error)

GetByUnknownIP get discovery list with unknown IP

func (*Discoveries) GetByUnknownIPAndMAC added in v0.4.0

func (d *Discoveries) GetByUnknownIPAndMAC() ([]entity.Discovery, error)

GetByUnknownIPAndMAC get discovery list with unknown IP and MAC

func (*Discoveries) GetByUnknownMAC added in v0.4.0

func (d *Discoveries) GetByUnknownMAC() ([]entity.Discovery, error)

GetByUnknownMAC get discovery list with unknown MAC

type Discovery added in v0.4.0

type Discovery struct {
	APIClient APIClient
}

Discovery implements api.Discovery

func (*Discovery) Get added in v0.4.0

func (d *Discovery) Get(id string) (*entity.Discovery, error)

Get discovery by id

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 Events added in v0.3.0

type Events struct {
	APIClient APIClient
}

Events implements api.Events

func (*Events) Get added in v0.3.0

func (e *Events) Get(params *entity.EventParams) (*entity.EventsResp, error)

Get events for nodes

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 MAASServer added in v0.2.0

type MAASServer struct {
	APIClient APIClient
}

MAASServer contains functionality for manipulating the MAASServer entity.

func (*MAASServer) Get added in v0.2.0

func (m *MAASServer) Get(name string) ([]byte, error)

Get MAAS server configuration value.

func (*MAASServer) Post added in v0.2.0

func (m *MAASServer) Post(name, value string) error

Post (Set) MAAS server configuration value.

type Machine

type Machine struct {
	APIClient APIClient
}

Machine contains functionality for manipulating the Machine entity.

func (*Machine) Abort added in v0.2.0

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

Abort aborts machine's current operation

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) Details added in v0.3.0

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

func (*Machine) ExitRescueMode added in v0.2.0

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

ExitRescueMode exits the rescue mode process on a given 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) GetPowerState added in v0.2.0

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

GetPowerState of the machine

func (*Machine) GetToken added in v0.2.0

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

GetToken gets the machine token for a given machine

func (*Machine) Lock

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

Lock machine.

func (*Machine) MarkBroken added in v0.2.0

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

MarkBroken marks a machine as ‘Broken’

func (*Machine) MarkFixed added in v0.2.0

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

MarkFixed marks a machine as ‘Fixed’

func (*Machine) PowerOff added in v0.2.0

func (m *Machine) PowerOff(systemID string, params *entity.MachinePowerOffParams) (*entity.Machine, error)

PowerOff machine

func (*Machine) PowerOn added in v0.2.0

func (m *Machine) PowerOn(systemID string, params *entity.MachinePowerOnParams) (*entity.Machine, error)

PowerOn machine

func (*Machine) Release

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

Release machine.

func (*Machine) RescueMode added in v0.2.0

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

RescueMode begins the rescue mode process on a given machine

func (*Machine) SetWorkloadAnnotations added in v0.2.0

func (m *Machine) SetWorkloadAnnotations(systemID string, params map[string]string) (*entity.Machine, error)

SetWorkloadAnnotations add, modify or remove workload annotations for given Machine

func (*Machine) Unlock added in v0.2.0

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

Unlock marks a machine as ‘Unlocked’, to allow changes

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) ListAllocated added in v0.2.0

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

ListAllocated lists allocated 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 NodeDevice added in v0.4.0

type NodeDevice struct {
	APIClient APIClient
}

NodeDevice implements api.NodeDevice

func (*NodeDevice) Delete added in v0.4.0

func (a *NodeDevice) Delete(systemID string, id int) error

Delete deletes NodeDevice object with id for given systemID

func (*NodeDevice) Get added in v0.4.0

func (a *NodeDevice) Get(systemID string, id int) (*entity.NodeDevice, error)

Get fetches NodeDevice object with id for given systemID

type NodeDevices added in v0.4.0

type NodeDevices struct {
	APIClient APIClient
}

NodeDevices implements api.NodeDevices

func (*NodeDevices) Get added in v0.4.0

func (a *NodeDevices) Get(systemID string, param *entity.NodeDeviceParams) ([]entity.NodeDevice, error)

Get fetches a list of NodeDevice objects

type PackageRepositories added in v0.2.0

type PackageRepositories struct {
	APIClient APIClient
}

PackageRepositories implements api.PackageRepositories

func (*PackageRepositories) Create added in v0.2.0

func (p *PackageRepositories) Create(packageRepositoryParams *entity.PackageRepositoryParams) (*entity.PackageRepository, error)

Create creates a new PackageRepository

func (*PackageRepositories) Get added in v0.2.0

Get fetches a list of PackageRepositories

type PackageRepository added in v0.2.0

type PackageRepository struct {
	APIClient APIClient
}

PackageRepository implements api.PackageRepository

func (*PackageRepository) Delete added in v0.2.0

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

Delete deletes a given PackageRepository

func (*PackageRepository) Get added in v0.2.0

Get fetches a packageRepository

func (*PackageRepository) Update added in v0.2.0

func (p *PackageRepository) Update(id int, packageRepositoryParams *entity.PackageRepositoryParams) (*entity.PackageRepository, error)

Update updates a given PackageRepository

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) DeleteByName added in v0.4.0

func (r *ResourcePool) DeleteByName(name string) error

DeleteByName deletes a given ResourcePool

func (*ResourcePool) Get

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

Get fetches a given ResourcePool

func (*ResourcePool) GetByName added in v0.4.0

func (r *ResourcePool) GetByName(name string) (*entity.ResourcePool, error)

GetByName fetches a given ResourcePool

func (*ResourcePool) Update

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

Update updates a given ResourcePool

func (*ResourcePool) UpdateByName added in v0.4.0

func (r *ResourcePool) UpdateByName(name string, params *entity.ResourcePoolParams) (*entity.ResourcePool, error)

UpdateByName 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 SSHKey added in v0.3.0

type SSHKey struct {
	APIClient APIClient
}

SSHKey implements api.SSHKey

func (*SSHKey) Delete added in v0.3.0

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

Delete deletes a given SSHKey

func (*SSHKey) Get added in v0.3.0

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

Get fetches a given SSHKey

type SSHKeys added in v0.3.0

type SSHKeys struct {
	APIClient APIClient
}

SSHKeys implements api.SSHKeys

func (*SSHKeys) Create added in v0.3.0

func (s *SSHKeys) Create(key string) (*entity.SSHKey, error)

Create creates a new SSHKey

func (*SSHKeys) Get added in v0.3.0

func (s *SSHKeys) Get() ([]entity.SSHKey, error)

Get fetches a list of SSHKey objects

func (*SSHKeys) Import added in v0.3.0

func (s *SSHKeys) Import(keysource string) ([]entity.SSHKey, error)

Import creates a new SSHKey

type SSLKey added in v0.3.0

type SSLKey struct {
	APIClient APIClient
}

SSLKey implements api.SSLKey

func (*SSLKey) Delete added in v0.3.0

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

Delete deletes a given SSLKey

func (*SSLKey) Get added in v0.3.0

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

Get fetches a given SSLKey

type SSLKeys added in v0.3.0

type SSLKeys struct {
	APIClient APIClient
}

SSLKeys implements api.SSLKeys

func (*SSLKeys) Create added in v0.3.0

func (s *SSLKeys) Create(key string) (*entity.SSLKey, error)

Create creates a new SSLKey

func (*SSLKeys) Get added in v0.3.0

func (s *SSLKeys) Get() ([]entity.SSLKey, error)

Get fetches a list of SSLKey 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

type Zone added in v0.2.0

type Zone struct {
	APIClient APIClient
}

Zone Contains functionality for manipulating the Zone entity.

func (*Zone) Delete added in v0.2.0

func (z *Zone) Delete(name string) error

Delete Zone.

func (*Zone) Get added in v0.2.0

func (z *Zone) Get(name string) (*entity.Zone, error)

Get Zone details.

func (*Zone) Update added in v0.2.0

func (z *Zone) Update(name string, params *entity.ZoneParams) (*entity.Zone, error)

Update Zone.

type Zones added in v0.2.0

type Zones struct {
	APIClient APIClient
}

Zones implements api.Zones

func (*Zones) Create added in v0.2.0

func (z *Zones) Create(params *entity.ZoneParams) (*entity.Zone, error)

Create creates a new Zone

func (*Zones) Get added in v0.2.0

func (z *Zones) Get() ([]entity.Zone, error)

Get fetches a list of Zone objects

Jump to

Keyboard shortcuts

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