Documentation ¶
Index ¶
- type NetworkInterface
- func (i *NetworkInterface) Create(sch interface{}) error
- func (i *NetworkInterface) Delete(sch interface{}) (err error)
- func (i *NetworkInterface) LinkSubnet(sch *tfschema.NetworkInterfaceLink) (err error)
- func (i *NetworkInterface) ReadLink(sch *tfschema.NetworkInterfaceLink) error
- func (i *NetworkInterface) ReadTo(sch interface{}) error
- func (i *NetworkInterface) UnlinkSubnet(sch *tfschema.NetworkInterfaceLink) (err error)
- func (i *NetworkInterface) UpdateFrom(sch interface{}) error
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.
func (*NetworkInterface) ReadLink ¶
func (i *NetworkInterface) ReadLink(sch *tfschema.NetworkInterfaceLink) 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.