api

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2026 License: Apache-2.0 Imports: 2 Imported by: 3

Documentation

Overview

Package api defines an interface to each MAAS API endpoint.

Each interface correlates to one endpoint, such as Subnets for the Subnets endpoint (ie /subnets) and Subnet for the Subnet endpoint (eg subnets/<subnet_id>). API clients are expected to implement these interfaces to provide a normalized way of accessing the MAAS API with normalized results (eg the types defined in the endpoint package).

Some endpoint operations require multiple parameters, such as the Rack Controllers GET operation, which takes a number of QSP that can be used to filter results. These parameters are encapsulated in the params subpackage, providing a quick reference for performing API operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account interface {
	CreateAuthorisationToken(name string) (*entity.AuthorisationToken, error)
	DeleteAuthorisationToken(key string) error
	ListAuthorisationTokens() ([]entity.AuthorisationTokenListItem, error)
	UpdateTokenName(name, token string) error
}

Account is an interface for managing user account

type BCache

type BCache interface {
	Get(systemID string, id int) (*entity.BCache, error)
	Update(systemID string, id int, params *entity.BCacheParams) (*entity.BCache, error)
	Delete(systemID string, id int) error
}

BCache declares the API operations related to MAAS `nodes/{systemID}/bcache/{id}` endpoint.

type BCacheCacheSet

type BCacheCacheSet interface {
	Get(systemID string, id int) (*entity.BCacheCacheSet, error)
	Update(systemID string, id int, params *entity.BCacheCacheSetParams) (*entity.BCacheCacheSet, error)
	Delete(systemID string, id int) error
}

BCacheCacheSet declares the API operations related to MAAS `nodes/{systemID}/bcache-cache-set/{id}` endpoint.

type BCacheCacheSets

type BCacheCacheSets interface {
	Get(systemID string) ([]entity.BCacheCacheSet, error)
	Create(systemID string, params *entity.BCacheCacheSetParams) (*entity.BCacheCacheSet, error)
}

BCacheCacheSets declares the API operations related to MAAS `nodes/{systemID}/bcache-cache-sets` endpoint.

type BCaches

type BCaches interface {
	Get(systemID string) ([]entity.BCache, error)
	Create(systemID string, params *entity.BCacheParams) (*entity.BCache, error)
}

BCaches declares the API operations related to MAAS `nodes/{systemID}/bcaches` endpoint.

type BlockDevice

type BlockDevice interface {
	Get(systemID string, id int) (*entity.BlockDevice, error)
	Update(systemID string, id int, params *entity.BlockDeviceParams) (*entity.BlockDevice, error)
	Delete(systemID string, id int) error
	AddTag(systemID string, id int, tag string) (*entity.BlockDevice, error)
	RemoveTag(systemID string, id int, tag string) (*entity.BlockDevice, error)
	Format(systemID string, id int, fsType string) (*entity.BlockDevice, error)
	Unformat(systemID string, id int) (*entity.BlockDevice, error)
	Mount(systemID string, id int, mountPoint string, mountOptions string) (*entity.BlockDevice, error)
	Unmount(systemID string, id int) (*entity.BlockDevice, error)
	SetBootDisk(systemID string, id int) error
}

BlockDevice is an interface providing API behaviour for block devices

type BlockDevicePartition

type BlockDevicePartition interface {
	Get(systemID string, blockDeviceID int, id int) (*entity.BlockDevicePartition, error)
	Delete(systemID string, blockDeviceID int, id int) error
	AddTag(systemID string, blockDeviceID int, id int, tag string) (*entity.BlockDevicePartition, error)
	RemoveTag(systemID string, blockDeviceID int, id int, tag string) (*entity.BlockDevicePartition, error)
	Format(systemID string, blockDeviceID int, id int, fsType string, label string) (*entity.BlockDevicePartition, error)
	Unformat(systemID string, blockDeviceID int, id int) (*entity.BlockDevicePartition, error)
	Mount(systemID string, blockDeviceID int, id int, mountPoint string, mountOptions string) (*entity.BlockDevicePartition, error)
	Unmount(systemID string, blockDeviceID int, id int) (*entity.BlockDevicePartition, error)
}

