entity

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: May 28, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package entity defines types for the MAAS API endpoints' return types.

Each endpoint returns JSON that describes the object it represents. For example, GETting the Subnets endpoint will return an array of Subnet, while GETting the Subnet endpoint (ie subnets/<subnet_id>) will return one Subnet.

Some endpoints expose operations that return metadata about the object, such as as Subnet's GetStatistics(), which contains statistics about the subnet, but does not actually describe the subnet: these alternative types can be found in subpackages named after the endpoint.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthorisationToken added in v0.3.0

type AuthorisationToken struct {
	Name        string `json:"name,omitempty"`
	TokenKey    string `json:"token_key,omitempty"`
	TokenSecret string `json:"token_secret,omitempty"`
	ConsumerKey string `json:"consumer_key,omitempty"`
}

AuthorisationToken represents user account authorisation Token

type AuthorisationTokenListItem added in v0.3.0

type AuthorisationTokenListItem struct {
	Name  string `json:"name,omitempty"`
	Token string `json:"token,omitempty"`
}

AuthorisationTokenListItem represents user account authorisation token in list API

type BCache added in v0.2.0

type BCache struct {
	HumanSize     string         `json:"human_size,omitempty"`
	UUID          string         `json:"uuid,omitempty"`
	Name          string         `json:"name,omitempty"`
	SystemID      string         `json:"system_id"`
	CacheMode     string         `json:"cache_mode,omitempty"`
	ResourceURI   string         `json:"resource_uri,omitempty"`
	VirtualDevice BlockDevice    `json:"virtual_device,omitempty"`
	BackingDevice BlockDevice    `json:"backing_device,omitempty"`
	CacheSet      BCacheCacheSet `json:"cache_set"`
	ID            int            `json:"id,omitempty"`
	Size          int64          `json:"size,omitempty"`
}

type BCacheCacheSet added in v0.2.0

type BCacheCacheSet struct {
	Name        string      `json:"name:omitempty"`
	SystemID    string      `json:"system_id,omitempty"`
	ResourceURI string      `json:"resource_uri,omitempty"`
	CacheDevice BlockDevice `json:"cache_device,omitempty"`
	ID          int         `json:"id,omitempty"`
}

type BCacheCacheSetParams added in v0.2.0

type BCacheCacheSetParams struct {
	CacheDevice    string `url:"cache_device,omitempty"`
	CachePartition string `url:"cache_partition,omitempty"`
}

type BCacheParams added in v0.2.0

type BCacheParams struct {
	Name             string `url:"name,omitempty"`
	UUID             string `url:"uuid,omitempty"`
	CacheSet         string `url:"cache_set,omitempty"`
	BackingDevice    string `url:"backing_device,omitempty"`
	BackingPartition string `url:"backing_partition,omitempty"`
	CacheMode        string `url:"cache_mode,omitempty"`
}

type BlockDevice

type BlockDevice struct {
	Filesystem         PartitionFileSystem    `json:"filesystem,omitempty"`
	Path               string                 `json:"path,omitempty"`
	Model              string                 `json:"model,omitempty"`
	ResourceURI        string                 `json:"resource_uri,omitempty"`
	PartitionTableType string                 `json:"partition_table_type,omitempty"`
	UUID               string                 `json:"uuid,omitempty"`
	Serial             string                 `json:"serial,omitempty"`
	IDPath             string                 `json:"id_path,omitempty"`
	UsedFor            string                 `json:"used_for,omitempty"`
	FirmwareVersion    string                 `json:"firmware_version,omitempty"`
	SystemID           string                 `json:"system_id,omitempty"`
	StoragePool        string                 `json:"storage_pool,omitempty"`
	Type               string                 `json:"type,omitempty"`
	Name               string                 `json:"name,omitempty"`
	Partitions         []BlockDevicePartition `json:"partitions,omitempty"`
	Tags               []string               `json:"tags,omitempty"`
	Size               int64                  `json:"size,omitempty"`
	ID                 int                    `json:"id,omitempty"`
	BlockSize          int                    `json:"block_size,omitempty"`
	UsedSize           int64                  `json:"used_size,omitempty"`
	AvailableSize      int64                  `json:"available_size,omitempty"`
	NUMANode           int                    `json:"numa_node,omitempty"`
}

BlockDevice represents the MAAS BlockDevice endpoint.

type BlockDeviceParams

type BlockDeviceParams struct {
	Name      string `url:"name,omitempty"`
	UUID      string `url:"uuid,omitempty"`
	Model     string `url:"model,omitempty"`
	Serial    string `url:"serial,omitempty"`
	IDPath    string `url:"id_path,omitempty"`
	Size      int64  `url:"size,omitempty"`
	BlockSize int    `url:"block_size,omitempty"`
}

type BlockDevicePartition

type BlockDevicePartition struct {
	FileSystem  PartitionFileSystem `json:"filesystem"`
	UUID        string              `json:"uuid"`
	SystemID    string              `json:"system_id"`
	UsedFor     string              `json:"used_for,omitempty"`
	Type        string              `json:"type"`
	Path        string              `json:"path"`
	ResourceURI string              `json:"resource_uri"`
	Tags        []string            `json:"tags,omitempty"`
	Size        int64               `json:"size"`
	ID          int                 `json:"id"`
	DeviceID    int                 `json:"device_id"`
	Bootable    bool                `json:"bootable"`
}

BlockDevicePartition represents the MAAS block device partition endpoint.

type BlockDevicePartitionParams

type BlockDevicePartitionParams struct {
	UUID     string `url:"uuid,omitempty"`
	Size     int64  `url:"size,omitempty"`
	Bootable bool   `url:"bootable"`
}

type BootResource added in v0.2.0

type BootResource struct {
	Sets         map[string]BootResourceSet `json:"sets,omitempty"`
	Type         string                     `json:"type,omitempty"`
	Name         string                     `json:"name,omitempty"`
	Architecture string                     `json:"architecture,omitempty"`
	ResourceURI  string                     `json:"resource_uri,omitempty"`
	LastDeployed string                     `json:"last_deployed,omitempty"`
	Subarches    string                     `json:"subarches,omitempty"`
	ID           int                        `json:"id,omitempty"`
}

type BootResourceParams added in v0.2.0

type BootResourceParams struct {
	Name         string `url:"name,omitempty"`
	Architecture string `url:"architecture,omitempty"`
	SHA256       string `url:"sha256,omitempty"`
	Size         string `url:"size,omitempty"`
	Title        string `url:"title,omitempty"`
	Filetype     string `url:"filetype,omitempty"`
	BaseImage    string `url:"base_image,omitempty"`
	Content      string `url:"content,omitempty"`
}

type BootResourceSet added in v0.2.0

type BootResourceSet struct {
	Files    map[string]BootResourceSetFile `json:"files,omitempty"`
	Version  string                         `json:"version,omitempty"`
	Label    string                         `json:"label,omitempty"`
	Size     int64                          `json:"size,omitempty"`
	Complete bool                           `json:"complete,omitempty"`
}

BootResourceSet represents a BootResource's "set". This type should not be used directly.

type BootResourceSetFile added in v0.2.0

type BootResourceSetFile struct {
	Filename string `json:"filename,omitempty"`
	Filetype string `json:"filetype,omitempty"`
	SHA256   string `json:"sha256,omitempty"`
	Size     int64  `json:"size,omitempty"`
	Complete bool   `json:"complete,omitempty"`
}

BootResourceSetFile represents a BootResource set's "file". This type should not be used directly.

type BootResourcesReadParams added in v0.2.0

type BootResourcesReadParams struct {
	Type string `json:"type,omitempty"`
}

type BootSource added in v0.2.0

type BootSource struct {
	Created         string `json:"created,omitempty"`
	Updated         string `json:"updated,omitempty"`
	URL             string `json:"url,omitempty"`
	KeyringFilename string `json:"keyring_filename,omitempty"`
	KeyringData     string `json:"keyring_data,omitempty"`
	ResourceURI     string `json:"resource_uri,omitempty"`
	ID              int    `json:"id,omitempty"`
}

type BootSourceParams added in v0.2.0

type BootSourceParams struct {
	KeyringData     string `url:"keyring_data,omitempty"`
	KeyringFilename string `url:"keyring_filename,omitempty"`
	URL             string `url:"url,omitempty"`
}

