models

package
v2.3.6+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SCSIPath added in v1.3.0

func SCSIPath(busNumber int, unitID int) string

SCSIPath builds a path representing the specified SCSI bus number and logical unit ID.

Types

type BackupClientAlerting added in v1.3.4

type BackupClientAlerting struct {
	Trigger string
	Emails  []string
}

BackupClientAlerting represents the alerting configuration (if any) for a backup client.

type Disk

type Disk struct {
	ID            string
	SCSIBusNumber int
	SCSIUnitID    int
	SizeGB        int
	Speed         string
	Iops          int
}

Disk represents the Terraform configuration for a ddcloud_server disk.

func NewDiskFromMap

func NewDiskFromMap(diskProperties map[string]interface{}) Disk

NewDiskFromMap creates a Disk from the values in the specified map.

func NewDiskFromVirtualMachineDisk

func NewDiskFromVirtualMachineDisk(virtualMachineDisk compute.VirtualMachineDisk, scsiBusNumber int) Disk

NewDiskFromVirtualMachineDisk creates a Disk from the values in the specified CloudControl VirtualMachineDisk.

func (*Disk) ReadMap

func (disk *Disk) ReadMap(diskProperties map[string]interface{})

ReadMap populates the Disk with values from the specified map.

func (*Disk) ReadVirtualMachineDisk

func (disk *Disk) ReadVirtualMachineDisk(virtualMachineDisk compute.VirtualMachineDisk)

ReadVirtualMachineDisk populates the Disk with values from the specified VirtualMachineDisk.

func (Disk) SCSIPath added in v1.3.0

func (disk Disk) SCSIPath() string

SCSIPath builds a path representing the disk's SCSI bus number and logical unit ID.

func (*Disk) ToMap

func (disk *Disk) ToMap() map[string]interface{}

ToMap creates a new map using the values from the Disk.

func (*Disk) ToVirtualMachineDisk

func (disk *Disk) ToVirtualMachineDisk() compute.VirtualMachineDisk

ToVirtualMachineDisk updates a map using values from the Disk.

func (*Disk) UpdateMap

func (disk *Disk) UpdateMap(diskProperties map[string]interface{})

UpdateMap updates a map using values from the Disk.

func (*Disk) UpdateVirtualMachineDisk

func (disk *Disk) UpdateVirtualMachineDisk(virtualMachineDisk *compute.VirtualMachineDisk)

UpdateVirtualMachineDisk updates a CloudControl VirtualMachineDisk using values from the Disk.

type Disks

type Disks []Disk

Disks represents an array of Disk structures.

func NewDisksFromMaps

func NewDisksFromMaps(diskPropertyList []map[string]interface{}) Disks

NewDisksFromMaps creates Disks from an array of Terraform value maps.

func NewDisksFromStateData

func NewDisksFromStateData(diskPropertyList []interface{}) Disks

NewDisksFromStateData creates Disks from an array of Terraform state data.

The values in the diskPropertyList are expected to be map[string]interface{}.

func NewDisksFromVirtualMachineSCSIController added in v1.3.0

func NewDisksFromVirtualMachineSCSIController(virtualMachineSCSIController compute.VirtualMachineSCSIController) (disks Disks)

NewDisksFromVirtualMachineSCSIController creates Disks from a compute.VirtualMachineSCSIController.

func NewDisksFromVirtualMachineSCSIControllers added in v1.3.0

func NewDisksFromVirtualMachineSCSIControllers(virtualMachineSCSIControllers compute.VirtualMachineSCSIControllers) (disks Disks)

NewDisksFromVirtualMachineSCSIControllers creates Disks from compute.VirtualMachineSCSIControllers.

func (*Disks) ApplyCurrentConfiguration

func (disks *Disks) ApplyCurrentConfiguration(currentDisks Disks)

ApplyCurrentConfiguration applies the current configuration, inline, to the old configuration.

Call this function on the old Disks, passing the new Disks.

func (Disks) ByDiskID

func (disks Disks) ByDiskID(diskID string) Disk

ByDiskID creates a map of Disk keyed by SCSI unit Id.

func (Disks) BySCSIPath added in v1.3.0

func (disks Disks) BySCSIPath() map[string]Disk

BySCSIPath creates a map of Disk keyed by SCSI unit Id.

func (Disks) CaptureIDs

func (disks Disks) CaptureIDs(actualDisks Disks)

CaptureIDs updates the Disk Ids from the actual disks.

func (Disks) IsEmpty