BlockDevicePartition is an interface providing API behaviour for block device partitions

type BlockDevicePartitions

type BlockDevicePartitions interface {
	Get(systemID string, blockDeviceID int) ([]entity.BlockDevicePartition, error)
	Create(systemID string, blockDeviceID int, params *entity.BlockDevicePartitionParams) (*entity.BlockDevicePartition, error)
}

BlockDevicePartitions is an interface for listing and creating BlockDevicePartition records

type BlockDevices

type BlockDevices interface {
	Get(systemID string) ([]entity.BlockDevice, error)
	Create(systemID string, params *entity.BlockDeviceParams) (*entity.BlockDevice, error)
}

BlockDevices is an interface for listing and creating BlockDevice records

type BootResource

type BootResource interface {
	Get(id int) (*entity.BootResource, error)
	Delete(id int) error
}

BootResource is an interface defining API behaviour for boot resources

type BootResources

type BootResources interface {
	Get(params *entity.BootResourcesReadParams) ([]entity.BootResource, error)
	Create(params *entity.BootResourceParams) (*entity.BootResource, error)
	Import() error
	IsImporting() (bool, error)
	StopImport() error
}

BootResources is an interface for listing and creating BootResource objects

type BootSource

type BootSource interface {
	Get(id int) (*entity.BootSource, error)
	Update(id int, params *entity.BootSourceParams) (*entity.BootSource, error)
	Delete(id int) error
}

BootSource is an interface defining API behaviour for boot sources

type BootSourceSelection

type BootSourceSelection interface {
	Get(bootSourceID int, id int) (*entity.BootSourceSelection, error)
	Update(bootSourceID int, id int, params *entity.BootSourceSelectionParams) (*entity.BootSourceSelection, error)
	Delete(bootSourceID int, id int) error
}

BootSourceSelection is an interface defining API behaviour for boot source selections

type BootSourceSelections

type BootSourceSelections interface {
	Get(bootSourceID int) ([]entity.BootSourceSelection, error)
	Create(bootSourceID int, params *entity.BootSourceSelectionParams) (*entity.BootSourceSelection, error)
}

BootSourceSelections is an interface for listing and creating BootSourceSelection objects

type BootSources

type BootSources interface {
	Get() ([]entity.BootSource, error)
	Create(params *entity.BootSourceParams) (*entity.BootSource, error)
}

BootSources is an interface for listing and creating BootSource objects

type DNSResource

type DNSResource interface {
	Get(id int) (*entity.DNSResource, error)
	Update(id int, params *entity.DNSResourceParams) (*entity.DNSResource, error)
	Delete(id int) error
}

DNSResource is an interface defining API behaviour for DNS resources

type DNSResourceRecord

type DNSResourceRecord interface {
	Get(id int) (*entity.DNSResourceRecord, error)
	Update(id int, params *entity.DNSResourceRecordParams) (*entity.DNSResourceRecord, error)
	Delete(id int) error
}

DNSResourceRecord is an interface defining API behaviour for DNS resource records

type DNSResourceRecords

type DNSResourceRecords interface {
	Get(params *entity.DNSResourceRecordsParams) ([]entity.DNSResourceRecord, error)
	Create(params *entity.DNSResourceRecordParams) (*entity.DNSResourceRecord, error)
}

DNSResourceRecords is an interface for listing and creaing DNSResourceRecord records

type DNSResources

type DNSResources interface {
	Get(params *entity.DNSResourcesParams) ([]entity.DNSResource, error)
	Create(params *entity.DNSResourceParams) (*entity.DNSResource, error)
}

DNSResources is an interface for listing and creating DNSResource records

type Device

type Device interface {
	Get(systemID string) (*entity.Device, error)
	Update(systemID string, deviceParams *entity.DeviceUpdateParams) (*entity.Device, error)
	Delete(systemID string) error
	SetWorkloadAnnotations(systemID string, params map[string]string) (*entity.Device, error)
}