type BootSourceSelection added in v0.2.0

type BootSourceSelection struct {
	OS           string   `json:"os,omitempty"`
	Release      string   `json:"release,omitempty"`
	ResourceURI  string   `json:"resource_uri,omitempty"`
	Arches       []string `json:"arches,omitempty"`
	Subarches    []string `json:"subarches,omitempty"`
	Labels       []string `json:"labels,omitempty"`
	ID           int      `json:"id,omitempty"`
	BootSourceID int      `json:"boot_source_id,omitempty"`
}

type BootSourceSelectionParams added in v0.2.0

type BootSourceSelectionParams struct {
	OS        string   `url:"os,omitempty"`
	Release   string   `url:"release,omitempty"`
	Arches    []string `url:"arches,omitempty"`
	Subarches []string `url:"subarches,omitempty"`
	Labels    []string `url:"labels,omitempty"`
}

type DNSResource

type DNSResource struct {
	FQDN            string              `json:"fqdn,omitempty"`
	ResourceURI     string              `json:"resource_uri,omitempty"`
	IPAddresses     []IPAddress         `json:"ip_addresses,omitempty"`
	ResourceRecords []DNSResourceRecord `json:"resource_records,omitempty"`
	ID              int                 `json:"id,omitempty"`
	AddressTTL      int                 `json:"address_ttl,omitempty"`
}

type DNSResourceParams

type DNSResourceParams struct {
	FQDN        string `url:"fqdn,omitempty"`
	Name        string `url:"name,omitempty"`
	Domain      string `url:"domain,omitempty"`
	IPAddresses string `url:"ip_addresses,omitempty"`
	AddressTTL  int    `url:"address_ttl"`
}

type DNSResourceRecord

type DNSResourceRecord struct {
	RRType      string `json:"rrtype,omitempty"`
	RRData      string `json:"rrdata,omitempty"`
	FQDN        string `json:"fqdn,omitempty"`
	ResourceURI string `json:"resource_uri,omitempty"`
	ID          int    `json:"id,omitempty"`
	TTL         int    `json:"ttl,omitempty"`
}

type DNSResourceRecordParams

type DNSResourceRecordParams struct {
	FQDN   string `url:"fqdn,omitempty"`
	Name   string `url:"name,omitempty"`
	Domain string `url:"domain,omitempty"`
	RRType string `url:"rrtype,omitempty"`
	RRData string `url:"rrdata,omitempty"`
	TTL    int    `url:"ttl"`
}

type Device

type Device struct {
	OwnerData           interface{}        `json:"owner_data,omitempty"`
	Zone                Zone               `json:"zone,omitempty"`
	FQDN                string             `json:"fqdn,omitempty"`
	Hostname            string             `json:"hostname,omitempty"`
	SystemID            string             `json:"system_id,omitempty"`
	Owner               string             `json:"owner,omitempty"`
	Description         string             `json:"description,omitempty"`
	Parent              string             `json:"parent,omitempty"`
	ResourceURI         string             `json:"resource_uri,omitempty"`
	NodeTypeName        string             `json:"node_type_name,omitempty"`
	WorkloadAnnotations map[string]string  `json:"workload_annotations,omitempty"`
	IPAddresses         []net.IP           `json:"ip_addresses,omitempty"`
	InterfaceSet        []NetworkInterface `json:"interface_set,omitempty"`
	TagNames            []string           `json:"tag_names,omitempty"`
	Domain              Domain             `json:"domain,omitempty"`
	NodeType            int                `json:"node_type,omitempty"`
	AddressTTL          int                `json:"address_ttl,omitempty"`
}

type DeviceCreateParams

type DeviceCreateParams struct {
	Hostname     string   `url:"hostname,omitempty"`
	Description  string   `url:"description,omitempty"`
	Domain       string   `url:"domain,omitempty"`
	Parent       string   `url:"parent,omitempty"`
	Zone         string   `url:"zone,omitempty"`
	MacAddresses []string `url:"mac_addresses,omitempty"`
}

type DeviceUpdateParams

type DeviceUpdateParams struct {
	Hostname    string `url:"hostname,omitempty"`
	Description string `url:"description,omitempty"`
	Domain      string `url:"domain,omitempty"`
	Parent      string `url:"parent,omitempty"`
	Zone        string `url:"zone,omitempty"`
}

type Discovery added in v0.4.0

type Discovery struct {
	DiscoveryID     string   `json:"discovery_id,omitempty"`
	IP              string   `json:"ip,omitempty"`
	MACAddress      string   `json:"mac_address,omitempty"`
	LastSeen        string   `json:"last_seen,omitempty"`
	Hostname        string   `json:"hostname,omitempty"`
	FabricName      string   `json:"fabric_name,omitempty"`
	Vid             string   `json:"vid,omitempty"`
	MacOrganization string   `json:"mac_organization,omitempty"`
	ResourceURI     string   `json:"resource_uri,omitempty"`
	Observer        Observer `json:"observer,omitempty"`
}

Discovery represents device discovery in MAAS

type DiscoveryClearParams added in v0.4.0

type DiscoveryClearParams struct {
	All        bool `url:"all,omitempty"`
	MDNS       bool `url:"mdns,omitempty"`
	Neighbours bool `url:"neighbours,omitempty"`
}

type Domain

type Domain struct {
	Name                string `json:"name,omitempty"`
	ResourceURI         string `json:"resource_uri,omitempty"`
	ID                  int    `json:"id,omitempty"`
	TTL                 int    `json:"ttl,omitempty"`
	ResourceRecordCount int    `json:"resource_record_count,omitempty"`
	Authoritative       bool   `json:"authoritative,omitempty"`
	IsDefault           bool   `json:"is_default,omitempty"`
}

Domain represents the MAAS Domain endpoint

type DomainParams

type DomainParams struct {
	Name          string `url:"name,omitempty"`
	TTL           int    `url:"ttl,omitempty"`
	Authoritative bool   `url:"authoritative"`
}

type Event added in v0.3.0

type Event struct {
	UserName    string         `json:"username,omitempty"`
	Node        string         `json:"node,omitempty"`
	Hostname    string         `json:"hostname,omitempty"`
	Created     string         `json:"created,omitempty"`
	Type        string         `json:"type,omitempty"`
	Description string         `json:"description,omitempty"`
	Level       event.LogLevel `json:"level,omitempty"`
	ID          int            `json:"id,omitempty"`
}

Event represents an event for MAAS node

type EventParams added in v0.3.0

type EventParams struct {
	Hostname   string         `url:"hostname,omitempty"`
	MACAddress string         `url:"mac_address,omitempty"`
	ID         string         `url:"id,omitempty"`
	Zone       string         `url:"zone,omitempty"`
	AgentName  string         `url:"agent_name,omitempty"`
	Limit      string         `url:"limit,omitempty"`
	Before     string         `url:"before,omitempty"`
	After      string         `url:"after,omitempty"`
	Owner      string         `url:"owner,omitempty"`
	Level      event.LogLevel `url:"level,omitempty"`
}

EventParams enumerates the parameters for the event get operation

type EventsResp added in v0.3.0

type EventsResp struct {
	NextURI string  `json:"next_uri,omitempty"`
	PrevURI string  `json:"prev_uri,omitempty"`
	Events  []Event `json:"events,omitempty"`
	Count   int     `json:"count,omitempty"`
}

EventsResp represents the MAAS Events endpoint

type Fabric

type Fabric struct {
	Name        string `json:"name,omitempty"`
	ClassType   string `json:"class_type,omitempty"`
	ResourceURI string `json:"resource_uri,omitempty"`
	VLANs       []VLAN `json:"vlans,omitempty"`
	ID          int    `json:"id,omitempty"`
}

type FabricParams

type FabricParams struct {
	Name        string `url:"name,omitempty"`
	Description string `url:"description,omitempty"`
	ClassType   string `url:"class_type,omitempty"`
}

type HardwareType added in v0.4.0

type HardwareType int
const (
	NODE HardwareType = iota
	CPU
	MEMORY
	STORAGE
	NETWORK
	GPU
)

HardwareType referring from MAAS server https://github.com/maas/maas/blob/deab73792a4fe839a2e84a926a6c728d510fc9ad/src/metadataserver/enum.py#L126

type IPAddress

