Documentation ¶
Index ¶
- func DeRef(v interface{}) interface{}
- func IsIPv4(str string) bool
- func NormalizeValue(v interface{}) interface{}
- func Provider() terraform.ResourceProvider
- func VAppNetworkSubresourceSchema() map[string]*schema.Schema
- func ValidateDiskSize() schema.SchemaValidateFunc
- func ValidateIPv4() schema.SchemaValidateFunc
- func VirtualMachineNetworkSubresourceSchema() map[string]*schema.Schema
- type Config
- type Subresource
- func (r *Subresource) Data() map[string]interface{}
- func (r *Subresource) Get(key string) interface{}
- func (r *Subresource) GetChange(key string) (interface{}, interface{})
- func (r *Subresource) GetWithVeto(key string) (interface{}, error)
- func (r *Subresource) HasChange(key string) bool
- func (r *Subresource) Hash() int
- func (r *Subresource) Set(key string, value interface{})
- type SubresourceInstance
- type VAppNetworkSubresource
- type VCDClient
- type VirtualMachineNetworkSubresource
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeRef ¶
func DeRef(v interface{}) interface{}
DeRef returns the value pointed to by the interface if the interface is a pointer and is not nil, otherwise returns nil, or the direct value if it's not a pointer.
func NormalizeValue ¶
func NormalizeValue(v interface{}) interface{}
NormalizeValue converts a value to something that is suitable to be set in a ResourceData and can be useful in situations where there is not access to normal helper/schema functionality, but you still need saved fields to behave in the same way.
Specifically, this will run the value through DeRef to dereference any pointers first, and then convert numeric primitives, if necessary.
func Provider ¶
func Provider() terraform.ResourceProvider
Provider returns a terraform.ResourceProvider.
func ValidateDiskSize ¶
func ValidateDiskSize() schema.SchemaValidateFunc
func ValidateIPv4 ¶
func ValidateIPv4() schema.SchemaValidateFunc
Types ¶
type Config ¶
type Subresource ¶
type Subresource struct { // The index of this subresource - should either be an index or hash. It's up // to the upstream object to set this to something useful. Index int // contains filtered or unexported fields }
Subresource defines a common interface for device sub-resources in the vsphere_virtual_machine resource.
This object is designed to be used by parts of the resource with workflows that are so complex in their own right that probably the only way to handle their management is to treat them like resources themselves.
This structure of this resource loosely follows schema.Resource with having CRUD and maintaining a set of resource data to work off of. However, since we are using schema.Resource, we take some liberties that we normally would not be able to take, or need to take considering the context of the data we are working with.
Inparticular functions implement this structure by creating an instance into it, much like how a resource creates itself by creating an instance of schema.Resource.
func (*Subresource) Data ¶
func (r *Subresource) Data() map[string]interface{}
Data returns the underlying data map.
func (*Subresource) Get ¶
func (r *Subresource) Get(key string) interface{}
Get hands off to r.data.Get, with an address relative to this subresource.
func (*Subresource) GetChange ¶
func (r *Subresource) GetChange(key string) (interface{}, interface{})
GetChange gets the old and new values for the value specified by key.
func (*Subresource) GetWithVeto ¶
func (r *Subresource) GetWithVeto(key string) (interface{}, error)
GetWithVeto returns the value specified by key, but returns an error if it has changed. The intention here is to block changes to the resource in a fashion that would otherwise result in forcing a new resource.
func (*Subresource) HasChange ¶
func (r *Subresource) HasChange(key string) bool
HasChange checks to see if there has been a change in the resource data since the last update.
Note that this operation may only be useful during update operations, depending on subresource-specific workflow.
func (*Subresource) Hash ¶
func (r *Subresource) Hash() int
Hash calculates a set hash for the current data. If you want a hash for error reporting a device address, it's probably a good idea to run this at the beginning of a run as any set calls will change the value this ultimately calculates.
func (*Subresource) Set ¶
func (r *Subresource) Set(key string, value interface{})
Set sets the specified key/value pair in the subresource.
type SubresourceInstance ¶
type SubresourceInstance interface { Set(string, interface{}) error Schema() map[string]*schema.Schema State() map[string]interface{} }
SubresourceInstance is an interface for derivative objects of Subresource. It's used on the general apply and read operation methods, and contains both exported methods of the base Subresource type and the CRUD methods that should be supplied by derivative objects.
Note that this interface should be used sparingly - as such, only the methods that are needed by inparticular functions external to most virtual device workflows are exported into this interface.
type VAppNetworkSubresource ¶
type VAppNetworkSubresource struct {
*Subresource
}
func NewVAppNetworkSubresource ¶
func NewVAppNetworkSubresource(d, old map[string]interface{}) *VAppNetworkSubresource
type VirtualMachineNetworkSubresource ¶
type VirtualMachineNetworkSubresource struct {
*Subresource
}
func NewVirtualMachineNetworkSubresource ¶
func NewVirtualMachineNetworkSubresource(d, old map[string]interface{}) *VirtualMachineNetworkSubresource
Source Files ¶
- config.go
- helper_structure.go
- helper_subresource.go
- helper_vapp.go
- helper_vdc.go
- helper_vm.go
- provider.go
- resource_vcd_catalog.go
- resource_vcd_disk.go
- resource_vcd_dnat.go
- resource_vcd_edgegateway_vpn.go
- resource_vcd_firewall_rules.go
- resource_vcd_network.go
- resource_vcd_snat.go
- resource_vcd_vapp.go
- resource_vcd_vm.go
- subresource_vcd_vapp_network.go
- subresource_vcd_vm_network.go