Device is an interface defining API behaviour for devices

type Devices

type Devices interface {
	Get() ([]entity.Device, error)
	Create(deviceParams *entity.DeviceCreateParams) (*entity.Device, error)
}

Devices is an interface for listing and creating Device objects

type Discoveries

type Discoveries interface {
	Get() ([]entity.Discovery, error)
	GetByUnknownIP() ([]entity.Discovery, error)
	GetByUnknownMAC() ([]entity.Discovery, error)
	GetByUnknownIpAndMAC() ([]entity.Discovery, error)
	Clear(params *entity.DiscoveryClearParams) error
	ClearByMACAndIP(mac, ip string) error
}

type Discovery

type Discovery interface {
	Get(id string) (*entity.Discovery, error)
}

type Domain

type Domain interface {
	Get(id int) (*entity.Domain, error)
	SetDefault(id int) (*entity.Domain, error)
	Update(id int, params *entity.DomainParams) (*entity.Domain, error)
	Delete(id int) error
}

Domain is an interface defining API behaviour for domain objects

type Domains

type Domains interface {
	Get() ([]entity.Domain, error)
	Create(params *entity.DomainParams) (*entity.Domain, error)
	SetSerial(serial int) error
}

Domains is an interface for listing and creaing Domain records

type Events

type Events interface {
	Get(params *entity.EventParams) (*entity.EventsResp, error)
}

Events is an interface for node events

type Fabric

type Fabric interface {
	Get(id int) (*entity.Fabric, error)
	Update(id int, fabricParams *entity.FabricParams) (*entity.Fabric, error)
	Delete(id int) error
}

Fabric is an interface defining API behaviour for fabric objects

type Fabrics

type Fabrics interface {
	Get() ([]entity.Fabric, error)
	Create(fabricParams *entity.FabricParams) (*entity.Fabric, error)
}

Fabrics is an interface for listing and creating Fabric records

type IPAddresses

type IPAddresses interface {
	Get(params *entity.IPAddressesParams) ([]entity.IPAddress, error)
	Release(params *entity.IPAddressesParams) error
	Reserve(params *entity.IPAddressesParams) (*entity.IPAddress, error)
}

IPAddresses is an interface defining API behaviour for IP addresses

type IPRange

type IPRange interface {
	Get(id int) (*entity.IPRange, error)
	Update(id int, params *entity.IPRangeParams) (*entity.IPRange, error)
	Delete(id int) error
}

IPRange is an interface defining API behaviour for IP ranges

type IPRanges

type IPRanges interface {
	Get() ([]entity.IPRange, error)
	Create(params *entity.IPRangeParams) (*entity.IPRange, error)
}

IPRanges is an interface for listing and creating IPRange records

type LicenseKey added in v0.13.0

type LicenseKey interface {
	Get(osystem string, distroSeries string) (*entity.LicenseKey, error)
	Update(osystem string, distroSeries string, params *entity.LicenseKeyParams) (*entity.LicenseKey, error)
	Delete(osystem string, distroSeries string) error
}

LicenseKey is an interface defining API behavior for LicenseKey objects

type LicenseKeys added in v0.13.0

type LicenseKeys interface {
	Get() ([]entity.LicenseKey, error)
	Create(params *entity.LicenseKeyParams) (*entity.LicenseKey, error)
}

LicenseKeys is an interface for listing and creating LicenseKey objects

type MAASServer

type MAASServer interface {
	Get(name string) (value []byte, err error)
	Post(name, value string) error
}

MAASServer represents the MAAS Server endpoint for changing global configuration settings

type Machine

