client

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiClient

type ApiClient struct {
	AuthClient gomaasapi.Client
	*gomaasapi.MAASObject
}

func GetApiClient

func GetApiClient(apiURL string, apiKey string, apiVersion string) (*ApiClient, error)

func (ApiClient) Get

func (c ApiClient) Get(op string, params url.Values, f func([]byte) error) error

func (ApiClient) GetSubObject

func (c ApiClient) GetSubObject(name string) ApiClient

func (ApiClient) Post

func (c ApiClient) Post(op string, params url.Values, f func([]byte) error) error

func (ApiClient) Put

func (c ApiClient) Put(params url.Values, f func([]byte) error) error

type BlockDevice

type BlockDevice struct {
	ApiClient ApiClient
}

func (*BlockDevice) AddTag

func (b *BlockDevice) AddTag(systemID string, id int, tag string) (blockDevice *entity.BlockDevice, err error)

func (*BlockDevice) Delete

func (b *BlockDevice) Delete(systemID string, id int) error

func (*BlockDevice) Format

func (b *BlockDevice) Format(systemID string, id int, fsType string) (blockDevice *entity.BlockDevice, err error)

func (*BlockDevice) Get

func (b *BlockDevice) Get(systemID string, id int) (blockDevice *entity.BlockDevice, err error)

func (*BlockDevice) Mount

func (b *BlockDevice) Mount(systemID string, id int, mountPoint string, mountOptions string) (blockDevice *entity.BlockDevice, err error)

func (*BlockDevice) RemoveTag

func (b *BlockDevice) RemoveTag(systemID string, id int, tag string) (blockDevice *entity.BlockDevice, err error)

func (*BlockDevice) SetBootDisk

func (b *BlockDevice) SetBootDisk(systemID string, id int) error

func (*BlockDevice) Unformat

func (b *BlockDevice) Unformat(systemID string, id int) (blockDevice *entity.BlockDevice, err error)

func (*BlockDevice) Unmount

func (b *BlockDevice) Unmount(systemID string, id int) (blockDevice *entity.BlockDevice, err error)

func (*BlockDevice) Update

func (b *BlockDevice) Update(systemID string, id int, params *entity.BlockDeviceParams) (blockDevice *entity.BlockDevice, err error)

type BlockDevicePartition

type BlockDevicePartition struct {
	ApiClient ApiClient
}

func (*BlockDevicePartition) AddTag

func (p *BlockDevicePartition) AddTag(systemID string, blockDeviceID int, id int, tag string) (partition *entity.BlockDevicePartition, err error)

func (*BlockDevicePartition) Delete

func (p *BlockDevicePartition) Delete(systemID string, blockDeviceID int, id int) error

func (*BlockDevicePartition) Format

func (p *BlockDevicePartition) Format(systemID string, blockDeviceID int, id int, fsType string, label string) (partition *entity.BlockDevicePartition, err error)

func (*BlockDevicePartition) Get

func (p *BlockDevicePartition) Get(systemID string, blockDeviceID int, id int) (partition *entity.BlockDevicePartition, err error)

func (*BlockDevicePartition) Mount

func (p *BlockDevicePartition) Mount(systemID string, blockDeviceID int, id int, mountPoint string, mountOptions string) (partition *entity.BlockDevicePartition, err error)

func (*BlockDevicePartition) RemoveTag

func (p *BlockDevicePartition) RemoveTag(systemID string, blockDeviceID int, id int, tag string) (partition *entity.BlockDevicePartition, err error)

func (*BlockDevicePartition) Unformat

func (p *BlockDevicePartition) Unformat(systemID string, blockDeviceID int, id int) (partition *entity.BlockDevicePartition, err error)

func (*BlockDevicePartition) Unmount

func (p *BlockDevicePartition) Unmount(systemID string, blockDeviceID int, id int) (partition *entity.BlockDevicePartition, err error)

type BlockDevicePartitions

type BlockDevicePartitions struct {
	ApiClient ApiClient
}

func (*BlockDevicePartitions) Create

func (p *BlockDevicePartitions) Create(systemID string, blockDeviceID int, params *entity.BlockDevicePartitionParams) (partition *entity.BlockDevicePartition, err error)