func (disks Disks) IsEmpty() bool

IsEmpty determines whether the Disk array is empty.

func (Disks) SortBySCSIPath added in v1.3.0

func (disks Disks) SortBySCSIPath()

SortBySCSIPath sorts the disks by SCSI bus number and then SCSI unit Id.

func (Disks) SplitByAction

func (disks Disks) SplitByAction(actualDisks Disks) (addDisks Disks, changeDisks Disks, removeDisks Disks)

SplitByAction splits the (configured) server disks by the action to be performed (add, change, or remove).

configuredDisks represents the disks currently specified in configuration. actualDisks represents the disks in the server, as returned by CloudControl.

func (Disks) SplitByInitialType

func (disks Disks) SplitByInitialType(actualDisks Disks) (imageDisks Disks, additionalDisks Disks)

SplitByInitialType splits the (initially-configured) disks by whether they represent image disks or additional disks.

configuredDisks represents the disks currently specified in configuration. actualDisks represents the disks in the server, as returned by CloudControl.

This function only works right after the server has been deployed (i.e. no post-deployment disk changes (such as AddDiskToServer) have been made).

func (Disks) ToMaps

func (disks Disks) ToMaps() []map[string]interface{}

ToMaps converts the Disks to an array of maps.

func (Disks) ToVirtualMachineDisks

func (disks Disks) ToVirtualMachineDisks() []compute.VirtualMachineDisk

ToVirtualMachineDisks converts the Disks to an array of compute.VirtualMachineDisk.

type Image

type Image struct {
	ID   string
	Name string
	Type string
}

Image represents the Terraform configuration for a ddcloud_server image.

func NewImageFromMap

func NewImageFromMap(imageProperties map[string]interface{}) Image

NewImageFromMap creates a Image from the values in the specified map.

func (*Image) ReadImage

func (image *Image) ReadImage(computeImage compute.Image)

ReadImage populates the Image with values from the specified compute.Image.

func (*Image) ReadMap

func (image *Image) ReadMap(imageProperties map[string]interface{})

ReadMap populates the Image with values from the specified map.

func (*Image) ToMap

func (image *Image) ToMap() map[string]interface{}

ToMap creates a new map using the values from the Image.

func (*Image) UpdateMap

func (image *Image) UpdateMap(imageProperties map[string]interface{})

UpdateMap updates a map using values from the Image.

func (*Image) Validate

func (image *Image) Validate() error

Validate the Image state.

type NetworkAdapter

type NetworkAdapter struct {
	ID                 string
	MACAddress         string
	VLANID             string
	PrivateIPv4Address string
	PrivateIPv6Address string
	AdapterType        string
}

NetworkAdapter represents the Terraform configuration for a ddcloud_server network_adapter.

func NewNetworkAdapterFromMap

func NewNetworkAdapterFromMap(networkAdapterProperties map[string]interface{}) NetworkAdapter

NewNetworkAdapterFromMap creates a NetworkAdapter from the values in the specified map.

func NewNetworkAdapterFromVirtualMachineNetworkAdapter

func NewNetworkAdapterFromVirtualMachineNetworkAdapter(virtualMachineNetworkAdapter compute.VirtualMachineNetworkAdapter) NetworkAdapter

NewNetworkAdapterFromVirtualMachineNetworkAdapter creates a NetworkAdapter from the values in the specified CloudControl VirtualMachineNetworkAdapter.

func (*NetworkAdapter) HasExplicitType

func (networkAdapter *NetworkAdapter) HasExplicitType() bool

HasExplicitType determines whether the NetworkAdapter explicitly declares an adapter type.

func (*NetworkAdapter) ReadMap

func (networkAdapter *NetworkAdapter) ReadMap(networkAdapterProperties map[string]interface{})

ReadMap populates the NetworkAdapter with values from the specified map.

func (*NetworkAdapter) ReadNetworkAdapter

func (networkAdapter *NetworkAdapter) ReadNetworkAdapter(targetNetworkAdapter NetworkAdapter)

ReadNetworkAdapter populates the NetworkAdapter with values from the specified NetworkAdapter.

func (*NetworkAdapter) ReadVirtualMachineNetworkAdapter

func (networkAdapter *NetworkAdapter) ReadVirtualMachineNetworkAdapter(virtualMachineNetworkAdapter compute.VirtualMachineNetworkAdapter)

ReadVirtualMachineNetworkAdapter populates the NetworkAdapter with values from the specified VirtualMachineNetworkAdapter.

func (*NetworkAdapter) ToMap

