Documentation ¶
Index ¶
- Constants
- type BootResource
- type BootResourceBuilder
- type BootResourceUploader
- type BootResources
- type Client
- type ClientSetInterface
- type Controller
- type DNSResource
- type DNSResourceBuilder
- type DNSResourceModifier
- type DNSResources
- type Domain
- type Domains
- type FilterType
- type IPAddress
- type Machine
- type MachineAllocator
- type MachineDeployer
- type MachineModifier
- type MachineReleaser
- type Machines
- type Params
- type RackControllers
- type ResourcePool
- type ResourcePools
- type Set
- type SetFile
- type Space
- type Spaces
- type Subnet
- type User
- type Users
- type VLAN
- type Zone
- type Zones
Constants ¶
View Source
const ( BootResourcesAPIPath = "/boot-resources/" BootResourceAPIPathFormat = "/boot-resources/%d/" )
View Source
const ( // parametes FQDNKey = "fqdn" DomainKey = "domain" NameKey = "name" ArchitectureKey = "architecture" SHA256Key = "sha256" SizeKey = "size" ZoneKey = "zone" SystemIDKey = "system_id" CPUCountKey = "cpu_count" MemoryKey = "mem" PoolLabel = "pool" OSSystemKey = "osystem" UserDataKey = "user_data" DistroSeriesKey = "distro_series" TitleKey = "title" ContentKey = "content" FileTypeKey = "filetype" RRTypeKey = "rrtype" AllKey = "all" AddressTTLKey = "address_ttl" IPAddressesKey = "ip_addresses" IDKey = "id" EraseKey = "erase" QuickEraseKey = "quick_erase" SecureEraseKey = "secure_erase" ForceKey = "force" CommentKey = "comment" SwapSizeKey = "swap_size" HostnameKey = "hostname" TrueKey = "true" // Resource operations Operation = "op" OperationDeploy = "deploy" OperationWhoAmI = "whoami" OperationImportBootImages = "import_boot_images" OperationReleaseMachine = "release" OperationAllocate = "allocate" )
View Source
const ( DNSResourcesAPIPath = "/dnsresources/" DNSResourceAPIFormat = "/dnsresources/%d/" )
View Source
const ( DomainsAPIPath = "/domains/" DomainAPIPathFormat = "/domains/%d" )
View Source
const ( ResourcePoolsAPIPath = "/resourcepools/" ResourcePoolAPIPathFormat = "/resourcepools/%d" )
View Source
const (
RackControllersAPIPath = "/rackcontrollers/"
)
View Source
const (
UsersAPIPath = "/users/"
)
View Source
const (
ZonesAPIPath = "/zones/"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BootResource ¶
type BootResourceBuilder ¶
type BootResourceBuilder interface { WithTitle(title string) BootResourceBuilder WithFileType(fileType string) BootResourceBuilder Create(ctx context.Context) (BootResource, error) }
type BootResourceUploader ¶
type BootResources ¶
type BootResources interface { List(ctx context.Context, params Params) ([]BootResource, error) BootResource(id int) BootResource Builder(name, architecture, hash, filePath string, size int) BootResourceBuilder }
Implements subset of https://maas.io/docs/api#boot-resources Usage bootstrap_test.go
func NewBootResourcesClient ¶
func NewBootResourcesClient(client Client) BootResources
type Client ¶
type Client interface { Get(ctx context.Context, path string, params url.Values) (*http.Response, error) PostForm(ctx context.Context, path string, contentType string, params url.Values, body io.Reader) (*http.Response, error) Post(ctx context.Context, path string, params url.Values) (*http.Response, error) Put(ctx context.Context, path string, params url.Values, body io.Reader, contentLength int) (*http.Response, error) PutParams(ctx context.Context, param string, params url.Values) (*http.Response, error) Delete(ctx context.Context, path string, params url.Values) (*http.Response, error) }
type ClientSetInterface ¶
type ClientSetInterface interface { BootResources() BootResources DNSResources() DNSResources Domains() Domains Machines() Machines RackControllers() RackControllers ResourcePools() ResourcePools Spaces() Spaces Users() Users Zones() Zones }
func NewAuthenticatedClientSet ¶
func NewAuthenticatedClientSet(maasEndpoint, apiKey string, options ...func(client *authenticatedClientSet)) ClientSetInterface
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
type DNSResource ¶
type DNSResourceBuilder ¶
type DNSResourceBuilder interface { WithFQDN(fqdn string) DNSResourceBuilder WithDomain(domain string) DNSResourceBuilder WithName(name string) DNSResourceBuilder WithAddressTTL(addressTTL string) DNSResourceBuilder WithIPAddresses(ipAddresses []string) DNSResourceBuilder Create(ctx context.Context) (DNSResource, error) }
type DNSResourceModifier ¶
type DNSResourceModifier interface { SetFQDN(fqdn string) DNSResourceModifier SetAddressTTL(addressTTL int) DNSResourceModifier SetIPAddresses(address []string) DNSResourceModifier SetName(name string) DNSResourceModifier SetDomain(name string) DNSResourceModifier Modify(ctx context.Context) (DNSResource, error) }
type DNSResources ¶
type DNSResources interface { List(ctx context.Context, params Params) ([]DNSResource, error) Builder() DNSResourceBuilder DNSResource(id int) DNSResource }
func NewDNSResourcesClient ¶
func NewDNSResourcesClient(client *authenticatedClient) DNSResources
type Domains ¶
func NewDomainsClient ¶
func NewDomainsClient(client *authenticatedClient) Domains
type FilterType ¶
type FilterType string
type Machine ¶
type Machine interface { Get(ctx context.Context) (Machine, error) Delete(ctx context.Context) error Releaser() MachineReleaser Modifier() MachineModifier Deployer() MachineDeployer SystemID() string FQDN() string Zone() Zone PowerState() string Hostname() string IPAddresses() []net.IP State() string OSSystem() string DistroSeries() string SwapSize() int }
type MachineAllocator ¶
type MachineAllocator interface { Allocate(ctx context.Context) (Machine, error) WithZone(zone string) MachineAllocator WithSystemID(id string) MachineAllocator WithName(name string) MachineAllocator WithCPUCount(cpuCount int) MachineAllocator WithMemory(memory int) MachineAllocator WithResourcePool(pool string) MachineAllocator }
type MachineDeployer ¶
type MachineDeployer interface { SetOSSystem(ossytem string) MachineDeployer SetUserData(userdata string) MachineDeployer SetDistroSeries(distroseries string) MachineDeployer Deploy(ctx context.Context) (Machine, error) }
type MachineModifier ¶
type MachineModifier interface { SetSwapSize(size int) MachineModifier SetHostname(hostname string) MachineModifier Update(ctx context.Context) (Machine, error) }
type MachineReleaser ¶
type MachineReleaser interface { Release(ctx context.Context) (Machine, error) WithErase() MachineReleaser WithQuickErase() MachineReleaser WithSecureErase() MachineReleaser WithForce() MachineReleaser WithComment(comment string) MachineReleaser }
type Machines ¶
type Machines interface { List(ctx context.Context, params Params) ([]Machine, error) Machine(systemId string) Machine Allocator() MachineAllocator }
func NewMachinesClient ¶
func NewMachinesClient(client *authenticatedClient) Machines
type Params ¶
type Params interface { Add(key, value string) Params Set(key, value string) Params Reset() Values() url.Values Copy(in Params) }
func ParamsBuilder ¶
func ParamsBuilder() Params
type RackControllers ¶
func NewRackControllersClient ¶
func NewRackControllersClient(client *authenticatedClient) RackControllers
type ResourcePool ¶
type ResourcePools ¶
type ResourcePools interface { List(ctx context.Context, params Params) ([]ResourcePool, error) ResourcePool(id int) ResourcePool }
func NewResourcePoolsClient ¶
func NewResourcePoolsClient(client *authenticatedClient) ResourcePools
type Spaces ¶
func NewSpacesClient ¶
func NewSpacesClient(client *authenticatedClient) Spaces
type Users ¶
type Users interface { List(ctx context.Context) ([]User, error) WhoAmI(ctx context.Context) (User, error) }
func NewUsersClient ¶
func NewUsersClient(client *authenticatedClient) Users
Source Files ¶
Click to show internal directories.
Click to hide internal directories.