Commit Graph

22 Commits

Author SHA1 Message Date
Joe Topjian 6efd0640ec Openstack port update fixes (#13604)
* provider/openstack: Handle 409 Errors Upon Security Group Deletion

If a security group is currently in use, it will throw a 409 error.
This commit catches the 409, allowing other resources to finish
deleting.

* Update openstack_networking_port_v2 resource to pass empty arrays for AllowedAddressPairs and SecurityGroups if not specified. Fixes #13531

* provider/openstack: Port Update comment
2017-04-13 13:37:15 +02:00
Joe Topjian 77a41ca859 provider/openstack: Resolve issues with Port Fixed IPs (#13056)
* provider/openstack: Add all_fixed_ips computed attribute to port resource

This commit adds the `all_fixed_ips` attribute to the
openstack_networking_port_v2 resource. This contains all of the port's
Fixed IPs returned by the Networking v2 API.

* provider/openstack: Revert Port fixed_ip back to a List

This commit reverts the changes made in a8c4e81a6e3f2. This
re-enables the ability to reference IP addresses using the
numerical-element notation.

This commit also makes fixed_ip a non-computed field, meaning
Terraform will no longer set fixed_ip with what was returned
by the API. This resolves the original issue about ordering.

The last use-case is for fixed_ips that received an IP address
via DHCP. Because fixed_ip is no longer computed, the DHCP IP
will not be set. The workaround for this use-case is to use the
new all_fixed_ips attribute.

In effect, users should use fixed_ip only as a way of inputting
data into Terraform and use all_fixed_ips as the output returned
by the API. If use-cases exist where fixed_ip can be used as an
output, that's a bonus feature.
2017-03-27 20:22:56 +03:00
Joe Topjian bd7ba34627 provider/openstack: Adding Timeouts to Network Resources (#12866) 2017-03-19 17:23:36 +00:00
Joe Topjian 20c88bcdf4 provider/openstack: Change Port fixed_ip to a Set (#12613)
This commit changes the openstack_networking_port_v2 fixed_ip
parameter from a List to a Set. This is because OpenStack does not
preserve the original ordering of the fixed IPs.
2017-03-12 16:00:47 +02:00
Joe Topjian 1c9853ec1b provider/openstack: Fix Ordering of Port Allowed Address Pairs (#10250)
This commit changes allowed_address_pairs from a TypeList to a TypeSet
allowing for arbitrary ordering. This solves the issue where a user
specifies an address pair one way and OpenStack returns a different
order.
2016-12-05 15:36:37 +00:00
Joe Topjian b2f9a3a6fd provider/openstack: Detect Region for Importing Resources (#10509)
* provider/openstack: Detect Region for Importing Resources

This commit changes the way the OpenStack region is detected and set.
Any time a region is required, the region attribute will first be
checked. Next, the OS_REGION_NAME environment variable will be checked.
While schema.EnvDefaultFunc handles this same situation, it is not
applicable when importing resources.

* provider/openstack: No longer ignore region in importing tests

* provider/openstack: Network and Subnet Import Fixes

This commit fixes the OpenStack Network and Subnet resources so that
importing of those resources is successful.
2016-12-04 14:24:07 +00:00
Gavin Williams b31b044785 provider/openstack: Add value_specs option to openstack_networking_port_v2.
Refactored to use common types.go
Add supporting documentation
2016-10-24 16:04:00 +01:00
Joe Topjian 520b3dda82 provider/openstack: gophercloud migration: Spelling correction 2016-10-23 02:38:26 +00:00
Joe Topjian c11a4ef214 provider/openstack: gophercloud migration: updating error responses 2016-10-23 02:38:22 +00:00
Joe Topjian 53bb3187fc provider/openstack: gophercloud migration: networking port 2016-10-23 02:38:20 +00:00
Federico Ceratto 5bc8736dc8 Add allowed_address_pairs
Original code from Rob Wilson <roobert@gmail.com>
2016-08-18 16:23:01 +01:00
Joe Topjian bc5a8b827f provider/openstack: Support Import of OpenStack Networking Resources (#7661)
Router-based resources are not included. They will be added later.
2016-07-15 09:47:11 +01:00
Seth Vargo 68a2a2299e Use schema funcs for reading values from the env 2016-04-08 17:28:54 -04:00
Trevor Pounds 0cd0ff0f8e Use built-in schema.HashString. 2016-02-07 16:29:34 -08:00
Yo Takezawa 17e6e5d118 provider/openstack Convert FixedIPS from struct to map for ResourceData 2016-01-29 14:23:03 +09:00
Yo Takezawa 0aff8e28a5 provider/openstack Changing the port resource to mark the ip_address as Optional 2016-01-27 17:36:29 +09:00
Ian Duffy 47ac10d66b Change resource.StateChangeConf to use an array for target states
Signed-off-by: Ian Duffy <ian@ianduffy.ie>
2016-01-21 01:20:41 +00:00
Cliff Pracht 1de2fde147 Fix to not put fixed_ip in request if not defined 2016-01-07 09:55:43 -05:00
Joe Topjian edd8e722bf provider/openstack: Make Networking Port attributes more intuitive
This commit makes some quick updates to the port attributes to make them
more intuitive:

* `security_groups` to `security_group_ids`: since the port is expecting
IDs and not security group names like in other areas of OpenStack.

* `admin_state_up`: change to Boolean to match this same attribute on
other resources.

* `fixed_ips` to `fixed_ip`: while multiple `fixed_ip` blocks can be
specified, only one fixed IP can be specified in each block.
2015-11-13 04:46:12 +00:00
Kirill Shirinkin 3a63b48f97 provider/openstack: fixed_ips implementation for ports 2015-11-05 19:23:05 +01:00
Joe Topjian 312d371ce9 provider/openstack: Additions to the OpenStack Port resource
This commit adds further work to the OpenStack port resource:

* Makes relevant fields computed
* Adds state change functions
* Adds acceptance tests
* Adds Documentation
2015-11-03 06:07:32 +00:00
Jean Mertz 7d11b4b7e7 provider/openstack: openstack_networking_port_v2 resource 2015-11-03 05:35:05 +00:00