type IPAddress struct {
	AllocTypeName string             `json:"alloc_type_name,omitempty"`
	Created       string             `json:"created,omitempty"`
	ResourceURI   string             `json:"resource_uri,omitempty"`
	Owner         User               `json:"owner,omitempty"`
	IP            net.IP             `json:"ip,omitempty"`
	InterfaceSet  []NetworkInterface `json:"interface_set,omitempty"`
	Subnet        Subnet             `json:"subnet,omitempty"`
	AllocType     int                `json:"alloc_type,omitempty"`
}

type IPAddressesParams

type IPAddressesParams struct {
	Subnet     string `url:"subnet,omitempty"`
	IP         string `url:"ip,omitempty"`
	Owner      string `url:"owner,omitempty"`
	All        bool   `url:"all,omitempty"`
	Discovered bool   `url:"discovered,omitempty"`
	Force      bool   `url:"force,omitempty"`
}

type IPRange

type IPRange struct {
	Type        string `json:"type"`
	Comment     string `json:"comment,omitempty"`
	ResourceURI string `json:"resource_uri"`
	User        User   `json:"user,omitempty"`
	StartIP     net.IP `json:"start_ip"`
	EndIP       net.IP `json:"end_ip"`
	Subnet      Subnet `json:"subnet"`
	ID          int    `json:"id"`
}

type IPRangeParams

type IPRangeParams struct {
	Type    string `url:"type"`
	Subnet  string `url:"subnet"`
	StartIP string `url:"start_ip"`
	EndIP   string `url:"end_ip"`
	Comment string `url:"comment,omitempty"`
}

type MAASTime

type MAASTime time.Time

MAASTime is a custom time format returned by MAAS API which is not RFC3339

func (MAASTime) String

func (t MAASTime) String() string

String returns MAASTime in RFC3339Nano format

func (*MAASTime) UnmarshalJSON

func (t *MAASTime) UnmarshalJSON(data []byte) error

type Machine

type Machine struct {
	HwNextSync              MAASTime                   `json:"next_sync,omitempty"`
	HwLastSync              MAASTime                   `json:"last_sync,omitempty"`
	OwnerData               interface{}                `json:"owner_data,omitempty"`
	HardwareInfo            map[string]string          `json:"hardware_info,omitempty"`
	WorkloadAnnotations     map[string]string          `json:"workload_annotations,omitempty"`
	OSystem                 string                     `json:"osystem,omitempty"`
	FQDN                    string                     `json:"fqdn,omitempty"`
	StatusName              string                     `json:"status_name,omitempty"`
	StatusMessage           string                     `json:"status_message,omitempty"`
	StatusAction            string                     `json:"status_action,omitempty"`
	Description             string                     `json:"description,omitempty"`
	CPUTestStatusName       string                     `json:"cpu_test_status_name,omitempty"`
	OtherTestStatusName     string                     `json:"other_test_status_name,omitempty"`
	Hostname                string                     `json:"hostname,omitempty"`
	ResourceURI             string                     `json:"resource_uri,omitempty"`
	Architecture            string                     `json:"architecture,omitempty"`
	PowerType               string                     `json:"power_type,omitempty"`
	MemoryTestStatusName    string                     `json:"memory_test_status_name,omitempty"`
	PowerState              string                     `json:"power_state,omitempty"`
	DistroSeries            string                     `json:"distro_series,omitempty"`
	MinHWEKernel            string                     `json:"min_hwe_kernel,omitempty"`
	CommissioningStatusName string                     `json:"commissioning_status_name,omitempty"`
	SystemID                string                     `json:"system_id,omitempty"`
	NodeTypeName            string                     `json:"node_type_name,omitempty"`
	StorageTestStatusName   string                     `json:"storage_test_status_name,omitempty"`
	Owner                   string                     `json:"owner,omitempty"`
	HWEKernel               string                     `json:"hwe_kernel,omitempty"`
	TestingStatusName       string                     `json:"testing_status_name,omitempty"`
	Version                 string                     `json:"version,omitempty"`
	BiosBootMethod          string                     `json:"bios_boot_method,omitempty"`
	Pool                    ResourcePool               `json:"pool,omitempty"`
	Zone                    Zone                       `json:"zone,omitempty"`
	SpecialFilesystems      []MachineSpecialFilesystem `json:"special_filesystems,omitempty"`
	VirtualBlockDeviceSet   []BlockDevice              `json:"virtualblockdevice_set,omitempty"`
	ISCSIBlockDeviceSet     []BlockDevice              `json:"iscsiblockdevice_set,omitempty"`
	ServiceSet              []MachineServiceSet        `json:"service_set,omitempty"`
	PhysicalBlockDeviceSet  []BlockDevice              `json:"physicalblockdevice_set,omitempty"`
	TagNames                []string                   `json:"tag_names,omitempty"`
	RAIDs                   []MachineRAID              `json:"raids,omitempty"`
	IPAddresses             []net.IP                   `json:"ip_addresses,omitempty"`
	BCaches                 []MachineBCache            `json:"bcaches,omitempty"`
	InterfaceSet            []NetworkInterface         `json:"interface_set,omitempty"`
	VolumeGroups            []MachineVolumeGroup       `json:"volume_groups,omitempty"`
	CacheSets               []MachineCacheSet          `json:"cache_sets,omitempty"`
	BlockDeviceSet          []BlockDevice              `json:"blockdevice_set,omitempty"`
	NUMANodeSet             []NUMANode                 `json:"numanode_set,omitempty"`
	DefaultGateways         struct {
		IPv4 struct {
			GatewayIP net.IP `json:"gateway_ip,omitempty"`
			LinkID    int    `json:"link_id,omitempty"`
		} `json:"ipv4,omitempty"`
		IPv6 struct {
			GatewayIP net.IP `json:"gateway_ip,omitempty"`
			LinkID    int    `json:"link_id,omitempty"`
		} `json:"ipv6,omitempty"`
	} `json:"default_gateways,omitempty"`
	Domain                       Domain           `json:"domain,omitempty"`
	BootDisk                     BlockDevice      `json:"boot_disk,omitempty"`
	BootInterface                NetworkInterface `json:"boot_interface,omitempty"`
	VMHost                       VMHost           `json:"pod,omitempty"`
	CurrentTestingResultID       int              `json:"current_testing_result_id,omitempty"`
	Memory                       int64            `json:"memory,omitempty"`
	NodeType                     int              `json:"node_type,omitempty"`
	HwSyncInterval               int              `json:"sync_interval,omitempty"`
	CPUTestStatus                int              `json:"cpu_test_status,omitempty"`
	AddressTTL                   int              `json:"address_ttl,omitempty"`
	Storage                      float64          `json:"storage,omitempty"`
	CPUSpeed                     int              `json:"cpu_speed,omitempty"`
	CPUCount                     int              `json:"cpu_count,omitempty"`
	Status                       node.Status      `json:"status,omitempty"`
	CurrentInstallationResultID  int              `json:"current_installation_result_id,omitempty"`
	CurrentCommissioningResultID int              `json:"current_commissioning_result_id,omitempty"`
	CommissioningStatus          int              `json:"commissioning_status,omitempty"`
	OtherTestStatus              int              `json:"other_test_status,omitempty"`
	TestingStatus                int              `json:"testing_status,omitempty"`
	StorageTestStatus            int              `json:"storage_test_status,omitempty"`
	SwapSize                     int64            `json:"swap_size,omitempty"`
	MemoryTestStatus             int              `json:"memory_test_status,omitempty"`
	EnableHwSync                 bool             `json:"enable_hw_sync,omitempty"`
	DisableIPv4                  bool             `json:"disable_ipv4,omitempty"`
	Netboot                      bool             `json:"netboot,omitempty"`
	Locked                       bool             `json:"locked,omitempty"`
}

Machine represents the MAAS Machine endpoint.

func (*Machine) UnmarshalJSON

func (m *Machine) UnmarshalJSON(data []byte) error

type MachineAllocateParams

