Documentation ¶
Overview ¶
This set of code handles all functions required to configure networking on an telefonicaopencloud_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 ¶
- Variables
- 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 DatabaseInstanceV1StateRefreshFunc(client *gophercloud.ServiceClient, instanceID string) resource.StateRefreshFunc
- func FormatHeaders(headers http.Header, seperator string) string
- func GetRegion(d *schema.ResourceData, config *Config) string
- func InstanceStateFlavorUpdateRefreshFunc(client *gophercloud.ServiceClient, instanceID string, flavorID string) resource.StateRefreshFunc
- func InstanceStateRefreshFunc(client *gophercloud.ServiceClient, instanceID string) resource.StateRefreshFunc
- func InstanceStateUpdateRefreshFunc(client *gophercloud.ServiceClient, instanceID string, size int) resource.StateRefreshFunc
- func MapValueSpecs(d *schema.ResourceData) map[string]string
- func Provider() terraform.ResourceProvider
- func RedactHeaders(headers http.Header) (processedHeaders []string)
- func SecGroupV2StateRefreshFunc(computeClient *gophercloud.ServiceClient, d *schema.ResourceData) resource.StateRefreshFunc
- func ServerV2StateRefreshFunc(client *gophercloud.ServiceClient, instanceID string) resource.StateRefreshFunc
- func ValidateStringList(v interface{}, k string, l []string) (ws []string, errors []error)
- func VolumeV1StateRefreshFunc(client *gophercloud.ServiceClient, volumeID string) resource.StateRefreshFunc
- func VolumeV2StateRefreshFunc(client *gophercloud.ServiceClient, volumeID string) resource.StateRefreshFunc
- type Config
- type EIPCreateOpts
- type Firewall
- type FirewallCreateOpts
- type FirewallUpdateOpts
- type FloatingIPCreateOpts
- type Group
- type InstanceAddresses
- type InstanceNIC
- type InstanceNetwork
- type KeyPairCreateOpts
- type LogRoundTripper
- type Network
- type NetworkCreateOpts
- type PolicyCreateOpts
- type PortCreateOpts
- type RecordSetCreateOpts
- type RouterCreateOpts
- type RuleCreateOpts
- type ServerGroupCreateOpts
- type SubnetCreateOpts
- type ZoneCreateOpts
Constants ¶
This section is empty.
Variables ¶
var BandWidthChargeMode = [1]string{"traffic"}
var ContainerFormats = [9]string{"ami", "ari", "aki", "bare", "ovf"}
var DiskFormats = [9]string{"ami", "ari", "aki", "vhd", "vmdk", "raw", "qcow2", "vdi", "iso"}
var DiskTypes = [2]string{"DATA", "SYS"}
var HealthAuditMethods = [2]string{"ELB_AUDIT", "NOVA_AUDIT"}
var HealthAuditTime = [4]int{5, 15, 60, 180}
var IpTypes = [1]string{"5_bgp"}
var PolicyActions = [3]string{"ADD", "REMOVE", "SET"}
var PolicyTypes = [3]string{"ALARM", "SCHEDULED", "RECURRENCE"}
var REDACT_HEADERS = []string{"x-auth-token", "x-auth-key", "x-service-token",
"x-storage-token", "x-account-meta-temp-url-key", "x-account-meta-temp-url-key-2",
"x-container-meta-temp-url-key", "x-container-meta-temp-url-key-2", "set-cookie",
"x-subject-token"}
List of headers that need to be redacted
var RecurrenceTypes = [3]string{"Daily", "Weekly", "Monthly"}
var TerminatePolices = [4]string{"OLD_CONFIG_OLD_INSTANCE", "OLD_CONFIG_NEW_INSTANCE", "OLD_INSTANCE", "NEW_INSTANCE"}
var VolumeTypes = [2]string{"SATA", "SSD"}
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 DatabaseInstanceV1StateRefreshFunc ¶
func DatabaseInstanceV1StateRefreshFunc(client *gophercloud.ServiceClient, instanceID string) resource.StateRefreshFunc
DatabaseInstanceV1StateRefreshFunc returns a resource.StateRefreshFunc that is used to watch an cloud database instance.
func FormatHeaders ¶
FormatHeaders processes a headers object plus a deliminator, returning a string
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 InstanceStateFlavorUpdateRefreshFunc ¶
func InstanceStateFlavorUpdateRefreshFunc(client *gophercloud.ServiceClient, instanceID string, flavorID string) resource.StateRefreshFunc
func InstanceStateRefreshFunc ¶
func InstanceStateRefreshFunc(client *gophercloud.ServiceClient, instanceID string) resource.StateRefreshFunc
func InstanceStateUpdateRefreshFunc ¶
func InstanceStateUpdateRefreshFunc(client *gophercloud.ServiceClient, instanceID string, size int) resource.StateRefreshFunc
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 RedactHeaders ¶
RedactHeaders processes a headers object, returning a redacted list
func SecGroupV2StateRefreshFunc ¶
func SecGroupV2StateRefreshFunc(computeClient *gophercloud.ServiceClient, d *schema.ResourceData) resource.StateRefreshFunc
func ServerV2StateRefreshFunc ¶
func ServerV2StateRefreshFunc(client *gophercloud.ServiceClient, instanceID string) resource.StateRefreshFunc
ServerV2StateRefreshFunc returns a resource.StateRefreshFunc that is used to watch an OpenStack instance.
func ValidateStringList ¶
func VolumeV1StateRefreshFunc ¶
func VolumeV1StateRefreshFunc(client *gophercloud.ServiceClient, volumeID string) resource.StateRefreshFunc
VolumeV1StateRefreshFunc returns a resource.StateRefreshFunc that is used to watch an OpenStack volume.
func VolumeV2StateRefreshFunc ¶
func VolumeV2StateRefreshFunc(client *gophercloud.ServiceClient, volumeID string) resource.StateRefreshFunc
VolumeV2StateRefreshFunc returns a resource.StateRefreshFunc that is used to watch an OpenStack volume.
Types ¶
type Config ¶
type Config struct { CACertFile string ClientCertFile string ClientKeyFile string Cloud string DomainID string DomainName string EndpointType string IdentityEndpoint string Insecure bool Password string Region string Swauth bool TenantID string TenantName string Token string Username string UserID string OsClient *gophercloud.ProviderClient // contains filtered or unexported fields }
func (*Config) LoadAndValidate ¶
func (*Config) RdsV1Client ¶
func (c *Config) RdsV1Client(region string) (*gophercloud.ServiceClient, error)
func (*Config) SmnV2Client ¶
func (c *Config) SmnV2Client(region string) (*gophercloud.ServiceClient, error)
type EIPCreateOpts ¶
type EIPCreateOpts struct { eips.ApplyOpts ValueSpecs map[string]string `json:"value_specs,omitempty"` }
EIPCreateOpts represents the attributes used when creating a new eip.
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 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 KeyPairCreateOpts ¶
type KeyPairCreateOpts struct { keypairs.CreateOpts ValueSpecs map[string]string `json:"value_specs,omitempty"` }
KeyPairCreateOpts represents the attributes used when creating a new keypair.
func (KeyPairCreateOpts) ToKeyPairCreateMap ¶
func (opts KeyPairCreateOpts) ToKeyPairCreateMap() (map[string]interface{}, error)
ToKeyPairCreateMap casts a CreateOpts struct to a map. It overrides keypairs.ToKeyPairCreateMap to add the ValueSpecs field.
type LogRoundTripper ¶
type LogRoundTripper struct { Rt http.RoundTripper OsDebug bool }
LogRoundTripper satisfies the http.RoundTripper interface and is used to customize the default http client RoundTripper to allow for logging.
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 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 ServerGroupCreateOpts ¶
type ServerGroupCreateOpts struct { servergroups.CreateOpts ValueSpecs map[string]string `json:"value_specs,omitempty"` }
ServerGroupCreateOpts represents the attributes used when creating a new router.
func (ServerGroupCreateOpts) ToServerGroupCreateMap ¶
func (opts ServerGroupCreateOpts) ToServerGroupCreateMap() (map[string]interface{}, error)
ToServerGroupCreateMap casts a CreateOpts struct to a map. It overrides routers.ToServerGroupCreateMap to add the ValueSpecs field.
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 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 ¶
- compute_instance_v2_networking.go
- config.go
- data_source_telefonicaopencloud_dns_zone_v2.go
- data_source_telefonicaopencloud_images_image_v2.go
- data_source_telefonicaopencloud_networking_network_v2.go
- data_source_telefonicaopencloud_networking_secgroup_v2.go
- data_source_telefonicaopencloud_networking_subnet_v2.go
- data_source_telefonicaopencloud_rds_flavors_v1.go
- elb_utils.go
- lb_v2_shared.go
- provider.go
- resource_telefonicaopencloud_as_configuration_v1.go
- resource_telefonicaopencloud_as_group_v1.go
- resource_telefonicaopencloud_as_policy_v1.go
- resource_telefonicaopencloud_blockstorage_volume_v1.go
- resource_telefonicaopencloud_blockstorage_volume_v2.go
- resource_telefonicaopencloud_ces_alarmrule.go
- resource_telefonicaopencloud_compute_flavor_v2.go
- resource_telefonicaopencloud_compute_floatingip_associate_v2.go
- resource_telefonicaopencloud_compute_floatingip_v2.go
- resource_telefonicaopencloud_compute_instance_v2.go
- resource_telefonicaopencloud_compute_keypair_v2.go
- resource_telefonicaopencloud_compute_secgroup_v2.go
- resource_telefonicaopencloud_compute_servergroup_v2.go
- resource_telefonicaopencloud_compute_volume_attach_v2.go
- resource_telefonicaopencloud_db_instance_v1.go
- resource_telefonicaopencloud_dns_recordset_v2.go
- resource_telefonicaopencloud_dns_zone_v2.go
- resource_telefonicaopencloud_elb_backendecs.go
- resource_telefonicaopencloud_elb_certificate.go
- resource_telefonicaopencloud_elb_healthcheck.go
- resource_telefonicaopencloud_elb_listener.go
- resource_telefonicaopencloud_elb_loadbalancer.go
- resource_telefonicaopencloud_elb_quota.go
- resource_telefonicaopencloud_fw_firewall_v1.go
- resource_telefonicaopencloud_fw_policy_v1.go
- resource_telefonicaopencloud_fw_rule_v1.go
- resource_telefonicaopencloud_identity_project_v3.go
- resource_telefonicaopencloud_identity_user_v3.go
- resource_telefonicaopencloud_images_image_v2.go
- resource_telefonicaopencloud_lb_listener_v2.go
- resource_telefonicaopencloud_lb_loadbalancer_v2.go
- resource_telefonicaopencloud_lb_member_v1.go
- resource_telefonicaopencloud_lb_member_v2.go
- resource_telefonicaopencloud_lb_monitor_v1.go
- resource_telefonicaopencloud_lb_monitor_v2.go
- resource_telefonicaopencloud_lb_pool_v1.go
- resource_telefonicaopencloud_lb_pool_v2.go
- resource_telefonicaopencloud_lb_vip_v1.go
- resource_telefonicaopencloud_networking_floatingip_v2.go
- resource_telefonicaopencloud_networking_network_v2.go
- resource_telefonicaopencloud_networking_port_v2.go
- resource_telefonicaopencloud_networking_router_interface_v2.go
- resource_telefonicaopencloud_networking_router_route_v2.go
- resource_telefonicaopencloud_networking_router_v2.go
- resource_telefonicaopencloud_networking_secgroup_rule_v2.go
- resource_telefonicaopencloud_networking_secgroup_v2.go
- resource_telefonicaopencloud_networking_subnet_v2.go
- resource_telefonicaopencloud_objectstorage_container_v1.go
- resource_telefonicaopencloud_objectstorage_object_v1.go
- resource_telefonicaopencloud_rds_instance_v1.go
- resource_telefonicaopencloud_smn_subscription_v2.go
- resource_telefonicaopencloud_smn_topic_v2.go
- resource_telefonicaopencloud_vpc_eip_v1.go
- structure.go
- types.go
- util.go
- validators.go