type Machine interface {
	Get(systemID string) (*entity.Machine, error)
	Update(systemID string, machineParams *entity.MachineUpdateParams, powerParams map[string]interface{}) (*entity.Machine, error)
	Delete(systemID string) error
	Commission(systemID string, params *entity.MachineCommissionParams) (*entity.Machine, error)
	Deploy(systemID string, params *entity.MachineDeployParams) (*entity.Machine, error)
	Release(systemID string, params *entity.MachineReleaseParams) (*entity.Machine, error)
	Lock(systemID string, comment string) (*entity.Machine, error)
	Unlock(systemID string, comment string) (*entity.Machine, error)
	ClearDefaultGateways(systemID string) (*entity.Machine, error)
	GetPowerParameters(systemID string) (map[string]interface{}, error)
	PowerOn(systemID string, params *entity.MachinePowerOnParams) (*entity.Machine, error)
	PowerOff(systemID string, params *entity.MachinePowerOffParams) (*entity.Machine, error)
	GetPowerState(systemID string) (*entity.MachinePowerState, error)
	SetWorkloadAnnotations(systemID string, params map[string]string) (*entity.Machine, error)
	RescueMode(systemID string) (*entity.Machine, error)
	ExitRescueMode(systemID string) (*entity.Machine, error)
	Abort(systemID string, comment string) (*entity.Machine, error)
	MarkBroken(systemID string, comment string) (*entity.Machine, error)
	MarkFixed(systemID string, comment string) (*entity.Machine, error)
	GetToken(systemID string) (*entity.MachineToken, error)
	Details(systemID string) (*entity.MachineDetails, error)
	RestoreDefaultConfiguration(systemID string) error
	RestoreNetworkingConfiguration(systemID string) error
	RestoreStorageConfiguration(systemID string) error
	GetCurtinConfig(systemID string) (map[string]interface{}, error)
}

Machine is an interface defining API behaviour for Machine objects

type Machines

type Machines interface {
	Get(machinesParams *entity.MachinesParams) ([]entity.Machine, error)
	Create(machineParams *entity.MachineCreateParams, powerParams map[string]interface{}) (*entity.Machine, error)
	Allocate(params *entity.MachineAllocateParams) (*entity.Machine, error)
	AcceptAll() error
	Release(systemID []string, comment string) error
	ListAllocated() ([]entity.Machine, error)
}

Machines is an interface for listing, creating, allocating, bulk-accepting enlistments and releasing Machine records

type NetworkInterface

type NetworkInterface interface {
	Get(systemID string, id int) (*entity.NetworkInterface, error)
	Update(systemID string, id int, params *entity.NetworkInterfaceUpdateParams) (*entity.NetworkInterface, error)
	Delete(systemID string, id int) error
	Disconnect(systemID string, id int) (*entity.NetworkInterface, error)
	AddTag(systemID string, id int, tag string) (*entity.NetworkInterface, error)
	RemoveTag(systemID string, id int, tag string) (*entity.NetworkInterface, error)
	LinkSubnet(systemID string, id int, params *entity.NetworkInterfaceLinkParams) (*entity.NetworkInterface, error)
	UnlinkSubnet(systemID string, id int, linkID int) (*entity.NetworkInterface, error)
	SetDefaultGateway(systemID string, id int, linkID int) (*entity.NetworkInterface, error)
}

NetworkInterface represents the MAAS Server Interface endpoint

type NetworkInterfaces

type NetworkInterfaces interface {
	Get(systemID string) ([]entity.NetworkInterface, error)
	CreateBond(systemID string, params *entity.NetworkInterfaceBondParams) (*entity.NetworkInterface, error)
	CreateBridge(systemID string, params *entity.NetworkInterfaceBridgeParams) (*entity.NetworkInterface, error)
	CreatePhysical(systemID string, params *entity.NetworkInterfacePhysicalParams) (*entity.NetworkInterface, error)
	CreateVLAN(systemID string, params *entity.NetworkInterfaceVLANParams) (*entity.NetworkInterface, error)
}

NetworkInterfaces represents the MAAS Server Interfaces endpoint

type NodeDevice

type NodeDevice interface {
	Get(systemID string, id int) (*entity.NodeDevice, error)
	Delete(systemID string, id int) error
}

NodeDevice is an interface defining API behaviour for Node Devices

type NodeDevices