func (networkAdapter *NetworkAdapter) ToMap() map[string]interface{}

ToMap creates a new map using the values from the NetworkAdapter.

func (*NetworkAdapter) ToVirtualMachineNetworkAdapter

func (networkAdapter *NetworkAdapter) ToVirtualMachineNetworkAdapter() compute.VirtualMachineNetworkAdapter

ToVirtualMachineNetworkAdapter updates a map using values from the NetworkAdapter.

func (*NetworkAdapter) UpdateMap

func (networkAdapter *NetworkAdapter) UpdateMap(networkAdapterProperties map[string]interface{})

UpdateMap updates a map using values from the NetworkAdapter.

func (*NetworkAdapter) UpdateVirtualMachineNetworkAdapter

func (networkAdapter *NetworkAdapter) UpdateVirtualMachineNetworkAdapter(virtualMachineNetworkAdapter *compute.VirtualMachineNetworkAdapter)

UpdateVirtualMachineNetworkAdapter updates a CloudControl VirtualMachineNetworkAdapter using values from the NetworkAdapter.

type NetworkAdapters

type NetworkAdapters []NetworkAdapter

NetworkAdapters represents an array of NetworkAdapter structures.

func NewNetworkAdaptersFromMaps

func NewNetworkAdaptersFromMaps(networkAdapterPropertyList []map[string]interface{}) NetworkAdapters

NewNetworkAdaptersFromMaps creates NetworkAdapters from an array of Terraform value maps.

func NewNetworkAdaptersFromStateData

func NewNetworkAdaptersFromStateData(networkAdapterPropertyList []interface{}) NetworkAdapters

NewNetworkAdaptersFromStateData creates NetworkAdapters from an array of Terraform state data.

The values in the networkAdapterPropertyList are expected to be map[string]interface{}.

func NewNetworkAdaptersFromVirtualMachineNetwork

func NewNetworkAdaptersFromVirtualMachineNetwork(virtualMachineNetwork compute.VirtualMachineNetwork) (networkAdapters NetworkAdapters)

NewNetworkAdaptersFromVirtualMachineNetwork creates a new NetworkAdapters array from the specified compute.VirtualMachineNetwork

This allocates index values in the order that adapters are found, and so it only works if there's *no* existing state at all.

func NewNetworkAdaptersFromVirtualMachineNetworkAdapters

func NewNetworkAdaptersFromVirtualMachineNetworkAdapters(virtualMachineNetworkAdapters []compute.VirtualMachineNetworkAdapter) NetworkAdapters

NewNetworkAdaptersFromVirtualMachineNetworkAdapters creates NetworkAdapters from an array of compute.VirtualMachineNetworkAdapter.

func (NetworkAdapters) ByID

func (networkAdapters NetworkAdapters) ByID() map[string]NetworkAdapter

ByID creates a map of NetworkAdapter keyed by Id.

func (NetworkAdapters) ByMACAddress

func (networkAdapters NetworkAdapters) ByMACAddress() map[string]NetworkAdapter

ByMACAddress creates a map of NetworkAdapter keyed by MAC address.

func (NetworkAdapters) CaptureIDs

func (networkAdapters NetworkAdapters) CaptureIDs(virtualMachineNetwork compute.VirtualMachineNetwork)

CaptureIDs sets the ID field on each NetworkAdapter based on the ID of the compute.VirtualMachineNetworkAdapter with the same index.

func (NetworkAdapters) GetAdditional

func (networkAdapters NetworkAdapters) GetAdditional() (additionalAdapters NetworkAdapters)

GetAdditional retrieves the additional network adapters (if any).

func (NetworkAdapters) GetByID

func (networkAdapters NetworkAdapters) GetByID(id string) *NetworkAdapter

GetByID retrieves the NetworkAdapter (if any) with the specified Id.

func (NetworkAdapters) GetPrimary

func (networkAdapters NetworkAdapters) GetPrimary() *NetworkAdapter

GetPrimary retrieves the primary network adapter (if present).

The primary network adapter has Index 0.

func (NetworkAdapters) HasAdditional

func (networkAdapters NetworkAdapters) HasAdditional() bool

HasAdditional determines whether the NetworkAdapter array includes one or more additional network adapters.

func (NetworkAdapters) HasPrimary

func (networkAdapters NetworkAdapters) HasPrimary() bool

HasPrimary determines whether the NetworkAdapter array includes a primary network adapter.

func (NetworkAdapters) Insert