type MachineAllocateParams struct {
	AgentName        string   `url:"agent_name,omitempty"`
	SystemID         string   `url:"system_id,omitempty"`
	Pool             string   `url:"pool,omitempty"`
	Zone             string   `url:"zone,omitempty"`
	Comment          string   `url:"comment,omitempty"`
	Interfaces       string   `url:"interfaces,omitempty"`
	NotVMHostType    string   `url:"not_pod_type,omitempty"`
	VMHostType       string   `url:"pod_type,omitempty"`
	NotVMHost        string   `url:"not_pod,omitempty"`
	VMHost           string   `url:"pod,omitempty"`
	Arch             string   `url:"arch,omitempty"`
	Name             string   `url:"name,omitempty"`
	NotFabrics       []string `url:"not_fabrics,omitempty"`
	Tags             []string `url:"tags,omitempty"`
	NotInPool        []string `url:"not_in_pool,omitempty"`
	NotInZone        []string `url:"not_in_zone,omitempty"`
	FabricClasses    []string `url:"fabric_classes,omitempty"`
	NotTags          []string `url:"not_tags,omitempty"`
	Fabrics          []string `url:"fabrics,omitempty"`
	Storage          []string `url:"storage,omitempty"`
	NotSubnets       []string `url:"not_subnets,omitempty"`
	NotFabricClasses []string `url:"not_fabric_classes,omitempty"`
	Subnets          []string `url:"subnets,omitempty"`
	CPUCount         int      `url:"cpu_count,omitempty"`
	Mem              int64    `url:"mem,omitempty"`
	BridgeFD         int      `url:"bridge_fd,omitempty"`
	BridgeAll        bool     `url:"bridge_all,omitempty"`
	BridgeSTP        bool     `url:"bridge_stp,omitempty"`
	DryRun           bool     `url:"dry_run,omitempty"`
	Verbose          bool     `url:"verbose,omitempty"`
}

MachineAllocateParams enumerates the options for the allocate operation.

type MachineBCache

type MachineBCache struct {
	SystemID   string `json:"system_id,omitempty"`
	ID         int    `json:"id,omitempty"`
	Incomplete bool   `json:"__incomplete__,omitempty"` //nolint:tagliatelle // MAAS returns this field intentionally
}

MachineBCache represents a Machine's "bcaches" list item. This type should not be used directly.

type MachineCacheSet

type MachineCacheSet struct {
	SystemID   string `json:"system_id,omitempty"`
	ID         int    `json:"id,omitempty"`
	Incomplete bool   `json:"__incomplete__,omitempty"` //nolint:tagliatelle // MAAS returns this field intentionally
}

MachineCacheSet represents a Machine's "cache_sets" list item. This type should not be used directly.

type MachineCommissionParams

type MachineCommissionParams struct {
	CommissioningScripts string `url:"commissioning_scripts,omitempty"`
	TestingScripts       string `url:"testing_scripts,omitempty"`
	EnableSSH            int    `url:"enable_ssh,omitempty"`
	SkipBMCConfig        int    `url:"skip_bmc_config,omitempty"`
	SkipNetworking       int    `url:"skip_networking,omitempty"`
	SkipStorage          int    `url:"skip_storage,omitempty"`
}

MachineCommissionParams enumerates the parameters for the commission operation

type MachineDeployParams

type MachineDeployParams struct {
	UserData       string `url:"user_data,omitempty"`
	DistroSeries   string `url:"distro_series,omitempty"`
	HWEKernel      string `url:"hwe_kernel,omitempty"`
	AgentName      string `url:"agent_name,omitempty"`
	Comment        string `url:"comment,omitempty"`
	BridgeFD       int    `url:"bridge_fd,omitempty"`
	BridgeAll      bool   `url:"bridge_all,omitempty"`
	BridgeSTP      bool   `url:"bridge_stp,omitempty"`
	InstallRackD   bool   `url:"install_rackd,omitempty"`
	InstallKVM     bool   `url:"install_kvm,omitempty"`
	RegisterVMHost bool   `url:"register_vmhost,omitempty"`
	EnableHwSync   bool   `url:"enable_hw_sync,omitempty"`
}

MachineDeployParams enumerates the parameters for the deploy operation

type MachineDetails added in v0.3.0

type MachineDetails struct {
	LLDP string `json:"lldp,omitempty"`
	LSHW string `json:"lshw,omitempty"`
}

type MachineParams

type MachineParams struct {
	PowerType     string `url:"power_type,omitempty"`
	PXEMacAddress string `url:"mac_addresses,omitempty"`
	Architecture  string `url:"architecture,omitempty"`
	MinHWEKernel  string `url:"min_hwe_kernel,omitempty"`
	Hostname      string `url:"hostname,omitempty"`
	Description   string `url:"description,omitempty"`
	Domain        string `url:"domain,omitempty"`
	Pool          string `url:"pool,omitempty"`
	Zone          string `url:"zone,omitempty"`
	Memory        int64  `url:"memory,omitempty"`
	SwapSize      int64  `url:"swap_size,omitempty"`
	CPUCount      int    `url:"cpu_count,omitempty"`
	Commission    bool   `url:"commission,omitempty"`
}

MachineParams enumerates the parameters for the machine update operation

type MachinePowerOffParams added in v0.2.0

type MachinePowerOffParams struct {
	Comment  string `url:"comment,omitempty"`
	StopMode string `url:"stop_mode,omitempty"`
}

MachinePowerOffParams enumerates the parameters for the machine power off operation

type MachinePowerOnParams added in v0.2.0

type MachinePowerOnParams struct {
	Comment  string `url:"comment,omitempty"`
	UserData string `url:"user_data,omitempty"`
}

MachinePowerOnParams enumerates the parameters for the machine power on operation UserData should be Base64-encoded data

type MachinePowerState added in v0.2.0

type MachinePowerState struct {
	State string `json:"state,omitempty"`
}

MachinePowerState represent current machines power state

type MachineRAID

type MachineRAID struct {
	SystemID   string `json:"system_id,omitempty"`
	ID         int    `json:"id,omitempty"`
	Incomplete bool   `json:"__incomplete__,omitempty"` //nolint:tagliatelle // MAAS returns this field intentionally
}

MachineRAID represents a Machine's "raids" list item. This type should not be used directly.

type MachineReleaseParams

type MachineReleaseParams struct {
	Comment     string `url:"comment,omitempty"`
	Erase       bool   `url:"erase,omitempty"`
	Force       bool   `url:"force,omitempty"`
	QuickErase  bool   `url:"quick_erase,omitempty"`
	SecureErase bool   `url:"secure_erase,omitempty"`
}

MachineReleaseParams enumerates the parameters for the release operation

type MachineServiceSet

type MachineServiceSet struct {
	Name       string `json:"name,omitempty"`
	Status     string `json:"status,omitempty"`
	StatusInfo string `json:"status_info,omitempty"`
}

MachineServiceSet represents a Machine's "service_set". This type should not be used directly.

type MachineSpecialFilesystem

type MachineSpecialFilesystem struct {
	FSType       string `json:"fstype,omitempty"`
	Label        string `json:"label,omitempty"`
	UUID         string `json:"uuid,omitempty"`
	MountPoint   string `json:"mount_point,omitempty"`
	MountOptions string `json:"mount_options,omitempty"`
}

MachineSpecialFilesystem represents a Machine's "special_filesystems" list item. This type should not be used directly.

type MachineToken added in v0.2.0

type MachineToken struct {
	TokenKey    string `json:"token_key,omitempty"`
	TokenSecret string `json:"token_secret,omitempty"`
	ConsumerKey string `json:"consumer_key,omitempty"`
}

MachineToken represents Machine token

type MachineVolumeGroup

type MachineVolumeGroup struct {
	SystemID   string `json:"system_id,omitempty"`
	ID         int    `json:"id,omitempty"`
	Incomplete bool   `json:"__incomplete__,omitempty"` //nolint:tagliatelle // MAAS returns this field intentionally
}

MachineVolumeGroup represents a Machine's "volume_groups" list item. This type should not be used directly.

type MachinesParams added in v0.5.0