func (*BlockDevicePartitions) Get

func (p *BlockDevicePartitions) Get(systemID string, blockDeviceID int) (partitions []entity.BlockDevicePartition, err error)

type BlockDevices

type BlockDevices struct {
	ApiClient ApiClient
}

func (*BlockDevices) Create

func (b *BlockDevices) Create(systemID string, params *entity.BlockDeviceParams) (blockDevice *entity.BlockDevice, err error)

func (*BlockDevices) Get

func (b *BlockDevices) Get(systemID string) (blockDevices []entity.BlockDevice, err error)

type Client

type Client struct {
	DNSResource           api.DNSResource
	DNSResources          api.DNSResources
	DNSResourceRecord     api.DNSResourceRecord
	DNSResourceRecords    api.DNSResourceRecords
	Domain                api.Domain
	Domains               api.Domains
	Fabric                api.Fabric
	Fabrics               api.Fabrics
	VLAN                  api.VLAN
	VLANs                 api.VLANs
	Space                 api.Space
	Spaces                api.Spaces
	Machine               api.Machine
	Machines              api.Machines
	VMHost                api.VMHost
	VMHosts               api.VMHosts
	NetworkInterface      api.NetworkInterface
	NetworkInterfaces     api.NetworkInterfaces
	Subnet                api.Subnet
	Subnets               api.Subnets
	IPRange               api.IPRange
	IPRanges              api.IPRanges
	IPAddresses           api.IPAddresses
	Tag                   api.Tag
	Tags                  api.Tags
	BlockDevice           api.BlockDevice
	BlockDevices          api.BlockDevices
	BlockDevicePartition  api.BlockDevicePartition
	BlockDevicePartitions api.BlockDevicePartitions
	User                  api.User
	Users                 api.Users
}

func GetClient

func GetClient(apiURL string, apiKey string, apiVersion string) (*Client, error)

type DNSResource

type DNSResource struct {
	ApiClient ApiClient
}

func (*DNSResource) Delete

func (d *DNSResource) Delete(id int) error

func (*DNSResource) Get

func (d *DNSResource) Get(id int) (dnsResource *entity.DNSResource, err error)

func (*DNSResource) Update

func (d *DNSResource) Update(id int, params *entity.DNSResourceParams) (dnsResource *entity.DNSResource, err error)

type DNSResourceRecord

type DNSResourceRecord struct {
	ApiClient ApiClient
}

func (*DNSResourceRecord) Delete

func (d *DNSResourceRecord) Delete(id int) error

func (*DNSResourceRecord) Get

func (d *DNSResourceRecord) Get(id int) (dnsResourceRecord *entity.DNSResourceRecord, err error)

func (*DNSResourceRecord) Update

func (d *DNSResourceRecord) Update(id int, params *entity.DNSResourceRecordParams) (dnsResourceRecord *entity.DNSResourceRecord, err error)

type DNSResourceRecords

type DNSResourceRecords struct {
	ApiClient ApiClient
}

func (*DNSResourceRecords) Create

func (d *DNSResourceRecords) Create(params *entity.DNSResourceRecordParams) (dnsResourceRecord *entity.DNSResourceRecord, err error)

func (*DNSResourceRecords) Get

func (d *DNSResourceRecords) Get() (dnsResourceRecords []entity.DNSResourceRecord, err error)

type DNSResources

type DNSResources struct {
	ApiClient ApiClient
}

func (*DNSResources) Create

func (d *DNSResources) Create(params *entity.DNSResourceParams) (dnsResource *entity.DNSResource, err error)

func (*DNSResources) Get

func (d *DNSResources) Get() (dnsresources []entity.DNSResource, err error)

type Domain

type Domain struct {
	ApiClient ApiClient
}

func (*Domain) Delete

func (d *Domain) Delete(id int) error

func (*Domain) Get

func (d *Domain) Get(id int) (domain *entity.Domain, err error)

func (*Domain) SetDefault

func (d *Domain) SetDefault(id int) (domain *entity.Domain, err error)

func (*Domain) Update

func (d *Domain) Update(id int, params *entity.DomainParams) (domain *entity.Domain, err error)

