entity

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: 2 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 BlockDevice

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

BlockDevice represents the MaaS BlockDevice endpoint.

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 Machine

type Machine struct {
	BootInterface   NetworkInterface `json:"boot_interface,omitempty"`
	Pod             Pod              `json:"pod,omitempty"`
	BootDisk        BlockDevice      `json:"boot_disk,omitempty"`
	Domain          Domain           `json:"domain,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"`
	Pool                         ResourcePool        `json:"pool,omitempty"`
	Zone                         Zone                `json:"zone,omitempty"`
	TagNames                     []string            `json:"tag_names,omitempty"`
	IPAddresses                  []net.IP            `json:"ip_addresses,omitempty"`
	BlockDeviceSet               []BlockDevice       `json:"blockdevice_set,omitempty"`
	CacheSets                    []string            `json:"cache_sets,omitempty"`
	VolumeGroups                 []string            `json:"volume_groups,omitempty"`
	InterfaceSet                 []NetworkInterface  `json:"interface_set,omitempty"`
	BCaches                      []string            `json:"bcaches,omitempty"`
	RAIDs                        []string            `json:"raids,omitempty"`
	SpecialFilesystems           []string            `json:"special_filesystems,omitempty"`
	ServiceSet                   []MachineServiceSet `json:"service_set,omitempty"`
	PhysicalBlockDeviceSet       []BlockDevice       `json:"physicalblockdevice_set,omitempty"`
	ISCSIBlockDeviceSet          []BlockDevice       `json:"iscsiblockdevice_set,omitempty"`
	VirtualBlockDeviceSet        []BlockDevice       `json:"virtualblockdevice_set,omitempty"`
	CurrentInstallationResultID  string              `json:"current_installation_result_id,omitempty"`
	FQDN                         string              `json:"fqdn,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"`
	Architecture                 string              `json:"architecture,omitempty"`
	PowerState                   string              `json:"power_state,omitempty"`
	MemoryTestStatusName         string              `json:"memory_test_status_name,omitempty"`
	PowerType                    string              `json:"power_type,omitempty"`
	OwnerData                    interface{}         `json:"owner_data,omitempty"`
	Hostname                     string              `json:"hostname,omitempty"`
	Description                  string              `json:"description,omitempty"`
	StatusAction                 string              `json:"status_action,omitempty"`
	StatusMessage                string              `json:"status_message,omitempty"`
	StatusName                   string              `json:"status_name,omitempty"`
	OSystem                      string              `json:"osystem,omitempty"`
	CPUTestStatusName            string              `json:"cpu_test_status_name,omitempty"`
	OtherTestStatusName          string              `json:"other_test_status_name,omitempty"`
	ResourceURI                  string              `json:"resource_uri,omitempty"`
	Memory                       int                 `json:"memory,omitempty"`
	NodeType                     int                 `json:"node_type,omitempty"`
	CurrentCommissioningResultID int                 `json:"current_commissioning_result_id,omitempty"`
	CPUTestStatus                int                 `json:"cpu_test_status,omitempty"`
	AddressTTL                   int                 `json:"address_ttl,omitempty"`
	Storage                      float64             `json:"storage,omitempty"`
	HardwareInfo                 map[string]string   `json:"hardware_info,omitempty"`
	CPUCount                     int                 `json:"cpu_count,omitempty"`
	Status                       node.Status         `json:"status,omitempty"`
	CurrentTestingResultID       int                 `json:"current_testing_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                     int                 `json:"swap_size,omitempty"`
	MemoryTestStatus             int                 `json:"memory_test_status,omitempty"`
	CPUSpeed                     int                 `json:"cpu_speed,omitempty"`
	DisableIPv4                  bool                `json:"disable_ipv4,omitempty"`
	Netboot                      bool                `json:"netboot,omitempty"`
	Locked                       bool                `json:"locked,omitempty"`
}

Machine represents the MaaS Machine endpoint.

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 NetworkInterface

type NetworkInterface struct {
	VLAN               VLAN                   `json:"vlan,omitempty"`
	Children           []string               `json:"children,omitempty"`
	Parents            []string               `json:"parents,omitempty"`
	Tags               []string               `json:"tags,omitempty"`
	Links              []NetworkInterfaceLink `json:"links,omitempty"`
	Name               string                 `json:"name,omitempty"`
	MACAddress         string                 `json:"mac_address,omitempty"`
	Product            string                 `json:"product,omitempty"`
	FirmwareVersion    string                 `json:"firmware_version,omitempty"`
	SystemID           string                 `json:"system_id,omitempty"`
	Params             interface{}            `json:"params,omitempty"`
	Type               string                 `json:"type,omitempty"`
	Discovered         string                 `json:"discovered,omitempty"`
	Vendor             string                 `json:"vendor,omitempty"`
	ResourceURI        string                 `json:"resource_uri,omitempty"`
	BondXMitHashPolicy string                 `json:"bond_x_mit_hash_policy,omitempty"`
	BondMode           string                 `json:"bond_mode,omitempty"`
	MTU                string                 `json:"mtu,omitempty"`
	EffectiveMTU       int                    `json:"effective_mtu,omitempty"`
	ID                 int                    `json:"id,omitempty"`
	BridgeFD           int                    `json:"bridge_fd,omitempty"`
	BondMIIMon         int                    `json:"bond_mii_mon,omitempty"`
	BondDownDelay      int                    `json:"bond_down_delay,omitempty"`
	BondUpDelay        int                    `json:"bond_up_delay,omitempty"`
	BondLACPRate       int                    `json:"bond_lacp_rate,omitempty"`
	AcceptRA           bool                   `json:"accept_ra,omitempty"`
	Autoconf           bool                   `json:"autoconf,omitempty"`
	Enabled            bool                   `json:"enabled,omitempty"`
	BridgeSTP          bool                   `json:"bridge_stp,omitempty"`
}

NetworkInterface represents the MaaS Interface endpoint.

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

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

type Node

type Node Machine

Node represents the MaaS Node endpoint.

type Pod

type Pod struct {
	Zone      Zone         `json:"zone,omitempty"`
	Pool      ResourcePool `json:"pool,omitempty"`
	Used      PodResource  `json:"used,omitempty"`
	Available PodResource  `json:"available,omitempty"`
	Total     PodResource  `json:"total,omitempty"`
	Host      struct {
		SystemID   string `json:"system_id,omitempty"`
		Incomplete bool   `json:"__incomplete__,omitempty"`
	} `json:"host,omitempty"`
	StoragePools          []PodStoragePool `json:"storage_pools,omitempty"`
	Architectures         []string         `json:"architectures,omitempty"`
	Tags                  []string         `json:"tags,omitempty"`
	Capabilities          []string         `json:"capabilities,omitempty"`
	Name                  string           `json:"name,omitempty"`
	Type                  string           `json:"type,omitempty"`
	DefaultMACVLANMode    string           `json:"default_macvlan_mode,omitempty"`
	ResourceURI           string           `json:"resource_uri,omitempty"`
	CPUOverCommitRatio    float64          `json:"cpu_over_commit_ratio,omitempty"`
	MemoryOverCommitRatio float64          `json:"memory_over_commit_ratio,omitempty"`
	ID                    int              `json:"id,omitempty"`
}

Pod represents the MaaS Pod endpoint.

type PodResource

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

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

type PodStoragePool

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

PodStoragePool represents the "storage_pools" object in a Pod. This type should not be used directly.

type RackController

type RackController Machine

RackController represents the MaaS RackController endpoint.

type ResourcePool

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

ResourcePool represents the MaaS ResourcePool endpoint

type Subnet

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

Subnet represents the MaaS Subnet endpoint.

type VLAN

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

VLAN represents the MaaS VLAN endpoint.

type Zone

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

Zone represents the MaaS Zone endpoint

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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