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 ¶
- type BlockDevice
- type BlockDevicePartition
- type BlockDevicePartitions
- type BlockDevices
- type DNSResource
- type DNSResourceRecord
- type DNSResourceRecords
- type DNSResources
- type Domain
- type Domains
- type Fabric
- type Fabrics
- type IPAddresses
- type IPRange
- type IPRanges
- type MAASServer
- type Machine
- type Machines
- type NetworkInterface
- type NetworkInterfaces
- type RackControllers
- type Space
- type Spaces
- type Subnet
- type Subnets
- type Tag
- type Tags
- type User
- type Users
- type VLAN
- type VLANs
- type VMHost
- type VMHosts
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 IPAddresses ¶
type IPAddresses interface { Get(params *entity.IPAddressesParams) ([]entity.IPAddress, error) Release(params *entity.IPAddressesParams) error Reserve(params *entity.IPAddressesParams) (*entity.IPAddress, 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 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 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 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) }
Source Files ¶
- api.go
- block_device.go
- block_device_partition.go
- block_device_partitions.go
- block_devices.go
- dns_resource.go
- dns_resource_record.go
- dns_resource_records.go
- dns_resources.go
- domain.go
- domains.go
- fabric.go
- fabrics.go
- ip_addresses.go
- ip_range.go
- ip_ranges.go
- maas_server.go
- machine.go
- machines.go
- network_interface.go
- network_interfaces.go
- rack_controllers.go
- space.go
- spaces.go
- subnet.go
- subnets.go
- tag.go
- tags.go
- user.go
- users.go
- vlan.go
- vlans.go
- vm_host.go
- vm_hosts.go