type NodeDevices interface {
	Get(systemID string, param *entity.NodeDeviceParams) ([]entity.NodeDevice, error)
}

NodeDevices is an interface for listing Node Devices objects

type NodeResults

type NodeResults interface {
	Get(systemID string, params *entity.NodeResultParams) ([]entity.NodeResult, error)
}

NodeResults is an interface for node script results

type NodeScript

type NodeScript interface {
	Get(name string, includeScript bool) (*entity.NodeScript, error)
	Update(name string, nodeScriptParams *entity.NodeScriptParams, script []byte) (*entity.NodeScript, error)
	Delete(name string) error
	AddTag(name string, tag string) (*entity.NodeScript, error)
	RemoveTag(name string, tag string) (*entity.NodeScript, error)
	Download(name string, revision int) ([]byte, error)
	Revert(name string, to int) (*entity.NodeScript, error)
}

NodeScript is an interface defining API behaviour for node scripts

type NodeScripts

type NodeScripts interface {
	Get(nodeScriptParams *entity.NodeScriptReadParams) ([]entity.NodeScript, error)
	Create(nodeScriptParams *entity.NodeScriptParams, script []byte) (*entity.NodeScript, error)
}

NodeScripts is an interface for listing and creating node script objects

type Notification added in v0.14.0

type Notification interface {
	Get(id int) (*entity.Notification, error)
	Update(id int, params *entity.NotificationParams) (*entity.Notification, error)
	Delete(id int) error
	Dismiss(id int) error
}

Notification is an interface defining API behavior for Notification objects

type Notifications added in v0.14.0

type Notifications interface {
	Get() ([]entity.Notification, error)
	Create(params *entity.NotificationParams) (*entity.Notification, error)
}

Notifications is an interface for listing and creating Notification objects

type PackageRepositories

type PackageRepositories interface {
	Get() ([]entity.PackageRepository, error)
	Create(params *entity.PackageRepositoryParams) (*entity.PackageRepository, error)
}

PackageRepositories is an interface for listing and creating Package Repository records

type PackageRepository

type PackageRepository interface {
	Get(id int) (*entity.PackageRepository, error)
	Update(id int, params *entity.PackageRepositoryParams) (*entity.PackageRepository, error)
	Delete(id int) error
}

PackageRepository represents the MAAS Server Package Repository endpoint

type RAID

type RAID interface {
	Get(systemID string, id int) (raid *entity.RAID, err error)
	Update(systemID string, id int, params *entity.RAIDUpdateParams) (raid *entity.RAID, err error)
	Delete(systemID string, id int) (err error)
}

RAID declares the API operations related to MAAS `nodes/{systemID}/raid/{id}` endpoint.

type RAIDs

type RAIDs interface {
	Get(systemID string) (raids []entity.RAID, err error)
	Create(systemID string, params *entity.RAIDCreateParams) (raid *entity.RAID, err error)
}

RAIDs declares the API operations related to MAAS `nodes/{systemID}/raids` endpoint.

type RackController

type RackController interface {
	Get(systemID string) (*entity.RackController, error)
	Update(systemID string, machineParams *entity.RackControllerParams, powerParams map[string]interface{}) (*entity.RackController, error)
	Delete(systemID string) error
	GetPowerParameters(systemID string) (map[string]interface{}, error)
	PowerOn(systemID string, params *entity.RackControllerPowerOnParams) (*entity.RackController, error)
	PowerOff(systemID string, params *entity.RackControllerPowerOffParams) (*entity.RackController, error)
	GetPowerState(systemID string) (*entity.RackControllerPowerState, error)
	Abort(systemID string, comment string) (*entity.RackController, error)
	Details(systemID string) (*entity.RackControllerDetails, error)
	OverrideFailedTesting(systemID string, comment string) (*entity.RackController, error)
	Test(systemID string, params map[string]interface{}) (*entity.RackController, error)
}

RackController represents the MAAS Rack Controller endpoint

type RackControllers