type Domains

type Domains struct {
	ApiClient ApiClient
}

func (*Domains) Create

func (d *Domains) Create(params *entity.DomainParams) (domain *entity.Domain, err error)

func (*Domains) Get

func (d *Domains) Get() (domains []entity.Domain, err error)

func (*Domains) SetSerial

func (d *Domains) SetSerial(serial int) error

type Fabric

type Fabric struct {
	ApiClient ApiClient
}

func (*Fabric) Delete

func (f *Fabric) Delete(id int) error

func (*Fabric) Get

func (f *Fabric) Get(id int) (fabric *entity.Fabric, err error)

func (*Fabric) Update

func (f *Fabric) Update(id int, fabricParams *entity.FabricParams) (fabric *entity.Fabric, err error)

type Fabrics

type Fabrics struct {
	ApiClient ApiClient
}

func (*Fabrics) Create

func (f *Fabrics) Create(fabricParams *entity.FabricParams) (fabric *entity.Fabric, err error)

func (*Fabrics) Get

func (f *Fabrics) Get() (fabrics []entity.Fabric, err error)

type IPAddresses

type IPAddresses struct {
	ApiClient ApiClient
}

func (*IPAddresses) Get

func (i *IPAddresses) Get(params *entity.IPAddressesParams) (ipAddresses []entity.IPAddress, err error)

func (*IPAddresses) Release

func (i *IPAddresses) Release(params *entity.IPAddressesParams) error

func (*IPAddresses) Reserve

func (i *IPAddresses) Reserve(params *entity.IPAddressesParams) (ipAddress *entity.IPAddress, err error)

type IPRange

type IPRange struct {
	ApiClient ApiClient
}

func (*IPRange) Delete

func (i *IPRange) Delete(id int) error

func (*IPRange) Get

func (i *IPRange) Get(id int) (ipRange *entity.IPRange, err error)

func (*IPRange) Update

func (i *IPRange) Update(id int, params *entity.IPRangeParams) (ipRange *entity.IPRange, err error)

type IPRanges

type IPRanges struct {
	ApiClient ApiClient
}

func (*IPRanges) Create

func (i *IPRanges) Create(params *entity.IPRangeParams) (ipRange *entity.IPRange, err error)

func (*IPRanges) Get

func (i *IPRanges) Get() (ipRanges []entity.IPRange, err error)

type Machine

type Machine struct {
	ApiClient ApiClient
}

Contains functionality for manipulating the Machine entity.

func (*Machine) ClearDefaultGateways

func (m *Machine) ClearDefaultGateways(systemID string) (ma *entity.Machine, err error)

Clear default gateways.

func (*Machine) Commission

func (m *Machine) Commission(systemID string, params *entity.MachineCommissionParams) (ma *entity.Machine, err error)

Commission machine.

func (*Machine) Delete

func (m *Machine) Delete(systemID string) error

Delete machine.

func (*Machine) Deploy

func (m *Machine) Deploy(systemID string, params *entity.MachineDeployParams) (ma *entity.Machine, err error)

Deploy machine.

func (*Machine) Get

func (m *Machine) Get(systemID string) (ma *entity.Machine, err error)

Get machine details.

func (*Machine) GetPowerParameters

func (m *Machine) GetPowerParameters(systemID string) (params map[string]string, err error)

func (*Machine) Lock

func (m *Machine) Lock(systemID string, comment string) (ma *entity.Machine, err error)

Lock machine.

func (*Machine) Update

func (m *Machine) Update(systemID string, machineParams *entity.MachineParams, powerParams map[string]string) (ma *entity.Machine, err error)

Update machine.

type Machines

type Machines struct {
	ApiClient ApiClient
}

Contains functionality for manipulating the Machines entity.

func (*Machines) Allocate

func (m *Machines) Allocate(params *entity.MachineAllocateParams) (ma *entity.Machine, err error)

Allocate machine.

func (*Machines) Create

func (m *Machines) Create(machineParams *entity.MachineParams, powerParams map[string]string) (ma *entity.Machine, err error)

Create machine.

func (*Machines) Get

func (m *Machines) Get() (machines []entity.Machine, err error)

