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]interface{}) map[string]interface{}
- func BuildRequest(opts interface{}, parent string) (map[string]interface{}, error)
- func CheckDeleted(d *schema.ResourceData, err error, msg string) error
- func GetRegion(d *schema.ResourceData, config *Config) string
- func GetTokenDetails(sc *gophercloud.ServiceClient) (*tokens3.User, *tokens3.Domain, *tokens3.Project, []tokens3.Role, error)
- func GetTokenInfo(sc *gophercloud.ServiceClient) (string, string, error)
- func GetTokenInfoV2(t tokens2.CreateResult) (string, string, error)
- func GetTokenInfoV3(t interface{}) (string, string, error)
- func MapValueSpecs(d *schema.ResourceData) map[string]string
- func Provider() terraform.ResourceProvider
- func ServerV2StateRefreshFunc(client *gophercloud.ServiceClient, instanceID string) resource.StateRefreshFunc
- type ComputeKeyPairV2CreateOpts
- type ComputeServerGroupV2CreateOpts
- type Config
- type EndpointGroupCreateOpts
- type Firewall
- type FirewallCreateOpts
- type FirewallUpdateOpts
- type FloatingIPCreateOpts
- type IKEPolicyCreateOpts
- type IKEPolicyLifetimeCreateOpts
- type IPSecPolicyCreateOpts
- type InstanceAddresses
- type InstanceNIC
- type InstanceNetwork
- type NetworkCreateOpts
- type PolicyCreateOpts
- type PortCreateOpts
- type QoSPolicyCreateOpts
- type RecordSetCreateOpts
- type RouterCreateOpts
- type RuleCreateOpts
- type ServiceCreateOpts
- type SiteConnectionCreateOpts
- type SubnetCreateOpts
- type SubnetPoolCreateOpts
- type ZoneCreateOpts
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 GetTokenDetails ¶ added in v1.31.0
func GetTokenInfo ¶ added in v1.31.0
func GetTokenInfo(sc *gophercloud.ServiceClient) (string, string, error)
func GetTokenInfoV2 ¶ added in v1.31.0
func GetTokenInfoV2(t tokens2.CreateResult) (string, string, error)
func GetTokenInfoV3 ¶ added in v1.31.0
func MapValueSpecs ¶
func MapValueSpecs(d *schema.ResourceData) map[string]string
MapValueSpecs converts ResourceData into a map
func Provider ¶
func Provider() terraform.ResourceProvider
Provider returns a schema.Provider for OpenStack.
func ServerV2StateRefreshFunc ¶
func ServerV2StateRefreshFunc(client *gophercloud.ServiceClient, instanceID string) resource.StateRefreshFunc
ServerV2StateRefreshFunc returns a resource.StateRefreshFunc that is used to watch an OpenStack instance.
Types ¶
type ComputeKeyPairV2CreateOpts ¶ added in v1.12.0
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 ¶ added in v1.12.0
func (opts ComputeKeyPairV2CreateOpts) ToKeyPairCreateMap() (map[string]interface{}, error)
ToKeyPairCreateMap casts a CreateOpts struct to a map. It overrides keypairs.ToKeyPairCreateMap to add the ValueSpecs field.
type ComputeServerGroupV2CreateOpts ¶ added in v1.13.0
type ComputeServerGroupV2CreateOpts struct { servergroups.CreateOpts ValueSpecs map[string]string `json:"value_specs,omitempty"` }
ServerGroupCreateOpts is a custom ServerGroup struct to include the ValueSpecs field.
func (ComputeServerGroupV2CreateOpts) ToServerGroupCreateMap ¶ added in v1.13.0
func (opts ComputeServerGroupV2CreateOpts) ToServerGroupCreateMap() (map[string]interface{}, error)
ToServerGroupCreateMap casts a CreateOpts struct to a map. It overrides routers.ToServerGroupCreateMap to add the ValueSpecs field.
type EndpointGroupCreateOpts ¶ added in v1.5.0
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 Firewall ¶
type Firewall struct { firewalls.Firewall routerinsertion.FirewallExt }
Firewall is an OpenStack firewall.
type FirewallCreateOpts ¶
type FirewallCreateOpts struct { firewalls.CreateOpts ValueSpecs map[string]string `json:"value_specs,omitempty"` }
FirewallCreateOpts represents the attributes used when creating a new firewall.
func (FirewallCreateOpts) ToFirewallCreateMap ¶
func (opts FirewallCreateOpts) ToFirewallCreateMap() (map[string]interface{}, error)
ToFirewallCreateMap casts a CreateOptsExt struct to a map. It overrides firewalls.ToFirewallCreateMap to add the ValueSpecs field.
type FirewallUpdateOpts ¶
type FirewallUpdateOpts struct {
firewalls.UpdateOptsBuilder
}
FirewallUpdateOpts
func (FirewallUpdateOpts) ToFirewallUpdateMap ¶
func (opts FirewallUpdateOpts) ToFirewallUpdateMap() (map[string]interface{}, error)
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]interface{}, error)
ToFloatingIPCreateMap casts a CreateOpts struct to a map. It overrides floatingips.ToFloatingIPCreateMap to add the ValueSpecs field.
type IKEPolicyCreateOpts ¶ added in v1.5.0
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 ¶ added in v1.5.0
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 ¶ added in v1.5.0
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 ¶ added in v0.2.0
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 ¶ added in v0.2.0
InstanceNIC is a structured representation of a Gophercloud servers.Server virtual NIC.
type InstanceNetwork ¶ added in v0.2.0
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]interface{}, error)
ToNetworkCreateMap casts a CreateOpts struct to a map. It overrides networks.ToNetworkCreateMap to add the ValueSpecs field.
type PolicyCreateOpts ¶
type PolicyCreateOpts struct { policies.CreateOpts ValueSpecs map[string]string `json:"value_specs,omitempty"` }
PolicyCreateOpts represents the attributes used when creating a new firewall policy.
func (PolicyCreateOpts) ToFirewallPolicyCreateMap ¶
func (opts PolicyCreateOpts) ToFirewallPolicyCreateMap() (map[string]interface{}, error)
ToPolicyCreateMap casts a CreateOpts struct to a map. It overrides policies.ToFirewallPolicyCreateMap 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]interface{}, error)
ToPortCreateMap casts a CreateOpts struct to a map. It overrides ports.ToPortCreateMap to add the ValueSpecs field.
type QoSPolicyCreateOpts ¶ added in v1.20.0
type QoSPolicyCreateOpts struct { policies.CreateOpts ValueSpecs map[string]string `json:"value_specs,omitempty"` }
QoSPolicyCreateOpts represents the attributes used when creating a new QoS policy.
type RecordSetCreateOpts ¶
type RecordSetCreateOpts struct { recordsets.CreateOpts ValueSpecs map[string]string `json:"value_specs,omitempty"` }
RecordSetCreateOpts represents the attributes used when creating a new DNS record set.
func (RecordSetCreateOpts) ToRecordSetCreateMap ¶
func (opts RecordSetCreateOpts) ToRecordSetCreateMap() (map[string]interface{}, error)
ToRecordSetCreateMap casts a CreateOpts struct to a map. It overrides recordsets.ToRecordSetCreateMap 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]interface{}, error)
ToRouterCreateMap casts a CreateOpts struct to a map. It overrides routers.ToRouterCreateMap to add the ValueSpecs field.
type RuleCreateOpts ¶
type RuleCreateOpts struct { rules.CreateOpts ValueSpecs map[string]string `json:"value_specs,omitempty"` }
RuleCreateOpts represents the attributes used when creating a new firewall rule.
func (RuleCreateOpts) ToRuleCreateMap ¶
func (opts RuleCreateOpts) ToRuleCreateMap() (map[string]interface{}, error)
ToRuleCreateMap casts a CreateOpts struct to a map. It overrides rules.ToRuleCreateMap to add the ValueSpecs field.
type ServiceCreateOpts ¶ added in v1.5.0
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 ¶ added in v1.6.0
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]interface{}, error)
ToSubnetCreateMap casts a CreateOpts struct to a map. It overrides subnets.ToSubnetCreateMap to add the ValueSpecs field.
type SubnetPoolCreateOpts ¶ added in v1.3.0
type SubnetPoolCreateOpts struct { subnetpools.CreateOpts ValueSpecs map[string]string `json:"value_specs,omitempty"` }
SubnetPoolCreateOpts represents the attributes used when creating a new subnet pool.
type ZoneCreateOpts ¶
type ZoneCreateOpts struct { zones.CreateOpts ValueSpecs map[string]string `json:"value_specs,omitempty"` }
ZoneCreateOpts represents the attributes used when creating a new DNS zone.
func (ZoneCreateOpts) ToZoneCreateMap ¶
func (opts ZoneCreateOpts) ToZoneCreateMap() (map[string]interface{}, error)
ToZoneCreateMap casts a CreateOpts struct to a map. It overrides zones.ToZoneCreateMap to add the ValueSpecs field.
Source Files ¶
- blockstorage_extensions.go
- blockstorage_snapshot_v2.go
- blockstorage_snapshot_v3.go
- blockstorage_volume_attach_v2.go
- blockstorage_volume_attach_v3.go
- blockstorage_volume_v1.go
- blockstorage_volume_v2.go
- blockstorage_volume_v3.go
- compute_flavor_v2.go
- compute_floatingip_associate_v2.go
- compute_instance_v2.go
- compute_interface_attach_v2.go
- compute_keypair_v2.go
- compute_secgroup_v2.go
- compute_servergroup_v2.go
- compute_volume_attach_v2.go
- containerinfra_shared_v1.go
- data_source_openstack_blockstorage_availability_zones_v3.go
- data_source_openstack_blockstorage_snapshot_v2.go
- data_source_openstack_blockstorage_snapshot_v3.go
- data_source_openstack_blockstorage_volume_v2.go
- data_source_openstack_blockstorage_volume_v3.go
- data_source_openstack_compute_availability_zones_v2.go
- data_source_openstack_compute_flavor_v2.go
- data_source_openstack_compute_instance_v2.go
- data_source_openstack_compute_keypair_v2.go
- data_source_openstack_containerinfra_cluster_v1.go
- data_source_openstack_containerinfra_clustertemplate_v1.go
- data_source_openstack_dns_zone_v2.go
- data_source_openstack_fw_policy_v1.go
- data_source_openstack_identity_auth_scope_v3.go
- data_source_openstack_identity_endpoint_v3.go
- data_source_openstack_identity_group_v3.go
- data_source_openstack_identity_project_v3.go
- data_source_openstack_identity_role_v3.go
- data_source_openstack_identity_service_v3.go
- data_source_openstack_identity_user_v3.go
- data_source_openstack_images_image_ids_v2.go
- data_source_openstack_images_image_v2.go
- data_source_openstack_keymanager_container_v1.go
- data_source_openstack_keymanager_secret_v1.go
- data_source_openstack_networking_addressscope_v2.go
- data_source_openstack_networking_floatingip_v2.go
- data_source_openstack_networking_network_v2.go
- data_source_openstack_networking_port_ids_v2.go
- data_source_openstack_networking_port_v2.go
- data_source_openstack_networking_qos_bandwidth_limit_rule_v2.go
- data_source_openstack_networking_qos_dscp_marking_rule_v2.go
- data_source_openstack_networking_qos_minimum_bandwidth_rule_v2.go
- data_source_openstack_networking_qos_policy_v2.go
- data_source_openstack_networking_router_v2.go
- data_source_openstack_networking_secgroup_v2.go
- data_source_openstack_networking_subnet_v2.go
- data_source_openstack_networking_subnetpool_v2.go
- data_source_openstack_networking_trunk_v2.go
- data_source_openstack_sharedfilesystem_availability_zones_v2.go
- data_source_openstack_sharedfilesystem_share_v2.go
- data_source_openstack_sharedfilesystem_sharenetwork_v2.go
- data_source_openstack_sharedfilesystem_snapshot_v2.go
- db_configuration_v1.go
- db_database_v1.go
- db_instance_v1.go
- db_user_v1.go
- dns_recordset_v2.go
- dns_zone_v2.go
- fw_firewall_v1.go
- fw_policy_v1.go
- fw_rule_v1.go
- identity_application_credential_v3.go
- identity_auth_scope_v3.go
- identity_endpoint_v3.go
- identity_role_assignment_v3.go
- identity_user_v3.go
- images_image_v2.go
- keymanager_container_v1.go
- keymanager_order_v1.go
- keymanager_secret_v1.go
- keymanager_v1.go
- lb_v2_shared.go
- networking_addressscope_v2.go
- networking_floatingip_v2.go
- networking_network_v2.go
- networking_port_v2.go
- networking_qos_policy_v2.go
- networking_qos_rule_v2.go
- networking_router_interface_v2.go
- networking_router_route_v2.go
- networking_router_v2.go
- networking_secgroup_rule_v2.go
- networking_secgroup_v2.go
- networking_subnet_route_v2.go
- networking_subnet_v2.go
- networking_subnetpool_v2.go
- networking_trunk_v2.go
- networking_v2_shared.go
- orchestration_stack_v1.go
- provider.go
- resource_openstack_blockstorage_quotaset_v2.go
- resource_openstack_blockstorage_quotaset_v3.go
- resource_openstack_blockstorage_volume_attach_v2.go
- resource_openstack_blockstorage_volume_attach_v3.go
- resource_openstack_blockstorage_volume_v1.go
- resource_openstack_blockstorage_volume_v2.go
- resource_openstack_blockstorage_volume_v3.go
- resource_openstack_compute_flavor_access_v2.go
- resource_openstack_compute_flavor_v2.go
- resource_openstack_compute_floatingip_associate_v2.go
- resource_openstack_compute_floatingip_v2.go
- resource_openstack_compute_instance_v2.go
- resource_openstack_compute_interface_attach_v2.go
- resource_openstack_compute_keypair_v2.go
- resource_openstack_compute_quotaset_v2.go
- resource_openstack_compute_secgroup_v2.go
- resource_openstack_compute_servergroup_v2.go
- resource_openstack_compute_volume_attach_v2.go
- resource_openstack_containerinfra_cluster_v1.go
- resource_openstack_containerinfra_clustertemplate_v1.go
- resource_openstack_db_configuration_v1.go
- resource_openstack_db_database_v1.go
- resource_openstack_db_instance_v1.go
- resource_openstack_db_user_v1.go
- resource_openstack_dns_recordset_v2.go
- resource_openstack_dns_zone_v2.go
- resource_openstack_fw_firewall_v1.go
- resource_openstack_fw_policy_v1.go
- resource_openstack_fw_rule_v1.go
- resource_openstack_identity_application_credential_v3.go
- resource_openstack_identity_ec2_credential_v3.go
- resource_openstack_identity_endpoint_v3.go
- resource_openstack_identity_group_v3.go
- resource_openstack_identity_project_v3.go
- resource_openstack_identity_role_assignment_v3.go
- resource_openstack_identity_role_v3.go
- resource_openstack_identity_service_v3.go
- resource_openstack_identity_user_v3.go
- resource_openstack_images_image_access_accept_v2.go
- resource_openstack_images_image_access_v2.go
- resource_openstack_images_image_v2.go
- resource_openstack_keymanager_container_v1.go
- resource_openstack_keymanager_order_v1.go
- resource_openstack_keymanager_secret_v1.go
- resource_openstack_lb_l7policy_v2.go
- resource_openstack_lb_l7rule_v2.go
- resource_openstack_lb_listener_v2.go
- resource_openstack_lb_loadbalancer_v2.go
- resource_openstack_lb_member_v1.go
- resource_openstack_lb_member_v2.go
- resource_openstack_lb_members_v2.go
- resource_openstack_lb_monitor_v1.go
- resource_openstack_lb_monitor_v2.go
- resource_openstack_lb_pool_v1.go
- resource_openstack_lb_pool_v2.go
- resource_openstack_lb_vip_v1.go
- resource_openstack_networking_addressscope_v2.go
- resource_openstack_networking_floatingip_associate_v2.go
- resource_openstack_networking_floatingip_v2.go
- resource_openstack_networking_network_v2.go
- resource_openstack_networking_port_secgroup_associate_v2.go
- resource_openstack_networking_port_v2.go
- resource_openstack_networking_qos_bandwidth_limit_rule_v2.go
- resource_openstack_networking_qos_dscp_marking_rule_v2.go
- resource_openstack_networking_qos_minimum_bandwidth_rule_v2.go
- resource_openstack_networking_qos_policy_v2.go
- resource_openstack_networking_quota_v2.go
- resource_openstack_networking_rbac_policy_v2.go
- resource_openstack_networking_router_interface_v2.go
- resource_openstack_networking_router_route_v2.go
- resource_openstack_networking_router_v2.go
- resource_openstack_networking_secgroup_rule_v2.go
- resource_openstack_networking_secgroup_v2.go
- resource_openstack_networking_subnet_route_v2.go
- resource_openstack_networking_subnet_v2.go
- resource_openstack_networking_subnetpool_v2.go
- resource_openstack_networking_trunk_v2.go
- resource_openstack_objectstorage_container_v1.go
- resource_openstack_objectstorage_object_v1.go
- resource_openstack_objectstorage_tempurl_v1.go
- resource_openstack_orchestration_stack_v1.go
- resource_openstack_sharedfilesystem_securityservice_v2.go
- resource_openstack_sharedfilesystem_share_access_v2.go
- resource_openstack_sharedfilesystem_share_v2.go
- resource_openstack_sharedfilesystem_sharenetwork_v2.go
- resource_openstack_vpnaas_endpoint_group_v2.go
- resource_openstack_vpnaas_ike_policy_v2.go
- resource_openstack_vpnaas_ipsec_policy_v2.go
- resource_openstack_vpnaas_service_v2.go
- resource_openstack_vpnaas_site_connection.go
- sharedfilesystem_share_access_v2.go
- sharedfilesystem_shared_v2.go
- types.go
- util.go