Versions in this module Expand all Collapse all v2 v2.3.0 Jun 7, 2024 Changes in this version type MAASObject + func (obj MAASObject) UpdateFiles(params url.Values, files map[string][]byte) (MAASObject, error) v2.2.0 Oct 12, 2023 v2.1.0 Sep 11, 2023 v2.0.2 Mar 17, 2023 v2.0.1 Jan 19, 2023 v2.0.0 Jun 21, 2022 Changes in this version + const DevicesManagement + const IPv6DeploymentUbuntu + const NetworkDeploymentUbuntu + const NetworksManagement + const NodeStatusAllocated + const NodeStatusBroken + const NodeStatusCommissioning + const NodeStatusDeclared + const NodeStatusDeployed + const NodeStatusDeploying + const NodeStatusDiskErasing + const NodeStatusFailedDeployment + const NodeStatusFailedDiskErasing + const NodeStatusFailedReleasing + const NodeStatusFailedTests + const NodeStatusMissing + const NodeStatusReady + const NodeStatusReleasing + const NodeStatusReserved + const NodeStatusRetired + const NumberOfRetries + const RetryAfterHeaderName + const StaticIPAddresses + const StorageDeploymentUbuntu + var NotImplemented = errors.New("Not implemented") + func AddAPIVersionToURL(BaseURL, apiVersion string) string + func EnsureTrailingSlash(URL string) string + func InternalError(w http.ResponseWriter, r *http.Request, err error) + func IsBadRequestError(err error) bool + func IsCannotCompleteError(err error) bool + func IsDeserializationError(err error) bool + func IsNoMatchError(err error) bool + func IsPermissionError(err error) bool + func IsUnexpectedError(err error) bool + func IsUnsupportedVersionError(err error) bool + func JoinURLs(baseURL, path string) string + func NameOrIDToID(v string, nameToID map[string]uint, minID, maxID uint) (ID uint, err error) + func NewBadRequestError(message string) error + func NewCannotCompleteError(message string) error + func NewDeserializationError(format string, args ...interface{}) error + func NewNoMatchError(message string) error + func NewPermissionError(message string) error + func NewUnexpectedError(err error) error + func NewUnsupportedVersionError(format string, args ...interface{}) error + func PrettyJsonWriter(thing interface{}, w http.ResponseWriter) + func SplitVersionedURL(url string) (string, string, bool) + func WrapWithDeserializationError(err error, format string, args ...interface{}) error + func WrapWithUnsupportedVersionError(err error) error + type AddFileArgs struct + Content []byte + Filename string + Length int64 + Reader io.Reader + func (a *AddFileArgs) Validate() error + type AddressRange struct + End string + NumAddresses uint + Purpose []string + Start string + type AddressRangeList struct + func (ranges *AddressRangeList) Append(startIP, endIP IP) + type AllocateMachineArgs struct + AgentName string + Architecture string + Comment string + DryRun bool + Hostname string + Interfaces []InterfaceSpec + MinCPUCount int + MinMemory int + NotInPool []string + NotInZone []string + NotSpace []string + NotTags []string + Pool string + Storage []StorageSpec + SystemId string + Tags []string + Zone string + func (a *AllocateMachineArgs) Validate() error + type BadRequestError struct + type BlockDevice interface + BlockSize func() uint64 + IDPath func() string + Model func() string + Name func() string + Partitions func() []Partition + UsedSize func() uint64 + type BootResource interface + Architecture func() string + ID func() int + KernelFlavor func() string + Name func() string + SubArchitectures func() set.Strings + Type func() string + type CannotCompleteError struct + type Client struct + APIURL *url.URL + HTTPClient *http.Client + Signer OAuthSigner + func NewAnonymousClient(BaseURL string, apiVersion string) (*Client, error) + func NewAuthenticatedClient(versionedURL, apiKey string) (*Client, error) + func (client Client) Delete(uri *url.URL) error + func (client Client) Get(uri *url.URL, operation string, parameters url.Values) ([]byte, error) + func (client Client) GetURL(uri *url.URL) *url.URL + func (client Client) Post(uri *url.URL, operation string, parameters url.Values, files map[string][]byte) ([]byte, error) + func (client Client) Put(uri *url.URL, parameters url.Values) ([]byte, error) + type ConstraintMatches struct + Interfaces map[string][]Interface + Storage map[string][]StorageDevice + type Controller interface + APIVersionInfo func() (string, string, error) + AddFile func(AddFileArgs) error + AllocateMachine func(AllocateMachineArgs) (Machine, ConstraintMatches, error) + BootResources func() ([]BootResource, error) + Capabilities func() set.Strings + CreateDevice func(CreateDeviceArgs) (Device, error) + Devices func(DevicesArgs) ([]Device, error) + Domains func() ([]Domain, error) + Fabrics func() ([]Fabric, error) + Files func(prefix string) ([]File, error) + GetFile func(filename string) (File, error) + Machines func(MachinesArgs) ([]Machine, error) + Pools func() ([]Pool, error) + ReleaseMachines func(ReleaseMachinesArgs) error + Spaces func() ([]Space, error) + StaticRoutes func() ([]StaticRoute, error) + Tags func() ([]Tag, error) + Zones func() ([]Zone, error) + func NewController(args ControllerArgs) (Controller, error) + type ControllerArgs struct + APIKey string + BaseURL string + HTTPClient *http.Client + type CreateDeviceArgs struct + Domain string + Hostname string + MACAddresses []string + Parent string + type CreateInterfaceArgs struct + AcceptRA bool + Autoconf bool + MACAddress string + MTU int + Name string + Tags []string + VLAN VLAN + func (a *CreateInterfaceArgs) Validate() error + type CreateMachineDeviceArgs struct + Domain string + Hostname string + InterfaceName string + MACAddress string + Subnet Subnet + VLAN VLAN + func (a *CreateMachineDeviceArgs) Validate() error + type CreateSpace struct + Name string + type CreateStaticRoute struct + DestinationCIDR string + GatewayIP string + Metric uint + SourceCIDR string + type CreateSubnet struct + CIDR string + DNSServers []string + Fabric *uint + GatewayIP string + ID uint + Name string + Space string + VID *uint + VLAN *uint + type DeserializationError struct + type Device interface + CreateInterface func(CreateInterfaceArgs) (Interface, error) + Delete func() error + FQDN func() string + Hostname func() string + IPAddresses func() []string + InterfaceSet func() []Interface + Owner func() string + Parent func() string + Pool func() Pool + SystemID func() string + Zone func() Zone + type DevicesArgs struct + AgentName string + Domain string + Hostname []string + MACAddresses []string + Pool string + SystemIDs []string + Zone string + type Domain interface + Name func() string + type Fabric interface + ClassType func() string + ID func() int + Name func() string + VLANs func() []VLAN + type File interface + AnonymousURL func() string + Delete func() error + Filename func() string + ReadAll func() ([]byte, error) + type FileSystem interface + Label func() string + MountPoint func() string + Type func() string + UUID func() string + type IP struct + Purpose []string + func IPFromInt64(v uint64) IP + func IPFromNetIP(netIP net.IP) IP + func IPFromString(v string) IP + func (ip *IP) SetUInt64(v uint64) + func (ip IP) String() string + func (ip IP) To16() net.IP + func (ip IP) To4() net.IP + func (ip IP) UInt64() uint64 + type Interface interface + Children func() []string + Delete func() error + EffectiveMTU func() int + Enabled func() bool + ID func() int + LinkSubnet func(LinkSubnetArgs) error + Links func() []Link + MACAddress func() string + Name func() string + Parents func() []string + Tags func() []string + Type func() string + UnlinkSubnet func(Subnet) error + Update func(UpdateInterfaceArgs) error + VLAN func() VLAN + type InterfaceLinkMode string + const LinkModeDHCP + const LinkModeLinkUp + const LinkModeStatic + type InterfaceSpec struct + Label string + Space string + func (a *InterfaceSpec) String() string + func (a *InterfaceSpec) Validate() error + type JSONObject struct + func JSONObjectFromStruct(client Client, input interface{}) (JSONObject, error) + func Parse(client Client, input []byte) (JSONObject, error) + func (obj JSONObject) GetArray() (value []JSONObject, err error) + func (obj JSONObject) GetBool() (value bool, err error) + func (obj JSONObject) GetBytes() ([]byte, error) + func (obj JSONObject) GetFloat64() (value float64, err error) + func (obj JSONObject) GetMAASObject() (MAASObject, error) + func (obj JSONObject) GetMap() (value map[string]JSONObject, err error) + func (obj JSONObject) GetString() (value string, err error) + func (obj JSONObject) IsNil() bool + func (obj JSONObject) MarshalJSON() ([]byte, error) + type Link interface + ID func() int + IPAddress func() string + Mode func() string + Subnet func() Subnet + type LinkSubnetArgs struct + DefaultGateway bool + IPAddress string + Mode InterfaceLinkMode + Subnet Subnet + func (a *LinkSubnetArgs) Validate() error + type MAASObject struct + func NewMAAS(client Client) *MAASObject + func (obj MAASObject) CallGet(operation string, params url.Values) (JSONObject, error) + func (obj MAASObject) CallPost(operation string, params url.Values) (JSONObject, error) + func (obj MAASObject) CallPostFiles(operation string, params url.Values, files map[string][]byte) (JSONObject, error) + func (obj MAASObject) Delete() error + func (obj MAASObject) Get() (MAASObject, error) + func (obj MAASObject) GetField(name string) (string, error) + func (obj MAASObject) GetMap() map[string]JSONObject + func (obj MAASObject) GetSubObject(name string) MAASObject + func (obj MAASObject) MarshalJSON() ([]byte, error) + func (obj MAASObject) Post(params url.Values) (JSONObject, error) + func (obj MAASObject) URI() *url.URL + func (obj MAASObject) URL() *url.URL + func (obj MAASObject) Update(params url.Values) (MAASObject, error) + type Machine interface + Architecture func() string + BlockDevice func(id int) BlockDevice + BlockDevices func() []BlockDevice + BootInterface func() Interface + CPUCount func() int + CreateDevice func(CreateMachineDeviceArgs) (Device, error) + Devices func(DevicesArgs) ([]Device, error) + DistroSeries func() string + FQDN func() string + HardwareInfo func() map[string]string + Hostname func() string + IPAddresses func() []string + Interface func(id int) Interface + InterfaceSet func() []Interface + Memory func() int + OperatingSystem func() string + Partition func(id int) Partition + PhysicalBlockDevice func(id int) BlockDevice + PhysicalBlockDevices func() []BlockDevice + Pool func() Pool + PowerState func() string + Start func(StartArgs) error + StatusMessage func() string + StatusName func() string + SystemID func() string + Tags func() []string + Zone func() Zone + type MachinesArgs struct + AgentName string + Domain string + Hostnames []string + MACAddresses []string + OwnerData map[string]string + Pool string + SystemIDs []string + Tags []string + Zone string + type NetworkLink struct + ID uint + Mode string + Subnet *TestSubnet + type NoMatchError struct + type Node struct + Interfaces []NodeNetworkInterface + SystemID string + type NodeNetworkInterface struct + Links []NetworkLink + Name string + type OAuthSigner interface + OAuthSign func(request *http.Request) error + func NewPlainTestOAuthSigner(token *OAuthToken, realm string) (OAuthSigner, error) + type OAuthToken struct + ConsumerKey string + ConsumerSecret string + TokenKey string + TokenSecret string + type OwnerDataHolder interface + OwnerData func() map[string]string + SetOwnerData func(map[string]string) error + type Partition interface + type PermissionError struct + type Pool interface + Description func() string + Name func() string + type PostedVLAN struct + Name string + VID uint + type ReleaseMachinesArgs struct + Comment string + SystemIDs []string + type ServerError struct + BodyMessage string + Header http.Header + StatusCode int + func GetServerError(err error) (ServerError, bool) + type SimpleTestServer struct + func NewSimpleServer() *SimpleTestServer + func (s *SimpleTestServer) AddDeleteResponse(path string, status int, body string) + func (s *SimpleTestServer) AddGetResponse(path string, status int, body string) + func (s *SimpleTestServer) AddPostResponse(path string, status int, body string) + func (s *SimpleTestServer) AddPutResponse(path string, status int, body string) + func (s *SimpleTestServer) LastNRequests(n int) []*http.Request + func (s *SimpleTestServer) LastRequest() *http.Request + func (s *SimpleTestServer) RequestCount() int + func (s *SimpleTestServer) ResetRequests() + type Space interface + ID func() int + Name func() string + Subnets func() []Subnet + type StartArgs struct + Comment string + DistroSeries string + Kernel string + UserData string + type StaticRoute interface + Destination func() Subnet + GatewayIP func() string + Metric func() int + Source func() Subnet + type StorageDevice interface + FileSystem func() FileSystem + ID func() int + Path func() string + Size func() uint64 + Tags func() []string + Type func() string + UUID func() string + UsedFor func() string + type StorageSpec struct + Label string + Size int + Tags []string + func (s *StorageSpec) String() string + func (s *StorageSpec) Validate() error + type Subnet interface + CIDR func() string + DNSServers func() []string + Gateway func() string + ID func() int + Name func() string + Space func() string + VLAN func() VLAN + type SubnetStats struct + LargestAvailable uint + NumAvailable uint + NumUnavailable uint + Ranges []AddressRange + TotalAddresses uint + Usage float32 + UsageString string + type Tag interface + Comment func() string + Definition func() string + KernelOpts func() string + Name func() string + type TestDevice struct + APIVersion string + Hostname string + IPAddresses []string + MACAddresses []string + Parent string + SystemId string + type TestMAASObject struct + TestServer *TestServer + func NewTestMAAS(version string) *TestMAASObject + func (testMAASObject *TestMAASObject) Close() + type TestServer struct + func NewTestServer(version string) *TestServer + func (server *TestServer) AddBootImage(nodegroupUUID string, jsonText string) + func (server *TestServer) AddDevice(device *TestDevice) + func (server *TestServer) AddFixedAddressRange(subnetID uint, ar AddressRange) + func (server *TestServer) AddNodeDetails(systemId, xmlText string) + func (server *TestServer) AddTag(name, comment string) + func (server *TestServer) AddZone(name, description string) + func (server *TestServer) ChangeNode(systemId, key, value string) + func (server *TestServer) Clear() + func (server *TestServer) ConnectNodeToNetwork(systemId, name string) + func (server *TestServer) ConnectNodeToNetworkWithMACAddress(systemId, networkName, macAddress string) + func (server *TestServer) Devices() map[string]*TestDevice + func (server *TestServer) Files() map[string]MAASObject + func (server *TestServer) IPAddresses() map[string][]string + func (server *TestServer) NewFile(filename string, filecontent []byte) MAASObject + func (server *TestServer) NewIPAddress(ipAddress, networkOrSubnet string) + func (server *TestServer) NewNetwork(jsonText string) MAASObject + func (server *TestServer) NewNode(jsonText string) MAASObject + func (server *TestServer) NewNodegroupInterface(uuid, jsonText string) JSONObject + func (server *TestServer) NewSpace(spaceJSON io.Reader) *TestSpace + func (server *TestServer) NewStaticRoute(staticRouteJSON io.Reader) *TestStaticRoute + func (server *TestServer) NewSubnet(subnetJSON io.Reader) *TestSubnet + func (server *TestServer) NodeOperationRequestValues() map[string][]url.Values + func (server *TestServer) NodeOperations() map[string][]string + func (server *TestServer) Nodes() map[string]MAASObject + func (server *TestServer) NodesOperationRequestValues() []url.Values + func (server *TestServer) NodesOperations() []string + func (server *TestServer) OwnedNodes() map[string]bool + func (server *TestServer) RemoveIPAddress(ipAddress string) bool + func (server *TestServer) SetNodeNetworkLink(SystemID string, nodeNetworkInterface NodeNetworkInterface) + func (server *TestServer) SetVersionJSON(json string) + func (server *TestServer) UpdateSubnet(subnetJSON io.Reader) TestSubnet + type TestSpace struct + ID uint + Name string + ResourceURI string + Subnets []TestSubnet + type TestStaticRoute struct + Destination TestSubnet + GatewayIP string + ID uint + Metric uint + ResourceURI string + Source TestSubnet + type TestSubnet struct + CIDR string + DNSServers []string + FixedAddressRanges []AddressRange + GatewayIP string + ID uint + InUseIPAddresses []IP + Name string + ResourceURI string + Space string + VLAN TestVLAN + type TestVLAN struct + Fabric string + ID uint + Name string + ResourceURI string + VID uint + type URLParams struct + Values url.Values + func NewURLParams() *URLParams + func (p *URLParams) MaybeAdd(name, value string) + func (p *URLParams) MaybeAddBool(name string, value bool) + func (p *URLParams) MaybeAddInt(name string, value int) + func (p *URLParams) MaybeAddMany(name string, values []string) + type UnexpectedError struct + type UnsupportedVersionError struct + type UpdateInterfaceArgs struct + MACAddress string + Name string + VLAN VLAN + type VLAN interface + DHCP func() bool + Fabric func() string + ID func() int + MTU func() int + Name func() string + PrimaryRack func() string + SecondaryRack func() string + VID func() int + type Zone interface + Description func() string + Name func() string