type RackControllers interface {
	DescribePowerTypes() ([]entity.PowerType, error)
	IsRegistered(macAddress string) (bool, error)
	GetPowerParameters(systemIDs []string) (map[string]interface{}, error)
	Get(*entity.RackControllersGetParams) ([]entity.RackController, error)
	SetZone(*entity.RackControllerSetZoneParams) error
}

RackControllers represents the MAAS Rack Controllers endpoint

type ReservedIP added in v0.20.0

type ReservedIP interface {
	Get(id int) (*entity.ReservedIP, error)
	Update(id int, params *entity.ReservedIPUpdateParams) (*entity.ReservedIP, error)
	Delete(id int) error
}

ReservedIP is an interface defining API behavior for reserved IP objects

type ReservedIPs added in v0.20.0

type ReservedIPs interface {
	Get() ([]entity.ReservedIP, error)
	Create(params *entity.ReservedIPCreateParams) (*entity.ReservedIP, error)
}

ReservedIPs is an interface for listing and creating ReservedIP records

type ResourcePool

type ResourcePool interface {
	Get(id int) (*entity.ResourcePool, error)
	Update(id int, params *entity.ResourcePoolParams) (*entity.ResourcePool, error)
	Delete(id int) error
	GetByName(name string) (*entity.ResourcePool, error)
	UpdateByName(name string, params *entity.ResourcePoolParams) (*entity.ResourcePool, error)
	DeleteByName(name string) error
}

ResourcePool is an interface defining API behaviour for ResourcePool objects

type ResourcePools

type ResourcePools interface {
	Get() ([]entity.ResourcePool, error)
	Create(params *entity.ResourcePoolParams) (*entity.ResourcePool, error)
}

ResourcePools is an interface for listing and creating ResourcePool records

type SSHKey

type SSHKey interface {
	Get(id int) (*entity.SSHKey, error)
	Delete(id int) error
}

SSHKey is an interface defining API behaviour for SSHKey objects

type SSHKeys

type SSHKeys interface {
	Get() ([]entity.SSHKey, error)
	Create(key string) (*entity.SSHKey, error)
	Import(keysource string) ([]entity.SSHKey, error)
}

SSHKeys is an interface for listing and creating SSHKey objects

type SSLKey

type SSLKey interface {
	Get(id int) (*entity.SSLKey, error)
	Delete(id int) error
}

SSLKey is an interface defining API behaviour for SSLKey objects

type SSLKeys

type SSLKeys interface {
	Get() ([]entity.SSLKey, error)
	Create(key string) (*entity.SSLKey, error)
}

SSLKeys is an interface for listing and creating SSLKey objects

type Space

type Space interface {
	Get(id int) (*entity.Space, error)
	Update(id int, name string) (*entity.Space, error)
	Delete(id int) error
}

Space is an interface defining API behaviour for Space objects

type Spaces

type Spaces interface {
	Get() ([]entity.Space, error)
	Create(name string) (*entity.Space, error)
}

Spaces is an interface for listing and creating Space objects

type StaticRoute added in v0.10.0

type StaticRoute interface {
	Get(id int) (*entity.StaticRoute, error)
	Update(id int, params *entity.StaticRouteParams) (*entity.StaticRoute, error)
	Delete(id int) error
}

StaticRoute is an interface defining API behavior for StaticRoute objects

type StaticRoutes added in v0.10.0

type StaticRoutes interface {
	Get() ([]entity.StaticRoute, error)
	Create(params *entity.StaticRouteParams) (*entity.StaticRoute, error)
}

StaticRoutes is an interface for listing and creating StaticRoutes records

type Subnet

type Subnet interface {
	Delete(id int) error
	Get(id int) (*entity.Subnet, error)
	GetIPAddresses(id int) ([]subnet.IPAddress, error)
	GetReservedIPRanges(id int) ([]subnet.ReservedIPRange, error)
	GetStatistics(id int) (*subnet.Statistics, error)
	GetUnreservedIPRanges(id int) ([]subnet.IPRange, error)
	Update(id int, params *entity.SubnetParams) (*entity.Subnet, error)
}