type MachinesParams struct {
	ID               []string `url:"id,omitempty"`
	NotID            []string `url:"not_id,omitempty"`
	Hostname         []string `url:"hostname,omitempty"`
	NotHostname      []string `url:"not_hostname,omitempty"`
	MACAddress       []string `url:"mac_address,omitempty"`
	Domain           []string `url:"domain,omitempty"`
	NotDomain        []string `url:"not_domain,omitempty"`
	AgentName        []string `url:"agent_name,omitempty"`
	NotAgentName     []string `url:"not_agent_name,omitempty"`
	Status           []string `url:"status,omitempty"`
	NotStatus        []string `url:"not_status,omitempty"`
	SimpleStatus     []string `url:"simple_status,omitempty"`
	NotSimpleStatus  []string `url:"not_simple_status,omitempty"`
	Arch             []string `url:"arch,omitempty"`
	NotArch          []string `url:"not_arch,omitempty"`
	Tags             []string `url:"tags,omitempty"`
	NotTags          []string `url:"not_tags,omitempty"`
	Fabrics          []string `url:"fabrics,omitempty"`
	NotFabrics       []string `url:"not_fabrics,omitempty"`
	FabricClasses    []string `url:"fabric_classes,omitempty"`
	NotFabricClasses []string `url:"not_fabric_classes,omitempty"`
	Subnets          []string `url:"subnets,omitempty"`
	NotSubnets       []string `url:"not_subnets,omitempty"`
	LinkSpeed        []int    `url:"link_speed,omitempty"`
	VLANs            []string `url:"vlans,omitempty"`
	NotVLANs         []string `url:"not_vlans,omitempty"`
	Zone             []string `url:"zone,omitempty"`
	NotInZone        []string `url:"not_in_zone,omitempty"`
	Pool             []string `url:"pool,omitempty"`
	NotInPool        []string `url:"not_in_pool,omitempty"`
	Storage          string   `url:"storage,omitempty"`
	Interfaces       string   `url:"devices,omitempty"`
	Devices          string   `url:"devices,omitempty"`
	CPUCount         []int    `url:"cpu_count,omitempty"`
	CPUSpeed         []int    `url:"cpu_speed,omitempty"`
	Mem              []int64  `url:"mem,omitempty"`
	Pod              []string `url:"pod,omitempty"`
	NotPod           []string `url:"not_pod,omitempty"`
	PodType          []string `url:"pod_type,omitempty"`
	NotPodType       []string `url:"not_pod_type,omitempty"`
	Owner            []string `url:"owner,omitempty"`
	NotOwner         []string `url:"not_owner,omitempty"`
	PowerState       []string `url:"power_state,omitempty"`
	NotPowerState    []string `url:"not_power_state,omitempty"`
}

MachinesParams enumerates the parameters for the get machines operation

type NUMANode added in v0.4.0

type NUMANode struct {
	HugepagesSet []NUMANodeHugepages `json:"hugepages_set,omitempty"`
	Cores        []int               `json:"cores,omitempty"`
	Index        int                 `json:"index,omitempty"`
	Memory       int                 `json:"memory,omitempty"`
}

NUMANode represents the MAAS numa node referred from https://github.com/maas/maas/blob/deab73792a4fe839a2e84a926a6c728d510fc9ad/src/maasserver/api/machines.py#L110

type NUMANodeHugepages added in v0.4.0

type NUMANodeHugepages struct {
	PageSize int `json:"page_size,omitempty"`
	Total    int `json:"total,omitempty"`
}

NUMANodeHugepages represents the MAAS numa node hugepages referred from https://github.com/maas/maas/blob/deab73792a4fe839a2e84a926a6c728d510fc9ad/src/maasserver/api/machines.py#L108

type NetworkInterface

type NetworkInterface struct {
	Params          interface{}                    `json:"params,omitempty"`
	Name            string                         `json:"name,omitempty"`
	Product         string                         `json:"product,omitempty"`
	MACAddress      string                         `json:"mac_address,omitempty"`
	FirmwareVersion string                         `json:"firmware_version,omitempty"`
	Vendor          string                         `json:"vendor,omitempty"`
	Type            string                         `json:"type,omitempty"`
	SystemID        string                         `json:"system_id,omitempty"`
	ResourceURI     string                         `json:"resource_uri,omitempty"`
	Links           []NetworkInterfaceLink         `json:"links,omitempty"`
	Parents         []string                       `json:"parents,omitempty"`
	Children        []string                       `json:"children,omitempty"`
	Tags            []string                       `json:"tags,omitempty"`
	Discovered      []NetworkInterfaceDiscoveredIP `json:"discovered,omitempty"`
	VLAN            VLAN                           `json:"vlan,omitempty"`
	NUMANode        int                            `json:"numa_node,omitempty"`
	LinkSpeed       int                            `json:"link_speed,omitempty"`
	EffectiveMTU    int                            `json:"effective_mtu,omitempty"`
	SRIOVMaxVF      int                            `json:"sriov_max_vf,omitempty"`
	InterfaceSpeed  int                            `json:"interface_speed,omitempty"`
	ID              int                            `json:"id,omitempty"`
	Enabled         bool                           `json:"enabled,omitempty"`
	LinkConnected   bool                           `json:"link_connected,omitempty"`
}

NetworkInterface represents the MAAS Interface endpoint.

type NetworkInterfaceBondParams

type NetworkInterfaceBondParams struct {
	IPAddress          string `url:"ip_address,omitempty"`
	Tags               string `url:"tags,omitempty"`
	BondLACPRate       string `url:"bond_lacp_rate,omitempty"`
	BondMode           string `url:"bond_mode,omitempty"`
	Name               string `url:"name,omitempty"`
	MACAddress         string `url:"mac_address,omitempty"`
	BondXMitHashPolicy string `url:"bond_xmit_hash_policy,omitempty"`
	IPAssignment       string `url:"ip_assignment,omitempty"`
	Parents            []int  `url:"parents,omitempty"`
	InterfaceSpeed     int    `url:"interface_speed,omitempty"`
	LinkSpeed          int    `url:"link_speed,omitempty"`
	BondUpDelay        int    `url:"bond_updelay,omitempty"`
	MTU                int    `url:"mtu,omitempty"`
	BondNumberGratARP  int    `url:"bond_num_grat_arp,omitempty"`
	BondMiimon         int    `url:"bond_miimon,omitempty"`
	BondDownDelay      int    `url:"bond_downdelay,omitempty"`
	VLAN               int    `url:"vlan,omitempty"`
	AcceptRA           bool   `url:"accept_ra,omitempty"`
	LinkConnected      bool   `url:"link_connected,omitempty"`
}

NetworkInterfaceBondParams is the parameters for the NetworkInterfaces create_bond POST operation.

type NetworkInterfaceBridgeParams

type NetworkInterfaceBridgeParams struct {
	IPAssignment   string `url:"ip_assignment,omitempty"`
	MACAddress     string `url:"mac_address,omitempty"`
	Tags           string `url:"tags,omitempty"`
	BridgeType     string `url:"bridge_type,omitempty"`
	IPAddress      string `url:"ip_address,omitempty"`
	Name           string `url:"name,omitempty"`
	Parents        []int  `url:"parents,omitempty"`
	LinkSpeed      int    `url:"link_speed,omitempty"`
	MTU            int    `url:"mtu,omitempty"`
	BridgeFD       int    `url:"bridge_fd,omitempty"`
	InterfaceSpeed int    `url:"interface_speed,omitempty"`
	VLAN           int    `url:"vlan,omitempty"`
	AcceptRA       bool   `url:"accept_ra,omitempty"`
	LinkConnected  bool   `url:"link_connected,omitempty"`
	BridgeSTP      bool   `url:"bridge_stp,omitempty"`
}

NetworkInterfaceBridgeParams is the parameters for the NetworkInterfaces create_bridge POST operation.

type NetworkInterfaceDiscoveredIP

type NetworkInterfaceDiscoveredIP struct {
	IPAddress string `json:"ip_address,omitempty"`
	Subnet    Subnet `json:"subnet,omitempty"`
}

NetworkInterfaceDiscoveredIP is consumed by NetworkInterface{} and should not be used directly.

type NetworkInterfaceLink struct {
	IPAddress string `json:"ip_address,omitempty"`
	Mode      string `json:"mode,omitempty"`
	Subnet    Subnet `json:"subnet,omitempty"`
	ID        int    `json:"id,omitempty"`
}

NetworkInterfaceLink is consumed by NetworkInterface{} and should not be used directly.

type NetworkInterfaceLinkParams

type NetworkInterfaceLinkParams struct {
	IPAddress      string `url:"ip_address,omitempty"`
	Mode           string `url:"mode,omitempty"`
	Subnet         int    `url:"subnet,omitempty"`
	DefaultGateway bool   `url:"default_gateway"`
	Force          bool   `url:"force,omitempty"`
}