List machines.

func (*Machines) Release

func (m *Machines) Release(systemIDs []string, comment string) error

Release machine.

type NetworkInterface

type NetworkInterface struct {
	ApiClient ApiClient
}

func (*NetworkInterface) AddTag

func (n *NetworkInterface) AddTag(systemID string, id int, tag string) (*entity.NetworkInterface, error)

func (*NetworkInterface) Delete

func (n *NetworkInterface) Delete(systemID string, id int) error

func (*NetworkInterface) Disconnect

func (n *NetworkInterface) Disconnect(systemID string, id int) (networkInterface *entity.NetworkInterface, err error)

func (*NetworkInterface) Get

func (n *NetworkInterface) Get(systemID string, id int) (networkInterface *entity.NetworkInterface, err error)

func (*NetworkInterface) LinkSubnet

func (n *NetworkInterface) LinkSubnet(systemID string, id int, params *entity.NetworkInterfaceLinkParams) (*entity.NetworkInterface, error)

func (*NetworkInterface) RemoveTag

func (n *NetworkInterface) RemoveTag(systemID string, id int, tag string) (*entity.NetworkInterface, error)

func (*NetworkInterface) SetDefaultGateway

func (n *NetworkInterface) SetDefaultGateway(systemID string, id int, linkID int) (networkInterface *entity.NetworkInterface, err error)

func (*NetworkInterface) UnlinkSubnet

func (n *NetworkInterface) UnlinkSubnet(systemID string, id int, linkID int) (networkInterface *entity.NetworkInterface, err error)

func (*NetworkInterface) Update

func (n *NetworkInterface) Update(systemID string, id int, params interface{}) (networkInterface *entity.NetworkInterface, err error)

type NetworkInterfaces

type NetworkInterfaces struct {
	ApiClient ApiClient
}

func (*NetworkInterfaces) CreateBond

func (n *NetworkInterfaces) CreateBond(systemID string, params *entity.NetworkInterfaceBondParams) (networkInterface *entity.NetworkInterface, err error)

func (*NetworkInterfaces) CreateBridge

func (n *NetworkInterfaces) CreateBridge(systemID string, params *entity.NetworkInterfaceBridgeParams) (networkInterface *entity.NetworkInterface, err error)

func (*NetworkInterfaces) CreatePhysical

func (n *NetworkInterfaces) CreatePhysical(systemID string, params *entity.NetworkInterfacePhysicalParams) (networkInterface *entity.NetworkInterface, err error)

func (*NetworkInterfaces) CreateVLAN

func (n *NetworkInterfaces) CreateVLAN(systemID string, params *entity.NetworkInterfaceVLANParams) (networkInterface *entity.NetworkInterface, err error)

func (*NetworkInterfaces) Get

func (n *NetworkInterfaces) Get(systemID string) (networkInterfaces []entity.NetworkInterface, err error)

type Space

type Space struct {
	ApiClient ApiClient
}

func (*Space) Delete

func (s *Space) Delete(id int) error

func (*Space) Get

func (s *Space) Get(id int) (space *entity.Space, err error)

func (*Space) Update

func (s *Space) Update(id int, name string) (space *entity.Space, err error)

type Spaces

type Spaces struct {
	ApiClient ApiClient
}

func (*Spaces) Create

func (s *Spaces) Create(name string) (space *entity.Space, err error)

func (*Spaces) Get

func (s *Spaces) Get() (spaces []entity.Space, err error)

type Subnet

type Subnet struct {
	ApiClient ApiClient
}

func (*Subnet) Delete

func (s *Subnet) Delete(id int) error

func (*Subnet) Get

func (s *Subnet) Get(id int) (subnet *entity.Subnet, err error)

func (*Subnet) GetIPAddresses

func (s *Subnet) GetIPAddresses(id int) (subnetIPAddresses []subnet.IPAddress, err error)

func (*Subnet) GetReservedIPRanges

func (s *Subnet) GetReservedIPRanges(id int) (subnetReservedIPRanges []subnet.ReservedIPRange, err error)

func (*Subnet) GetStatistics

func (s *Subnet) GetStatistics(id int) (stats *subnet.Statistics, err error)