func (networkAdapters NetworkAdapters) Insert(index int, networkAdapter NetworkAdapter) NetworkAdapters

Insert a NetworkAdapter at the specified index.

Returns a new NetworkAdapters.

func (NetworkAdapters) IsEmpty

func (networkAdapters NetworkAdapters) IsEmpty() bool

IsEmpty determines whether the NetworkAdapter array is empty.

func (NetworkAdapters) ReadVirtualMachineNetwork

func (networkAdapters NetworkAdapters) ReadVirtualMachineNetwork(virtualMachineNetwork compute.VirtualMachineNetwork)

ReadVirtualMachineNetwork updates each NetworkAdapter with values from the corresponding compute.VirtualMachineNetworkAdapter (if one is found with the same Id).

func (NetworkAdapters) Remove

func (networkAdapters NetworkAdapters) Remove(networkAdapter NetworkAdapter) NetworkAdapters

Remove the specified NetworkAdapter (by Id).

Returns a new NetworkAdapters.

func (NetworkAdapters) RemoveAt

func (networkAdapters NetworkAdapters) RemoveAt(index int) NetworkAdapters

RemoveAt removes the NetworkAdapter at the specified index.

Returns a new NetworkAdapters.

func (NetworkAdapters) SplitByAction

func (networkAdapters NetworkAdapters) SplitByAction(actualNetworkAdapters NetworkAdapters) (addNetworkAdapters NetworkAdapters, changeNetworkAdapters NetworkAdapters, removeNetworkAdapters NetworkAdapters)

SplitByAction splits the (configured) network adapters by the action to be performed (add, change, or remove).

configuredNetworkAdapters represents the network adapters currently specified in configuration. actualNetworkAdapters represents the network adapters in the server, as returned by CloudControl.

func (NetworkAdapters) Subtract

func (networkAdapters NetworkAdapters) Subtract(otherNetworkAdapters NetworkAdapters) (remainingNetworkAdapters NetworkAdapters)

Subtract the specified NetworkAdapters from the current NetworkAdapters.

func (NetworkAdapters) ToMaps

func (networkAdapters NetworkAdapters) ToMaps() []map[string]interface{}

ToMaps converts the NetworkAdapters to an array of maps.

func (NetworkAdapters) ToVirtualMachineNetwork

func (networkAdapters NetworkAdapters) ToVirtualMachineNetwork() compute.VirtualMachineNetwork

ToVirtualMachineNetwork converts the NetworkAdapters to a compute.VirtualMachineNetwork.

func (NetworkAdapters) ToVirtualMachineNetworkAdapters

func (networkAdapters NetworkAdapters) ToVirtualMachineNetworkAdapters() []compute.VirtualMachineNetworkAdapter

ToVirtualMachineNetworkAdapters converts the NetworkAdapters to an array of compute.VirtualMachineNetworkAdapter.

func (NetworkAdapters) UpdateVirtualMachineNetwork

func (networkAdapters NetworkAdapters) UpdateVirtualMachineNetwork(virtualMachineNetwork *compute.VirtualMachineNetwork)

UpdateVirtualMachineNetwork updates a compute.VirtualMachineNetwork with values from the NetworkAdapters.

type ServerBackupClient added in v1.3.3

type ServerBackupClient struct {
	ID                 string
	Type               string
	Description        string
	StoragePolicyName  string
	SchedulePolicyName string
	DownloadURL        string
	Status             string
	Alerting           *BackupClientAlerting
}

ServerBackupClient represents a backup client assigned to a server.

func NewServerBackupClientFromBackupClientDetail added in v1.3.3

func NewServerBackupClientFromBackupClientDetail(backupClientDetail compute.BackupClientDetail) ServerBackupClient

NewServerBackupClientFromBackupClientDetail creates a ServerBackupClient from the values in the specified CloudControl BackupClientDetail.

func NewServerBackupClientFromMap added in v1.3.3

func NewServerBackupClientFromMap(backupClientProperties map[string]interface{}) ServerBackupClient

NewServerBackupClientFromMap creates a ServerBackupClient from the values in the specified map.

func (*ServerBackupClient) ReadBackupClientDetail added in v1.3.3

func (backupClient *ServerBackupClient) ReadBackupClientDetail(backupClientDetail compute.BackupClientDetail)

ReadBackupClientDetail populates the ServerBackupClient with values from the specified BackupClientDetail.

func (*ServerBackupClient) ReadMap added in v1.3.3

func (backupClient *ServerBackupClient) ReadMap(backupClientProperties map[string]interface{})

