api

package
v0.0.0-...-a2cb0ab Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

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 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
}

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)
}

type BlockDevicePartitions

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

type BlockDevices

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

type DNSResource

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

type DNSResourceRecord

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

type DNSResourceRecords

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

type DNSResources

type DNSResources interface {
	Get() ([]entity.DNSResource, error)
	Create(params *entity.DNSResourceParams) (*entity.DNSResource, 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
}

type Domains

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

type Fabric

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

type Fabrics

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

type IPAddresses

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

type IPRange

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

type IPRanges

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

type MAASServer

type MAASServer interface {
	Get(name string) (value string, 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.MachineParams, powerParams map[string]string) (*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)
	Lock(systemID string, comment string) (*entity.Machine, error)
	ClearDefaultGateways(systemID string) (*entity.Machine, error)
	GetPowerParameters(systemID string) (map[string]string, error)
}

type Machines

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

type NetworkInterface

type NetworkInterface interface {
	Get(systemID string, id int) (*entity.NetworkInterface, error)
	Update(systemID string, id int, params interface{}) (*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 RackControllers

type RackControllers interface {
	Get(*entity.RackControllerSearch) ([]entity.RackController, error)
}

RackControllers represents the MaaS Rack Controllers endpoint

type Space

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

type Spaces

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

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
}

type Tags

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

type User

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

type Users

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

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
}

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)
}

type VMHosts

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

Jump to

Keyboard shortcuts

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