func (*Subnet) GetUnreservedIPRanges

func (s *Subnet) GetUnreservedIPRanges(id int) (ipRanges []subnet.IPRange, err error)

func (*Subnet) Update

func (s *Subnet) Update(id int, params *entity.SubnetParams) (subnet *entity.Subnet, err error)

type Subnets

type Subnets struct {
	ApiClient ApiClient
}

Contains functionality for manipulating the Subnets entity.

func (*Subnets) Create

func (s *Subnets) Create(params *entity.SubnetParams) (subnet *entity.Subnet, err error)

func (*Subnets) Get

func (s *Subnets) Get() (subnets []entity.Subnet, err error)

type Tag

type Tag struct {
	ApiClient ApiClient
}

func (*Tag) AddMachines

func (t *Tag) AddMachines(name string, machineIds []string) error

func (*Tag) Delete

func (t *Tag) Delete(name string) error

func (*Tag) Get

func (t *Tag) Get(name string) (tag *entity.Tag, err error)

func (*Tag) GetMachines

func (t *Tag) GetMachines(name string) (machines []entity.Machine, err error)

func (*Tag) RemoveMachines

func (t *Tag) RemoveMachines(name string, machineIds []string) error

func (*Tag) Update

func (t *Tag) Update(name string, tagParams *entity.TagParams) (tag *entity.Tag, err error)

type Tags

type Tags struct {
	ApiClient ApiClient
}

func (*Tags) Create

func (t *Tags) Create(tagParams *entity.TagParams) (tag *entity.Tag, err error)

func (*Tags) Get

func (t *Tags) Get() (tags []entity.Tag, err error)

type User

type User struct {
	ApiClient ApiClient
}

func (*User) Delete

func (u *User) Delete(userName string) error

func (*User) Get

func (u *User) Get(userName string) (user *entity.User, err error)

type Users

type Users struct {
	ApiClient ApiClient
}

func (*Users) Create

func (u *Users) Create(params *entity.UserParams) (user *entity.User, err error)

func (*Users) Get

func (u *Users) Get() (users []entity.User, err error)

type VLAN

type VLAN struct {
	ApiClient ApiClient
}

func (*VLAN) Delete

func (v *VLAN) Delete(fabricID int, vid int) error

func (*VLAN) Get

func (v *VLAN) Get(fabricID int, vid int) (vlan *entity.VLAN, err error)

func (*VLAN) Update

func (v *VLAN) Update(fabricID int, vid int, params *entity.VLANParams) (vlan *entity.VLAN, err error)

type VLANs

type VLANs struct {
	ApiClient ApiClient
}

func (*VLANs) Create

func (v *VLANs) Create(fabricID int, params *entity.VLANParams) (vlan *entity.VLAN, err error)

func (*VLANs) Get

func (v *VLANs) Get(fabricID int) (vlans []entity.VLAN, err error)

type VMHost

type VMHost struct {
	ApiClient ApiClient
	// contains filtered or unexported fields
}

Contains functionality for manipulating the VMHost entity.

func (*VMHost) Compose

func (p *VMHost) Compose(id int, params *entity.VMHostMachineParams) (machine *entity.Machine, err error)

func (*VMHost) Delete

func (p *VMHost) Delete(id int) (err error)

func (*VMHost) Get

func (p *VMHost) Get(id int) (vmHost *entity.VMHost, err error)

func (*VMHost) GetParameters

func (p *VMHost) GetParameters(id int) (params map[string]string, err error)

func (*VMHost) Refresh

func (p *VMHost) Refresh(id int) (vmHost *entity.VMHost, err error)

func (*VMHost) Update

func (p *VMHost) Update(id int, params *entity.VMHostParams) (vmHost *entity.VMHost, err error)

type VMHosts

type VMHosts struct {
	ApiClient ApiClient
}

Contains functionality for manipulating the VMHosts entity.

func (*VMHosts) Create

func (m *VMHosts) Create(params *entity.VMHostParams) (vmHost *entity.VMHost, err error)

func (*VMHosts) Get

func (p *VMHosts) Get() (vmHosts []entity.VMHost, err error)

Jump to

Keyboard shortcuts

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