api

package
v0.0.0-...-e443136 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2023 License: Apache-2.0 Imports: 3 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 entity 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 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 NetworkInterface

type NetworkInterface interface {
	Delete(systemID string, id int) error
	Get(systemID string, id int) (*entity.NetworkInterface, error)
	AddTag(systemID string, id int, tag string) (*entity.NetworkInterface, error)
	Disconnect(systemID string, id int) (*entity.NetworkInterface, error)
	LinkSubnet(systemID string, id int, params *params.NetworkInterfaceLink) (*entity.NetworkInterface, error)
	RemoveTag(systemID string, id int, tag string) (*entity.NetworkInterface, error)
	SetDefaultGateway(systemID string, id, linkID int) (*entity.NetworkInterface, error)
	UnlinkSubnet(systemID string, id, linkID int) (*entity.NetworkInterface, error)
	Put(systemID string, id int, params interface{}) (*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 *params.NetworkInterfaceBond) (*entity.NetworkInterface, error)
	CreateBridge(systemID string, params *params.NetworkInterfaceBridge) (*entity.NetworkInterface, error)
	CreatePhysical(systemID string, params *params.NetworkInterfacePhysical) (*entity.NetworkInterface, error)
	CreateVLAN(systemID string, params *params.NetworkInterfaceVLAN) (*entity.NetworkInterface, error)
}

NetworkInterfaces represents the MaaS Server Interfaces endpoint

type RackControllers

type RackControllers interface {
	Get(*params.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, WithUsername, WithSummary bool) ([]subnet.IPAddress, error)
	GetReservedIPRanges(id int) ([]subnet.ReservedIPRange, error)
	GetStatistics(id int, IncludeRanges, IncludeSuggestions bool) (*subnet.Statistics, error)
	GetUnreservedIPRanges(id int) ([]subnet.IPRange, error)
	Put(id int, params *params.Subnet) (*entity.Subnet, error)
}

Subnet represents the MaaS Subnet endpoint

type Subnets

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

Subnets represents the MaaS Subnets endpoint

type VLANs

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

VLANs represents the MaaS Vlans endpoint

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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