bridge

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: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NetworkInterface

type NetworkInterface struct {
	// contains filtered or unexported fields
}

NetworkInterface contains methods for connecting maas_interfaces to MaaS Interfaces.

func NewNetworkInterface

func NewNetworkInterface(m interface{}) *NetworkInterface

NewNetworkInterface creates a new NetworkInterface. The parameter should be the metadata passed to the Terraform CRUD functions, which should be a *gomaasapi.MAASObject. This function will cast the interface received by the Terraform functions to the correct type and store it in the NetworkInterface. If the type does not convert, a nil pointer will be stored.

func (*NetworkInterface) Create

func (i *NetworkInterface) Create(sch interface{}) error

Create a new NetworkInterface in MaaS. The sch parameter should be a tfschema type that can be used to create an Interface in MaaS. The only compatible type at this time is NetworkInterfacePhysical. This method will set the InterfaceID of the type, and expects any attributes required to create the Interface to be preset. This function will return an error if the MaaS API client returns an error.

func (*NetworkInterface) Delete

func (i *NetworkInterface) Delete(sch interface{}) (err error)

Delete an Interface in MaaS. The sch parameter should be a tfschema type that represents an Interface in MaaS. This function will return an error if the MaaS API client returns an error.

func (*NetworkInterface) LinkSubnet

func (i *NetworkInterface) LinkSubnet(sch *tfschema.NetworkInterfaceLink) (err error)

LinkSubnet creates a link between an interface and a subnet. This function will return an error if the MaaS API client returns an error.

ReadLink synchronizes the NetworkInterfaceLink with the current MaaS state. This function will return an error if the MaaS API client returns an error, or if the link cannot be found in MaaS.

func (*NetworkInterface) ReadTo

func (i *NetworkInterface) ReadTo(sch interface{}) error

ReadTo updates a tfschema representation of an NetworkInterface to the current state in MaaS. The sch parameter should be a tfschema type that represents an Interface in MaaS. This function will return an error if the MaaS API client returns an error.

func (*NetworkInterface) UnlinkSubnet

func (i *NetworkInterface) UnlinkSubnet(sch *tfschema.NetworkInterfaceLink) (err error)

UnlinkSubnet removes the link between an interface and a subnet. This function will return an error if the MaaS API client returns an error.

func (*NetworkInterface) UpdateFrom

func (i *NetworkInterface) UpdateFrom(sch interface{}) error

UpdateFrom updates the MaaS resource represented by sch. The sch parameter should be a tfschema type that represents an Interface in MaaS. This function will return an error if the MaaS API client returns an error.

Jump to

Keyboard shortcuts

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