New module: manage 1&1 public ip (cloud/oneandone/oneandone_public_ip) (#35079)

* Added firewall_policy, load_balancer, and monitoring_policy cloud modules for oneandone provider.

* Updated OneAndOneResources class and argument specs for monitoring policy and load balancer.

* Addressed ansible-test sanity pep8 and validate-modules errors.

* Added oneandone_public_ip cloud module for oneandone cloud provider. Removed extra modules to adhere to one module per PR.
This commit is contained in:
Amel Ajdinovic 2018-02-07 19:15:27 +01:00 committed by Adam Miller
parent 248c1e8b9f
commit 3381ff3ac9
2 changed files with 355 additions and 0 deletions

View file

@ -192,6 +192,18 @@ def get_vpn(oneandone_conn, vpn, full_object=False):
return _vpn['id']
def get_public_ip(oneandone_conn, public_ip, full_object=False):
"""
Validates that the public ip exists by ID or a name.
Returns the public ip if one was found.
"""
for _public_ip in oneandone_conn.list_public_ips(per_page=1000):
if public_ip in (_public_ip['id'], _public_ip['ip']):
if full_object:
return _public_ip
return _public_ip['id']
def wait_for_resource_creation_completion(oneandone_conn,
resource_type,
resource_id,