ReadMap populates the ServerBackupClient with values from the specified map.

func (*ServerBackupClient) ToBackupClientDetail added in v1.3.3

func (backupClient *ServerBackupClient) ToBackupClientDetail() compute.BackupClientDetail

ToBackupClientDetail updates a map using values from the ServerBackupClient.

func (*ServerBackupClient) ToMap added in v1.3.3

func (backupClient *ServerBackupClient) ToMap() map[string]interface{}

ToMap creates a new map using the values from the ServerBackupClient.

func (*ServerBackupClient) UpdateBackupClientDetail added in v1.3.3

func (backupClient *ServerBackupClient) UpdateBackupClientDetail(backupClientDetail *compute.BackupClientDetail)

UpdateBackupClientDetail updates a CloudControl BackupClientDetail using values from the ServerBackupClient.

func (*ServerBackupClient) UpdateMap added in v1.3.3

func (backupClient *ServerBackupClient) UpdateMap(backupClientProperties map[string]interface{})

UpdateMap updates a map using values from the ServerBackupClient.

type ServerBackupClients added in v1.3.4

type ServerBackupClients []ServerBackupClient

ServerBackupClients represents an array of ServerBackupClient structures.

func NewServerBackupClientsFromBackupClientDetails added in v1.3.4

func NewServerBackupClientsFromBackupClientDetails(backupClientDetails []compute.BackupClientDetail) (clients ServerBackupClients)

NewServerBackupClientsFromBackupClientDetails creates ServerBackupClients from compute.BackupClientDetails.

func NewServerBackupClientsFromMaps added in v1.3.4

func NewServerBackupClientsFromMaps(clientPropertyList []map[string]interface{}) ServerBackupClients

NewServerBackupClientsFromMaps creates ServerBackupClients from an array of Terraform value maps.

func NewServerBackupClientsFromStateData added in v1.3.4

func NewServerBackupClientsFromStateData(clientPropertyList []interface{}) ServerBackupClients

NewServerBackupClientsFromStateData creates ServerBackupClients from an array of Terraform state data.

The values in the clientPropertyList are expected to be map[string]interface{}.

func (*ServerBackupClients) ApplyCurrentConfiguration added in v1.3.4

func (clients *ServerBackupClients) ApplyCurrentConfiguration(currentServerBackupClients ServerBackupClients)

ApplyCurrentConfiguration applies the current configuration, inline, to the old configuration.

Call this function on the old ServerBackupClients, passing the new ServerBackupClients.

func (ServerBackupClients) ByID added in v1.3.4

func (clients ServerBackupClients) ByID() map[string]ServerBackupClient

ByID creates a map of ServerBackupClient keyed by client Id.

func (ServerBackupClients) ByType added in v1.3.4

func (clients ServerBackupClients) ByType() map[string]ServerBackupClient

ByType creates a map of ServerBackupClient keyed by client type.

func (ServerBackupClients) CaptureIDs added in v1.3.4

func (clients ServerBackupClients) CaptureIDs(actualServerBackupClients ServerBackupClients)

CaptureIDs updates the ServerBackupClient Ids from the actual clients.

func (ServerBackupClients) IsEmpty added in v1.3.4

func (clients ServerBackupClients) IsEmpty() bool

IsEmpty determines whether the ServerBackupClient array is empty.

func (ServerBackupClients) SortByType added in v1.3.4

func (clients ServerBackupClients) SortByType()

SortByType sorts the backup clients by type.

func (ServerBackupClients) SplitByAction added in v1.3.4

func (clients ServerBackupClients) SplitByAction(actualServerBackupClients ServerBackupClients) (addServerBackupClients ServerBackupClients, changeServerBackupClients ServerBackupClients, removeServerBackupClients ServerBackupClients)

SplitByAction splits the (configured) server clients by the action to be performed (add, change, or remove).

configuredServerBackupClients represents the clients currently specified in configuration. actualServerBackupClients represents the clients in the server, as returned by CloudControl.

func (ServerBackupClients) ToBackupClientDetails added in v1.3.4

func (clients ServerBackupClients) ToBackupClientDetails() []compute.BackupClientDetail

ToBackupClientDetails converts the ServerBackupClients to an array of compute.BackupClientDetail.

func (ServerBackupClients) ToMaps added in v1.3.4

func (clients ServerBackupClients) ToMaps() []map[string]interface{}

ToMaps converts the ServerBackupClients to an array of maps.

Jump to

Keyboard shortcuts

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