Documentation
¶
Overview ¶
This set of code handles all functions required to configure networking on an openstack_compute_instance_v2 resource.
This is a complicated task because it's not possible to obtain all information in a single API call. In fact, it even traverses multiple OpenStack services.
The end result, from the user's point of view, is a structured set of understandable network information within the instance resource.
Index ¶
- func AddValueSpecs(body map[string]any) map[string]any
- func BuildRequest(opts any, parent string) (map[string]any, error)
- func CheckDeleted(d *schema.ResourceData, err error, msg string) error
- func GetRegion(d *schema.ResourceData, config *Config) string
- func MapValueSpecs(d *schema.ResourceData) map[string]string
- func Provider() *schema.Provider
- func ServerV2StateRefreshFunc(ctx context.Context, client *gophercloud.ServiceClient, instanceID string) retry.StateRefreshFunc
- type ComputeKeyPairV2CreateOpts
- type Config
- type EndpointGroupCreateOpts
- type FloatingIPCreateOpts
- type IKEPolicyCreateOpts
- type IKEPolicyLifetimeCreateOpts
- type IPSecPolicyCreateOpts
- type InstanceAddresses
- type InstanceNIC
- type InstanceNetwork
- type NetworkCreateOpts
- type PortCreateOpts
- type RouterCreateOpts
- type ServiceCreateOpts
- type SiteConnectionCreateOpts
- type SubnetCreateOpts
- type SubnetPoolCreateOpts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddValueSpecs ¶
AddValueSpecs expands the 'value_specs' object and removes 'value_specs' from the reqeust body.
func BuildRequest ¶
BuildRequest takes an opts struct and builds a request body for Gophercloud to execute.
func CheckDeleted ¶
func CheckDeleted(d *schema.ResourceData, err error, msg string) error
CheckDeleted checks the error to see if it's a 404 (Not Found) and, if so, sets the resource ID to the empty string instead of throwing an error.
func GetRegion ¶
func GetRegion(d *schema.ResourceData, config *Config) string
GetRegion returns the region that was specified in the resource. If a region was not set, the provider-level region is checked. The provider-level region can either be set by the region argument or by OS_REGION_NAME.
func MapValueSpecs ¶
func MapValueSpecs(d *schema.ResourceData) map[string]string
MapValueSpecs converts ResourceData into a map.
func ServerV2StateRefreshFunc ¶
func ServerV2StateRefreshFunc(ctx context.Context, client *gophercloud.ServiceClient, instanceID string) retry.StateRefreshFunc
ServerV2StateRefreshFunc returns a retry.StateRefreshFunc that is used to watch an OpenStack instance.
Types ¶
type ComputeKeyPairV2CreateOpts ¶
type ComputeKeyPairV2CreateOpts struct {
keypairs.CreateOpts
ValueSpecs map[string]string `json:"value_specs,omitempty"`
}
ComputeKeyPairV2CreateOpts is a custom KeyPair struct to include the ValueSpecs field.
func (ComputeKeyPairV2CreateOpts) ToKeyPairCreateMap ¶
func (opts ComputeKeyPairV2CreateOpts) ToKeyPairCreateMap() (map[string]any, error)
ToKeyPairCreateMap casts a CreateOpts struct to a map. It overrides keypairs.ToKeyPairCreateMap to add the ValueSpecs field.
type EndpointGroupCreateOpts ¶
type EndpointGroupCreateOpts struct {
endpointgroups.CreateOpts
ValueSpecs map[string]string `json:"value_specs,omitempty"`
}
EndpointGroupCreateOpts represents the attributes used when creating a new endpoint group.
type FloatingIPCreateOpts ¶
type FloatingIPCreateOpts struct {
*floatingips.CreateOpts
ValueSpecs map[string]string `json:"value_specs,omitempty"`
}
FloatingIPCreateOpts represents the attributes used when creating a new floating ip.
func (FloatingIPCreateOpts) ToFloatingIPCreateMap ¶
func (opts FloatingIPCreateOpts) ToFloatingIPCreateMap() (map[string]any, error)
ToFloatingIPCreateMap casts a CreateOpts struct to a map. It overrides floatingips.ToFloatingIPCreateMap to add the ValueSpecs field.
type IKEPolicyCreateOpts ¶
type IKEPolicyCreateOpts struct {
ikepolicies.CreateOpts
ValueSpecs map[string]string `json:"value_specs,omitempty"`
}
IKEPolicyCreateOpts represents the attributes used when creating a new IKE policy.
type IKEPolicyLifetimeCreateOpts ¶
type IKEPolicyLifetimeCreateOpts struct {
ikepolicies.LifetimeCreateOpts
ValueSpecs map[string]string `json:"value_specs,omitempty"`
}
IKEPolicyLifetimeCreateOpts represents the attributes used when creating a new lifetime for an IKE policy.
type IPSecPolicyCreateOpts ¶
type IPSecPolicyCreateOpts struct {
ipsecpolicies.CreateOpts
ValueSpecs map[string]string `json:"value_specs,omitempty"`
}
IPSecPolicyCreateOpts represents the attributes used when creating a new IPSec policy.
type InstanceAddresses ¶
type InstanceAddresses struct {
NetworkName string
InstanceNICs []InstanceNIC
}
InstanceAddresses is a collection of InstanceNICs, grouped by the network name. An instance/server could have multiple NICs on the same network.
type InstanceNIC ¶
InstanceNIC is a structured representation of a Gophercloud servers.Server virtual NIC.
type InstanceNetwork ¶
type InstanceNetwork struct {
UUID string
Name string
Port string
FixedIP string
AccessNetwork bool
}
InstanceNetwork represents a collection of network information that a Terraform instance needs to satisfy all network information requirements.
type NetworkCreateOpts ¶
type NetworkCreateOpts struct {
networks.CreateOpts
ValueSpecs map[string]string `json:"value_specs,omitempty"`
}
NetworkCreateOpts represents the attributes used when creating a new network.
func (NetworkCreateOpts) ToNetworkCreateMap ¶
func (opts NetworkCreateOpts) ToNetworkCreateMap() (map[string]any, error)
ToNetworkCreateMap casts a CreateOpts struct to a map. It overrides networks.ToNetworkCreateMap to add the ValueSpecs field.
type PortCreateOpts ¶
type PortCreateOpts struct {
ports.CreateOpts
ValueSpecs map[string]string `json:"value_specs,omitempty"`
}
PortCreateOpts represents the attributes used when creating a new port.
func (PortCreateOpts) ToPortCreateMap ¶
func (opts PortCreateOpts) ToPortCreateMap() (map[string]any, error)
ToPortCreateMap casts a CreateOpts struct to a map. It overrides ports.ToPortCreateMap to add the ValueSpecs field.
type RouterCreateOpts ¶
type RouterCreateOpts struct {
routers.CreateOpts
ValueSpecs map[string]string `json:"value_specs,omitempty"`
}
RouterCreateOpts represents the attributes used when creating a new router.
func (RouterCreateOpts) ToRouterCreateMap ¶
func (opts RouterCreateOpts) ToRouterCreateMap() (map[string]any, error)
ToRouterCreateMap casts a CreateOpts struct to a map. It overrides routers.ToRouterCreateMap to add the ValueSpecs field.
type ServiceCreateOpts ¶
type ServiceCreateOpts struct {
services.CreateOpts
ValueSpecs map[string]string `json:"value_specs,omitempty"`
}
ServiceCreateOpts represents the attributes used when creating a new VPN service.
type SiteConnectionCreateOpts ¶
type SiteConnectionCreateOpts struct {
siteconnections.CreateOpts
ValueSpecs map[string]string `json:"value_specs,omitempty"`
}
SiteConnectionCreateOpts represents the attributes used when creating a new IPSec site connection.
type SubnetCreateOpts ¶
type SubnetCreateOpts struct {
subnets.CreateOpts
ValueSpecs map[string]string `json:"value_specs,omitempty"`
}
SubnetCreateOpts represents the attributes used when creating a new subnet.
func (SubnetCreateOpts) ToSubnetCreateMap ¶
func (opts SubnetCreateOpts) ToSubnetCreateMap() (map[string]any, error)
ToSubnetCreateMap casts a CreateOpts struct to a map. It overrides subnets.ToSubnetCreateMap to add the ValueSpecs field.
type SubnetPoolCreateOpts ¶
type SubnetPoolCreateOpts struct {
subnetpools.CreateOpts
ValueSpecs map[string]string `json:"value_specs,omitempty"`
}
SubnetPoolCreateOpts represents the attributes used when creating a new subnet pool.
Source Files
¶
- blockstorage_volume_v3.go
- compute_instance_v2.go
- compute_interface_attach_v2.go
- compute_keypair_v2.go
- compute_volume_attach_v2.go
- networking_port_v2.go
- networking_secgroup_rule_v2.go
- networking_secgroup_v2.go
- networking_v2_shared.go
- provider.go
- resource_openstack_blockstorage_volume_v3.go
- resource_openstack_compute_instance_v2.go
- resource_openstack_compute_keypair_v2.go
- resource_openstack_networking_secgroup_rule_v2.go
- resource_openstack_networking_secgroup_v2.go
- types.go
- util.go
Directories
¶
| Path | Synopsis |
|---|---|
|
internal
|
|
|
pathorcontents
Helpers for dealing with file paths and their contents
|
Helpers for dealing with file paths and their contents |