NetworkInterfaceLinkParams is used with NetworkInterface.LinkSubnet(). Mode must be one of (AUTO, DHCP, STATIC, LINK_UP). IPAddress is ignored unless mode is STATIC, and will be set automatically if empty. Force allows LINK_UP to be set when other links exist, allows links between different VLANs, and deletes all other links on the interface. DefaultGateway is ignored unless Mode is AUTO or STATIC. Note: You can parse an IP address into a net.IP via net.ParseIP(string).

type NetworkInterfacePhysicalParams

type NetworkInterfacePhysicalParams struct {
	Name           string `url:"name,omitempty"`
	IPAddress      string `url:"ip_address,omitempty"`
	IPAssignment   string `url:"ip_assignment,omitempty"`
	MACAddress     string `url:"mac_address,omitempty"`
	Tags           string `url:"tags,omitempty"`
	InterfaceSpeed int    `url:"interface_speed,omitempty"`
	LinkSpeed      int    `url:"link_speed,omitempty"`
	MTU            int    `url:"mtu,omitempty"`
	NUMANode       int    `url:"numa_node,omitempty"`
	VLAN           int    `url:"vlan,omitempty"`
	Enabled        bool   `url:"enabled,omitempty"`
	LinkConnected  bool   `url:"link_connected,omitempty"`
	AcceptRA       bool   `url:"accept_ra,omitempty"`
}

NetworkInterfacePhysicalParams is the parameters for the NetworkInterfaces create_physical POST operation.

type NetworkInterfaceUpdateParams

type NetworkInterfaceUpdateParams struct {
	BridgeType         string `url:"bridge_type,omitempty"`
	Tags               string `url:"tags,omitempty"`
	BondLACPRate       string `url:"bond_lacp_rate,omitempty"`
	BondMode           string `url:"bond_mode,omitempty"`
	Name               string `url:"name,omitempty"`
	MACAddress         string `url:"mac_address,omitempty"`
	BondXMitHashPolicy string `url:"bond_xmit_hash_policy,omitempty"`
	IPAssignment       string `url:"ip_assignment,omitempty"`
	IPAddress          string `url:"ip_address,omitempty"`
	Parents            []int  `url:"parents,omitempty"`
	InterfaceSpeed     int    `url:"interface_speed,omitempty"`
	BondUpDelay        int    `url:"bond_updelay,omitempty"`
	VLAN               int    `url:"vlan,omitempty"`
	BondDownDelay      int    `url:"bond_downdelay,omitempty"`
	BridgeFD           int    `url:"bridge_fd,omitempty"`
	BondMiimon         int    `url:"bond_miimon,omitempty"`
	LinkSpeed          int    `url:"link_speed,omitempty"`
	NUMANode           int    `url:"numa_node,omitempty"`
	MTU                int    `url:"mtu,omitempty"`
	BondNumberGratARP  int    `url:"bond_num_grat_arp,omitempty"`
	Enabled            bool   `url:"enabled,omitempty"`
	LinkConnected      bool   `url:"link_connected,omitempty"`
	BridgeSTP          bool   `url:"bridge_stp,omitempty"`
	AcceptRA           bool   `url:"accept_ra,omitempty"`
}

NetworkInterfaceUpdateParams is the parameters for the NetworkInterfaces update_bond POST operation.

type NetworkInterfaceVLANParams

type NetworkInterfaceVLANParams struct {
	IPAddress      string `url:"ip_address,omitempty"`
	IPAssignment   string `url:"ip_assignment,omitempty"`
	Name           string `url:"name,omitempty"`
	Tags           string `url:"tags,omitempty"`
	Parents        []int  `url:"parents,omitempty"`
	InterfaceSpeed int    `url:"interface_speed,omitempty"`
	LinkSpeed      int    `url:"link_speed,omitempty"`
	MTU            int    `url:"mtu,omitempty"`
	VLAN           int    `url:"vlan,omitempty"`
	AcceptRA       bool   `url:"accept_ra,omitempty"`
	LinkConnected  bool   `url:"link_connected,omitempty"`
}

NetworkInterfaceVLANParams is the parameters for the NetworkInterfaces create_vlan POST operation.

type Node

type Node Machine

Node represents the MAAS Node endpoint.

type NodeDevice added in v0.4.0

type NodeDevice struct {
	SystemID                 string           `json:"system_id,omitempty"`
	VendorID                 string           `json:"vendor_id,omitempty"`
	ProductID                string           `json:"product_id,omitempty"`
	VendorName               string           `json:"vendor_name,omitempty"`
	ProductName              string           `json:"product_name,omitempty"`
	CommissioningDriver      string           `json:"commissioning_driver,omitempty"`
	PCIAddress               string           `json:"pci_address,omitempty"`
	BusName                  string           `json:"bus_name,omitempty"`
	HardwareTypeName         string           `json:"hardware_type_name,omitempty"`
	ResourceURI              string           `json:"resource_uri,omitempty"`
	PhysicalBlockDevice      BlockDevice      `json:"physical_blockdevice,omitempty"`
	PhysicalNetworkInterface NetworkInterface `json:"physical_interface,omitempty"`
	Bus                      NodeDeviceBus    `json:"bus,omitempty"`
	HardwareType             HardwareType     `json:"hardware_type,omitempty"`
	BusNumber                int              `json:"bus_number,omitempty"`
	DeviceNumber             int              `json:"device_number,omitempty"`
	NumaNode                 int              `json:"numa_node,omitempty"`
	ID                       int              `json:"id,omitempty"`
}

NodeDevice represents a Node Device of a MAAS Node

type NodeDeviceBus added in v0.4.0

type NodeDeviceBus int

type NodeDeviceParams added in v0.4.0

type NodeDeviceParams struct {
	Bus                 string `url:"bus,omitempty"`
	HardwareType        string `url:"hardware_type,omitempty"`
	VendorID            string `url:"vendor_id,omitempty"`
	ProductID           string `url:"product_id,omitempty"`
	VendorName          string `url:"vendor_name,omitempty"`
	ProductName         string `url:"product_name,omitempty"`
	CommissioningDriver string `url:"commissioning_driver,omitempty"`
}

type NodeResult added in v0.5.0

type NodeResult struct {
	Node struct {
		SystemID string `json:"system_id,omitempty"`
	} `json:"node,omitempty"`
	Name         string     `json:"name,omitempty"`
	Created      string     `json:"created,omitempty"`
	Updated      string     `json:"updated,omitempty"`
	Data         string     `json:"data,omitempty"`
	ResourceURI  string     `json:"resource_uri,omitempty"`
	ID           int        `json:"id,omitempty"`
	ScriptResult int        `json:"script_result,omitempty"`
	ResultType   ResultType `json:"result_type,omitempty"`
}

type NodeResultParams added in v0.5.0

type NodeResultParams struct {
	SystemID   string     `url:"system_id,omitempty"`
	Name       []string   `url:"name,omitempty"`
	ResultType ResultType `url:"result_type,omitempty"`
}

type Observer added in v0.4.0

type Observer struct {
	SystemID      string `json:"system_id,omitempty"`
	Hostname      string `json:"hostname,omitempty"`
	InterfaceName string `json:"interface_name,omitempty"`
	InterfaceID   int    `json:"interface_id,omitempty"`
}

type PackageRepository added in v0.2.0

type PackageRepository struct {
	Name               string   `json:"name,omitempty"`
	URL                string   `json:"url,omitempty"`
	Key                string   `json:"key,omitempty"`
	ResourceURI        string   `json:"resource_uri,omitempty"`
	Distributions      []string `json:"distributions,omitempty"`
	DisabledPockets    []string `json:"disabled_pockets,omitempty"`
	DisabledComponents []string `json:"disabled_components,omitempty"`
	Components         []string `json:"components,omitempty"`
	Arches             []string `json:"arches,omitempty"`
	ID                 int      `json:"id,omitempty"`
	DisableSources     bool     `json:"disable_sources,omitempty"`
	Enabled            bool     `json:"enabled,omitempty"`
}

type PackageRepositoryParams added in v0.2.0