Subnet represents the MAAS Subnet endpoint

type Subnets

type Subnets interface {
	Get() ([]entity.Subnet, error)
	Create(params *entity.SubnetParams) (*entity.Subnet, error)
}

Subnets represents the MAAS Subnets endpoint

type Tag

type Tag interface {
	Get(name string) (*entity.Tag, error)
	Update(name string, tagParams *entity.TagParams) (*entity.Tag, error)
	Delete(name string) error
	GetMachines(name string) ([]entity.Machine, error)
	AddMachines(name string, machineIds []string) error
	RemoveMachines(name string, machineIds []string) error
}

Tag is an interface defining API behaviour for Tag objects

type Tags

type Tags interface {
	Get() ([]entity.Tag, error)
	Create(tagParams *entity.TagParams) (*entity.Tag, error)
}

Tags is an interface for listing and creating Tag objects

type User

type User interface {
	Get(userName string) (*entity.User, error)
	Delete(params *entity.UserDeleteParams) error
}

User is an interface for getting and deleting users

type Users

type Users interface {
	Get() ([]entity.User, error)
	Create(params *entity.UserParams) (*entity.User, error)
	Whoami() (*entity.User, error)
}

Users is an interface for listing and creating users

type VLAN

type VLAN interface {
	Get(fabricID int, vid int) (*entity.VLAN, error)
	Update(fabricID int, vid int, params *entity.VLANParams) (*entity.VLAN, error)
	Delete(fabricID int, vid int) error
}

VLAN is an interface defining API behaviour for VLAN objects

type VLANs

type VLANs interface {
	Get(fabricID int) ([]entity.VLAN, error)
	Create(fabricID int, params *entity.VLANParams) (*entity.VLAN, error)
}

VLANs represents the MAAS Vlans endpoint

type VMHost

type VMHost interface {
	Get(id int) (*entity.VMHost, error)
	Update(id int, params *entity.VMHostParams) (*entity.VMHost, error)
	Delete(id int) error
	Compose(id int, params *entity.VMHostMachineParams) (*entity.Machine, error)
	Refresh(id int) (*entity.VMHost, error)
	GetParameters(id int) (map[string]string, error)
}

VMHost is an interface defining API behaviour for VMHost objects

type VMHosts

type VMHosts interface {
	Get() ([]entity.VMHost, error)
	Create(params *entity.VMHostParams) (*entity.VMHost, error)
}

VMHosts is an interface for listing and creating VMHost objects

type Version

type Version interface {
	Get() (*entity.Version, error)
}

Version is an interface for listing MAAS version details

type VolumeGroup added in v0.8.0

type VolumeGroup interface {
	Get(systemID string, id int) (*entity.VolumeGroup, error)
	Update(systemID string, id int, params *entity.VolumeGroupUpdateParams) (*entity.VolumeGroup, error)
	Delete(systemID string, id int) error
	CreateLogicalVolume(systemID string, id int, params *entity.LogicalVolumeParams) (*entity.BlockDevice, error)
	DeleteLogicalVolume(ssytemID string, id int, logicalVolumeID int) error
}

VolumeGroup is an interface providing API behaviour for volume groups

type VolumeGroups added in v0.8.0

type VolumeGroups interface {
	Get(systemID string) ([]entity.VolumeGroup, error)
	Create(systemID string, params *entity.VolumeGroupCreateParams) (*entity.VolumeGroup, error)
}

VolumeGroups is an interface for listing and creating VolumeGroup records

type Zone

type Zone interface {
	Get(name string) (*entity.Zone, error)
	Update(name string, params *entity.ZoneParams) (*entity.Zone, error)
	Delete(name string) error
}

Zone is an interface defining API behaviour for zones

type Zones

type Zones interface {
	Get() ([]entity.Zone, error)
	Create(params *entity.ZoneParams) (*entity.Zone, error)
}

Zones is an interface for listing and creating Zone objects

Jump to

Keyboard shortcuts

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