type PackageRepositoryParams struct {
	Name               string `url:"name,omitempty"`
	URL                string `url:"url,omitempty"`
	Distributions      string `url:"distributions,omitempty"`
	DisabledPockets    string `url:"disabled_pockets,omitempty"`
	DisabledComponents string `url:"disabled_components,omitempty"`
	Components         string `url:"components,omitempty"`
	Arches             string `url:"arches,omitempty"`
	Key                string `url:"key,omitempty"`
	DisableSources     bool   `url:"disable_sources,omitempty"`
	Enabled            bool   `url:"enabled,omitempty"`
}

type PartitionFileSystem

type PartitionFileSystem struct {
	FSType       string `json:"fstype"`
	UUID         string `json:"uuid"`
	MountPoint   string `json:"mount_point"`
	Label        string `json:"label,omitempty"`
	MountOptions string `json:"mount_options,omitempty"`
}

type RAID

type RAID struct {
	UUID          string       `json:"uuid,omitempty"`
	Name          string       `json:"name,omitempty"`
	Level         string       `json:"level,omitempty"`
	HumanSize     string       `json:"human_size,omitempty"`
	ResourceURI   string       `json:"resource_uri"`
	SystemID      string       `json:"system_id"`
	Devices       []RAIDDevice `json:"devices,omitempty"`
	SpareDevices  []RAIDDevice `json:"spare_devices,omitempty"`
	VirtualDevice BlockDevice  `json:"virtual_device,omitempty"`
	ID            int          `json:"id,omitempty"`
	Size          int64        `json:"size,omitempty"`
}

RAID represents the MAAS RAID endpoint.

type RAIDCreateParams

type RAIDCreateParams struct {
	Name            string   `url:"name,omitempty"`
	UUID            string   `url:"uuid,omitempty"`
	Level           string   `url:"level,omitempty"`
	BlockDevices    []string `url:"block_devices,omitempty"`
	Partitions      []string `url:"partitions,omitempty"`
	SpareDevices    []string `url:"spare_devices,omitempty"`
	SparePartitions []string `url:"spare_partitions,omitempty"`
}

RAIDCreateParams enumerates the parameters for the RAID create operation

type RAIDDevice

type RAIDDevice struct {
	Filesystem         PartitionFileSystem    `json:"filesystem,omitempty"`
	Type               string                 `json:"type,omitempty"`
	Model              string                 `json:"model,omitempty"`
	ResourceURI        string                 `json:"resource_uri,omitempty"`
	Name               string                 `json:"name,omitempty"`
	Path               string                 `json:"path,omitempty"`
	Serial             string                 `json:"serial,omitempty"`
	IDPath             string                 `json:"id_path,omitempty"`
	UsedFor            string                 `json:"used_for,omitempty"`
	FirmwareVersion    string                 `json:"firmware_version,omitempty"`
	PartitionTableType string                 `json:"partition_table_type,omitempty"`
	StoragePool        string                 `json:"storage_pool,omitempty"`
	UUID               string                 `json:"uuid,omitempty"`
	SystemID           string                 `json:"system_id,omitempty"`
	Partitions         []BlockDevicePartition `json:"partitions,omitempty"`
	Tags               []string               `json:"tags,omitempty"`
	Size               int64                  `json:"size,omitempty"`
	ID                 int                    `json:"id,omitempty"`
	BlockSize          int                    `json:"block_size,omitempty"`
	DeviceID           int                    `json:"device_id,omitempty"`
	AvailableSize      int64                  `json:"available_size,omitempty"`
	NUMANode           int                    `json:"numa_node,omitempty"`
	UsedSize           int64                  `json:"used_size,omitempty"`
	Bootable           bool                   `json:"bootable,omitempty"`
}

RAIDDevice is a combination of a BlockDevice and BlockDevicePartition since a RAID can contain either at devices field

type RAIDUpdateParams

type RAIDUpdateParams struct {
	Name                  string   `url:"name,omitempty"`
	UUID                  string   `url:"uuid,omitempty"`
	AddBlockDevices       []string `url:"add_block_devices,omitempty"`
	AddPartitions         []string `url:"add_partitions,omitempty"`
	AddSpareDevices       []string `url:"add_spare_devices,omitempty"`
	AddSparePartitions    []string `url:"add_spare_partitions,omitempty"`
	RemoveBlockDevices    []string `url:"remove_block_devices,omitempty"`
	RemovePartitions      []string `url:"remove_partitions,omitempty"`
	RemoveSpareDevices    []string `url:"remove_spare_devices,omitempty"`
	RemoveSparePartitions []string `url:"remove_spare_partitions,omitempty"`
}

RAIDUpdateParams enumerates the parameters for the RAID update operation

type RackController

type RackController Machine

RackController represents the MAAS RackController endpoint.

type RackControllerSearch

type RackControllerSearch struct {
	Hostname   string `json:"hostname,omitempty"`
	MACAddress string `json:"mac_address,omitempty"`
	SystemID   string `json:"id,omitempty"`
	Domain     string `json:"domain,omitempty"`
	Zone       string `json:"zone,omitempty"`
	Pool       string `json:"pool,omitempty"`
	AgentName  string `json:"agent_name,omitempty"`
}

RackControllerSearch narrows down the list in RackController.Get(). All fields are optional.

type ResourcePool

type ResourcePool struct {
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
	ResourceURI string `json:"resource_uri,omitempty"`
	ID          int    `json:"id,omitempty"`
}

ResourcePool represents the MAAS ResourcePool endpoint

type ResourcePoolParams

type ResourcePoolParams struct {
	Name        string `url:"name,omitempty"`
	Description string `url:"description,omitempty"`
}

type ResultType added in v0.5.0

type ResultType int

ResultType referring from MAAS server https://github.com/maas/maas/blob/master/src/metadataserver/enum.py#L56

const (
	COMMISSIONING ResultType = iota
	INSTALLATION
	TESTING
	RELEASE
)

type SSHKey added in v0.3.0

type SSHKey struct {
	Key         string `json:"key,omitempty"`
	Keysource   string `json:"keysource,omitempty"`
	ResourceURI string `json:"resource_uri,omitempty"`
	ID          int    `json:"id,omitempty"`
}

type SSLKey added in v0.3.0

type SSLKey struct {
	Key         string `json:"key,omitempty"`
	ResourceURI string `json:"resource_uri,omitempty"`
	ID          int    `json:"id,omitempty"`
}

type Space

type Space struct {
	Name        string   `json:"name,omitempty"`
	ResourceURI string   `json:"resource_uri,omitempty"`
	Subnets     []Subnet `json:"subnets,omitempty"`
	VLANs       []VLAN   `json:"vlans,omitempty"`
	ID          int      `json:"id,omitempty"`
}

type Subnet

type Subnet struct {
	Space           string   `json:"space,omitempty"`
	CIDR            string   `json:"cidr,omitempty"`
	Name            string   `json:"name,omitempty"`
	ResourceURI     string   `json:"resource_uri,omitempty"`
	DNSServers      []net.IP `json:"dns_servers,omitempty"`
	GatewayIP       net.IP   `json:"gateway_ip,omitempty"`
	VLAN            VLAN     `json:"vlan,omitempty"`
	ID              int      `json:"id,omitempty"`
	RDNSMode        int      `json:"rdns_mode,omitempty"`
	AllowDNS        bool     `json:"allow_dns,omitempty"`
	Managed         bool     `json:"managed,omitempty"`
	ActiveDiscovery bool     `json:"active_discovery,omitempty"`
	AllowProxy      bool     `json:"allow_proxy,omitempty"`
}

Subnet represents the MAAS Subnet endpoint.

type SubnetParams

type SubnetParams struct {
	CIDR        string   `url:"cidr"`
	Name        string   `url:"name,omitempty"`
	Description string   `url:"description,omitempty"`
	VLAN        string   `url:"vlan,omitempty"`
	Fabric      string   `url:"fabric,omitempty"`
	GatewayIP   string   `url:"gateway_ip,omitempty"`
	DNSServers  []string `url:"dns_servers,omitempty"`
	VID         int      `url:"vid,omitempty"`
	RDNSMode    int      `url:"rdns_mode"`
	AllowDNS    bool     `url:"allow_dns"`
	AllowProxy  bool     `url:"allow_proxy"`
	Managed     bool     `url:"managed"`
}

SubnetParams contains the parameters for the POST operation on the Subnets endpoint.

type Tag

type Tag struct {
	Name        string `json:"name,omitempty"`
	Definition  string `json:"definition,omitempty"`
	Comment     string `json:"comment,omitempty"`
	KernelOpts  string `json:"kernel_opts,omitempty"`
	ResourceURI string `json:"resource_uri,omitempty"`
}

type TagParams

type TagParams struct {
	Name       string `url:"name"`
	Definition string `url:"definition,omitempty"`
	Comment    string `url:"comment,omitempty"`
	KernelOpts string `url:"kernel_opts,omitempty"`
}

type User

type User struct {
	UserName    string `json:"username"`
	Email       string `json:"email"`
	ResourceURI string `json:"resource_uri"`
	IsSuperUser bool   `json:"is_superuser"`
	IsLocal     bool   `json:"is_local"`
}

type UserParams

type UserParams struct {
	UserName    string `url:"username"`
	Password    string `url:"password"`
	Email       string `url:"email"`
	IsSuperUser bool   `url:"is_superuser,int"`
}

type VLAN

type VLAN struct {
	RelayVLAN     *VLAN  `json:"relay_vlan,omitempty"`
	Name          string `json:"name,omitempty"`
	ExternalDHCP  string `json:"external_dhcp,omitempty"`
	Description   string `json:"description,omitempty"`
	PrimaryRack   string `json:"primary_rack,omitempty"`
	SecondaryRack string `json:"secondary_rack,omitempty"`
	Space         string `json:"space,omitempty"`
	Fabric        string `json:"fabric,omitempty"`
	ResourceURI   string `json:"resource_uri,omitempty"`
	MTU           int    `json:"mtu,omitempty"`
	FabricID      int    `json:"fabric_id,omitempty"`
	VID           int    `json:"vid,omitempty"`
	ID            int    `json:"id,omitempty"`
	DHCPOn        bool   `json:"dhcp_on,omitempty"`
}

VLAN represents the MAAS VLAN endpoint.

type VLANParams

type VLANParams struct {
	Name          string `url:"name,omitempty"`
	Description   string `url:"description,omitempty"`
	Space         string `url:"space,omitempty"`
	PrimaryRack   string `url:"primary_rack,omitempty"`
	SecondaryRack string `url:"secondary_rack,omitempty"`
	VID           int    `url:"vid,omitempty"`
	MTU           int    `url:"mtu,omitempty"`
	RelayVLAN     int    `url:"relay_vlan,omitempty"`
	DHCPOn        bool   `url:"dhcp_on"`
}

VLANParams contains the options for a POST request to the vlans endpoint. Only the VID field is required. If Space is empty or the string "undefined", the VLAN will be created in the 'undefined' space.

type VMHost

type VMHost struct {
	Zone               Zone                `json:"zone,omitempty"`
	Pool               ResourcePool        `json:"pool,omitempty"`
	ResourceURI        string              `json:"resource_uri,omitempty"`
	DefaultMACVLANMode string              `json:"default_macvlan_mode,omitempty"`
	Type               string              `json:"type,omitempty"`
	Name               string              `json:"name,omitempty"`
	Tags               []string            `json:"tags,omitempty"`
	Architectures      []string            `json:"architectures,omitempty"`
	StoragePools       []VMHostStoragePool `json:"storage_pools,omitempty"`
	Capabilities       []string            `json:"capabilities,omitempty"`
	Host               struct {
		SystemID   string `json:"system_id,omitempty"`
		Incomplete bool   `json:"__incomplete__,omitempty"` //nolint:tagliatelle // MAAS returns this field intentionally
	} `json:"host,omitempty"`
	Total                 VMHostResource `json:"total,omitempty"`
	Available             VMHostResource `json:"available,omitempty"`
	Used                  VMHostResource `json:"used,omitempty"`
	CPUOverCommitRatio    float64        `json:"cpu_over_commit_ratio,omitempty"`
	MemoryOverCommitRatio float64        `json:"memory_over_commit_ratio,omitempty"`
	ID                    int            `json:"id,omitempty"`
}

VMHost represents the MAAS VM host endpoint.

type VMHostMachineParams

type VMHostMachineParams struct {
	Architecture    string `url:"architecture,omitempty"`
	Storage         string `url:"storage,omitempty"`
	Interfaces      string `url:"interfaces,omitempty"`
	Hostname        string `url:"hostname,omitempty"`
	Cores           int    `url:"cores,omitempty"`
	PinnedCores     int    `url:"pinned_cores,omitempty"`
	Memory          int64  `url:"memory,omitempty"`
	HugepagesBacked bool   `url:"hugepages_backed,omitempty"`
}

VMHostMachineParams enumerates the VMHost machine configuration options.

type VMHostParams

type VMHostParams struct {
	Pool                  string  `url:"pool,omitempty"`
	Type                  string  `url:"type,omitempty"`
	PowerUser             string  `url:"power_user,omitempty"`
	PowerPass             string  `url:"power_pass,omitempty"`
	Name                  string  `url:"name,omitempty"`
	Zone                  string  `url:"zone,omitempty"`
	PowerAddress          string  `url:"power_address,omitempty"`
	DefaultStoragePool    string  `url:"default_storage_pool,omitempty"`
	Key                   string  `url:"key,omitempty"`
	Tags                  string  `url:"tags,omitempty"`
	DefaultMacvlanMode    string  `url:"default_macvlan_mode,omitempty"`
	Certificate           string  `url:"certificate,omitempty"`
	MemoryOverCommitRatio float64 `url:"memory_over_commit_ratio,omitempty"`
	CPUOverCommitRatio    float64 `url:"cpu_over_commit_ratio,omitempty"`
}

VMHostParams enumerates the VMHost configuration options.

type VMHostResource

type VMHostResource struct {
	Cores        int   `json:"cores,omitempty"`
	Memory       int64 `json:"memory,omitempty"`
	LocalStorage int64 `json:"local_storage,omitempty"`
}

VMHostResource represents the "used", "available", and "total" objects in a VMHost This type should not be used directly.

type VMHostStoragePool

type VMHostStoragePool struct {
	ID        string `json:"id,omitempty"`
	Name      string `json:"name,omitempty"`
	Type      string `json:"type,omitempty"`
	Path      string `json:"path,omitempty"`
	Total     int64  `json:"total,omitempty"`
	Used      int64  `json:"used,omitempty"`
	Available int64  `json:"available,omitempty"`
	Default   bool   `json:"default,omitempty"`
}

VMHostStoragePool represents the "storage_pools" object in a VMHost. This type should not be used directly.

type Version added in v0.5.0

type Version struct {
	Subversion   string   `json:"subversion,omitempty"`
	Version      string   `json:"version,omitempty"`
	Capabilities []string `json:"capabilities,omitempty"`
}

type VolumeGroup

type VolumeGroup struct {
	LogicalVolumes     interface{} `json:"logical_volumes,omitempty"`
	Devices            interface{} `json:"devices,omitempty"`
	HumanSize          string      `json:"human_size,omitempty"`
	UUID               string      `json:"uuid,omitempty"`
	HumanAvailableSize string      `json:"human_available_size,omitempty"`
	SystemID           string      `json:"system_id,omitempty"`
	ResourceURI        string      `json:"resource_uri,omitempty"`
	HumanUsedSize      string      `json:"human_used_size,omitempty"`
	Name               string      `json:"name,omitempty"`
	Size               int64       `json:"size,omitempty"`
	UsedSize           int64       `json:"used_size,omitempty"`
	AvailableSize      int64       `json:"available_size,omitempty"`
	ID                 int         `json:"id,omitempty"`
}

VolumeGroup represents the MAAS VolumeGroup endpoint.

type Zone

type Zone struct {
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
	ResourceURI string `json:"resource_uri,omitempty"`
	ID          int    `json:"id,omitempty"`
}

Zone represents the MAAS Zone endpoint

type ZoneParams added in v0.2.0

type ZoneParams struct {
	Name        string `url:"name,omitempty"`
	Description string `url:"description,omitempty"`
}

Directories

Path Synopsis
Package event contains entities related to events.
Package event contains entities related to events.
Package node contains entities related to nodes.
Package node contains entities related to nodes.
Package subnet contains entities related to subnets.
Package subnet contains entities related to subnets.

Jump to

Keyboard shortcuts

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