Add source snapshot to ansible (#300)

* Make `iap` field computed (#3814) (#272)

Signed-off-by: Modular Magician <magic-modules@google.com>

* add source_image and source_snapshot to google_compute_image (#3799) (#273)

* add source_image to google_compute_image

* add source_snapshot to google_compute_image

* PR comment changes

Signed-off-by: Modular Magician <magic-modules@google.com>

* Collection fixes for release (#3831) (#274)

Signed-off-by: Modular Magician <magic-modules@google.com>

* Add new field filter to pubsub. (#3759) (#275)

* Add new field filter to pubsub.

Fixes: https://github.com/terraform-providers/terraform-provider-google/issues/6727

* Fixed filter name, it was improperly set.

* add filter key to pubsub subscription unit test

* spaces not tabs!

* hardcode filter value in test

* revert remove escaped quotes

Co-authored-by: Tim O'Connell <hi@timoconnell.co.uk>
Signed-off-by: Modular Magician <magic-modules@google.com>

Co-authored-by: Tim O'Connell <hi@timoconnell.co.uk>

* Add archive class to gcs (#3867) (#276)

Signed-off-by: Modular Magician <magic-modules@google.com>

* Add support for gRPC healthchecks (#3825) (#277)

Signed-off-by: Modular Magician <magic-modules@google.com>

* Add enableMessageOrdering to Pub/Sub Subscription (#3872) (#278)

Add enableMessageOrdering to Pub/Sub Subscription

Signed-off-by: Modular Magician <magic-modules@google.com>

* use {product}.googleapis.com endpoints (#3755) (#279)

* use {product}.googleapis.com endpoints

* use actual correct urls

* fix zone data source test

* fix network peering tests

* possibly fix deleting default network

Signed-off-by: Modular Magician <magic-modules@google.com>

* Removed instances where input and output are both true (#3890) (#280)

* [provider-yaml] - Removed instances where input and output are both true

* modified to only supply output. Following pattern from bigquerydatatransfer

Co-authored-by: Scott Suarez <scottsuarez@google.com>
Signed-off-by: Modular Magician <magic-modules@google.com>

Co-authored-by: Scott Suarez <scottsuarez@google.com>

* retrypolicy attribute added (#3843) (#281)

* retrypolicy attribute added

* test case updated

Signed-off-by: Modular Magician <magic-modules@google.com>

* Advanced logging config options in google_compute_subnetwork (#3603) (#282)

Co-authored-by: Dana Hoffman <danahoffman@google.com>
Signed-off-by: Modular Magician <magic-modules@google.com>

Co-authored-by: Dana Hoffman <danahoffman@google.com>

* Add Erase Windows VSS support to compute disk (#3898) (#283)

Co-authored-by: Cameron Thornton <camthornton@google.com>
Signed-off-by: Modular Magician <magic-modules@google.com>

Co-authored-by: Cameron Thornton <camthornton@google.com>

* Add Snapshot location to compute snapshot (#3896) (#286)

* added storage locations

* add storage locations to field

* tweak cmek logic

* fix the decoder logic and cleanup whitespaces

* remove duplicate entry

Signed-off-by: Modular Magician <magic-modules@google.com>

* Added missing 'all' option for protocol firewall rule (#3962) (#287)

Signed-off-by: Modular Magician <magic-modules@google.com>

* Added support GRPC for google_compute_(region)_backend_service.protocol (#3973) (#289)

Co-authored-by: Edward Sun <sunedward@google.com>
Signed-off-by: Modular Magician <magic-modules@google.com>

Co-authored-by: Edward Sun <sunedward@google.com>

* Add schema update support to spanner db 2082 (#3947) (#291)

* eoncders and customdiff added for spanner DB ddl update

* config update test case added

* customdiff modified to handle out-of-index issue

* new lines added

* indent fixed

* indent fixed for tests

* test added for ddl update condition

* mock added Terraformresourcediff, unit tests added

* test fixed

* more unit tests added

* tests fixed

* PR comments implemented

* unit tests converted to table driven tests

* ImportStateVerifyIgnore flag added to tests

* syntax corrected in test

Signed-off-by: Modular Magician <magic-modules@google.com>

* Added properties of options & artifacts on google_cloudbuild_trigger (#3944) (#292)

* added options & artifacts to cloudbuild trigger

* updated with minor changes and added more options in test

* a test adding update behavior for multiple optional fields

Co-authored-by: Edward Sun <sunedward@google.com>
Signed-off-by: Modular Magician <magic-modules@google.com>

Co-authored-by: Edward Sun <sunedward@google.com>

* Enable TPUs to use Shared VPC (#3939) (#293)

* add support for shared vpc

* make cidr_block computable

* add diffsuppression

* tweak diffsupression to ignore when network has a change

* rework diffsupress

* add customizediff

* switch the diff checks

Signed-off-by: Modular Magician <magic-modules@google.com>

* Add SEV_CAPABLE option to google_compute_image (#3994) (#294)

Signed-off-by: Modular Magician <magic-modules@google.com>

* Update docs for pubsub targets in cloud scheduler (#4008) (#295)

Signed-off-by: Modular Magician <magic-modules@google.com>

* Make RegionBackendService health checks optional (#4053) (#297)

Signed-off-by: Modular Magician <magic-modules@google.com>

* Update terminology for IAM roles (#4056) (#299)

Roles like "Owner" and "Editor" are now called "basic roles": https://cloud.google.com/iam/docs/understand

Signed-off-by: Modular Magician <magic-modules@google.com>

* Add source snapshot to ansible (#4060)

Signed-off-by: Modular Magician <magic-modules@google.com>

Co-authored-by: Tim O'Connell <hi@timoconnell.co.uk>
Co-authored-by: Scott Suarez <scottsuarez@google.com>
Co-authored-by: Dana Hoffman <danahoffman@google.com>
Co-authored-by: Cameron Thornton <camthornton@google.com>
Co-authored-by: Edward Sun <sunedward@google.com>
This commit is contained in:
The Magician 2020-10-06 15:39:08 -07:00 committed by GitHub
parent fb1485be7b
commit 7fa00db18c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
169 changed files with 2105 additions and 764 deletions

View file

@ -34,7 +34,6 @@ description:
- A single firewall rule that is evaluated against incoming traffic and provides an - A single firewall rule that is evaluated against incoming traffic and provides an
action to take on matched requests. action to take on matched requests.
short_description: Creates a GCP FirewallRule short_description: Creates a GCP FirewallRule
version_added: '2.9'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -106,6 +105,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.

View file

@ -33,7 +33,6 @@ module: gcp_appengine_firewall_rule_info
description: description:
- Gather info for GCP FirewallRule - Gather info for GCP FirewallRule
short_description: Gather info for GCP FirewallRule short_description: Gather info for GCP FirewallRule
version_added: '2.9'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -71,6 +70,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -134,7 +134,7 @@ resources:
################################################################################ ################################################################################
# Imports # Imports
################################################################################ ################################################################################
from ansible.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest from ansible_collections.google.cloud.plugins.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest
import json import json
################################################################################ ################################################################################

View file

@ -33,7 +33,6 @@ module: gcp_bigquery_dataset
description: description:
- Datasets allow you to organize and control access to your tables. - Datasets allow you to organize and control access to your tables.
short_description: Creates a GCP Dataset short_description: Creates a GCP Dataset
version_added: '2.8'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -74,9 +73,9 @@ options:
role: role:
description: description:
- Describes the rights granted to the user specified by the other member of - Describes the rights granted to the user specified by the other member of
the access object. Primitive, Predefined and custom roles are supported. the access object. Basic, predefined, and custom roles are supported. Predefined
Predefined roles that have equivalent primitive roles are swapped by the roles that have equivalent basic roles are swapped by the API to their basic
API to their Primitive counterparts. See [official docs](U(https://cloud.google.com/bigquery/docs/access-control)). counterparts. See [official docs](U(https://cloud.google.com/bigquery/docs/access-control)).
required: false required: false
type: str type: str
special_group: special_group:
@ -85,7 +84,7 @@ options:
Owners of the enclosing project.' Owners of the enclosing project.'
- "* `projectReaders`: Readers of the enclosing project." - "* `projectReaders`: Readers of the enclosing project."
- "* `projectWriters`: Writers of the enclosing project." - "* `projectWriters`: Writers of the enclosing project."
- "* `allAuthenticatedUsers`: All authenticated BigQuery users. ." - "* `allAuthenticatedUsers`: All authenticated BigQuery users."
required: false required: false
type: str type: str
user_by_email: user_by_email:
@ -167,7 +166,6 @@ options:
the default partition expiration time indicated by this property.' the default partition expiration time indicated by this property.'
required: false required: false
type: int type: int
version_added: '2.9'
description: description:
description: description:
- A user-friendly description of the dataset. - A user-friendly description of the dataset.
@ -208,7 +206,6 @@ options:
key. key.
required: false required: false
type: dict type: dict
version_added: '2.10'
suboptions: suboptions:
kms_key_name: kms_key_name:
description: description:
@ -248,6 +245,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -307,9 +305,9 @@ access:
role: role:
description: description:
- Describes the rights granted to the user specified by the other member of - Describes the rights granted to the user specified by the other member of
the access object. Primitive, Predefined and custom roles are supported. Predefined the access object. Basic, predefined, and custom roles are supported. Predefined
roles that have equivalent primitive roles are swapped by the API to their roles that have equivalent basic roles are swapped by the API to their basic
Primitive counterparts. See [official docs](U(https://cloud.google.com/bigquery/docs/access-control)). counterparts. See [official docs](U(https://cloud.google.com/bigquery/docs/access-control)).
returned: success returned: success
type: str type: str
specialGroup: specialGroup:
@ -318,7 +316,7 @@ access:
Owners of the enclosing project.' Owners of the enclosing project.'
- "* `projectReaders`: Readers of the enclosing project." - "* `projectReaders`: Readers of the enclosing project."
- "* `projectWriters`: Writers of the enclosing project." - "* `projectWriters`: Writers of the enclosing project."
- "* `allAuthenticatedUsers`: All authenticated BigQuery users. ." - "* `allAuthenticatedUsers`: All authenticated BigQuery users."
returned: success returned: success
type: str type: str
userByEmail: userByEmail:
@ -600,11 +598,11 @@ def fetch_resource(module, link, kind, allow_not_found=True):
def self_link(module): def self_link(module):
return "https://www.googleapis.com/bigquery/v2/projects/{project}/datasets/{name}".format(**module.params) return "https://bigquery.googleapis.com/bigquery/v2/projects/{project}/datasets/{name}".format(**module.params)
def collection(module): def collection(module):
return "https://www.googleapis.com/bigquery/v2/projects/{project}/datasets".format(**module.params) return "https://bigquery.googleapis.com/bigquery/v2/projects/{project}/datasets".format(**module.params)
def return_if_object(module, response, kind, allow_not_found=False): def return_if_object(module, response, kind, allow_not_found=False):

View file

@ -33,7 +33,6 @@ module: gcp_bigquery_dataset_info
description: description:
- Gather info for GCP Dataset - Gather info for GCP Dataset
short_description: Gather info for GCP Dataset short_description: Gather info for GCP Dataset
version_added: '2.8'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -71,6 +70,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -129,9 +129,9 @@ resources:
role: role:
description: description:
- Describes the rights granted to the user specified by the other member - Describes the rights granted to the user specified by the other member
of the access object. Primitive, Predefined and custom roles are supported. of the access object. Basic, predefined, and custom roles are supported.
Predefined roles that have equivalent primitive roles are swapped by the Predefined roles that have equivalent basic roles are swapped by the API
API to their Primitive counterparts. See [official docs](U(https://cloud.google.com/bigquery/docs/access-control)). to their basic counterparts. See [official docs](U(https://cloud.google.com/bigquery/docs/access-control)).
returned: success returned: success
type: str type: str
specialGroup: specialGroup:
@ -140,7 +140,7 @@ resources:
Owners of the enclosing project.' Owners of the enclosing project.'
- "* `projectReaders`: Readers of the enclosing project." - "* `projectReaders`: Readers of the enclosing project."
- "* `projectWriters`: Writers of the enclosing project." - "* `projectWriters`: Writers of the enclosing project."
- "* `allAuthenticatedUsers`: All authenticated BigQuery users. ." - "* `allAuthenticatedUsers`: All authenticated BigQuery users."
returned: success returned: success
type: str type: str
userByEmail: userByEmail:
@ -298,7 +298,7 @@ resources:
################################################################################ ################################################################################
# Imports # Imports
################################################################################ ################################################################################
from ansible.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest from ansible_collections.google.cloud.plugins.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest
import json import json
################################################################################ ################################################################################
@ -317,7 +317,7 @@ def main():
def collection(module): def collection(module):
return "https://www.googleapis.com/bigquery/v2/projects/{project}/datasets".format(**module.params) return "https://bigquery.googleapis.com/bigquery/v2/projects/{project}/datasets".format(**module.params)
def fetch_list(module, link): def fetch_list(module, link):

View file

@ -33,7 +33,6 @@ module: gcp_bigquery_table
description: description:
- A Table that belongs to a Dataset . - A Table that belongs to a Dataset .
short_description: Creates a GCP Table short_description: Creates a GCP Table
version_added: '2.8'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -78,7 +77,6 @@ options:
elements: str elements: str
required: false required: false
type: list type: list
version_added: '2.9'
description: description:
description: description:
- A user-friendly description of the dataset. - A user-friendly description of the dataset.
@ -106,7 +104,6 @@ options:
buffer. buffer.
required: false required: false
type: int type: int
version_added: '2.9'
view: view:
description: description:
- The view definition. - The view definition.
@ -157,7 +154,6 @@ options:
or REQUIRED. or REQUIRED.
required: false required: false
type: str type: str
version_added: '2.9'
type: type:
description: description:
- The only type supported is DAY, which will generate one partition per day. - The only type supported is DAY, which will generate one partition per day.
@ -497,6 +493,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -1195,11 +1192,11 @@ def fetch_resource(module, link, kind, allow_not_found=True):
def self_link(module): def self_link(module):
return "https://www.googleapis.com/bigquery/v2/projects/{project}/datasets/{dataset}/tables/{name}".format(**module.params) return "https://bigquery.googleapis.com/bigquery/v2/projects/{project}/datasets/{dataset}/tables/{name}".format(**module.params)
def collection(module): def collection(module):
return "https://www.googleapis.com/bigquery/v2/projects/{project}/datasets/{dataset}/tables".format(**module.params) return "https://bigquery.googleapis.com/bigquery/v2/projects/{project}/datasets/{dataset}/tables".format(**module.params)
def return_if_object(module, response, kind, allow_not_found=False): def return_if_object(module, response, kind, allow_not_found=False):

View file

@ -33,7 +33,6 @@ module: gcp_bigquery_table_info
description: description:
- Gather info for GCP Table - Gather info for GCP Table
short_description: Gather info for GCP Table short_description: Gather info for GCP Table
version_added: '2.8'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -76,6 +75,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -574,7 +574,7 @@ resources:
################################################################################ ################################################################################
# Imports # Imports
################################################################################ ################################################################################
from ansible.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest from ansible_collections.google.cloud.plugins.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest
import json import json
################################################################################ ################################################################################
@ -593,7 +593,7 @@ def main():
def collection(module): def collection(module):
return "https://www.googleapis.com/bigquery/v2/projects/{project}/datasets/{dataset}/tables".format(**module.params) return "https://bigquery.googleapis.com/bigquery/v2/projects/{project}/datasets/{dataset}/tables".format(**module.params)
def fetch_list(module, link): def fetch_list(module, link):

View file

@ -34,7 +34,6 @@ description:
- A collection of Bigtable Tables and the resources that serve them. All tables in - A collection of Bigtable Tables and the resources that serve them. All tables in
an instance are served from all Clusters in the instance. an instance are served from all Clusters in the instance.
short_description: Creates a GCP Instance short_description: Creates a GCP Instance
version_added: '2.10'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -136,6 +135,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.

View file

@ -33,7 +33,6 @@ module: gcp_bigtable_instance_info
description: description:
- Gather info for GCP Instance - Gather info for GCP Instance
short_description: Gather info for GCP Instance short_description: Gather info for GCP Instance
version_added: '2.10'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -71,6 +70,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -172,7 +172,7 @@ resources:
################################################################################ ################################################################################
# Imports # Imports
################################################################################ ################################################################################
from ansible.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest from ansible_collections.google.cloud.plugins.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest
import json import json
################################################################################ ################################################################################

View file

@ -33,7 +33,6 @@ module: gcp_cloudbuild_trigger
description: description:
- Configuration for an automated build in response to source repository changes. - Configuration for an automated build in response to source repository changes.
short_description: Creates a GCP Trigger short_description: Creates a GCP Trigger
version_added: '2.8'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -58,7 +57,6 @@ options:
- Name of the trigger. Must be unique within the project. - Name of the trigger. Must be unique within the project.
required: false required: false
type: str type: str
version_added: '2.10'
description: description:
description: description:
- Human-readable description of the trigger. - Human-readable description of the trigger.
@ -70,7 +68,6 @@ options:
elements: str elements: str
required: false required: false
type: list type: list
version_added: '2.10'
disabled: disabled:
description: description:
- Whether the trigger is disabled or not. If true, the trigger will never result - Whether the trigger is disabled or not. If true, the trigger will never result
@ -145,7 +142,6 @@ options:
- Only trigger a build if the revision regex does NOT match the revision regex. - Only trigger a build if the revision regex does NOT match the revision regex.
required: false required: false
type: bool type: bool
version_added: '2.10'
branch_name: branch_name:
description: description:
- Name of the branch to build. Exactly one a of branch name, tag, or commit - Name of the branch to build. Exactly one a of branch name, tag, or commit
@ -178,7 +174,6 @@ options:
- The location of the source files to build. - The location of the source files to build.
required: false required: false
type: dict type: dict
version_added: '2.10'
suboptions: suboptions:
storage_source: storage_source:
description: description:
@ -286,7 +281,6 @@ options:
- Substitutions data for Build resource. - Substitutions data for Build resource.
required: false required: false
type: dict type: dict
version_added: '2.10'
queue_ttl: queue_ttl:
description: description:
- TTL in queue for this build. If provided and the build is enqueued longer - TTL in queue for this build. If provided and the build is enqueued longer
@ -296,14 +290,12 @@ options:
''s''. Example: "3.5s".' ''s''. Example: "3.5s".'
required: false required: false
type: str type: str
version_added: '2.10'
logs_bucket: logs_bucket:
description: description:
- Google Cloud Storage bucket where logs should be written. Logs file names - Google Cloud Storage bucket where logs should be written. Logs file names
will be of the format ${logsBucket}/log-${build_id}.txt. will be of the format ${logsBucket}/log-${build_id}.txt.
required: false required: false
type: str type: str
version_added: '2.10'
timeout: timeout:
description: description:
- Amount of time that this build should be allowed to run, to second granularity. - Amount of time that this build should be allowed to run, to second granularity.
@ -316,14 +308,12 @@ options:
required: false required: false
default: 600s default: 600s
type: str type: str
version_added: '2.10'
secrets: secrets:
description: description:
- Secrets to decrypt using Cloud Key Management Service. - Secrets to decrypt using Cloud Key Management Service.
elements: dict elements: dict
required: false required: false
type: list type: list
version_added: '2.10'
suboptions: suboptions:
kms_key_name: kms_key_name:
description: description:
@ -464,6 +454,168 @@ options:
elements: str elements: str
required: false required: false
type: list type: list
artifacts:
description:
- Artifacts produced by the build that should be uploaded upon successful
completion of all build steps.
required: false
type: dict
suboptions:
images:
description:
- A list of images to be pushed upon the successful completion of all
build steps.
- The images will be pushed using the builder service account's credentials.
- The digests of the pushed images will be stored in the Build resource's
results field.
- If any of the images fail to be pushed, the build is marked FAILURE.
elements: str
required: false
type: list
objects:
description:
- A list of objects to be uploaded to Cloud Storage upon successful completion
of all build steps.
- Files in the workspace matching specified paths globs will be uploaded
to the Cloud Storage location using the builder service account's credentials.
- The location and generation of the uploaded objects will be stored in
the Build resource's results field.
- If any objects fail to be pushed, the build is marked FAILURE.
required: false
type: dict
suboptions:
location:
description:
- Cloud Storage bucket and optional object path, in the form "gs://bucket/path/to/somewhere/".
- Files in the workspace matching any path pattern will be uploaded
to Cloud Storage with this location as a prefix.
required: false
type: str
paths:
description:
- Path globs used to match files in the build's workspace.
elements: str
required: false
type: list
options:
description:
- Special options for this build.
required: false
type: dict
suboptions:
source_provenance_hash:
description:
- Requested hash for SourceProvenance.
elements: str
required: false
type: list
requested_verify_option:
description:
- Requested verifiability options.
- 'Some valid choices include: "NOT_VERIFIED", "VERIFIED"'
required: false
type: str
machine_type:
description:
- Compute Engine machine type on which to run the build.
- 'Some valid choices include: "UNSPECIFIED", "N1_HIGHCPU_8", "N1_HIGHCPU_32"'
required: false
type: str
disk_size_gb:
description:
- Requested disk size for the VM that runs the build. Note that this is
NOT "disk free"; some of the space will be used by the operating system
and build utilities.
- Also note that this is the minimum disk size that will be allocated
for the build -- the build may run with a larger disk than requested.
At present, the maximum disk size is 1000GB; builds that request more
than the maximum are rejected with an error.
required: false
type: int
substitution_option:
description:
- Option to specify behavior when there is an error in the substitution
checks.
- NOTE this is always set to ALLOW_LOOSE for triggered builds and cannot
be overridden in the build configuration file.
- 'Some valid choices include: "MUST_MATCH", "ALLOW_LOOSE"'
required: false
type: str
dynamic_substitutions:
description:
- Option to specify whether or not to apply bash style string operations
to the substitutions.
- NOTE this is always enabled for triggered builds and cannot be overridden
in the build configuration file.
required: false
type: bool
log_streaming_option:
description:
- Option to define build log streaming behavior to Google Cloud Storage.
- 'Some valid choices include: "STREAM_DEFAULT", "STREAM_ON", "STREAM_OFF"'
required: false
type: str
worker_pool:
description:
- Option to specify a WorkerPool for the build. Format projects/{project}/workerPools/{workerPool}
This field is experimental.
required: false
type: str
logging:
description:
- Option to specify the logging mode, which determines if and where build
logs are stored.
- 'Some valid choices include: "LOGGING_UNSPECIFIED", "LEGACY", "GCS_ONLY",
"STACKDRIVER_ONLY", "NONE"'
required: false
type: str
env:
description:
- A list of global environment variable definitions that will exist for
all build steps in this build. If a variable is defined in both globally
and in a build step, the variable will use the build step value.
- The elements are of the form "KEY=VALUE" for the environment variable
"KEY" being given the value "VALUE".
elements: str
required: false
type: list
secret_env:
description:
- A list of global environment variables, which are encrypted using a
Cloud Key Management Service crypto key. These values must be specified
in the build's Secret. These variables will be available to all build
steps in this build.
elements: str
required: false
type: list
volumes:
description:
- Global list of volumes to mount for ALL build steps Each volume is created
as an empty volume prior to starting the build process.
- Upon completion of the build, volumes and their contents are discarded.
Global volume names and paths cannot conflict with the volumes defined
a build step.
- Using a global volume in a build with only one step is not valid as
it is indicative of a build request with an incorrect configuration.
elements: dict
required: false
type: list
suboptions:
name:
description:
- Name of the volume to mount.
- Volume names must be unique per build step and must be valid names
for Docker volumes.
- Each named volume must be used by at least two build steps.
required: false
type: str
path:
description:
- Path at which to mount the volume.
- Paths must be absolute and cannot conflict with other volume paths
on the same build step or with certain reserved volume paths.
required: false
type: str
project: project:
description: description:
- The Google Cloud Platform project to use. - The Google Cloud Platform project to use.
@ -495,6 +647,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -935,6 +1088,178 @@ build:
successfully. successfully.
returned: success returned: success
type: list type: list
artifacts:
description:
- Artifacts produced by the build that should be uploaded upon successful completion
of all build steps.
returned: success
type: complex
contains:
images:
description:
- A list of images to be pushed upon the successful completion of all build
steps.
- The images will be pushed using the builder service account's credentials.
- The digests of the pushed images will be stored in the Build resource's
results field.
- If any of the images fail to be pushed, the build is marked FAILURE.
returned: success
type: list
objects:
description:
- A list of objects to be uploaded to Cloud Storage upon successful completion
of all build steps.
- Files in the workspace matching specified paths globs will be uploaded
to the Cloud Storage location using the builder service account's credentials.
- The location and generation of the uploaded objects will be stored in
the Build resource's results field.
- If any objects fail to be pushed, the build is marked FAILURE.
returned: success
type: complex
contains:
location:
description:
- Cloud Storage bucket and optional object path, in the form "gs://bucket/path/to/somewhere/".
- Files in the workspace matching any path pattern will be uploaded
to Cloud Storage with this location as a prefix.
returned: success
type: str
paths:
description:
- Path globs used to match files in the build's workspace.
returned: success
type: list
timing:
description:
- Output only. Stores timing information for pushing all artifact objects.
returned: success
type: complex
contains:
startTime:
description:
- Start of time span.
- 'A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution
and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z"
and "2014-10-02T15:01:23.045123456Z".'
returned: success
type: str
endTime:
description:
- End of time span.
- 'A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution
and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z"
and "2014-10-02T15:01:23.045123456Z".'
returned: success
type: str
options:
description:
- Special options for this build.
returned: success
type: complex
contains:
sourceProvenanceHash:
description:
- Requested hash for SourceProvenance.
returned: success
type: list
requestedVerifyOption:
description:
- Requested verifiability options.
returned: success
type: str
machineType:
description:
- Compute Engine machine type on which to run the build.
returned: success
type: str
diskSizeGb:
description:
- Requested disk size for the VM that runs the build. Note that this is
NOT "disk free"; some of the space will be used by the operating system
and build utilities.
- Also note that this is the minimum disk size that will be allocated for
the build -- the build may run with a larger disk than requested. At present,
the maximum disk size is 1000GB; builds that request more than the maximum
are rejected with an error.
returned: success
type: int
substitutionOption:
description:
- Option to specify behavior when there is an error in the substitution
checks.
- NOTE this is always set to ALLOW_LOOSE for triggered builds and cannot
be overridden in the build configuration file.
returned: success
type: str
dynamicSubstitutions:
description:
- Option to specify whether or not to apply bash style string operations
to the substitutions.
- NOTE this is always enabled for triggered builds and cannot be overridden
in the build configuration file.
returned: success
type: bool
logStreamingOption:
description:
- Option to define build log streaming behavior to Google Cloud Storage.
returned: success
type: str
workerPool:
description:
- Option to specify a WorkerPool for the build. Format projects/{project}/workerPools/{workerPool}
This field is experimental.
returned: success
type: str
logging:
description:
- Option to specify the logging mode, which determines if and where build
logs are stored.
returned: success
type: str
env:
description:
- A list of global environment variable definitions that will exist for
all build steps in this build. If a variable is defined in both globally
and in a build step, the variable will use the build step value.
- The elements are of the form "KEY=VALUE" for the environment variable
"KEY" being given the value "VALUE".
returned: success
type: list
secretEnv:
description:
- A list of global environment variables, which are encrypted using a Cloud
Key Management Service crypto key. These values must be specified in the
build's Secret. These variables will be available to all build steps in
this build.
returned: success
type: list
volumes:
description:
- Global list of volumes to mount for ALL build steps Each volume is created
as an empty volume prior to starting the build process.
- Upon completion of the build, volumes and their contents are discarded.
Global volume names and paths cannot conflict with the volumes defined
a build step.
- Using a global volume in a build with only one step is not valid as it
is indicative of a build request with an incorrect configuration.
returned: success
type: complex
contains:
name:
description:
- Name of the volume to mount.
- Volume names must be unique per build step and must be valid names
for Docker volumes.
- Each named volume must be used by at least two build steps.
returned: success
type: str
path:
description:
- Path at which to mount the volume.
- Paths must be absolute and cannot conflict with other volume paths
on the same build step or with certain reserved volume paths.
returned: success
type: str
''' '''
################################################################################ ################################################################################
@ -1035,6 +1360,30 @@ def main():
wait_for=dict(type='list', elements='str'), wait_for=dict(type='list', elements='str'),
), ),
), ),
artifacts=dict(
type='dict',
options=dict(
images=dict(type='list', elements='str'),
objects=dict(type='dict', options=dict(location=dict(type='str'), paths=dict(type='list', elements='str'))),
),
),
options=dict(
type='dict',
options=dict(
source_provenance_hash=dict(type='list', elements='str'),
requested_verify_option=dict(type='str'),
machine_type=dict(type='str'),
disk_size_gb=dict(type='int'),
substitution_option=dict(type='str'),
dynamic_substitutions=dict(type='bool'),
log_streaming_option=dict(type='str'),
worker_pool=dict(type='str'),
logging=dict(type='str'),
env=dict(type='list', elements='str'),
secret_env=dict(type='list', elements='str'),
volumes=dict(type='list', elements='dict', options=dict(name=dict(type='str'), path=dict(type='str'))),
),
),
), ),
), ),
) )
@ -1233,6 +1582,8 @@ class TriggerBuild(object):
u'timeout': self.request.get('timeout'), u'timeout': self.request.get('timeout'),
u'secrets': TriggerSecretsArray(self.request.get('secrets', []), self.module).to_request(), u'secrets': TriggerSecretsArray(self.request.get('secrets', []), self.module).to_request(),
u'steps': TriggerStepsArray(self.request.get('steps', []), self.module).to_request(), u'steps': TriggerStepsArray(self.request.get('steps', []), self.module).to_request(),
u'artifacts': TriggerArtifacts(self.request.get('artifacts', {}), self.module).to_request(),
u'options': TriggerOptions(self.request.get('options', {}), self.module).to_request(),
} }
) )
@ -1248,6 +1599,8 @@ class TriggerBuild(object):
u'timeout': self.request.get(u'timeout'), u'timeout': self.request.get(u'timeout'),
u'secrets': TriggerSecretsArray(self.request.get(u'secrets', []), self.module).from_response(), u'secrets': TriggerSecretsArray(self.request.get(u'secrets', []), self.module).from_response(),
u'steps': TriggerStepsArray(self.request.get(u'steps', []), self.module).from_response(), u'steps': TriggerStepsArray(self.request.get(u'steps', []), self.module).from_response(),
u'artifacts': TriggerArtifacts(self.request.get(u'artifacts', {}), self.module).from_response(),
u'options': TriggerOptions(self.request.get(u'options', {}), self.module).from_response(),
} }
) )
@ -1442,5 +1795,126 @@ class TriggerVolumesArray(object):
return remove_nones_from_dict({u'name': item.get(u'name'), u'path': item.get(u'path')}) return remove_nones_from_dict({u'name': item.get(u'name'), u'path': item.get(u'path')})
class TriggerArtifacts(object):
def __init__(self, request, module):
self.module = module
if request:
self.request = request
else:
self.request = {}
def to_request(self):
return remove_nones_from_dict(
{u'images': self.request.get('images'), u'objects': TriggerObjects(self.request.get('objects', {}), self.module).to_request()}
)
def from_response(self):
return remove_nones_from_dict(
{u'images': self.request.get(u'images'), u'objects': TriggerObjects(self.request.get(u'objects', {}), self.module).from_response()}
)
class TriggerObjects(object):
def __init__(self, request, module):
self.module = module
if request:
self.request = request
else:
self.request = {}
def to_request(self):
return remove_nones_from_dict({u'location': self.request.get('location'), u'paths': self.request.get('paths')})
def from_response(self):
return remove_nones_from_dict({u'location': self.request.get(u'location'), u'paths': self.request.get(u'paths')})
class TriggerTiming(object):
def __init__(self, request, module):
self.module = module
if request:
self.request = request
else:
self.request = {}
def to_request(self):
return remove_nones_from_dict({u'startTime': self.request.get('start_time'), u'endTime': self.request.get('end_time')})
def from_response(self):
return remove_nones_from_dict({u'startTime': self.request.get(u'startTime'), u'endTime': self.request.get(u'endTime')})
class TriggerOptions(object):
def __init__(self, request, module):
self.module = module
if request:
self.request = request
else:
self.request = {}
def to_request(self):
return remove_nones_from_dict(
{
u'sourceProvenanceHash': self.request.get('source_provenance_hash'),
u'requestedVerifyOption': self.request.get('requested_verify_option'),
u'machineType': self.request.get('machine_type'),
u'diskSizeGb': self.request.get('disk_size_gb'),
u'substitutionOption': self.request.get('substitution_option'),
u'dynamicSubstitutions': self.request.get('dynamic_substitutions'),
u'logStreamingOption': self.request.get('log_streaming_option'),
u'workerPool': self.request.get('worker_pool'),
u'logging': self.request.get('logging'),
u'env': self.request.get('env'),
u'secretEnv': self.request.get('secret_env'),
u'volumes': TriggerVolumesArray(self.request.get('volumes', []), self.module).to_request(),
}
)
def from_response(self):
return remove_nones_from_dict(
{
u'sourceProvenanceHash': self.request.get(u'sourceProvenanceHash'),
u'requestedVerifyOption': self.request.get(u'requestedVerifyOption'),
u'machineType': self.request.get(u'machineType'),
u'diskSizeGb': self.request.get(u'diskSizeGb'),
u'substitutionOption': self.request.get(u'substitutionOption'),
u'dynamicSubstitutions': self.request.get(u'dynamicSubstitutions'),
u'logStreamingOption': self.request.get(u'logStreamingOption'),
u'workerPool': self.request.get(u'workerPool'),
u'logging': self.request.get(u'logging'),
u'env': self.request.get(u'env'),
u'secretEnv': self.request.get(u'secretEnv'),
u'volumes': TriggerVolumesArray(self.request.get(u'volumes', []), self.module).from_response(),
}
)
class TriggerVolumesArray(object):
def __init__(self, request, module):
self.module = module
if request:
self.request = request
else:
self.request = []
def to_request(self):
items = []
for item in self.request:
items.append(self._request_for_item(item))
return items
def from_response(self):
items = []
for item in self.request:
items.append(self._response_from_item(item))
return items
def _request_for_item(self, item):
return remove_nones_from_dict({u'name': item.get('name'), u'path': item.get('path')})
def _response_from_item(self, item):
return remove_nones_from_dict({u'name': item.get(u'name'), u'path': item.get(u'path')})
if __name__ == '__main__': if __name__ == '__main__':
main() main()

View file

@ -33,7 +33,6 @@ module: gcp_cloudbuild_trigger_info
description: description:
- Gather info for GCP Trigger - Gather info for GCP Trigger
short_description: Gather info for GCP Trigger short_description: Gather info for GCP Trigger
version_added: '2.8'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -71,6 +70,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -506,12 +506,187 @@ resources:
have completed successfully. have completed successfully.
returned: success returned: success
type: list type: list
artifacts:
description:
- Artifacts produced by the build that should be uploaded upon successful
completion of all build steps.
returned: success
type: complex
contains:
images:
description:
- A list of images to be pushed upon the successful completion of all
build steps.
- The images will be pushed using the builder service account's credentials.
- The digests of the pushed images will be stored in the Build resource's
results field.
- If any of the images fail to be pushed, the build is marked FAILURE.
returned: success
type: list
objects:
description:
- A list of objects to be uploaded to Cloud Storage upon successful
completion of all build steps.
- Files in the workspace matching specified paths globs will be uploaded
to the Cloud Storage location using the builder service account's
credentials.
- The location and generation of the uploaded objects will be stored
in the Build resource's results field.
- If any objects fail to be pushed, the build is marked FAILURE.
returned: success
type: complex
contains:
location:
description:
- Cloud Storage bucket and optional object path, in the form "gs://bucket/path/to/somewhere/".
- Files in the workspace matching any path pattern will be uploaded
to Cloud Storage with this location as a prefix.
returned: success
type: str
paths:
description:
- Path globs used to match files in the build's workspace.
returned: success
type: list
timing:
description:
- Output only. Stores timing information for pushing all artifact
objects.
returned: success
type: complex
contains:
startTime:
description:
- Start of time span.
- 'A timestamp in RFC3339 UTC "Zulu" format, with nanosecond
resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z"
and "2014-10-02T15:01:23.045123456Z".'
returned: success
type: str
endTime:
description:
- End of time span.
- 'A timestamp in RFC3339 UTC "Zulu" format, with nanosecond
resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z"
and "2014-10-02T15:01:23.045123456Z".'
returned: success
type: str
options:
description:
- Special options for this build.
returned: success
type: complex
contains:
sourceProvenanceHash:
description:
- Requested hash for SourceProvenance.
returned: success
type: list
requestedVerifyOption:
description:
- Requested verifiability options.
returned: success
type: str
machineType:
description:
- Compute Engine machine type on which to run the build.
returned: success
type: str
diskSizeGb:
description:
- Requested disk size for the VM that runs the build. Note that this
is NOT "disk free"; some of the space will be used by the operating
system and build utilities.
- Also note that this is the minimum disk size that will be allocated
for the build -- the build may run with a larger disk than requested.
At present, the maximum disk size is 1000GB; builds that request more
than the maximum are rejected with an error.
returned: success
type: int
substitutionOption:
description:
- Option to specify behavior when there is an error in the substitution
checks.
- NOTE this is always set to ALLOW_LOOSE for triggered builds and cannot
be overridden in the build configuration file.
returned: success
type: str
dynamicSubstitutions:
description:
- Option to specify whether or not to apply bash style string operations
to the substitutions.
- NOTE this is always enabled for triggered builds and cannot be overridden
in the build configuration file.
returned: success
type: bool
logStreamingOption:
description:
- Option to define build log streaming behavior to Google Cloud Storage.
returned: success
type: str
workerPool:
description:
- Option to specify a WorkerPool for the build. Format projects/{project}/workerPools/{workerPool}
This field is experimental.
returned: success
type: str
logging:
description:
- Option to specify the logging mode, which determines if and where
build logs are stored.
returned: success
type: str
env:
description:
- A list of global environment variable definitions that will exist
for all build steps in this build. If a variable is defined in both
globally and in a build step, the variable will use the build step
value.
- The elements are of the form "KEY=VALUE" for the environment variable
"KEY" being given the value "VALUE".
returned: success
type: list
secretEnv:
description:
- A list of global environment variables, which are encrypted using
a Cloud Key Management Service crypto key. These values must be specified
in the build's Secret. These variables will be available to all build
steps in this build.
returned: success
type: list
volumes:
description:
- Global list of volumes to mount for ALL build steps Each volume is
created as an empty volume prior to starting the build process.
- Upon completion of the build, volumes and their contents are discarded.
Global volume names and paths cannot conflict with the volumes defined
a build step.
- Using a global volume in a build with only one step is not valid as
it is indicative of a build request with an incorrect configuration.
returned: success
type: complex
contains:
name:
description:
- Name of the volume to mount.
- Volume names must be unique per build step and must be valid names
for Docker volumes.
- Each named volume must be used by at least two build steps.
returned: success
type: str
path:
description:
- Path at which to mount the volume.
- Paths must be absolute and cannot conflict with other volume paths
on the same build step or with certain reserved volume paths.
returned: success
type: str
''' '''
################################################################################ ################################################################################
# Imports # Imports
################################################################################ ################################################################################
from ansible.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest from ansible_collections.google.cloud.plugins.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest
import json import json
################################################################################ ################################################################################

View file

@ -33,7 +33,6 @@ module: gcp_cloudfunctions_cloud_function
description: description:
- A Cloud Function that contains user computation executed in response to an event. - A Cloud Function that contains user computation executed in response to an event.
short_description: Creates a GCP CloudFunction short_description: Creates a GCP CloudFunction
version_added: '2.9'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -189,6 +188,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.

View file

@ -33,7 +33,6 @@ module: gcp_cloudfunctions_cloud_function_info
description: description:
- Gather info for GCP CloudFunction - Gather info for GCP CloudFunction
short_description: Gather info for GCP CloudFunction short_description: Gather info for GCP CloudFunction
version_added: '2.9'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -76,6 +75,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -257,7 +257,7 @@ resources:
################################################################################ ################################################################################
# Imports # Imports
################################################################################ ################################################################################
from ansible.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest from ansible_collections.google.cloud.plugins.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest
import json import json
################################################################################ ################################################################################

View file

@ -37,7 +37,6 @@ description:
in one of the supported regions. If your project does not have an App Engine app, in one of the supported regions. If your project does not have an App Engine app,
you must create one. you must create one.
short_description: Creates a GCP Job short_description: Creates a GCP Job
version_added: '2.9'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -84,6 +83,8 @@ options:
- 'The allowed duration for this deadline is: * For HTTP targets, between 15 seconds - 'The allowed duration for this deadline is: * For HTTP targets, between 15 seconds
and 30 minutes.' and 30 minutes.'
- "* For App Engine HTTP targets, between 15 seconds and 24 hours." - "* For App Engine HTTP targets, between 15 seconds and 24 hours."
- "* **Note**: For PubSub targets, this field is ignored - setting it will introduce
an unresolvable diff."
- 'A duration in seconds with up to nine fractional digits, terminated by ''s''. - 'A duration in seconds with up to nine fractional digits, terminated by ''s''.
Example: "3.5s" .' Example: "3.5s" .'
required: false required: false
@ -324,6 +325,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -399,6 +401,8 @@ attemptDeadline:
- 'The allowed duration for this deadline is: * For HTTP targets, between 15 seconds - 'The allowed duration for this deadline is: * For HTTP targets, between 15 seconds
and 30 minutes.' and 30 minutes.'
- "* For App Engine HTTP targets, between 15 seconds and 24 hours." - "* For App Engine HTTP targets, between 15 seconds and 24 hours."
- "* **Note**: For PubSub targets, this field is ignored - setting it will introduce
an unresolvable diff."
- 'A duration in seconds with up to nine fractional digits, terminated by ''s''. - 'A duration in seconds with up to nine fractional digits, terminated by ''s''.
Example: "3.5s" .' Example: "3.5s" .'
returned: success returned: success

View file

@ -33,7 +33,6 @@ module: gcp_cloudscheduler_job_info
description: description:
- Gather info for GCP Job - Gather info for GCP Job
short_description: Gather info for GCP Job short_description: Gather info for GCP Job
version_added: '2.9'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -76,6 +75,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -141,6 +141,8 @@ resources:
- 'The allowed duration for this deadline is: * For HTTP targets, between 15 - 'The allowed duration for this deadline is: * For HTTP targets, between 15
seconds and 30 minutes.' seconds and 30 minutes.'
- "* For App Engine HTTP targets, between 15 seconds and 24 hours." - "* For App Engine HTTP targets, between 15 seconds and 24 hours."
- "* **Note**: For PubSub targets, this field is ignored - setting it will introduce
an unresolvable diff."
- 'A duration in seconds with up to nine fractional digits, terminated by ''s''. - 'A duration in seconds with up to nine fractional digits, terminated by ''s''.
Example: "3.5s" .' Example: "3.5s" .'
returned: success returned: success
@ -358,7 +360,7 @@ resources:
################################################################################ ################################################################################
# Imports # Imports
################################################################################ ################################################################################
from ansible.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest from ansible_collections.google.cloud.plugins.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest
import json import json
################################################################################ ################################################################################

View file

@ -33,7 +33,6 @@ module: gcp_cloudtasks_queue
description: description:
- A named resource to which messages are sent by publishers. - A named resource to which messages are sent by publishers.
short_description: Creates a GCP Queue short_description: Creates a GCP Queue
version_added: '2.9'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -194,6 +193,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.

View file

@ -33,7 +33,6 @@ module: gcp_cloudtasks_queue_info
description: description:
- Gather info for GCP Queue - Gather info for GCP Queue
short_description: Gather info for GCP Queue short_description: Gather info for GCP Queue
version_added: '2.9'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -76,6 +75,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -250,7 +250,7 @@ resources:
################################################################################ ################################################################################
# Imports # Imports
################################################################################ ################################################################################
from ansible.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest from ansible_collections.google.cloud.plugins.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest
import json import json
################################################################################ ################################################################################

View file

@ -42,7 +42,6 @@ description:
a new internal IP address, either by Compute Engine or by you. External IP addresses a new internal IP address, either by Compute Engine or by you. External IP addresses
can be either ephemeral or static. can be either ephemeral or static.
short_description: Creates a GCP Address short_description: Creates a GCP Address
version_added: '2.6'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -71,7 +70,6 @@ options:
required: false required: false
default: EXTERNAL default: EXTERNAL
type: str type: str
version_added: '2.7'
description: description:
description: description:
- An optional description of this resource. - An optional description of this resource.
@ -95,7 +93,6 @@ options:
- 'Some valid choices include: "GCE_ENDPOINT"' - 'Some valid choices include: "GCE_ENDPOINT"'
required: false required: false
type: str type: str
version_added: '2.10'
network_tier: network_tier:
description: description:
- The networking tier used for configuring this address. If this field is not - The networking tier used for configuring this address. If this field is not
@ -103,7 +100,6 @@ options:
- 'Some valid choices include: "PREMIUM", "STANDARD"' - 'Some valid choices include: "PREMIUM", "STANDARD"'
required: false required: false
type: str type: str
version_added: '2.8'
subnetwork: subnetwork:
description: description:
- The URL of the subnetwork in which to reserve the address. If an IP address - The URL of the subnetwork in which to reserve the address. If an IP address
@ -117,7 +113,6 @@ options:
}}"' }}"'
required: false required: false
type: dict type: dict
version_added: '2.7'
region: region:
description: description:
- URL of the region where the regional address resides. - URL of the region where the regional address resides.
@ -155,6 +150,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -369,11 +365,11 @@ def fetch_resource(module, link, kind, allow_not_found=True):
def self_link(module): def self_link(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/addresses/{name}".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/addresses/{name}".format(**module.params)
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/addresses".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/addresses".format(**module.params)
def return_if_object(module, response, kind, allow_not_found=False): def return_if_object(module, response, kind, allow_not_found=False):
@ -436,7 +432,7 @@ def response_to_hash(module, response):
def async_op_url(module, extra_data=None): def async_op_url(module, extra_data=None):
if extra_data is None: if extra_data is None:
extra_data = {} extra_data = {}
url = "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/operations/{op_id}" url = "https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/operations/{op_id}"
combined = extra_data.copy() combined = extra_data.copy()
combined.update(module.params) combined.update(module.params)
return url.format(**combined) return url.format(**combined)

View file

@ -33,7 +33,6 @@ module: gcp_compute_address_info
description: description:
- Gather info for GCP Address - Gather info for GCP Address
short_description: Gather info for GCP Address short_description: Gather info for GCP Address
version_added: '2.7'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -46,6 +45,7 @@ options:
- Each additional filter in the list will act be added as an AND condition (filter1 - Each additional filter in the list will act be added as an AND condition (filter1
and filter2) . and filter2) .
type: list type: list
elements: str
region: region:
description: description:
- URL of the region where the regional address resides. - URL of the region where the regional address resides.
@ -83,6 +83,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -201,7 +202,7 @@ resources:
################################################################################ ################################################################################
# Imports # Imports
################################################################################ ################################################################################
from ansible.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest from ansible_collections.google.cloud.plugins.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest
import json import json
################################################################################ ################################################################################
@ -220,7 +221,7 @@ def main():
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/addresses".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/addresses".format(**module.params)
def fetch_list(module, link, query): def fetch_list(module, link, query):

View file

@ -35,7 +35,6 @@ description:
- Autoscalers allow you to automatically scale virtual machine instances in managed - Autoscalers allow you to automatically scale virtual machine instances in managed
instance groups according to an autoscaling policy that you define. instance groups according to an autoscaling policy that you define.
short_description: Creates a GCP Autoscaler short_description: Creates a GCP Autoscaler
version_added: '2.9'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -112,7 +111,6 @@ options:
required: false required: false
default: 'ON' default: 'ON'
type: str type: str
version_added: '2.10'
cpu_utilization: cpu_utilization:
description: description:
- Defines the CPU utilization policy that allows the autoscaler to scale based - Defines the CPU utilization policy that allows the autoscaler to scale based
@ -237,6 +235,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -592,11 +591,11 @@ def fetch_resource(module, link, kind, allow_not_found=True):
def self_link(module): def self_link(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/autoscalers/{name}".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/zones/{zone}/autoscalers/{name}".format(**module.params)
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/autoscalers".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/zones/{zone}/autoscalers".format(**module.params)
def return_if_object(module, response, kind, allow_not_found=False): def return_if_object(module, response, kind, allow_not_found=False):
@ -654,7 +653,7 @@ def response_to_hash(module, response):
def async_op_url(module, extra_data=None): def async_op_url(module, extra_data=None):
if extra_data is None: if extra_data is None:
extra_data = {} extra_data = {}
url = "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/operations/{op_id}" url = "https://compute.googleapis.com/compute/v1/projects/{project}/zones/{zone}/operations/{op_id}"
combined = extra_data.copy() combined = extra_data.copy()
combined.update(module.params) combined.update(module.params)
return url.format(**combined) return url.format(**combined)

View file

@ -33,7 +33,6 @@ module: gcp_compute_autoscaler_info
description: description:
- Gather info for GCP Autoscaler - Gather info for GCP Autoscaler
short_description: Gather info for GCP Autoscaler short_description: Gather info for GCP Autoscaler
version_added: '2.9'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -46,6 +45,7 @@ options:
- Each additional filter in the list will act be added as an AND condition (filter1 - Each additional filter in the list will act be added as an AND condition (filter1
and filter2) . and filter2) .
type: list type: list
elements: str
zone: zone:
description: description:
- URL of the zone where the instance group resides. - URL of the zone where the instance group resides.
@ -82,6 +82,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -261,7 +262,7 @@ resources:
################################################################################ ################################################################################
# Imports # Imports
################################################################################ ################################################################################
from ansible.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest from ansible_collections.google.cloud.plugins.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest
import json import json
################################################################################ ################################################################################
@ -280,7 +281,7 @@ def main():
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/autoscalers".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/zones/{zone}/autoscalers".format(**module.params)
def fetch_list(module, link, query): def fetch_list(module, link, query):

View file

@ -37,7 +37,6 @@ description:
rather than a backend service. It can send requests for static content to a Cloud rather than a backend service. It can send requests for static content to a Cloud
Storage bucket and requests for dynamic content to a virtual machine instance. Storage bucket and requests for dynamic content to a virtual machine instance.
short_description: Creates a GCP BackendBucket short_description: Creates a GCP BackendBucket
version_added: '2.6'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -62,7 +61,6 @@ options:
- Cloud CDN configuration for this Backend Bucket. - Cloud CDN configuration for this Backend Bucket.
required: false required: false
type: dict type: dict
version_added: '2.8'
suboptions: suboptions:
signed_url_cache_max_age_sec: signed_url_cache_max_age_sec:
description: description:
@ -127,6 +125,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -329,11 +328,11 @@ def fetch_resource(module, link, kind, allow_not_found=True):
def self_link(module): def self_link(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/global/backendBuckets/{name}".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/global/backendBuckets/{name}".format(**module.params)
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/global/backendBuckets".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/global/backendBuckets".format(**module.params)
def return_if_object(module, response, kind, allow_not_found=False): def return_if_object(module, response, kind, allow_not_found=False):
@ -392,7 +391,7 @@ def response_to_hash(module, response):
def async_op_url(module, extra_data=None): def async_op_url(module, extra_data=None):
if extra_data is None: if extra_data is None:
extra_data = {} extra_data = {}
url = "https://www.googleapis.com/compute/v1/projects/{project}/global/operations/{op_id}" url = "https://compute.googleapis.com/compute/v1/projects/{project}/global/operations/{op_id}"
combined = extra_data.copy() combined = extra_data.copy()
combined.update(module.params) combined.update(module.params)
return url.format(**combined) return url.format(**combined)

View file

@ -33,7 +33,6 @@ module: gcp_compute_backend_bucket_info
description: description:
- Gather info for GCP BackendBucket - Gather info for GCP BackendBucket
short_description: Gather info for GCP BackendBucket short_description: Gather info for GCP BackendBucket
version_added: '2.7'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -46,6 +45,7 @@ options:
- Each additional filter in the list will act be added as an AND condition (filter1 - Each additional filter in the list will act be added as an AND condition (filter1
and filter2) . and filter2) .
type: list type: list
elements: str
project: project:
description: description:
- The Google Cloud Platform project to use. - The Google Cloud Platform project to use.
@ -77,6 +77,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -170,7 +171,7 @@ resources:
################################################################################ ################################################################################
# Imports # Imports
################################################################################ ################################################################################
from ansible.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest from ansible_collections.google.cloud.plugins.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest
import json import json
################################################################################ ################################################################################
@ -189,7 +190,7 @@ def main():
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/global/backendBuckets".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/global/backendBuckets".format(**module.params)
def fetch_list(module, link, query): def fetch_list(module, link, query):

View file

@ -37,7 +37,6 @@ description:
- For managed internal load balancing, use a regional backend service instead. - For managed internal load balancing, use a regional backend service instead.
- Currently self-managed internal load balancing is only available in beta. - Currently self-managed internal load balancing is only available in beta.
short_description: Creates a GCP BackendService short_description: Creates a GCP BackendService
version_added: '2.6'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -134,7 +133,6 @@ options:
must be set. must be set.
required: false required: false
type: int type: int
version_added: '2.9'
max_rate: max_rate:
description: description:
- The max requests per second (RPS) of the group. - The max requests per second (RPS) of the group.
@ -159,7 +157,6 @@ options:
must be set. must be set.
required: false required: false
type: str type: str
version_added: '2.9'
max_utilization: max_utilization:
description: description:
- Used when balancingMode is UTILIZATION. This ratio defines the CPU utilization - Used when balancingMode is UTILIZATION. This ratio defines the CPU utilization
@ -173,7 +170,6 @@ options:
is applicable only when the load_balancing_scheme is set to INTERNAL_SELF_MANAGED. is applicable only when the load_balancing_scheme is set to INTERNAL_SELF_MANAGED.
required: false required: false
type: dict type: dict
version_added: '2.10'
suboptions: suboptions:
max_requests_per_connection: max_requests_per_connection:
description: description:
@ -221,7 +217,6 @@ options:
This field is only applicable when locality_lb_policy is set to MAGLEV or RING_HASH. This field is only applicable when locality_lb_policy is set to MAGLEV or RING_HASH.
required: false required: false
type: dict type: dict
version_added: '2.10'
suboptions: suboptions:
http_cookie: http_cookie:
description: description:
@ -338,7 +333,6 @@ options:
required: false required: false
default: '3600' default: '3600'
type: int type: int
version_added: '2.8'
connection_draining: connection_draining:
description: description:
- Settings for connection draining . - Settings for connection draining .
@ -358,7 +352,6 @@ options:
elements: str elements: str
required: false required: false
type: list type: list
version_added: '2.10'
description: description:
description: description:
- An optional description of this resource. - An optional description of this resource.
@ -374,7 +367,7 @@ options:
- The set of URLs to the HttpHealthCheck or HttpsHealthCheck resource for health - The set of URLs to the HttpHealthCheck or HttpsHealthCheck resource for health
checking this BackendService. Currently at most one health check can be specified. checking this BackendService. Currently at most one health check can be specified.
- A health check must be specified unless the backend service uses an internet - A health check must be specified unless the backend service uses an internet
NEG as a backend. or serverless NEG as a backend.
- For internal load balancing, a URL to a HealthCheck resource must be specified - For internal load balancing, a URL to a HealthCheck resource must be specified
instead. instead.
elements: str elements: str
@ -385,7 +378,6 @@ options:
- Settings for enabling Cloud Identity Aware Proxy. - Settings for enabling Cloud Identity Aware Proxy.
required: false required: false
type: dict type: dict
version_added: '2.7'
suboptions: suboptions:
enabled: enabled:
description: description:
@ -411,7 +403,6 @@ options:
required: false required: false
default: EXTERNAL default: EXTERNAL
type: str type: str
version_added: '2.7'
locality_lb_policy: locality_lb_policy:
description: description:
- The load balancing algorithm used within the scope of the locality. - The load balancing algorithm used within the scope of the locality.
@ -435,7 +426,6 @@ options:
"ORIGINAL_DESTINATION", "MAGLEV"' "ORIGINAL_DESTINATION", "MAGLEV"'
required: false required: false
type: str type: str
version_added: '2.10'
name: name:
description: description:
- Name of the resource. Provided by the client when the resource is created. The - Name of the resource. Provided by the client when the resource is created. The
@ -452,7 +442,6 @@ options:
- This field is applicable only when the load_balancing_scheme is set to INTERNAL_SELF_MANAGED. - This field is applicable only when the load_balancing_scheme is set to INTERNAL_SELF_MANAGED.
required: false required: false
type: dict type: dict
version_added: '2.10'
suboptions: suboptions:
base_ejection_time: base_ejection_time:
description: description:
@ -583,7 +572,7 @@ options:
- The protocol this BackendService uses to communicate with backends. - The protocol this BackendService uses to communicate with backends.
- 'The default is HTTP. **NOTE**: HTTP2 is only valid for beta HTTP/2 load balancer - 'The default is HTTP. **NOTE**: HTTP2 is only valid for beta HTTP/2 load balancer
types and may result in errors if used with the GA API.' types and may result in errors if used with the GA API.'
- 'Some valid choices include: "HTTP", "HTTPS", "HTTP2", "TCP", "SSL"' - 'Some valid choices include: "HTTP", "HTTPS", "HTTP2", "TCP", "SSL", "GRPC"'
required: false required: false
type: str type: str
security_policy: security_policy:
@ -591,7 +580,6 @@ options:
- The security policy associated with this backend service. - The security policy associated with this backend service.
required: false required: false
type: str type: str
version_added: '2.8'
session_affinity: session_affinity:
description: description:
- Type of session affinity to use. The default is NONE. Session affinity is not - Type of session affinity to use. The default is NONE. Session affinity is not
@ -615,7 +603,6 @@ options:
- If logging is enabled, logs will be exported to Stackdriver. - If logging is enabled, logs will be exported to Stackdriver.
required: false required: false
type: dict type: dict
version_added: '2.10'
suboptions: suboptions:
enable: enable:
description: description:
@ -663,6 +650,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -1032,8 +1020,8 @@ healthChecks:
description: description:
- The set of URLs to the HttpHealthCheck or HttpsHealthCheck resource for health - The set of URLs to the HttpHealthCheck or HttpsHealthCheck resource for health
checking this BackendService. Currently at most one health check can be specified. checking this BackendService. Currently at most one health check can be specified.
- A health check must be specified unless the backend service uses an internet NEG - A health check must be specified unless the backend service uses an internet or
as a backend. serverless NEG as a backend.
- For internal load balancing, a URL to a HealthCheck resource must be specified - For internal load balancing, a URL to a HealthCheck resource must be specified
instead. instead.
returned: success returned: success
@ -1450,7 +1438,7 @@ def update_fields(module, request, response):
def security_policy_update(module, request, response): def security_policy_update(module, request, response):
auth = GcpSession(module, 'compute') auth = GcpSession(module, 'compute')
auth.post( auth.post(
''.join(["https://www.googleapis.com/compute/v1/", "projects/{project}/global/backendServices/{name}/setSecurityPolicy"]).format(**module.params), ''.join(["https://compute.googleapis.com/compute/v1/", "projects/{project}/global/backendServices/{name}/setSecurityPolicy"]).format(**module.params),
{u'securityPolicy': module.params.get('security_policy')}, {u'securityPolicy': module.params.get('security_policy')},
) )
@ -1499,11 +1487,11 @@ def fetch_resource(module, link, kind, allow_not_found=True):
def self_link(module): def self_link(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/global/backendServices/{name}".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/global/backendServices/{name}".format(**module.params)
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/global/backendServices".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/global/backendServices".format(**module.params)
def return_if_object(module, response, kind, allow_not_found=False): def return_if_object(module, response, kind, allow_not_found=False):
@ -1579,7 +1567,7 @@ def response_to_hash(module, response):
def async_op_url(module, extra_data=None): def async_op_url(module, extra_data=None):
if extra_data is None: if extra_data is None:
extra_data = {} extra_data = {}
url = "https://www.googleapis.com/compute/v1/projects/{project}/global/operations/{op_id}" url = "https://compute.googleapis.com/compute/v1/projects/{project}/global/operations/{op_id}"
combined = extra_data.copy() combined = extra_data.copy()
combined.update(module.params) combined.update(module.params)
return url.format(**combined) return url.format(**combined)

View file

@ -33,7 +33,6 @@ module: gcp_compute_backend_service_info
description: description:
- Gather info for GCP BackendService - Gather info for GCP BackendService
short_description: Gather info for GCP BackendService short_description: Gather info for GCP BackendService
version_added: '2.7'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -46,6 +45,7 @@ options:
- Each additional filter in the list will act be added as an AND condition (filter1 - Each additional filter in the list will act be added as an AND condition (filter1
and filter2) . and filter2) .
type: list type: list
elements: str
project: project:
description: description:
- The Google Cloud Platform project to use. - The Google Cloud Platform project to use.
@ -77,6 +77,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -428,7 +429,7 @@ resources:
- The set of URLs to the HttpHealthCheck or HttpsHealthCheck resource for health - The set of URLs to the HttpHealthCheck or HttpsHealthCheck resource for health
checking this BackendService. Currently at most one health check can be specified. checking this BackendService. Currently at most one health check can be specified.
- A health check must be specified unless the backend service uses an internet - A health check must be specified unless the backend service uses an internet
NEG as a backend. or serverless NEG as a backend.
- For internal load balancing, a URL to a HealthCheck resource must be specified - For internal load balancing, a URL to a HealthCheck resource must be specified
instead. instead.
returned: success returned: success
@ -680,7 +681,7 @@ resources:
################################################################################ ################################################################################
# Imports # Imports
################################################################################ ################################################################################
from ansible.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest from ansible_collections.google.cloud.plugins.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest
import json import json
################################################################################ ################################################################################
@ -699,7 +700,7 @@ def main():
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/global/backendServices".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/global/backendServices".format(**module.params)
def fetch_list(module, link, query): def fetch_list(module, link, query):

View file

@ -43,7 +43,6 @@ description:
- Add a persistent disk to your instance when you need reliable and affordable storage - Add a persistent disk to your instance when you need reliable and affordable storage
with consistent performance characteristics. with consistent performance characteristics.
short_description: Creates a GCP Disk short_description: Creates a GCP Disk
version_added: '2.6'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -69,7 +68,6 @@ options:
- Labels to apply to this disk. A list of key->value pairs. - Labels to apply to this disk. A list of key->value pairs.
required: false required: false
type: dict type: dict
version_added: '2.7'
licenses: licenses:
description: description:
- Any applicable publicly visible licenses. - Any applicable publicly visible licenses.
@ -105,22 +103,20 @@ options:
values for the caller's project. values for the caller's project.
required: false required: false
type: int type: int
version_added: '2.8'
type: type:
description: description:
- URL of the disk type resource describing which disk type to use to create the - URL of the disk type resource describing which disk type to use to create the
disk. Provide this when creating the disk. disk. Provide this when creating the disk.
required: false required: false
type: str type: str
version_added: '2.7'
source_image: source_image:
description: description:
- The source image used to create this disk. If the source image is deleted, this - The source image used to create this disk. If the source image is deleted, this
field will not be set. field will not be set.
- 'To create a disk with one of the public operating system images, specify the - 'To create a disk with one of the public operating system images, specify the
image by its family name. For example, specify family/debian-8 to use the latest image by its family name. For example, specify family/debian-9 to use the latest
Debian 8 image: projects/debian-cloud/global/images/family/debian-8 Alternatively, Debian 9 image: projects/debian-cloud/global/images/family/debian-9 Alternatively,
use a specific version of a public operating system image: projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD use a specific version of a public operating system image: projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD
To create a disk with a private image that you created, specify the image name To create a disk with a private image that you created, specify the image name
in the following format: global/images/my-private-image You can also specify in the following format: global/images/my-private-image You can also specify
a private image by its image family, which returns the latest version of the a private image by its image family, which returns the latest version of the
@ -151,6 +147,12 @@ options:
- The name of the encryption key that is stored in Google Cloud KMS. - The name of the encryption key that is stored in Google Cloud KMS.
required: false required: false
type: str type: str
kms_key_service_account:
description:
- The service account used for the encryption request for the given KMS key.
- If absent, the Compute Engine Service Agent service account is used.
required: false
type: str
disk_encryption_key: disk_encryption_key:
description: description:
- Encrypts the disk using a customer-supplied encryption key. - Encrypts the disk using a customer-supplied encryption key.
@ -177,6 +179,12 @@ options:
must have `roles/cloudkms.cryptoKeyEncrypterDecrypter` to use this feature. must have `roles/cloudkms.cryptoKeyEncrypterDecrypter` to use this feature.
required: false required: false
type: str type: str
kms_key_service_account:
description:
- The service account used for the encryption request for the given KMS key.
- If absent, the Compute Engine Service Agent service account is used.
required: false
type: str
source_snapshot: source_snapshot:
description: description:
- The source snapshot used to create this disk. You can provide this as a partial - The source snapshot used to create this disk. You can provide this as a partial
@ -206,6 +214,12 @@ options:
- The name of the encryption key that is stored in Google Cloud KMS. - The name of the encryption key that is stored in Google Cloud KMS.
required: false required: false
type: str type: str
kms_key_service_account:
description:
- The service account used for the encryption request for the given KMS key.
If absent, the Compute Engine Service Agent service account is used.
required: false
type: str
project: project:
description: description:
- The Google Cloud Platform project to use. - The Google Cloud Platform project to use.
@ -237,6 +251,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -361,9 +376,9 @@ sourceImage:
- The source image used to create this disk. If the source image is deleted, this - The source image used to create this disk. If the source image is deleted, this
field will not be set. field will not be set.
- 'To create a disk with one of the public operating system images, specify the - 'To create a disk with one of the public operating system images, specify the
image by its family name. For example, specify family/debian-8 to use the latest image by its family name. For example, specify family/debian-9 to use the latest
Debian 8 image: projects/debian-cloud/global/images/family/debian-8 Alternatively, Debian 9 image: projects/debian-cloud/global/images/family/debian-9 Alternatively,
use a specific version of a public operating system image: projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD use a specific version of a public operating system image: projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD
To create a disk with a private image that you created, specify the image name To create a disk with a private image that you created, specify the image name
in the following format: global/images/my-private-image You can also specify a in the following format: global/images/my-private-image You can also specify a
private image by its image family, which returns the latest version of the image private image by its image family, which returns the latest version of the image
@ -400,6 +415,12 @@ sourceImageEncryptionKey:
- The name of the encryption key that is stored in Google Cloud KMS. - The name of the encryption key that is stored in Google Cloud KMS.
returned: success returned: success
type: str type: str
kmsKeyServiceAccount:
description:
- The service account used for the encryption request for the given KMS key.
- If absent, the Compute Engine Service Agent service account is used.
returned: success
type: str
sourceImageId: sourceImageId:
description: description:
- The ID value of the image used to create this disk. This value identifies the - The ID value of the image used to create this disk. This value identifies the
@ -441,6 +462,12 @@ diskEncryptionKey:
must have `roles/cloudkms.cryptoKeyEncrypterDecrypter` to use this feature. must have `roles/cloudkms.cryptoKeyEncrypterDecrypter` to use this feature.
returned: success returned: success
type: str type: str
kmsKeyServiceAccount:
description:
- The service account used for the encryption request for the given KMS key.
- If absent, the Compute Engine Service Agent service account is used.
returned: success
type: str
sourceSnapshot: sourceSnapshot:
description: description:
- The source snapshot used to create this disk. You can provide this as a partial - The source snapshot used to create this disk. You can provide this as a partial
@ -471,6 +498,12 @@ sourceSnapshotEncryptionKey:
key that protects this resource. key that protects this resource.
returned: success returned: success
type: str type: str
kmsKeyServiceAccount:
description:
- The service account used for the encryption request for the given KMS key.
If absent, the Compute Engine Service Agent service account is used.
returned: success
type: str
sourceSnapshotId: sourceSnapshotId:
description: description:
- The unique ID of the snapshot used to create this disk. This value identifies - The unique ID of the snapshot used to create this disk. This value identifies
@ -518,10 +551,16 @@ def main():
type=dict(type='str'), type=dict(type='str'),
source_image=dict(type='str'), source_image=dict(type='str'),
zone=dict(required=True, type='str'), zone=dict(required=True, type='str'),
source_image_encryption_key=dict(type='dict', options=dict(raw_key=dict(type='str'), kms_key_name=dict(type='str'))), source_image_encryption_key=dict(
disk_encryption_key=dict(type='dict', options=dict(raw_key=dict(type='str'), kms_key_name=dict(type='str'))), type='dict', options=dict(raw_key=dict(type='str'), kms_key_name=dict(type='str'), kms_key_service_account=dict(type='str'))
),
disk_encryption_key=dict(
type='dict', options=dict(raw_key=dict(type='str'), kms_key_name=dict(type='str'), kms_key_service_account=dict(type='str'))
),
source_snapshot=dict(type='dict'), source_snapshot=dict(type='dict'),
source_snapshot_encryption_key=dict(type='dict', options=dict(raw_key=dict(type='str'), kms_key_name=dict(type='str'))), source_snapshot_encryption_key=dict(
type='dict', options=dict(raw_key=dict(type='str'), kms_key_name=dict(type='str'), kms_key_service_account=dict(type='str'))
),
) )
) )
@ -576,7 +615,7 @@ def update_fields(module, request, response):
def label_fingerprint_update(module, request, response): def label_fingerprint_update(module, request, response):
auth = GcpSession(module, 'compute') auth = GcpSession(module, 'compute')
auth.post( auth.post(
''.join(["https://www.googleapis.com/compute/v1/", "projects/{project}/zones/{zone}/disks/{name}/setLabels"]).format(**module.params), ''.join(["https://compute.googleapis.com/compute/v1/", "projects/{project}/zones/{zone}/disks/{name}/setLabels"]).format(**module.params),
{u'labelFingerprint': response.get('labelFingerprint'), u'labels': module.params.get('labels')}, {u'labelFingerprint': response.get('labelFingerprint'), u'labels': module.params.get('labels')},
) )
@ -584,7 +623,7 @@ def label_fingerprint_update(module, request, response):
def size_gb_update(module, request, response): def size_gb_update(module, request, response):
auth = GcpSession(module, 'compute') auth = GcpSession(module, 'compute')
auth.post( auth.post(
''.join(["https://www.googleapis.com/compute/v1/", "projects/{project}/zones/{zone}/disks/{name}/resize"]).format(**module.params), ''.join(["https://compute.googleapis.com/compute/v1/", "projects/{project}/zones/{zone}/disks/{name}/resize"]).format(**module.params),
{u'sizeGb': module.params.get('size_gb')}, {u'sizeGb': module.params.get('size_gb')},
) )
@ -599,6 +638,7 @@ def resource_to_request(module):
u'kind': 'compute#disk', u'kind': 'compute#disk',
u'sourceImageEncryptionKey': DiskSourceimageencryptionkey(module.params.get('source_image_encryption_key', {}), module).to_request(), u'sourceImageEncryptionKey': DiskSourceimageencryptionkey(module.params.get('source_image_encryption_key', {}), module).to_request(),
u'diskEncryptionKey': DiskDiskencryptionkey(module.params.get('disk_encryption_key', {}), module).to_request(), u'diskEncryptionKey': DiskDiskencryptionkey(module.params.get('disk_encryption_key', {}), module).to_request(),
u'sourceSnapshot': replace_resource_dict(module.params.get(u'source_snapshot', {}), 'selfLink'),
u'sourceSnapshotEncryptionKey': DiskSourcesnapshotencryptionkey(module.params.get('source_snapshot_encryption_key', {}), module).to_request(), u'sourceSnapshotEncryptionKey': DiskSourcesnapshotencryptionkey(module.params.get('source_snapshot_encryption_key', {}), module).to_request(),
u'description': module.params.get('description'), u'description': module.params.get('description'),
u'labels': module.params.get('labels'), u'labels': module.params.get('labels'),
@ -623,11 +663,11 @@ def fetch_resource(module, link, kind, allow_not_found=True):
def self_link(module): def self_link(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/disks/{name}".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/zones/{zone}/disks/{name}".format(**module.params)
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/disks".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/zones/{zone}/disks".format(**module.params)
def return_if_object(module, response, kind, allow_not_found=False): def return_if_object(module, response, kind, allow_not_found=False):
@ -693,16 +733,16 @@ def response_to_hash(module, response):
def disk_type_selflink(name, params): def disk_type_selflink(name, params):
if name is None: if name is None:
return return
url = r"https://www.googleapis.com/compute/v1/projects/.*/zones/.*/diskTypes/.*" url = r"https://compute.googleapis.com/compute/v1/projects/.*/zones/.*/diskTypes/.*"
if not re.match(url, name): if not re.match(url, name):
name = "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/diskTypes/%s".format(**params) % name name = "https://compute.googleapis.com/compute/v1/projects/{project}/zones/{zone}/diskTypes/%s".format(**params) % name
return name return name
def async_op_url(module, extra_data=None): def async_op_url(module, extra_data=None):
if extra_data is None: if extra_data is None:
extra_data = {} extra_data = {}
url = "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/operations/{op_id}" url = "https://compute.googleapis.com/compute/v1/projects/{project}/zones/{zone}/operations/{op_id}"
combined = extra_data.copy() combined = extra_data.copy()
combined.update(module.params) combined.update(module.params)
return url.format(**combined) return url.format(**combined)
@ -743,10 +783,22 @@ class DiskSourceimageencryptionkey(object):
self.request = {} self.request = {}
def to_request(self): def to_request(self):
return remove_nones_from_dict({u'rawKey': self.request.get('raw_key'), u'kmsKeyName': self.request.get('kms_key_name')}) return remove_nones_from_dict(
{
u'rawKey': self.request.get('raw_key'),
u'kmsKeyName': self.request.get('kms_key_name'),
u'kmsKeyServiceAccount': self.request.get('kms_key_service_account'),
}
)
def from_response(self): def from_response(self):
return remove_nones_from_dict({u'rawKey': self.request.get(u'rawKey'), u'kmsKeyName': self.request.get(u'kmsKeyName')}) return remove_nones_from_dict(
{
u'rawKey': self.request.get(u'rawKey'),
u'kmsKeyName': self.request.get(u'kmsKeyName'),
u'kmsKeyServiceAccount': self.request.get(u'kmsKeyServiceAccount'),
}
)
class DiskDiskencryptionkey(object): class DiskDiskencryptionkey(object):
@ -758,10 +810,22 @@ class DiskDiskencryptionkey(object):
self.request = {} self.request = {}
def to_request(self): def to_request(self):
return remove_nones_from_dict({u'rawKey': self.request.get('raw_key'), u'kmsKeyName': self.request.get('kms_key_name')}) return remove_nones_from_dict(
{
u'rawKey': self.request.get('raw_key'),
u'kmsKeyName': self.request.get('kms_key_name'),
u'kmsKeyServiceAccount': self.request.get('kms_key_service_account'),
}
)
def from_response(self): def from_response(self):
return remove_nones_from_dict({u'rawKey': self.request.get(u'rawKey'), u'kmsKeyName': self.request.get(u'kmsKeyName')}) return remove_nones_from_dict(
{
u'rawKey': self.request.get(u'rawKey'),
u'kmsKeyName': self.request.get(u'kmsKeyName'),
u'kmsKeyServiceAccount': self.request.get(u'kmsKeyServiceAccount'),
}
)
class DiskSourcesnapshotencryptionkey(object): class DiskSourcesnapshotencryptionkey(object):
@ -773,10 +837,22 @@ class DiskSourcesnapshotencryptionkey(object):
self.request = {} self.request = {}
def to_request(self): def to_request(self):
return remove_nones_from_dict({u'rawKey': self.request.get('raw_key'), u'kmsKeyName': self.request.get('kms_key_name')}) return remove_nones_from_dict(
{
u'rawKey': self.request.get('raw_key'),
u'kmsKeyName': self.request.get('kms_key_name'),
u'kmsKeyServiceAccount': self.request.get('kms_key_service_account'),
}
)
def from_response(self): def from_response(self):
return remove_nones_from_dict({u'rawKey': self.request.get(u'rawKey'), u'kmsKeyName': self.request.get(u'kmsKeyName')}) return remove_nones_from_dict(
{
u'rawKey': self.request.get(u'rawKey'),
u'kmsKeyName': self.request.get(u'kmsKeyName'),
u'kmsKeyServiceAccount': self.request.get(u'kmsKeyServiceAccount'),
}
)
if __name__ == '__main__': if __name__ == '__main__':

View file

@ -33,7 +33,6 @@ module: gcp_compute_disk_info
description: description:
- Gather info for GCP Disk - Gather info for GCP Disk
short_description: Gather info for GCP Disk short_description: Gather info for GCP Disk
version_added: '2.7'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -46,6 +45,7 @@ options:
- Each additional filter in the list will act be added as an AND condition (filter1 - Each additional filter in the list will act be added as an AND condition (filter1
and filter2) . and filter2) .
type: list type: list
elements: str
zone: zone:
description: description:
- A reference to the zone where the disk resides. - A reference to the zone where the disk resides.
@ -82,6 +82,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -206,10 +207,10 @@ resources:
- The source image used to create this disk. If the source image is deleted, - The source image used to create this disk. If the source image is deleted,
this field will not be set. this field will not be set.
- 'To create a disk with one of the public operating system images, specify - 'To create a disk with one of the public operating system images, specify
the image by its family name. For example, specify family/debian-8 to use the image by its family name. For example, specify family/debian-9 to use
the latest Debian 8 image: projects/debian-cloud/global/images/family/debian-8 the latest Debian 9 image: projects/debian-cloud/global/images/family/debian-9
Alternatively, use a specific version of a public operating system image: Alternatively, use a specific version of a public operating system image:
projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD To create a projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD To create a
disk with a private image that you created, specify the image name in the disk with a private image that you created, specify the image name in the
following format: global/images/my-private-image You can also specify a private following format: global/images/my-private-image You can also specify a private
image by its image family, which returns the latest version of the image in image by its image family, which returns the latest version of the image in
@ -246,6 +247,13 @@ resources:
- The name of the encryption key that is stored in Google Cloud KMS. - The name of the encryption key that is stored in Google Cloud KMS.
returned: success returned: success
type: str type: str
kmsKeyServiceAccount:
description:
- The service account used for the encryption request for the given KMS
key.
- If absent, the Compute Engine Service Agent service account is used.
returned: success
type: str
sourceImageId: sourceImageId:
description: description:
- The ID value of the image used to create this disk. This value identifies - The ID value of the image used to create this disk. This value identifies
@ -288,6 +296,13 @@ resources:
must have `roles/cloudkms.cryptoKeyEncrypterDecrypter` to use this feature. must have `roles/cloudkms.cryptoKeyEncrypterDecrypter` to use this feature.
returned: success returned: success
type: str type: str
kmsKeyServiceAccount:
description:
- The service account used for the encryption request for the given KMS
key.
- If absent, the Compute Engine Service Agent service account is used.
returned: success
type: str
sourceSnapshot: sourceSnapshot:
description: description:
- The source snapshot used to create this disk. You can provide this as a partial - The source snapshot used to create this disk. You can provide this as a partial
@ -318,6 +333,12 @@ resources:
key that protects this resource. key that protects this resource.
returned: success returned: success
type: str type: str
kmsKeyServiceAccount:
description:
- The service account used for the encryption request for the given KMS
key. If absent, the Compute Engine Service Agent service account is used.
returned: success
type: str
sourceSnapshotId: sourceSnapshotId:
description: description:
- The unique ID of the snapshot used to create this disk. This value identifies - The unique ID of the snapshot used to create this disk. This value identifies
@ -332,7 +353,7 @@ resources:
################################################################################ ################################################################################
# Imports # Imports
################################################################################ ################################################################################
from ansible.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest from ansible_collections.google.cloud.plugins.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest
import json import json
################################################################################ ################################################################################
@ -351,7 +372,7 @@ def main():
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/disks".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/zones/{zone}/disks".format(**module.params)
def fetch_list(module, link, query): def fetch_list(module, link, query):

View file

@ -33,7 +33,6 @@ module: gcp_compute_external_vpn_gateway
description: description:
- Represents a VPN gateway managed outside of GCP. - Represents a VPN gateway managed outside of GCP.
short_description: Creates a GCP ExternalVpnGateway short_description: Creates a GCP ExternalVpnGateway
version_added: '2.10'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -88,7 +87,7 @@ options:
description: description:
- IP address of the interface in the external VPN gateway. - IP address of the interface in the external VPN gateway.
- Only IPv4 is supported. This IP address can be either from your on-premise - Only IPv4 is supported. This IP address can be either from your on-premise
gateway or another Cloud providers VPN gateway, it cannot be an IP address gateway or another Cloud provider's VPN gateway, it cannot be an IP address
from Google Compute Engine. from Google Compute Engine.
required: false required: false
type: str type: str
@ -123,6 +122,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -196,7 +196,7 @@ interfaces:
description: description:
- IP address of the interface in the external VPN gateway. - IP address of the interface in the external VPN gateway.
- Only IPv4 is supported. This IP address can be either from your on-premise - Only IPv4 is supported. This IP address can be either from your on-premise
gateway or another Cloud providers VPN gateway, it cannot be an IP address gateway or another Cloud provider's VPN gateway, it cannot be an IP address
from Google Compute Engine. from Google Compute Engine.
returned: success returned: success
type: str type: str
@ -303,11 +303,11 @@ def fetch_resource(module, link, kind, allow_not_found=True):
def self_link(module): def self_link(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/global/externalVpnGateways/{name}".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/global/externalVpnGateways/{name}".format(**module.params)
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/global/externalVpnGateways".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/global/externalVpnGateways".format(**module.params)
def return_if_object(module, response, kind, allow_not_found=False): def return_if_object(module, response, kind, allow_not_found=False):
@ -363,7 +363,7 @@ def response_to_hash(module, response):
def async_op_url(module, extra_data=None): def async_op_url(module, extra_data=None):
if extra_data is None: if extra_data is None:
extra_data = {} extra_data = {}
url = "https://www.googleapis.com/compute/v1/projects/{project}/global/operations/{op_id}" url = "https://compute.googleapis.com/compute/v1/projects/{project}/global/operations/{op_id}"
combined = extra_data.copy() combined = extra_data.copy()
combined.update(module.params) combined.update(module.params)
return url.format(**combined) return url.format(**combined)

View file

@ -33,7 +33,6 @@ module: gcp_compute_external_vpn_gateway_info
description: description:
- Gather info for GCP ExternalVpnGateway - Gather info for GCP ExternalVpnGateway
short_description: Gather info for GCP ExternalVpnGateway short_description: Gather info for GCP ExternalVpnGateway
version_added: '2.10'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -46,6 +45,7 @@ options:
- Each additional filter in the list will act be added as an AND condition (filter1 - Each additional filter in the list will act be added as an AND condition (filter1
and filter2) . and filter2) .
type: list type: list
elements: str
project: project:
description: description:
- The Google Cloud Platform project to use. - The Google Cloud Platform project to use.
@ -77,6 +77,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -149,7 +150,7 @@ resources:
description: description:
- IP address of the interface in the external VPN gateway. - IP address of the interface in the external VPN gateway.
- Only IPv4 is supported. This IP address can be either from your on-premise - Only IPv4 is supported. This IP address can be either from your on-premise
gateway or another Cloud providers VPN gateway, it cannot be an IP address gateway or another Cloud provider's VPN gateway, it cannot be an IP address
from Google Compute Engine. from Google Compute Engine.
returned: success returned: success
type: str type: str
@ -158,7 +159,7 @@ resources:
################################################################################ ################################################################################
# Imports # Imports
################################################################################ ################################################################################
from ansible.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest from ansible_collections.google.cloud.plugins.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest
import json import json
################################################################################ ################################################################################
@ -177,7 +178,7 @@ def main():
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/global/externalVpnGateways".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/global/externalVpnGateways".format(**module.params)
def fetch_list(module, link, query): def fetch_list(module, link, query):

View file

@ -40,7 +40,6 @@ description:
incoming traffic. For all networks except the default network, you must create any incoming traffic. For all networks except the default network, you must create any
firewall rules you need. firewall rules you need.
short_description: Creates a GCP Firewall short_description: Creates a GCP Firewall
version_added: '2.6'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -67,8 +66,8 @@ options:
description: description:
- The IP protocol to which this rule applies. The protocol type is required - The IP protocol to which this rule applies. The protocol type is required
when creating a firewall rule. This value can either be one of the following when creating a firewall rule. This value can either be one of the following
well known protocol strings (tcp, udp, icmp, esp, ah, sctp, ipip), or the well known protocol strings (tcp, udp, icmp, esp, ah, sctp, ipip, all),
IP protocol number. or the IP protocol number.
required: true required: true
type: str type: str
ports: ports:
@ -88,14 +87,13 @@ options:
elements: dict elements: dict
required: false required: false
type: list type: list
version_added: '2.8'
suboptions: suboptions:
ip_protocol: ip_protocol:
description: description:
- The IP protocol to which this rule applies. The protocol type is required - The IP protocol to which this rule applies. The protocol type is required
when creating a firewall rule. This value can either be one of the following when creating a firewall rule. This value can either be one of the following
well known protocol strings (tcp, udp, icmp, esp, ah, sctp, ipip), or the well known protocol strings (tcp, udp, icmp, esp, ah, sctp, ipip, all),
IP protocol number. or the IP protocol number.
required: true required: true
type: str type: str
ports: ports:
@ -122,7 +120,6 @@ options:
elements: str elements: str
required: false required: false
type: list type: list
version_added: '2.8'
direction: direction:
description: description:
- 'Direction of traffic to which this firewall applies; default is INGRESS. Note: - 'Direction of traffic to which this firewall applies; default is INGRESS. Note:
@ -131,7 +128,6 @@ options:
- 'Some valid choices include: "INGRESS", "EGRESS"' - 'Some valid choices include: "INGRESS", "EGRESS"'
required: false required: false
type: str type: str
version_added: '2.8'
disabled: disabled:
description: description:
- Denotes whether the firewall rule is disabled, i.e not applied to the network - Denotes whether the firewall rule is disabled, i.e not applied to the network
@ -140,14 +136,12 @@ options:
rule will be enabled. rule will be enabled.
required: false required: false
type: bool type: bool
version_added: '2.8'
log_config: log_config:
description: description:
- This field denotes the logging options for a particular firewall rule. - This field denotes the logging options for a particular firewall rule.
- If logging is enabled, logs will be exported to Cloud Logging. - If logging is enabled, logs will be exported to Cloud Logging.
required: false required: false
type: dict type: dict
version_added: '2.10'
suboptions: suboptions:
enable: enable:
description: description:
@ -198,7 +192,6 @@ options:
required: false required: false
default: '1000' default: '1000'
type: int type: int
version_added: '2.8'
source_ranges: source_ranges:
description: description:
- If source ranges are specified, the firewall will apply only to traffic that - If source ranges are specified, the firewall will apply only to traffic that
@ -225,7 +218,6 @@ options:
elements: str elements: str
required: false required: false
type: list type: list
version_added: '2.8'
source_tags: source_tags:
description: description:
- If source tags are specified, the firewall will apply only to traffic with source - If source tags are specified, the firewall will apply only to traffic with source
@ -249,7 +241,6 @@ options:
elements: str elements: str
required: false required: false
type: list type: list
version_added: '2.8'
target_tags: target_tags:
description: description:
- A list of instance tags indicating sets of instances located in the network - A list of instance tags indicating sets of instances located in the network
@ -290,6 +281,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -342,8 +334,8 @@ allowed:
description: description:
- The IP protocol to which this rule applies. The protocol type is required - The IP protocol to which this rule applies. The protocol type is required
when creating a firewall rule. This value can either be one of the following when creating a firewall rule. This value can either be one of the following
well known protocol strings (tcp, udp, icmp, esp, ah, sctp, ipip), or the well known protocol strings (tcp, udp, icmp, esp, ah, sctp, ipip, all), or
IP protocol number. the IP protocol number.
returned: success returned: success
type: str type: str
ports: ports:
@ -370,8 +362,8 @@ denied:
description: description:
- The IP protocol to which this rule applies. The protocol type is required - The IP protocol to which this rule applies. The protocol type is required
when creating a firewall rule. This value can either be one of the following when creating a firewall rule. This value can either be one of the following
well known protocol strings (tcp, udp, icmp, esp, ah, sctp, ipip), or the well known protocol strings (tcp, udp, icmp, esp, ah, sctp, ipip, all), or
IP protocol number. the IP protocol number.
returned: success returned: success
type: str type: str
ports: ports:
@ -650,11 +642,11 @@ def fetch_resource(module, link, kind, allow_not_found=True):
def self_link(module): def self_link(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/global/firewalls/{name}".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/global/firewalls/{name}".format(**module.params)
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/global/firewalls".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/global/firewalls".format(**module.params)
def return_if_object(module, response, kind, allow_not_found=False): def return_if_object(module, response, kind, allow_not_found=False):
@ -723,7 +715,7 @@ def response_to_hash(module, response):
def async_op_url(module, extra_data=None): def async_op_url(module, extra_data=None):
if extra_data is None: if extra_data is None:
extra_data = {} extra_data = {}
url = "https://www.googleapis.com/compute/v1/projects/{project}/global/operations/{op_id}" url = "https://compute.googleapis.com/compute/v1/projects/{project}/global/operations/{op_id}"
combined = extra_data.copy() combined = extra_data.copy()
combined.update(module.params) combined.update(module.params)
return url.format(**combined) return url.format(**combined)

View file

@ -33,7 +33,6 @@ module: gcp_compute_firewall_info
description: description:
- Gather info for GCP Firewall - Gather info for GCP Firewall
short_description: Gather info for GCP Firewall short_description: Gather info for GCP Firewall
version_added: '2.7'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -46,6 +45,7 @@ options:
- Each additional filter in the list will act be added as an AND condition (filter1 - Each additional filter in the list will act be added as an AND condition (filter1
and filter2) . and filter2) .
type: list type: list
elements: str
project: project:
description: description:
- The Google Cloud Platform project to use. - The Google Cloud Platform project to use.
@ -77,6 +77,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -123,8 +124,8 @@ resources:
description: description:
- The IP protocol to which this rule applies. The protocol type is required - The IP protocol to which this rule applies. The protocol type is required
when creating a firewall rule. This value can either be one of the following when creating a firewall rule. This value can either be one of the following
well known protocol strings (tcp, udp, icmp, esp, ah, sctp, ipip), or well known protocol strings (tcp, udp, icmp, esp, ah, sctp, ipip, all),
the IP protocol number. or the IP protocol number.
returned: success returned: success
type: str type: str
ports: ports:
@ -152,8 +153,8 @@ resources:
description: description:
- The IP protocol to which this rule applies. The protocol type is required - The IP protocol to which this rule applies. The protocol type is required
when creating a firewall rule. This value can either be one of the following when creating a firewall rule. This value can either be one of the following
well known protocol strings (tcp, udp, icmp, esp, ah, sctp, ipip), or well known protocol strings (tcp, udp, icmp, esp, ah, sctp, ipip, all),
the IP protocol number. or the IP protocol number.
returned: success returned: success
type: str type: str
ports: ports:
@ -305,7 +306,7 @@ resources:
################################################################################ ################################################################################
# Imports # Imports
################################################################################ ################################################################################
from ansible.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest from ansible_collections.google.cloud.plugins.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest
import json import json
################################################################################ ################################################################################
@ -324,7 +325,7 @@ def main():
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/global/firewalls".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/global/firewalls".format(**module.params)
def fetch_list(module, link, query): def fetch_list(module, link, query):

View file

@ -35,7 +35,6 @@ description:
virtual machines to forward a packet to if it matches the given [IPAddress, IPProtocol, virtual machines to forward a packet to if it matches the given [IPAddress, IPProtocol,
portRange] tuple. portRange] tuple.
short_description: Creates a GCP ForwardingRule short_description: Creates a GCP ForwardingRule
version_added: '2.6'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -177,14 +176,12 @@ options:
- The forwarded traffic must be of a type appropriate to the target object. - The forwarded traffic must be of a type appropriate to the target object.
required: false required: false
type: str type: str
version_added: '2.7'
allow_global_access: allow_global_access:
description: description:
- If true, clients can access ILB from all regions. - If true, clients can access ILB from all regions.
- Otherwise only allows from the local region the ILB is located at. - Otherwise only allows from the local region the ILB is located at.
required: false required: false
type: bool type: bool
version_added: '2.10'
all_ports: all_ports:
description: description:
- For internal TCP/UDP load balancing (i.e. load balancing scheme is INTERNAL - For internal TCP/UDP load balancing (i.e. load balancing scheme is INTERNAL
@ -193,7 +190,6 @@ options:
Used with backend service. Cannot be set if port or portRange are set. Used with backend service. Cannot be set if port or portRange are set.
required: false required: false
type: bool type: bool
version_added: '2.8'
network_tier: network_tier:
description: description:
- The networking tier used for configuring this address. If this field is not - The networking tier used for configuring this address. If this field is not
@ -201,7 +197,6 @@ options:
- 'Some valid choices include: "PREMIUM", "STANDARD"' - 'Some valid choices include: "PREMIUM", "STANDARD"'
required: false required: false
type: str type: str
version_added: '2.8'
service_label: service_label:
description: description:
- An optional prefix to the service name for this Forwarding Rule. - An optional prefix to the service name for this Forwarding Rule.
@ -214,7 +209,6 @@ options:
- This field is only used for INTERNAL load balancing. - This field is only used for INTERNAL load balancing.
required: false required: false
type: str type: str
version_added: '2.8'
region: region:
description: description:
- A reference to the region where the regional forwarding rule resides. - A reference to the region where the regional forwarding rule resides.
@ -252,6 +246,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -562,7 +557,7 @@ def update_fields(module, request, response):
def target_update(module, request, response): def target_update(module, request, response):
auth = GcpSession(module, 'compute') auth = GcpSession(module, 'compute')
auth.post( auth.post(
''.join(["https://www.googleapis.com/compute/v1/", "projects/{project}/regions/{region}/forwardingRules/{name}/setTarget"]).format(**module.params), ''.join(["https://compute.googleapis.com/compute/v1/", "projects/{project}/regions/{region}/forwardingRules/{name}/setTarget"]).format(**module.params),
{u'target': module.params.get('target')}, {u'target': module.params.get('target')},
) )
@ -570,7 +565,7 @@ def target_update(module, request, response):
def allow_global_access_update(module, request, response): def allow_global_access_update(module, request, response):
auth = GcpSession(module, 'compute') auth = GcpSession(module, 'compute')
auth.patch( auth.patch(
''.join(["https://www.googleapis.com/compute/v1/", "projects/{project}/regions/{region}/forwardingRules/{name}"]).format(**module.params), ''.join(["https://compute.googleapis.com/compute/v1/", "projects/{project}/regions/{region}/forwardingRules/{name}"]).format(**module.params),
{u'allowGlobalAccess': module.params.get('allow_global_access')}, {u'allowGlobalAccess': module.params.get('allow_global_access')},
) )
@ -613,11 +608,11 @@ def fetch_resource(module, link, kind, allow_not_found=True):
def self_link(module): def self_link(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/forwardingRules/{name}".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/forwardingRules/{name}".format(**module.params)
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/forwardingRules".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/forwardingRules".format(**module.params)
def return_if_object(module, response, kind, allow_not_found=False): def return_if_object(module, response, kind, allow_not_found=False):
@ -687,7 +682,7 @@ def response_to_hash(module, response):
def async_op_url(module, extra_data=None): def async_op_url(module, extra_data=None):
if extra_data is None: if extra_data is None:
extra_data = {} extra_data = {}
url = "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/operations/{op_id}" url = "https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/operations/{op_id}"
combined = extra_data.copy() combined = extra_data.copy()
combined.update(module.params) combined.update(module.params)
return url.format(**combined) return url.format(**combined)

View file

@ -33,7 +33,6 @@ module: gcp_compute_forwarding_rule_info
description: description:
- Gather info for GCP ForwardingRule - Gather info for GCP ForwardingRule
short_description: Gather info for GCP ForwardingRule short_description: Gather info for GCP ForwardingRule
version_added: '2.7'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -46,6 +45,7 @@ options:
- Each additional filter in the list will act be added as an AND condition (filter1 - Each additional filter in the list will act be added as an AND condition (filter1
and filter2) . and filter2) .
type: list type: list
elements: str
region: region:
description: description:
- A reference to the region where the regional forwarding rule resides. - A reference to the region where the regional forwarding rule resides.
@ -83,6 +83,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -288,7 +289,7 @@ resources:
################################################################################ ################################################################################
# Imports # Imports
################################################################################ ################################################################################
from ansible.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest from ansible_collections.google.cloud.plugins.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest
import json import json
################################################################################ ################################################################################
@ -307,7 +308,7 @@ def main():
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/forwardingRules".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/forwardingRules".format(**module.params)
def fetch_list(module, link, query): def fetch_list(module, link, query):

View file

@ -34,7 +34,6 @@ description:
- Represents a Global Address resource. Global addresses are used for HTTP(S) load - Represents a Global Address resource. Global addresses are used for HTTP(S) load
balancing. balancing.
short_description: Creates a GCP GlobalAddress short_description: Creates a GCP GlobalAddress
version_added: '2.6'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -54,7 +53,6 @@ options:
- The static external IP address represented by this resource. - The static external IP address represented by this resource.
required: false required: false
type: str type: str
version_added: '2.8'
description: description:
description: description:
- An optional description of this resource. - An optional description of this resource.
@ -83,7 +81,6 @@ options:
- This field is not applicable to addresses with addressType=EXTERNAL. - This field is not applicable to addresses with addressType=EXTERNAL.
required: false required: false
type: int type: int
version_added: '2.9'
address_type: address_type:
description: description:
- The type of the address to reserve. - The type of the address to reserve.
@ -93,7 +90,6 @@ options:
required: false required: false
default: EXTERNAL default: EXTERNAL
type: str type: str
version_added: '2.8'
purpose: purpose:
description: description:
- The purpose of the resource. For global internal addresses it can be * VPC_PEERING - The purpose of the resource. For global internal addresses it can be * VPC_PEERING
@ -101,7 +97,6 @@ options:
- 'Some valid choices include: "VPC_PEERING"' - 'Some valid choices include: "VPC_PEERING"'
required: false required: false
type: str type: str
version_added: '2.9'
network: network:
description: description:
- The URL of the network in which to reserve the IP range. The IP range must be - The URL of the network in which to reserve the IP range. The IP range must be
@ -115,7 +110,6 @@ options:
}}"' }}"'
required: false required: false
type: dict type: dict
version_added: '2.9'
project: project:
description: description:
- The Google Cloud Platform project to use. - The Google Cloud Platform project to use.
@ -147,6 +141,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -352,11 +347,11 @@ def fetch_resource(module, link, kind, allow_not_found=True):
def self_link(module): def self_link(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/global/addresses/{name}".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/global/addresses/{name}".format(**module.params)
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/global/addresses".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/global/addresses".format(**module.params)
def return_if_object(module, response, kind, allow_not_found=False): def return_if_object(module, response, kind, allow_not_found=False):
@ -419,16 +414,16 @@ def response_to_hash(module, response):
def region_selflink(name, params): def region_selflink(name, params):
if name is None: if name is None:
return return
url = r"https://www.googleapis.com/compute/v1/projects/.*/regions/.*" url = r"https://compute.googleapis.com/compute/v1/projects/.*/regions/.*"
if not re.match(url, name): if not re.match(url, name):
name = "https://www.googleapis.com/compute/v1/projects/{project}/regions/%s".format(**params) % name name = "https://compute.googleapis.com/compute/v1/projects/{project}/regions/%s".format(**params) % name
return name return name
def async_op_url(module, extra_data=None): def async_op_url(module, extra_data=None):
if extra_data is None: if extra_data is None:
extra_data = {} extra_data = {}
url = "https://www.googleapis.com/compute/v1/projects/{project}/global/operations/{op_id}" url = "https://compute.googleapis.com/compute/v1/projects/{project}/global/operations/{op_id}"
combined = extra_data.copy() combined = extra_data.copy()
combined.update(module.params) combined.update(module.params)
return url.format(**combined) return url.format(**combined)

View file

@ -33,7 +33,6 @@ module: gcp_compute_global_address_info
description: description:
- Gather info for GCP GlobalAddress - Gather info for GCP GlobalAddress
short_description: Gather info for GCP GlobalAddress short_description: Gather info for GCP GlobalAddress
version_added: '2.7'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -46,6 +45,7 @@ options:
- Each additional filter in the list will act be added as an AND condition (filter1 - Each additional filter in the list will act be added as an AND condition (filter1
and filter2) . and filter2) .
type: list type: list
elements: str
project: project:
description: description:
- The Google Cloud Platform project to use. - The Google Cloud Platform project to use.
@ -77,6 +77,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -186,7 +187,7 @@ resources:
################################################################################ ################################################################################
# Imports # Imports
################################################################################ ################################################################################
from ansible.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest from ansible_collections.google.cloud.plugins.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest
import json import json
################################################################################ ################################################################################
@ -205,7 +206,7 @@ def main():
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/global/addresses".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/global/addresses".format(**module.params)
def fetch_list(module, link, query): def fetch_list(module, link, query):

View file

@ -37,7 +37,6 @@ description:
- For more information, see U(https://cloud.google.com/compute/docs/load-balancing/http/) - For more information, see U(https://cloud.google.com/compute/docs/load-balancing/http/)
. .
short_description: Creates a GCP GlobalForwardingRule short_description: Creates a GCP GlobalForwardingRule
version_added: '2.6'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -122,7 +121,6 @@ options:
elements: dict elements: dict
required: false required: false
type: list type: list
version_added: '2.10'
suboptions: suboptions:
filter_match_criteria: filter_match_criteria:
description: description:
@ -231,6 +229,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -563,7 +562,7 @@ def update_fields(module, request, response):
def target_update(module, request, response): def target_update(module, request, response):
auth = GcpSession(module, 'compute') auth = GcpSession(module, 'compute')
auth.post( auth.post(
''.join(["https://www.googleapis.com/compute/v1/", "projects/{project}/global/forwardingRules/{name}/setTarget"]).format(**module.params), ''.join(["https://compute.googleapis.com/compute/v1/", "projects/{project}/global/forwardingRules/{name}/setTarget"]).format(**module.params),
{u'target': module.params.get('target')}, {u'target': module.params.get('target')},
) )
@ -601,11 +600,11 @@ def fetch_resource(module, link, kind, allow_not_found=True):
def self_link(module): def self_link(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/global/forwardingRules/{name}".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/global/forwardingRules/{name}".format(**module.params)
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/global/forwardingRules".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/global/forwardingRules".format(**module.params)
def return_if_object(module, response, kind, allow_not_found=False): def return_if_object(module, response, kind, allow_not_found=False):
@ -669,7 +668,7 @@ def response_to_hash(module, response):
def async_op_url(module, extra_data=None): def async_op_url(module, extra_data=None):
if extra_data is None: if extra_data is None:
extra_data = {} extra_data = {}
url = "https://www.googleapis.com/compute/v1/projects/{project}/global/operations/{op_id}" url = "https://compute.googleapis.com/compute/v1/projects/{project}/global/operations/{op_id}"
combined = extra_data.copy() combined = extra_data.copy()
combined.update(module.params) combined.update(module.params)
return url.format(**combined) return url.format(**combined)

View file

@ -33,7 +33,6 @@ module: gcp_compute_global_forwarding_rule_info
description: description:
- Gather info for GCP GlobalForwardingRule - Gather info for GCP GlobalForwardingRule
short_description: Gather info for GCP GlobalForwardingRule short_description: Gather info for GCP GlobalForwardingRule
version_added: '2.7'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -46,6 +45,7 @@ options:
- Each additional filter in the list will act be added as an AND condition (filter1 - Each additional filter in the list will act be added as an AND condition (filter1
and filter2) . and filter2) .
type: list type: list
elements: str
project: project:
description: description:
- The Google Cloud Platform project to use. - The Google Cloud Platform project to use.
@ -77,6 +77,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -265,7 +266,7 @@ resources:
################################################################################ ################################################################################
# Imports # Imports
################################################################################ ################################################################################
from ansible.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest from ansible_collections.google.cloud.plugins.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest
import json import json
################################################################################ ################################################################################
@ -284,7 +285,7 @@ def main():
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/global/forwardingRules".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/global/forwardingRules".format(**module.params)
def fetch_list(module, link, query): def fetch_list(module, link, query):

View file

@ -41,7 +41,6 @@ description:
successfully to some number of consecutive probes, it is marked healthy again and successfully to some number of consecutive probes, it is marked healthy again and
can receive new connections. can receive new connections.
short_description: Creates a GCP HealthCheck short_description: Creates a GCP HealthCheck
version_added: '2.6'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -171,7 +170,6 @@ options:
- 'Some valid choices include: "USE_FIXED_PORT", "USE_NAMED_PORT", "USE_SERVING_PORT"' - 'Some valid choices include: "USE_FIXED_PORT", "USE_NAMED_PORT", "USE_SERVING_PORT"'
required: false required: false
type: str type: str
version_added: '2.9'
https_health_check: https_health_check:
description: description:
- A nested object resource. - A nested object resource.
@ -233,7 +231,6 @@ options:
- 'Some valid choices include: "USE_FIXED_PORT", "USE_NAMED_PORT", "USE_SERVING_PORT"' - 'Some valid choices include: "USE_FIXED_PORT", "USE_NAMED_PORT", "USE_SERVING_PORT"'
required: false required: false
type: str type: str
version_added: '2.9'
tcp_health_check: tcp_health_check:
description: description:
- A nested object resource. - A nested object resource.
@ -288,7 +285,6 @@ options:
- 'Some valid choices include: "USE_FIXED_PORT", "USE_NAMED_PORT", "USE_SERVING_PORT"' - 'Some valid choices include: "USE_FIXED_PORT", "USE_NAMED_PORT", "USE_SERVING_PORT"'
required: false required: false
type: str type: str
version_added: '2.9'
ssl_health_check: ssl_health_check:
description: description:
- A nested object resource. - A nested object resource.
@ -343,13 +339,11 @@ options:
- 'Some valid choices include: "USE_FIXED_PORT", "USE_NAMED_PORT", "USE_SERVING_PORT"' - 'Some valid choices include: "USE_FIXED_PORT", "USE_NAMED_PORT", "USE_SERVING_PORT"'
required: false required: false
type: str type: str
version_added: '2.9'
http2_health_check: http2_health_check:
description: description:
- A nested object resource. - A nested object resource.
required: false required: false
type: dict type: dict
version_added: '2.10'
suboptions: suboptions:
host: host:
description: description:
@ -406,6 +400,49 @@ options:
- 'Some valid choices include: "USE_FIXED_PORT", "USE_NAMED_PORT", "USE_SERVING_PORT"' - 'Some valid choices include: "USE_FIXED_PORT", "USE_NAMED_PORT", "USE_SERVING_PORT"'
required: false required: false
type: str type: str
grpc_health_check:
description:
- A nested object resource.
required: false
type: dict
suboptions:
port:
description:
- The port number for the health check request. Must be specified if portName
and portSpecification are not set or if port_specification is USE_FIXED_PORT.
Valid values are 1 through 65535.
required: false
type: int
port_name:
description:
- Port name as defined in InstanceGroup#NamedPort#name. If both port and port_name
are defined, port takes precedence.
required: false
type: str
port_specification:
description:
- 'Specifies how port is selected for health checking, can be one of the following
values: * `USE_FIXED_PORT`: The port number in `port` is used for health
checking.'
- "* `USE_NAMED_PORT`: The `portName` is used for health checking."
- "* `USE_SERVING_PORT`: For NetworkEndpointGroup, the port specified for
each network endpoint is used for health checking. For other backends, the
port or named port specified in the Backend Service is used for health checking."
- If not specified, gRPC health check follows behavior specified in `port`
and `portName` fields.
- 'Some valid choices include: "USE_FIXED_PORT", "USE_NAMED_PORT", "USE_SERVING_PORT"'
required: false
type: str
grpc_service_name:
description:
- 'The gRPC service name for the health check. The value of grpcServiceName
has the following meanings by convention: - Empty serviceName means the
overall status of all services at the backend.'
- "- Non-empty serviceName means the health of that gRPC service, as defined
by the owner of the service."
- The grpcServiceName can only be ASCII.
required: false
type: str
project: project:
description: description:
- The Google Cloud Platform project to use. - The Google Cloud Platform project to use.
@ -437,6 +474,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -797,6 +835,47 @@ http2HealthCheck:
and `portName` fields. and `portName` fields.
returned: success returned: success
type: str type: str
grpcHealthCheck:
description:
- A nested object resource.
returned: success
type: complex
contains:
port:
description:
- The port number for the health check request. Must be specified if portName
and portSpecification are not set or if port_specification is USE_FIXED_PORT.
Valid values are 1 through 65535.
returned: success
type: int
portName:
description:
- Port name as defined in InstanceGroup#NamedPort#name. If both port and port_name
are defined, port takes precedence.
returned: success
type: str
portSpecification:
description:
- 'Specifies how port is selected for health checking, can be one of the following
values: * `USE_FIXED_PORT`: The port number in `port` is used for health checking.'
- "* `USE_NAMED_PORT`: The `portName` is used for health checking."
- "* `USE_SERVING_PORT`: For NetworkEndpointGroup, the port specified for each
network endpoint is used for health checking. For other backends, the port
or named port specified in the Backend Service is used for health checking."
- If not specified, gRPC health check follows behavior specified in `port` and
`portName` fields.
returned: success
type: str
grpcServiceName:
description:
- 'The gRPC service name for the health check. The value of grpcServiceName
has the following meanings by convention: - Empty serviceName means the overall
status of all services at the backend.'
- "- Non-empty serviceName means the health of that gRPC service, as defined
by the owner of the service."
- The grpcServiceName can only be ASCII.
returned: success
type: str
''' '''
################################################################################ ################################################################################
@ -890,6 +969,10 @@ def main():
port_specification=dict(type='str'), port_specification=dict(type='str'),
), ),
), ),
grpc_health_check=dict(
type='dict',
options=dict(port=dict(type='int'), port_name=dict(type='str'), port_specification=dict(type='str'), grpc_service_name=dict(type='str')),
),
) )
) )
@ -954,6 +1037,7 @@ def resource_to_request(module):
u'tcpHealthCheck': HealthCheckTcphealthcheck(module.params.get('tcp_health_check', {}), module).to_request(), u'tcpHealthCheck': HealthCheckTcphealthcheck(module.params.get('tcp_health_check', {}), module).to_request(),
u'sslHealthCheck': HealthCheckSslhealthcheck(module.params.get('ssl_health_check', {}), module).to_request(), u'sslHealthCheck': HealthCheckSslhealthcheck(module.params.get('ssl_health_check', {}), module).to_request(),
u'http2HealthCheck': HealthCheckHttp2healthcheck(module.params.get('http2_health_check', {}), module).to_request(), u'http2HealthCheck': HealthCheckHttp2healthcheck(module.params.get('http2_health_check', {}), module).to_request(),
u'grpcHealthCheck': HealthCheckGrpchealthcheck(module.params.get('grpc_health_check', {}), module).to_request(),
} }
return_vals = {} return_vals = {}
for k, v in request.items(): for k, v in request.items():
@ -969,11 +1053,11 @@ def fetch_resource(module, link, kind, allow_not_found=True):
def self_link(module): def self_link(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/global/healthChecks/{name}".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/global/healthChecks/{name}".format(**module.params)
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/global/healthChecks".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/global/healthChecks".format(**module.params)
def return_if_object(module, response, kind, allow_not_found=False): def return_if_object(module, response, kind, allow_not_found=False):
@ -1033,13 +1117,14 @@ def response_to_hash(module, response):
u'tcpHealthCheck': HealthCheckTcphealthcheck(response.get(u'tcpHealthCheck', {}), module).from_response(), u'tcpHealthCheck': HealthCheckTcphealthcheck(response.get(u'tcpHealthCheck', {}), module).from_response(),
u'sslHealthCheck': HealthCheckSslhealthcheck(response.get(u'sslHealthCheck', {}), module).from_response(), u'sslHealthCheck': HealthCheckSslhealthcheck(response.get(u'sslHealthCheck', {}), module).from_response(),
u'http2HealthCheck': HealthCheckHttp2healthcheck(response.get(u'http2HealthCheck', {}), module).from_response(), u'http2HealthCheck': HealthCheckHttp2healthcheck(response.get(u'http2HealthCheck', {}), module).from_response(),
u'grpcHealthCheck': HealthCheckGrpchealthcheck(response.get(u'grpcHealthCheck', {}), module).from_response(),
} }
def async_op_url(module, extra_data=None): def async_op_url(module, extra_data=None):
if extra_data is None: if extra_data is None:
extra_data = {} extra_data = {}
url = "https://www.googleapis.com/compute/v1/projects/{project}/global/operations/{op_id}" url = "https://compute.googleapis.com/compute/v1/projects/{project}/global/operations/{op_id}"
combined = extra_data.copy() combined = extra_data.copy()
combined.update(module.params) combined.update(module.params)
return url.format(**combined) return url.format(**combined)
@ -1242,5 +1327,34 @@ class HealthCheckHttp2healthcheck(object):
) )
class HealthCheckGrpchealthcheck(object):
def __init__(self, request, module):
self.module = module
if request:
self.request = request
else:
self.request = {}
def to_request(self):
return remove_nones_from_dict(
{
u'port': self.request.get('port'),
u'portName': self.request.get('port_name'),
u'portSpecification': self.request.get('port_specification'),
u'grpcServiceName': self.request.get('grpc_service_name'),
}
)
def from_response(self):
return remove_nones_from_dict(
{
u'port': self.request.get(u'port'),
u'portName': self.request.get(u'portName'),
u'portSpecification': self.request.get(u'portSpecification'),
u'grpcServiceName': self.request.get(u'grpcServiceName'),
}
)
if __name__ == '__main__': if __name__ == '__main__':
main() main()

View file

@ -33,7 +33,6 @@ module: gcp_compute_health_check_info
description: description:
- Gather info for GCP HealthCheck - Gather info for GCP HealthCheck
short_description: Gather info for GCP HealthCheck short_description: Gather info for GCP HealthCheck
version_added: '2.7'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -46,6 +45,7 @@ options:
- Each additional filter in the list will act be added as an AND condition (filter1 - Each additional filter in the list will act be added as an AND condition (filter1
and filter2) . and filter2) .
type: list type: list
elements: str
project: project:
description: description:
- The Google Cloud Platform project to use. - The Google Cloud Platform project to use.
@ -77,6 +77,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -450,12 +451,55 @@ resources:
and `portName` fields. and `portName` fields.
returned: success returned: success
type: str type: str
grpcHealthCheck:
description:
- A nested object resource.
returned: success
type: complex
contains:
port:
description:
- The port number for the health check request. Must be specified if portName
and portSpecification are not set or if port_specification is USE_FIXED_PORT.
Valid values are 1 through 65535.
returned: success
type: int
portName:
description:
- Port name as defined in InstanceGroup#NamedPort#name. If both port and
port_name are defined, port takes precedence.
returned: success
type: str
portSpecification:
description:
- 'Specifies how port is selected for health checking, can be one of the
following values: * `USE_FIXED_PORT`: The port number in `port` is used
for health checking.'
- "* `USE_NAMED_PORT`: The `portName` is used for health checking."
- "* `USE_SERVING_PORT`: For NetworkEndpointGroup, the port specified for
each network endpoint is used for health checking. For other backends,
the port or named port specified in the Backend Service is used for health
checking."
- If not specified, gRPC health check follows behavior specified in `port`
and `portName` fields.
returned: success
type: str
grpcServiceName:
description:
- 'The gRPC service name for the health check. The value of grpcServiceName
has the following meanings by convention: - Empty serviceName means the
overall status of all services at the backend.'
- "- Non-empty serviceName means the health of that gRPC service, as defined
by the owner of the service."
- The grpcServiceName can only be ASCII.
returned: success
type: str
''' '''
################################################################################ ################################################################################
# Imports # Imports
################################################################################ ################################################################################
from ansible.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest from ansible_collections.google.cloud.plugins.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest
import json import json
################################################################################ ################################################################################
@ -474,7 +518,7 @@ def main():
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/global/healthChecks".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/global/healthChecks".format(**module.params)
def fetch_list(module, link, query): def fetch_list(module, link, query):

View file

@ -34,7 +34,6 @@ description:
- An HttpHealthCheck resource. This resource defines a template for how individual - An HttpHealthCheck resource. This resource defines a template for how individual
VMs should be checked for health, via HTTP. VMs should be checked for health, via HTTP.
short_description: Creates a GCP HttpHealthCheck short_description: Creates a GCP HttpHealthCheck
version_added: '2.6'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -144,6 +143,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -355,11 +355,11 @@ def fetch_resource(module, link, kind, allow_not_found=True):
def self_link(module): def self_link(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/global/httpHealthChecks/{name}".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/global/httpHealthChecks/{name}".format(**module.params)
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/global/httpHealthChecks".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/global/httpHealthChecks".format(**module.params)
def return_if_object(module, response, kind, allow_not_found=False): def return_if_object(module, response, kind, allow_not_found=False):
@ -422,7 +422,7 @@ def response_to_hash(module, response):
def async_op_url(module, extra_data=None): def async_op_url(module, extra_data=None):
if extra_data is None: if extra_data is None:
extra_data = {} extra_data = {}
url = "https://www.googleapis.com/compute/v1/projects/{project}/global/operations/{op_id}" url = "https://compute.googleapis.com/compute/v1/projects/{project}/global/operations/{op_id}"
combined = extra_data.copy() combined = extra_data.copy()
combined.update(module.params) combined.update(module.params)
return url.format(**combined) return url.format(**combined)

View file

@ -33,7 +33,6 @@ module: gcp_compute_http_health_check_info
description: description:
- Gather info for GCP HttpHealthCheck - Gather info for GCP HttpHealthCheck
short_description: Gather info for GCP HttpHealthCheck short_description: Gather info for GCP HttpHealthCheck
version_added: '2.7'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -46,6 +45,7 @@ options:
- Each additional filter in the list will act be added as an AND condition (filter1 - Each additional filter in the list will act be added as an AND condition (filter1
and filter2) . and filter2) .
type: list type: list
elements: str
project: project:
description: description:
- The Google Cloud Platform project to use. - The Google Cloud Platform project to use.
@ -77,6 +77,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -187,7 +188,7 @@ resources:
################################################################################ ################################################################################
# Imports # Imports
################################################################################ ################################################################################
from ansible.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest from ansible_collections.google.cloud.plugins.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest
import json import json
################################################################################ ################################################################################
@ -206,7 +207,7 @@ def main():
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/global/httpHealthChecks".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/global/httpHealthChecks".format(**module.params)
def fetch_list(module, link, query): def fetch_list(module, link, query):

View file

@ -34,7 +34,6 @@ description:
- An HttpsHealthCheck resource. This resource defines a template for how individual - An HttpsHealthCheck resource. This resource defines a template for how individual
VMs should be checked for health, via HTTPS. VMs should be checked for health, via HTTPS.
short_description: Creates a GCP HttpsHealthCheck short_description: Creates a GCP HttpsHealthCheck
version_added: '2.6'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -141,6 +140,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -352,11 +352,11 @@ def fetch_resource(module, link, kind, allow_not_found=True):
def self_link(module): def self_link(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/global/httpsHealthChecks/{name}".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/global/httpsHealthChecks/{name}".format(**module.params)
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/global/httpsHealthChecks".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/global/httpsHealthChecks".format(**module.params)
def return_if_object(module, response, kind, allow_not_found=False): def return_if_object(module, response, kind, allow_not_found=False):
@ -419,7 +419,7 @@ def response_to_hash(module, response):
def async_op_url(module, extra_data=None): def async_op_url(module, extra_data=None):
if extra_data is None: if extra_data is None:
extra_data = {} extra_data = {}
url = "https://www.googleapis.com/compute/v1/projects/{project}/global/operations/{op_id}" url = "https://compute.googleapis.com/compute/v1/projects/{project}/global/operations/{op_id}"
combined = extra_data.copy() combined = extra_data.copy()
combined.update(module.params) combined.update(module.params)
return url.format(**combined) return url.format(**combined)

View file

@ -33,7 +33,6 @@ module: gcp_compute_https_health_check_info
description: description:
- Gather info for GCP HttpsHealthCheck - Gather info for GCP HttpsHealthCheck
short_description: Gather info for GCP HttpsHealthCheck short_description: Gather info for GCP HttpsHealthCheck
version_added: '2.7'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -46,6 +45,7 @@ options:
- Each additional filter in the list will act be added as an AND condition (filter1 - Each additional filter in the list will act be added as an AND condition (filter1
and filter2) . and filter2) .
type: list type: list
elements: str
project: project:
description: description:
- The Google Cloud Platform project to use. - The Google Cloud Platform project to use.
@ -77,6 +77,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -187,7 +188,7 @@ resources:
################################################################################ ################################################################################
# Imports # Imports
################################################################################ ################################################################################
from ansible.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest from ansible_collections.google.cloud.plugins.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest
import json import json
################################################################################ ################################################################################
@ -206,7 +207,7 @@ def main():
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/global/httpsHealthChecks".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/global/httpsHealthChecks".format(**module.params)
def fetch_list(module, link, query): def fetch_list(module, link, query):

View file

@ -43,7 +43,6 @@ description:
You can create a custom image from root persistent disks and other images. Then, You can create a custom image from root persistent disks and other images. Then,
use the custom image to create an instance. use the custom image to create an instance.
short_description: Creates a GCP Image short_description: Creates a GCP Image
version_added: '2.6'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -88,8 +87,8 @@ options:
type: type:
description: description:
- The type of supported feature. - The type of supported feature.
- 'Some valid choices include: "MULTI_IP_SUBNET", "SECURE_BOOT", "UEFI_COMPATIBLE", - 'Some valid choices include: "MULTI_IP_SUBNET", "SECURE_BOOT", "SEV_CAPABLE",
"VIRTIO_SCSI_MULTIQUEUE", "WINDOWS"' "UEFI_COMPATIBLE", "VIRTIO_SCSI_MULTIQUEUE", "WINDOWS"'
required: true required: true
type: str type: str
image_encryption_key: image_encryption_key:
@ -111,7 +110,6 @@ options:
- Labels to apply to this Image. - Labels to apply to this Image.
required: false required: false
type: dict type: dict
version_added: '2.8'
licenses: licenses:
description: description:
- Any applicable license URI. - Any applicable license URI.
@ -186,6 +184,31 @@ options:
of a given disk name. of a given disk name.
required: false required: false
type: str type: str
source_image:
description:
- 'URL of the source image used to create this image. In order to create an image,
you must provide the full or partial URL of one of the following: The selfLink
URL This property The rawDisk.source URL The sourceDisk URL .'
- 'This field represents a link to a Image resource in GCP. It can be specified
in two ways. First, you can place a dictionary with key ''selfLink'' and value
of your resource''s selfLink Alternatively, you can add `register: name-of-resource`
to a gcp_compute_image task and then set this source_image field to "{{ name-of-resource
}}"'
required: false
type: dict
source_snapshot:
description:
- URL of the source snapshot used to create this image.
- 'In order to create an image, you must provide the full or partial URL of one
of the following: The selfLink URL This property The sourceImage URL The rawDisk.source
URL The sourceDisk URL .'
- 'This field represents a link to a Snapshot resource in GCP. It can be specified
in two ways. First, you can place a dictionary with key ''selfLink'' and value
of your resource''s selfLink Alternatively, you can add `register: name-of-resource`
to a gcp_compute_snapshot task and then set this source_snapshot field to "{{
name-of-resource }}"'
required: false
type: dict
source_type: source_type:
description: description:
- The type of the image used to create this disk. The default and only value is - The type of the image used to create this disk. The default and only value is
@ -224,6 +247,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -460,6 +484,21 @@ sourceDiskId:
of a given disk name. of a given disk name.
returned: success returned: success
type: str type: str
sourceImage:
description:
- 'URL of the source image used to create this image. In order to create an image,
you must provide the full or partial URL of one of the following: The selfLink
URL This property The rawDisk.source URL The sourceDisk URL .'
returned: success
type: dict
sourceSnapshot:
description:
- URL of the source snapshot used to create this image.
- 'In order to create an image, you must provide the full or partial URL of one
of the following: The selfLink URL This property The sourceImage URL The rawDisk.source
URL The sourceDisk URL .'
returned: success
type: dict
sourceType: sourceType:
description: description:
- The type of the image used to create this disk. The default and only value is - The type of the image used to create this disk. The default and only value is
@ -507,6 +546,8 @@ def main():
source_disk=dict(type='dict'), source_disk=dict(type='dict'),
source_disk_encryption_key=dict(type='dict', options=dict(raw_key=dict(type='str'))), source_disk_encryption_key=dict(type='dict', options=dict(raw_key=dict(type='str'))),
source_disk_id=dict(type='str'), source_disk_id=dict(type='str'),
source_image=dict(type='dict'),
source_snapshot=dict(type='dict'),
source_type=dict(type='str'), source_type=dict(type='str'),
) )
) )
@ -560,7 +601,7 @@ def update_fields(module, request, response):
def labels_update(module, request, response): def labels_update(module, request, response):
auth = GcpSession(module, 'compute') auth = GcpSession(module, 'compute')
auth.post( auth.post(
''.join(["https://www.googleapis.com/compute/v1/", "projects/{project}/global/images/{name}/setLabels"]).format(**module.params), ''.join(["https://compute.googleapis.com/compute/v1/", "projects/{project}/global/images/{name}/setLabels"]).format(**module.params),
{u'labels': module.params.get('labels'), u'labelFingerprint': response.get('labelFingerprint')}, {u'labels': module.params.get('labels'), u'labelFingerprint': response.get('labelFingerprint')},
) )
@ -585,6 +626,8 @@ def resource_to_request(module):
u'sourceDisk': replace_resource_dict(module.params.get(u'source_disk', {}), 'selfLink'), u'sourceDisk': replace_resource_dict(module.params.get(u'source_disk', {}), 'selfLink'),
u'sourceDiskEncryptionKey': ImageSourcediskencryptionkey(module.params.get('source_disk_encryption_key', {}), module).to_request(), u'sourceDiskEncryptionKey': ImageSourcediskencryptionkey(module.params.get('source_disk_encryption_key', {}), module).to_request(),
u'sourceDiskId': module.params.get('source_disk_id'), u'sourceDiskId': module.params.get('source_disk_id'),
u'sourceImage': replace_resource_dict(module.params.get(u'source_image', {}), 'selfLink'),
u'sourceSnapshot': replace_resource_dict(module.params.get(u'source_snapshot', {}), 'selfLink'),
u'sourceType': module.params.get('source_type'), u'sourceType': module.params.get('source_type'),
} }
return_vals = {} return_vals = {}
@ -601,11 +644,11 @@ def fetch_resource(module, link, kind, allow_not_found=True):
def self_link(module): def self_link(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/global/images/{name}".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/global/images/{name}".format(**module.params)
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/global/images".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/global/images".format(**module.params)
def return_if_object(module, response, kind, allow_not_found=False): def return_if_object(module, response, kind, allow_not_found=False):
@ -668,6 +711,8 @@ def response_to_hash(module, response):
u'sourceDisk': response.get(u'sourceDisk'), u'sourceDisk': response.get(u'sourceDisk'),
u'sourceDiskEncryptionKey': ImageSourcediskencryptionkey(response.get(u'sourceDiskEncryptionKey', {}), module).from_response(), u'sourceDiskEncryptionKey': ImageSourcediskencryptionkey(response.get(u'sourceDiskEncryptionKey', {}), module).from_response(),
u'sourceDiskId': response.get(u'sourceDiskId'), u'sourceDiskId': response.get(u'sourceDiskId'),
u'sourceImage': response.get(u'sourceImage'),
u'sourceSnapshot': response.get(u'sourceSnapshot'),
u'sourceType': response.get(u'sourceType'), u'sourceType': response.get(u'sourceType'),
} }
@ -675,16 +720,16 @@ def response_to_hash(module, response):
def license_selflink(name, params): def license_selflink(name, params):
if name is None: if name is None:
return return
url = r"https://www.googleapis.com/compute/v1//projects/.*/global/licenses/.*" url = r"https://compute.googleapis.com/compute/v1//projects/.*/global/licenses/.*"
if not re.match(url, name): if not re.match(url, name):
name = "https://www.googleapis.com/compute/v1//projects/{project}/global/licenses/%s".format(**params) % name name = "https://compute.googleapis.com/compute/v1//projects/{project}/global/licenses/%s".format(**params) % name
return name return name
def async_op_url(module, extra_data=None): def async_op_url(module, extra_data=None):
if extra_data is None: if extra_data is None:
extra_data = {} extra_data = {}
url = "https://www.googleapis.com/compute/v1/projects/{project}/global/operations/{op_id}" url = "https://compute.googleapis.com/compute/v1/projects/{project}/global/operations/{op_id}"
combined = extra_data.copy() combined = extra_data.copy()
combined.update(module.params) combined.update(module.params)
return url.format(**combined) return url.format(**combined)

View file

@ -33,7 +33,6 @@ module: gcp_compute_image_info
description: description:
- Gather info for GCP Image - Gather info for GCP Image
short_description: Gather info for GCP Image short_description: Gather info for GCP Image
version_added: '2.7'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -46,6 +45,7 @@ options:
- Each additional filter in the list will act be added as an AND condition (filter1 - Each additional filter in the list will act be added as an AND condition (filter1
and filter2) . and filter2) .
type: list type: list
elements: str
project: project:
description: description:
- The Google Cloud Platform project to use. - The Google Cloud Platform project to use.
@ -77,6 +77,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -307,6 +308,21 @@ resources:
of a given disk name. of a given disk name.
returned: success returned: success
type: str type: str
sourceImage:
description:
- 'URL of the source image used to create this image. In order to create an
image, you must provide the full or partial URL of one of the following: The
selfLink URL This property The rawDisk.source URL The sourceDisk URL .'
returned: success
type: dict
sourceSnapshot:
description:
- URL of the source snapshot used to create this image.
- 'In order to create an image, you must provide the full or partial URL of
one of the following: The selfLink URL This property The sourceImage URL The
rawDisk.source URL The sourceDisk URL .'
returned: success
type: dict
sourceType: sourceType:
description: description:
- The type of the image used to create this disk. The default and only value - The type of the image used to create this disk. The default and only value
@ -318,7 +334,7 @@ resources:
################################################################################ ################################################################################
# Imports # Imports
################################################################################ ################################################################################
from ansible.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest from ansible_collections.google.cloud.plugins.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest
import json import json
################################################################################ ################################################################################
@ -337,7 +353,7 @@ def main():
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/global/images".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/global/images".format(**module.params)
def fetch_list(module, link, query): def fetch_list(module, link, query):

View file

@ -33,7 +33,6 @@ module: gcp_compute_instance
description: description:
- An instance is a virtual machine (VM) hosted on Google's infrastructure. - An instance is a virtual machine (VM) hosted on Google's infrastructure.
short_description: Creates a GCP Instance short_description: Creates a GCP Instance
version_added: '2.6'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -62,7 +61,6 @@ options:
- Whether the resource should be protected against deletion. - Whether the resource should be protected against deletion.
required: false required: false
type: bool type: bool
version_added: '2.9'
disks: disks:
description: description:
- An array of disks that are associated with the instances that are created from - An array of disks that are associated with the instances that are created from
@ -233,13 +231,11 @@ options:
when using zonal DNS. when using zonal DNS.
required: false required: false
type: str type: str
version_added: '2.9'
labels: labels:
description: description:
- Labels to apply to this instance. A list of key->value pairs. - Labels to apply to this instance. A list of key->value pairs.
required: false required: false
type: dict type: dict
version_added: '2.9'
metadata: metadata:
description: description:
- The metadata key/value pairs to assign to instances that are created from this - The metadata key/value pairs to assign to instances that are created from this
@ -319,14 +315,12 @@ options:
external IP address of the instance to a DNS domain name. external IP address of the instance to a DNS domain name.
required: false required: false
type: bool type: bool
version_added: '2.10'
public_ptr_domain_name: public_ptr_domain_name:
description: description:
- The DNS domain name for the public PTR record. You can set this field - The DNS domain name for the public PTR record. You can set this field
only if the setPublicPtr field is enabled. only if the setPublicPtr field is enabled.
required: false required: false
type: str type: str
version_added: '2.10'
network_tier: network_tier:
description: description:
- This signifies the networking tier used for configuring this access - This signifies the networking tier used for configuring this access
@ -338,7 +332,6 @@ options:
- 'Some valid choices include: "PREMIUM", "STANDARD"' - 'Some valid choices include: "PREMIUM", "STANDARD"'
required: false required: false
type: str type: str
version_added: '2.10'
alias_ip_ranges: alias_ip_ranges:
description: description:
- An array of alias IP ranges for this network interface. Can only be specified - An array of alias IP ranges for this network interface. Can only be specified
@ -448,7 +441,6 @@ options:
- Configuration for various parameters related to shielded instances. - Configuration for various parameters related to shielded instances.
required: false required: false
type: dict type: dict
version_added: '2.9'
suboptions: suboptions:
enable_secure_boot: enable_secure_boot:
description: description:
@ -475,7 +467,6 @@ options:
"SUSPENDING", "SUSPENDED", "TERMINATED"' "SUSPENDING", "SUSPENDED", "TERMINATED"'
required: false required: false
type: str type: str
version_added: '2.8'
tags: tags:
description: description:
- A list of tags to apply to this instance. Tags are used to identify valid sources - A list of tags to apply to this instance. Tags are used to identify valid sources
@ -537,6 +528,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -1217,7 +1209,7 @@ def update_fields(module, request, response):
def label_fingerprint_update(module, request, response): def label_fingerprint_update(module, request, response):
auth = GcpSession(module, 'compute') auth = GcpSession(module, 'compute')
auth.post( auth.post(
''.join(["https://www.googleapis.com/compute/v1/", "projects/{project}/zones/{zone}/instances/{name}/setLabels"]).format(**module.params), ''.join(["https://compute.googleapis.com/compute/v1/", "projects/{project}/zones/{zone}/instances/{name}/setLabels"]).format(**module.params),
{u'labelFingerprint': response.get('labelFingerprint'), u'labels': module.params.get('labels')}, {u'labelFingerprint': response.get('labelFingerprint'), u'labels': module.params.get('labels')},
) )
@ -1225,7 +1217,7 @@ def label_fingerprint_update(module, request, response):
def machine_type_update(module, request, response): def machine_type_update(module, request, response):
auth = GcpSession(module, 'compute') auth = GcpSession(module, 'compute')
auth.post( auth.post(
''.join(["https://www.googleapis.com/compute/v1/", "projects/{project}/zones/{zone}/instances/{name}/setMachineType"]).format(**module.params), ''.join(["https://compute.googleapis.com/compute/v1/", "projects/{project}/zones/{zone}/instances/{name}/setMachineType"]).format(**module.params),
{u'machineType': machine_type_selflink(module.params.get('machine_type'), module.params)}, {u'machineType': machine_type_selflink(module.params.get('machine_type'), module.params)},
) )
@ -1270,11 +1262,11 @@ def fetch_resource(module, link, kind, allow_not_found=True):
def self_link(module): def self_link(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/instances/{name}".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/zones/{zone}/instances/{name}".format(**module.params)
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/instances".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/zones/{zone}/instances".format(**module.params)
def return_if_object(module, response, kind, allow_not_found=False): def return_if_object(module, response, kind, allow_not_found=False):
@ -1350,25 +1342,25 @@ def response_to_hash(module, response):
def disk_type_selflink(name, params): def disk_type_selflink(name, params):
if name is None: if name is None:
return return
url = r"https://www.googleapis.com/compute/v1/projects/.*/zones/.*/diskTypes/.*" url = r"https://compute.googleapis.com/compute/v1/projects/.*/zones/.*/diskTypes/.*"
if not re.match(url, name): if not re.match(url, name):
name = "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/diskTypes/%s".format(**params) % name name = "https://compute.googleapis.com/compute/v1/projects/{project}/zones/{zone}/diskTypes/%s".format(**params) % name
return name return name
def machine_type_selflink(name, params): def machine_type_selflink(name, params):
if name is None: if name is None:
return return
url = r"https://www.googleapis.com/compute/v1/projects/.*/zones/.*/machineTypes/.*" url = r"https://compute.googleapis.com/compute/v1/projects/.*/zones/.*/machineTypes/.*"
if not re.match(url, name): if not re.match(url, name):
name = "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/machineTypes/%s".format(**params) % name name = "https://compute.googleapis.com/compute/v1/projects/{project}/zones/{zone}/machineTypes/%s".format(**params) % name
return name return name
def async_op_url(module, extra_data=None): def async_op_url(module, extra_data=None):
if extra_data is None: if extra_data is None:
extra_data = {} extra_data = {}
url = "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/operations/{op_id}" url = "https://compute.googleapis.com/compute/v1/projects/{project}/zones/{zone}/operations/{op_id}"
combined = extra_data.copy() combined = extra_data.copy()
combined.update(module.params) combined.update(module.params)
return url.format(**combined) return url.format(**combined)

View file

@ -36,7 +36,6 @@ description:
template. Unlike managed instance groups, you must create and add instances to an template. Unlike managed instance groups, you must create and add instances to an
instance group manually. instance group manually.
short_description: Creates a GCP InstanceGroup short_description: Creates a GCP InstanceGroup
version_added: '2.6'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -126,7 +125,6 @@ options:
elements: dict elements: dict
required: false required: false
type: list type: list
version_added: '2.8'
project: project:
description: description:
- The Google Cloud Platform project to use. - The Google Cloud Platform project to use.
@ -158,6 +156,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -378,11 +377,11 @@ def fetch_resource(module, link, kind, allow_not_found=True):
def self_link(module): def self_link(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/instanceGroups/{name}".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/zones/{zone}/instanceGroups/{name}".format(**module.params)
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/instanceGroups".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/zones/{zone}/instanceGroups".format(**module.params)
def return_if_object(module, response, kind, allow_not_found=False): def return_if_object(module, response, kind, allow_not_found=False):
@ -442,16 +441,16 @@ def response_to_hash(module, response):
def region_selflink(name, params): def region_selflink(name, params):
if name is None: if name is None:
return return
url = r"https://www.googleapis.com/compute/v1/projects/.*/regions/.*" url = r"https://compute.googleapis.com/compute/v1/projects/.*/regions/.*"
if not re.match(url, name): if not re.match(url, name):
name = "https://www.googleapis.com/compute/v1/projects/{project}/regions/%s".format(**params) % name name = "https://compute.googleapis.com/compute/v1/projects/{project}/regions/%s".format(**params) % name
return name return name
def async_op_url(module, extra_data=None): def async_op_url(module, extra_data=None):
if extra_data is None: if extra_data is None:
extra_data = {} extra_data = {}
url = "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/operations/{op_id}" url = "https://compute.googleapis.com/compute/v1/projects/{project}/zones/{zone}/operations/{op_id}"
combined = extra_data.copy() combined = extra_data.copy()
combined.update(module.params) combined.update(module.params)
return url.format(**combined) return url.format(**combined)

View file

@ -33,7 +33,6 @@ module: gcp_compute_instance_group_info
description: description:
- Gather info for GCP InstanceGroup - Gather info for GCP InstanceGroup
short_description: Gather info for GCP InstanceGroup short_description: Gather info for GCP InstanceGroup
version_added: '2.7'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -46,6 +45,7 @@ options:
- Each additional filter in the list will act be added as an AND condition (filter1 - Each additional filter in the list will act be added as an AND condition (filter1
and filter2) . and filter2) .
type: list type: list
elements: str
zone: zone:
description: description:
- A reference to the zone where the instance group resides. - A reference to the zone where the instance group resides.
@ -82,6 +82,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -196,7 +197,7 @@ resources:
################################################################################ ################################################################################
# Imports # Imports
################################################################################ ################################################################################
from ansible.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest from ansible_collections.google.cloud.plugins.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest
import json import json
################################################################################ ################################################################################
@ -215,7 +216,7 @@ def main():
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/instanceGroups".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/zones/{zone}/instanceGroups".format(**module.params)
def fetch_list(module, link, query): def fetch_list(module, link, query):

View file

@ -38,7 +38,6 @@ description:
must separately verify the status of the individual instances. must separately verify the status of the individual instances.
- A managed instance group can have up to 1000 VM instances per group. - A managed instance group can have up to 1000 VM instances per group.
short_description: Creates a GCP InstanceGroupManager short_description: Creates a GCP InstanceGroupManager
version_added: '2.6'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -155,6 +154,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -475,11 +475,11 @@ def fetch_resource(module, link, kind, allow_not_found=True):
def self_link(module): def self_link(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{name}".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{name}".format(**module.params)
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers".format(**module.params)
def return_if_object(module, response, kind, allow_not_found=False): def return_if_object(module, response, kind, allow_not_found=False):
@ -543,16 +543,16 @@ def response_to_hash(module, response):
def region_selflink(name, params): def region_selflink(name, params):
if name is None: if name is None:
return return
url = r"https://www.googleapis.com/compute/v1/projects/.*/regions/.*" url = r"https://compute.googleapis.com/compute/v1/projects/.*/regions/.*"
if not re.match(url, name): if not re.match(url, name):
name = "https://www.googleapis.com/compute/v1/projects/{project}/regions/%s".format(**params) % name name = "https://compute.googleapis.com/compute/v1/projects/{project}/regions/%s".format(**params) % name
return name return name
def async_op_url(module, extra_data=None): def async_op_url(module, extra_data=None):
if extra_data is None: if extra_data is None:
extra_data = {} extra_data = {}
url = "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/operations/{op_id}" url = "https://compute.googleapis.com/compute/v1/projects/{project}/zones/{zone}/operations/{op_id}"
combined = extra_data.copy() combined = extra_data.copy()
combined.update(module.params) combined.update(module.params)
return url.format(**combined) return url.format(**combined)

View file

@ -33,7 +33,6 @@ module: gcp_compute_instance_group_manager_info
description: description:
- Gather info for GCP InstanceGroupManager - Gather info for GCP InstanceGroupManager
short_description: Gather info for GCP InstanceGroupManager short_description: Gather info for GCP InstanceGroupManager
version_added: '2.7'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -46,6 +45,7 @@ options:
- Each additional filter in the list will act be added as an AND condition (filter1 - Each additional filter in the list will act be added as an AND condition (filter1
and filter2) . and filter2) .
type: list type: list
elements: str
zone: zone:
description: description:
- The zone the managed instance group resides. - The zone the managed instance group resides.
@ -82,6 +82,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -271,7 +272,7 @@ resources:
################################################################################ ################################################################################
# Imports # Imports
################################################################################ ################################################################################
from ansible.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest from ansible_collections.google.cloud.plugins.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest
import json import json
################################################################################ ################################################################################
@ -290,7 +291,7 @@ def main():
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers".format(**module.params)
def fetch_list(module, link, query): def fetch_list(module, link, query):

View file

@ -33,7 +33,6 @@ module: gcp_compute_instance_info
description: description:
- Gather info for GCP Instance - Gather info for GCP Instance
short_description: Gather info for GCP Instance short_description: Gather info for GCP Instance
version_added: '2.7'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -46,6 +45,7 @@ options:
- Each additional filter in the list will act be added as an AND condition (filter1 - Each additional filter in the list will act be added as an AND condition (filter1
and filter2) . and filter2) .
type: list type: list
elements: str
zone: zone:
description: description:
- A reference to the zone where the machine resides. - A reference to the zone where the machine resides.
@ -82,6 +82,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -580,7 +581,7 @@ resources:
################################################################################ ################################################################################
# Imports # Imports
################################################################################ ################################################################################
from ansible.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest from ansible_collections.google.cloud.plugins.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest
import json import json
################################################################################ ################################################################################
@ -599,7 +600,7 @@ def main():
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/instances".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/zones/{zone}/instances".format(**module.params)
def fetch_list(module, link, query): def fetch_list(module, link, query):

View file

@ -39,7 +39,6 @@ description:
- 'Tip: Disks should be set to autoDelete=true so that leftover disks are not left - 'Tip: Disks should be set to autoDelete=true so that leftover disks are not left
behind on machine deletion.' behind on machine deletion.'
short_description: Creates a GCP InstanceTemplate short_description: Creates a GCP InstanceTemplate
version_added: '2.6'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -236,7 +235,6 @@ options:
- Labels to apply to this address. A list of key->value pairs. - Labels to apply to this address. A list of key->value pairs.
required: false required: false
type: dict type: dict
version_added: '2.9'
machine_type: machine_type:
description: description:
- The machine type to use in the VM instance template. - The machine type to use in the VM instance template.
@ -326,14 +324,12 @@ options:
the external IP address of the instance to a DNS domain name. the external IP address of the instance to a DNS domain name.
required: false required: false
type: bool type: bool
version_added: '2.10'
public_ptr_domain_name: public_ptr_domain_name:
description: description:
- The DNS domain name for the public PTR record. You can set this - The DNS domain name for the public PTR record. You can set this
field only if the setPublicPtr field is enabled. field only if the setPublicPtr field is enabled.
required: false required: false
type: str type: str
version_added: '2.10'
network_tier: network_tier:
description: description:
- This signifies the networking tier used for configuring this access - This signifies the networking tier used for configuring this access
@ -345,7 +341,6 @@ options:
- 'Some valid choices include: "PREMIUM", "STANDARD"' - 'Some valid choices include: "PREMIUM", "STANDARD"'
required: false required: false
type: str type: str
version_added: '2.10'
alias_ip_ranges: alias_ip_ranges:
description: description:
- An array of alias IP ranges for this network interface. Can only be - An array of alias IP ranges for this network interface. Can only be
@ -508,6 +503,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -1143,11 +1139,11 @@ def fetch_resource(module, link, kind, allow_not_found=True):
def self_link(module): def self_link(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/global/instanceTemplates/{name}".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/global/instanceTemplates/{name}".format(**module.params)
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/global/instanceTemplates".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/global/instanceTemplates".format(**module.params)
def return_if_object(module, response, kind, allow_not_found=False): def return_if_object(module, response, kind, allow_not_found=False):
@ -1207,16 +1203,16 @@ def response_to_hash(module, response):
def disk_type_selflink(name, params): def disk_type_selflink(name, params):
if name is None: if name is None:
return return
url = r"https://www.googleapis.com/compute/v1/projects/.*/zones/.*/diskTypes/.*" url = r"https://compute.googleapis.com/compute/v1/projects/.*/zones/.*/diskTypes/.*"
if not re.match(url, name): if not re.match(url, name):
name = "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/diskTypes/%s".format(**params) % name name = "https://compute.googleapis.com/compute/v1/projects/{project}/zones/{zone}/diskTypes/%s".format(**params) % name
return name return name
def async_op_url(module, extra_data=None): def async_op_url(module, extra_data=None):
if extra_data is None: if extra_data is None:
extra_data = {} extra_data = {}
url = "https://www.googleapis.com/compute/v1/projects/{project}/global/operations/{op_id}" url = "https://compute.googleapis.com/compute/v1/projects/{project}/global/operations/{op_id}"
combined = extra_data.copy() combined = extra_data.copy()
combined.update(module.params) combined.update(module.params)
return url.format(**combined) return url.format(**combined)

View file

@ -33,7 +33,6 @@ module: gcp_compute_instance_template_info
description: description:
- Gather info for GCP InstanceTemplate - Gather info for GCP InstanceTemplate
short_description: Gather info for GCP InstanceTemplate short_description: Gather info for GCP InstanceTemplate
version_added: '2.7'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -46,6 +45,7 @@ options:
- Each additional filter in the list will act be added as an AND condition (filter1 - Each additional filter in the list will act be added as an AND condition (filter1
and filter2) . and filter2) .
type: list type: list
elements: str
project: project:
description: description:
- The Google Cloud Platform project to use. - The Google Cloud Platform project to use.
@ -77,6 +77,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -543,7 +544,7 @@ resources:
################################################################################ ################################################################################
# Imports # Imports
################################################################################ ################################################################################
from ansible.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest from ansible_collections.google.cloud.plugins.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest
import json import json
################################################################################ ################################################################################
@ -562,7 +563,7 @@ def main():
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/global/instanceTemplates".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/global/instanceTemplates".format(**module.params)
def fetch_list(module, link, query): def fetch_list(module, link, query):

View file

@ -34,7 +34,6 @@ description:
- Represents an InterconnectAttachment (VLAN attachment) resource. For more information, - Represents an InterconnectAttachment (VLAN attachment) resource. For more information,
see Creating VLAN Attachments. see Creating VLAN Attachments.
short_description: Creates a GCP InterconnectAttachment short_description: Creates a GCP InterconnectAttachment
version_added: '2.8'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -56,7 +55,6 @@ options:
required: false required: false
default: 'true' default: 'true'
type: bool type: bool
version_added: '2.9'
interconnect: interconnect:
description: description:
- URL of the underlying Interconnect object that this attachment's traffic will - URL of the underlying Interconnect object that this attachment's traffic will
@ -82,7 +80,6 @@ options:
"BPS_50G"' "BPS_50G"'
required: false required: false
type: str type: str
version_added: '2.9'
edge_availability_domain: edge_availability_domain:
description: description:
- Desired availability domain for the attachment. Only available for type PARTNER, - Desired availability domain for the attachment. Only available for type PARTNER,
@ -176,6 +173,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -458,11 +456,11 @@ def fetch_resource(module, link, kind, allow_not_found=True):
def self_link(module): def self_link(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/interconnectAttachments/{name}".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/interconnectAttachments/{name}".format(**module.params)
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/interconnectAttachments".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/interconnectAttachments".format(**module.params)
def return_if_object(module, response, kind, allow_not_found=False): def return_if_object(module, response, kind, allow_not_found=False):
@ -533,16 +531,16 @@ def response_to_hash(module, response):
def region_selflink(name, params): def region_selflink(name, params):
if name is None: if name is None:
return return
url = r"https://www.googleapis.com/compute/v1/projects/.*/regions/.*" url = r"https://compute.googleapis.com/compute/v1/projects/.*/regions/.*"
if not re.match(url, name): if not re.match(url, name):
name = "https://www.googleapis.com/compute/v1/projects/{project}/regions/%s".format(**params) % name name = "https://compute.googleapis.com/compute/v1/projects/{project}/regions/%s".format(**params) % name
return name return name
def async_op_url(module, extra_data=None): def async_op_url(module, extra_data=None):
if extra_data is None: if extra_data is None:
extra_data = {} extra_data = {}
url = "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/operations/{op_id}" url = "https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/operations/{op_id}"
combined = extra_data.copy() combined = extra_data.copy()
combined.update(module.params) combined.update(module.params)
return url.format(**combined) return url.format(**combined)

View file

@ -33,7 +33,6 @@ module: gcp_compute_interconnect_attachment_info
description: description:
- Gather info for GCP InterconnectAttachment - Gather info for GCP InterconnectAttachment
short_description: Gather info for GCP InterconnectAttachment short_description: Gather info for GCP InterconnectAttachment
version_added: '2.8'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -46,6 +45,7 @@ options:
- Each additional filter in the list will act be added as an AND condition (filter1 - Each additional filter in the list will act be added as an AND condition (filter1
and filter2) . and filter2) .
type: list type: list
elements: str
region: region:
description: description:
- Region where the regional interconnect attachment resides. - Region where the regional interconnect attachment resides.
@ -82,6 +82,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -267,7 +268,7 @@ resources:
################################################################################ ################################################################################
# Imports # Imports
################################################################################ ################################################################################
from ansible.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest from ansible_collections.google.cloud.plugins.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest
import json import json
################################################################################ ################################################################################
@ -286,7 +287,7 @@ def main():
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/interconnectAttachments".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/interconnectAttachments".format(**module.params)
def fetch_list(module, link, query): def fetch_list(module, link, query):

View file

@ -33,7 +33,6 @@ module: gcp_compute_network
description: description:
- Manages a VPC network or legacy network resource on GCP. - Manages a VPC network or legacy network resource on GCP.
short_description: Creates a GCP Network short_description: Creates a GCP Network
version_added: '2.6'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -79,7 +78,6 @@ options:
to determine what type of network-wide routing behavior to enforce. to determine what type of network-wide routing behavior to enforce.
required: false required: false
type: dict type: dict
version_added: '2.8'
suboptions: suboptions:
routing_mode: routing_mode:
description: description:
@ -122,6 +120,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -300,7 +299,7 @@ def update_fields(module, request, response):
def routing_config_update(module, request, response): def routing_config_update(module, request, response):
auth = GcpSession(module, 'compute') auth = GcpSession(module, 'compute')
auth.patch( auth.patch(
''.join(["https://www.googleapis.com/compute/v1/", "projects/{project}/global/networks/{name}"]).format(**module.params), ''.join(["https://compute.googleapis.com/compute/v1/", "projects/{project}/global/networks/{name}"]).format(**module.params),
{u'routingConfig': NetworkRoutingconfig(module.params.get('routing_config', {}), module).to_request()}, {u'routingConfig': NetworkRoutingconfig(module.params.get('routing_config', {}), module).to_request()},
) )
@ -332,11 +331,11 @@ def fetch_resource(module, link, kind, allow_not_found=True):
def self_link(module): def self_link(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{name}".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/global/networks/{name}".format(**module.params)
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/global/networks".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/global/networks".format(**module.params)
def return_if_object(module, response, kind, allow_not_found=False): def return_if_object(module, response, kind, allow_not_found=False):
@ -396,7 +395,7 @@ def response_to_hash(module, response):
def async_op_url(module, extra_data=None): def async_op_url(module, extra_data=None):
if extra_data is None: if extra_data is None:
extra_data = {} extra_data = {}
url = "https://www.googleapis.com/compute/v1/projects/{project}/global/operations/{op_id}" url = "https://compute.googleapis.com/compute/v1/projects/{project}/global/operations/{op_id}"
combined = extra_data.copy() combined = extra_data.copy()
combined.update(module.params) combined.update(module.params)
return url.format(**combined) return url.format(**combined)

View file

@ -40,7 +40,6 @@ description:
you can distribute traffic in a granular fashion among applications or containers you can distribute traffic in a granular fashion among applications or containers
running within VM instances. running within VM instances.
short_description: Creates a GCP NetworkEndpointGroup short_description: Creates a GCP NetworkEndpointGroup
version_added: '2.10'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -140,6 +139,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -351,11 +351,11 @@ def fetch_resource(module, link, kind, allow_not_found=True):
def self_link(module): def self_link(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/networkEndpointGroups/{name}".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/zones/{zone}/networkEndpointGroups/{name}".format(**module.params)
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/networkEndpointGroups".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/zones/{zone}/networkEndpointGroups".format(**module.params)
def return_if_object(module, response, kind, allow_not_found=False): def return_if_object(module, response, kind, allow_not_found=False):
@ -415,7 +415,7 @@ def response_to_hash(module, response):
def async_op_url(module, extra_data=None): def async_op_url(module, extra_data=None):
if extra_data is None: if extra_data is None:
extra_data = {} extra_data = {}
url = "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/operations/{op_id}" url = "https://compute.googleapis.com/compute/v1/projects/{project}/zones/{zone}/operations/{op_id}"
combined = extra_data.copy() combined = extra_data.copy()
combined.update(module.params) combined.update(module.params)
return url.format(**combined) return url.format(**combined)

View file

@ -33,7 +33,6 @@ module: gcp_compute_network_endpoint_group_info
description: description:
- Gather info for GCP NetworkEndpointGroup - Gather info for GCP NetworkEndpointGroup
short_description: Gather info for GCP NetworkEndpointGroup short_description: Gather info for GCP NetworkEndpointGroup
version_added: '2.10'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -46,6 +45,7 @@ options:
- Each additional filter in the list will act be added as an AND condition (filter1 - Each additional filter in the list will act be added as an AND condition (filter1
and filter2) . and filter2) .
type: list type: list
elements: str
zone: zone:
description: description:
- Zone where the network endpoint group is located. - Zone where the network endpoint group is located.
@ -82,6 +82,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -175,7 +176,7 @@ resources:
################################################################################ ################################################################################
# Imports # Imports
################################################################################ ################################################################################
from ansible.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest from ansible_collections.google.cloud.plugins.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest
import json import json
################################################################################ ################################################################################
@ -194,7 +195,7 @@ def main():
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/networkEndpointGroups".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/zones/{zone}/networkEndpointGroups".format(**module.params)
def fetch_list(module, link, query): def fetch_list(module, link, query):

View file

@ -33,7 +33,6 @@ module: gcp_compute_network_info
description: description:
- Gather info for GCP Network - Gather info for GCP Network
short_description: Gather info for GCP Network short_description: Gather info for GCP Network
version_added: '2.7'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -46,6 +45,7 @@ options:
- Each additional filter in the list will act be added as an AND condition (filter1 - Each additional filter in the list will act be added as an AND condition (filter1
and filter2) . and filter2) .
type: list type: list
elements: str
project: project:
description: description:
- The Google Cloud Platform project to use. - The Google Cloud Platform project to use.
@ -77,6 +77,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -179,7 +180,7 @@ resources:
################################################################################ ################################################################################
# Imports # Imports
################################################################################ ################################################################################
from ansible.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest from ansible_collections.google.cloud.plugins.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest
import json import json
################################################################################ ################################################################################
@ -198,7 +199,7 @@ def main():
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/global/networks".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/global/networks".format(**module.params)
def fetch_list(module, link, query): def fetch_list(module, link, query):

View file

@ -33,7 +33,6 @@ module: gcp_compute_node_group
description: description:
- Represents a NodeGroup resource to manage a group of sole-tenant nodes. - Represents a NodeGroup resource to manage a group of sole-tenant nodes.
short_description: Creates a GCP NodeGroup short_description: Creates a GCP NodeGroup
version_added: '2.10'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -109,6 +108,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -265,7 +265,7 @@ def update_fields(module, request, response):
def node_template_update(module, request, response): def node_template_update(module, request, response):
auth = GcpSession(module, 'compute') auth = GcpSession(module, 'compute')
auth.post( auth.post(
''.join(["https://www.googleapis.com/compute/v1/", "projects/{project}/zones/{zone}/nodeGroups/{name}/setNodeTemplate"]).format(**module.params), ''.join(["https://compute.googleapis.com/compute/v1/", "projects/{project}/zones/{zone}/nodeGroups/{name}/setNodeTemplate"]).format(**module.params),
{u'nodeTemplate': replace_resource_dict(module.params.get(u'node_template', {}), 'selfLink')}, {u'nodeTemplate': replace_resource_dict(module.params.get(u'node_template', {}), 'selfLink')},
) )
@ -297,15 +297,15 @@ def fetch_resource(module, link, kind, allow_not_found=True):
def self_link(module): def self_link(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/nodeGroups/{name}".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/zones/{zone}/nodeGroups/{name}".format(**module.params)
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/nodeGroups".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/zones/{zone}/nodeGroups".format(**module.params)
def create_link(module): def create_link(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/nodeGroups?initialNodeCount={size}".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/zones/{zone}/nodeGroups?initialNodeCount={size}".format(**module.params)
def return_if_object(module, response, kind, allow_not_found=False): def return_if_object(module, response, kind, allow_not_found=False):
@ -362,25 +362,25 @@ def response_to_hash(module, response):
def region_selflink(name, params): def region_selflink(name, params):
if name is None: if name is None:
return return
url = r"https://www.googleapis.com/compute/v1/projects/.*/regions/.*" url = r"https://compute.googleapis.com/compute/v1/projects/.*/regions/.*"
if not re.match(url, name): if not re.match(url, name):
name = "https://www.googleapis.com/compute/v1/projects/{project}/regions/%s".format(**params) % name name = "https://compute.googleapis.com/compute/v1/projects/{project}/regions/%s".format(**params) % name
return name return name
def zone_selflink(name, params): def zone_selflink(name, params):
if name is None: if name is None:
return return
url = r"https://www.googleapis.com/compute/v1/projects/.*/zones/.*" url = r"https://compute.googleapis.com/compute/v1/projects/.*/zones/.*"
if not re.match(url, name): if not re.match(url, name):
name = "https://www.googleapis.com/compute/v1/projects/{project}/zones/%s".format(**params) % name name = "https://compute.googleapis.com/compute/v1/projects/{project}/zones/%s".format(**params) % name
return name return name
def async_op_url(module, extra_data=None): def async_op_url(module, extra_data=None):
if extra_data is None: if extra_data is None:
extra_data = {} extra_data = {}
url = "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/operations/{op_id}" url = "https://compute.googleapis.com/compute/v1/projects/{project}/zones/{zone}/operations/{op_id}"
combined = extra_data.copy() combined = extra_data.copy()
combined.update(module.params) combined.update(module.params)
return url.format(**combined) return url.format(**combined)

View file

@ -33,7 +33,6 @@ module: gcp_compute_node_group_info
description: description:
- Gather info for GCP NodeGroup - Gather info for GCP NodeGroup
short_description: Gather info for GCP NodeGroup short_description: Gather info for GCP NodeGroup
version_added: '2.10'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -46,6 +45,7 @@ options:
- Each additional filter in the list will act be added as an AND condition (filter1 - Each additional filter in the list will act be added as an AND condition (filter1
and filter2) . and filter2) .
type: list type: list
elements: str
zone: zone:
description: description:
- Zone where this node group is located . - Zone where this node group is located .
@ -82,6 +82,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -153,7 +154,7 @@ resources:
################################################################################ ################################################################################
# Imports # Imports
################################################################################ ################################################################################
from ansible.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest from ansible_collections.google.cloud.plugins.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest
import json import json
################################################################################ ################################################################################
@ -172,7 +173,7 @@ def main():
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/nodeGroups".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/zones/{zone}/nodeGroups".format(**module.params)
def fetch_list(module, link, query): def fetch_list(module, link, query):

View file

@ -35,7 +35,6 @@ description:
sole-tenant nodes, such as node type, vCPU and memory requirements, node affinity sole-tenant nodes, such as node type, vCPU and memory requirements, node affinity
labels, and region. labels, and region.
short_description: Creates a GCP NodeTemplate short_description: Creates a GCP NodeTemplate
version_added: '2.10'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -125,6 +124,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -321,11 +321,11 @@ def fetch_resource(module, link, kind, allow_not_found=True):
def self_link(module): def self_link(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/nodeTemplates/{name}".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/nodeTemplates/{name}".format(**module.params)
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/nodeTemplates".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/nodeTemplates".format(**module.params)
def return_if_object(module, response, kind, allow_not_found=False): def return_if_object(module, response, kind, allow_not_found=False):
@ -383,16 +383,16 @@ def response_to_hash(module, response):
def region_selflink(name, params): def region_selflink(name, params):
if name is None: if name is None:
return return
url = r"https://www.googleapis.com/compute/v1/projects/.*/regions/.*" url = r"https://compute.googleapis.com/compute/v1/projects/.*/regions/.*"
if not re.match(url, name): if not re.match(url, name):
name = "https://www.googleapis.com/compute/v1/projects/{project}/regions/%s".format(**params) % name name = "https://compute.googleapis.com/compute/v1/projects/{project}/regions/%s".format(**params) % name
return name return name
def async_op_url(module, extra_data=None): def async_op_url(module, extra_data=None):
if extra_data is None: if extra_data is None:
extra_data = {} extra_data = {}
url = "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/operations/{op_id}" url = "https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/operations/{op_id}"
combined = extra_data.copy() combined = extra_data.copy()
combined.update(module.params) combined.update(module.params)
return url.format(**combined) return url.format(**combined)

View file

@ -33,7 +33,6 @@ module: gcp_compute_node_template_info
description: description:
- Gather info for GCP NodeTemplate - Gather info for GCP NodeTemplate
short_description: Gather info for GCP NodeTemplate short_description: Gather info for GCP NodeTemplate
version_added: '2.10'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -46,6 +45,7 @@ options:
- Each additional filter in the list will act be added as an AND condition (filter1 - Each additional filter in the list will act be added as an AND condition (filter1
and filter2) . and filter2) .
type: list type: list
elements: str
region: region:
description: description:
- Region where nodes using the node template will be created . - Region where nodes using the node template will be created .
@ -82,6 +82,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -177,7 +178,7 @@ resources:
################################################################################ ################################################################################
# Imports # Imports
################################################################################ ################################################################################
from ansible.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest from ansible_collections.google.cloud.plugins.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest
import json import json
################################################################################ ################################################################################
@ -196,7 +197,7 @@ def main():
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/nodeTemplates".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/nodeTemplates".format(**module.params)
def fetch_list(module, link, query): def fetch_list(module, link, query):

View file

@ -35,7 +35,6 @@ description:
- Autoscalers allow you to automatically scale virtual machine instances in managed - Autoscalers allow you to automatically scale virtual machine instances in managed
instance groups according to an autoscaling policy that you define. instance groups according to an autoscaling policy that you define.
short_description: Creates a GCP RegionAutoscaler short_description: Creates a GCP RegionAutoscaler
version_added: '2.10'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -213,6 +212,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -563,11 +563,11 @@ def fetch_resource(module, link, kind, allow_not_found=True):
def self_link(module): def self_link(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/autoscalers/{name}".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/autoscalers/{name}".format(**module.params)
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/autoscalers".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/autoscalers".format(**module.params)
def return_if_object(module, response, kind, allow_not_found=False): def return_if_object(module, response, kind, allow_not_found=False):
@ -625,7 +625,7 @@ def response_to_hash(module, response):
def async_op_url(module, extra_data=None): def async_op_url(module, extra_data=None):
if extra_data is None: if extra_data is None:
extra_data = {} extra_data = {}
url = "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/operations/{op_id}" url = "https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/operations/{op_id}"
combined = extra_data.copy() combined = extra_data.copy()
combined.update(module.params) combined.update(module.params)
return url.format(**combined) return url.format(**combined)

View file

@ -33,7 +33,6 @@ module: gcp_compute_region_autoscaler_info
description: description:
- Gather info for GCP RegionAutoscaler - Gather info for GCP RegionAutoscaler
short_description: Gather info for GCP RegionAutoscaler short_description: Gather info for GCP RegionAutoscaler
version_added: '2.10'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -46,6 +45,7 @@ options:
- Each additional filter in the list will act be added as an AND condition (filter1 - Each additional filter in the list will act be added as an AND condition (filter1
and filter2) . and filter2) .
type: list type: list
elements: str
region: region:
description: description:
- URL of the region where the instance group resides. - URL of the region where the instance group resides.
@ -82,6 +82,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -261,7 +262,7 @@ resources:
################################################################################ ################################################################################
# Imports # Imports
################################################################################ ################################################################################
from ansible.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest from ansible_collections.google.cloud.plugins.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest
import json import json
################################################################################ ################################################################################
@ -280,7 +281,7 @@ def main():
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/autoscalers".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/autoscalers".format(**module.params)
def fetch_list(module, link, query): def fetch_list(module, link, query):

View file

@ -34,7 +34,6 @@ description:
- A Region Backend Service defines a regionally-scoped group of virtual machines that - A Region Backend Service defines a regionally-scoped group of virtual machines that
will serve traffic for load balancing. will serve traffic for load balancing.
short_description: Creates a GCP RegionBackendService short_description: Creates a GCP RegionBackendService
version_added: '2.10'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -339,9 +338,11 @@ options:
health_checks: health_checks:
description: description:
- The set of URLs to HealthCheck resources for health checking this RegionBackendService. - The set of URLs to HealthCheck resources for health checking this RegionBackendService.
Currently at most one health check can be specified, and a health check is required. Currently at most one health check can be specified. A health check must be
specified unless the backend service uses an internet or serverless NEG as a
backend.
elements: str elements: str
required: true required: false
type: list type: list
load_balancing_scheme: load_balancing_scheme:
description: description:
@ -529,7 +530,8 @@ options:
- The protocol this RegionBackendService uses to communicate with backends. - The protocol this RegionBackendService uses to communicate with backends.
- 'The default is HTTP. **NOTE**: HTTP2 is only valid for beta HTTP/2 load balancer - 'The default is HTTP. **NOTE**: HTTP2 is only valid for beta HTTP/2 load balancer
types and may result in errors if used with the GA API.' types and may result in errors if used with the GA API.'
- 'Some valid choices include: "HTTP", "HTTPS", "HTTP2", "SSL", "TCP", "UDP"' - 'Some valid choices include: "HTTP", "HTTPS", "HTTP2", "SSL", "TCP", "UDP",
"GRPC"'
required: false required: false
type: str type: str
session_affinity: session_affinity:
@ -616,6 +618,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -959,7 +962,8 @@ fingerprint:
healthChecks: healthChecks:
description: description:
- The set of URLs to HealthCheck resources for health checking this RegionBackendService. - The set of URLs to HealthCheck resources for health checking this RegionBackendService.
Currently at most one health check can be specified, and a health check is required. Currently at most one health check can be specified. A health check must be specified
unless the backend service uses an internet or serverless NEG as a backend.
returned: success returned: success
type: list type: list
id: id:
@ -1267,7 +1271,7 @@ def main():
disable_connection_drain_on_failover=dict(type='bool'), drop_traffic_if_unhealthy=dict(type='bool'), failover_ratio=dict(type='str') disable_connection_drain_on_failover=dict(type='bool'), drop_traffic_if_unhealthy=dict(type='bool'), failover_ratio=dict(type='str')
), ),
), ),
health_checks=dict(required=True, type='list', elements='str'), health_checks=dict(type='list', elements='str'),
load_balancing_scheme=dict(default='INTERNAL', type='str'), load_balancing_scheme=dict(default='INTERNAL', type='str'),
locality_lb_policy=dict(type='str'), locality_lb_policy=dict(type='str'),
name=dict(required=True, type='str'), name=dict(required=True, type='str'),
@ -1379,11 +1383,11 @@ def fetch_resource(module, link, kind, allow_not_found=True):
def self_link(module): def self_link(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/backendServices/{name}".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/backendServices/{name}".format(**module.params)
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/backendServices".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/backendServices".format(**module.params)
def return_if_object(module, response, kind, allow_not_found=False): def return_if_object(module, response, kind, allow_not_found=False):
@ -1456,7 +1460,7 @@ def response_to_hash(module, response):
def async_op_url(module, extra_data=None): def async_op_url(module, extra_data=None):
if extra_data is None: if extra_data is None:
extra_data = {} extra_data = {}
url = "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/operations/{op_id}" url = "https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/operations/{op_id}"
combined = extra_data.copy() combined = extra_data.copy()
combined.update(module.params) combined.update(module.params)
return url.format(**combined) return url.format(**combined)

View file

@ -33,7 +33,6 @@ module: gcp_compute_region_backend_service_info
description: description:
- Gather info for GCP RegionBackendService - Gather info for GCP RegionBackendService
short_description: Gather info for GCP RegionBackendService short_description: Gather info for GCP RegionBackendService
version_added: '2.10'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -46,6 +45,7 @@ options:
- Each additional filter in the list will act be added as an AND condition (filter1 - Each additional filter in the list will act be added as an AND condition (filter1
and filter2) . and filter2) .
type: list type: list
elements: str
region: region:
description: description:
- A reference to the region where the regional backend service resides. - A reference to the region where the regional backend service resides.
@ -82,6 +82,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -415,8 +416,9 @@ resources:
healthChecks: healthChecks:
description: description:
- The set of URLs to HealthCheck resources for health checking this RegionBackendService. - The set of URLs to HealthCheck resources for health checking this RegionBackendService.
Currently at most one health check can be specified, and a health check is Currently at most one health check can be specified. A health check must be
required. specified unless the backend service uses an internet or serverless NEG as
a backend.
returned: success returned: success
type: list type: list
id: id:
@ -655,7 +657,7 @@ resources:
################################################################################ ################################################################################
# Imports # Imports
################################################################################ ################################################################################
from ansible.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest from ansible_collections.google.cloud.plugins.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest
import json import json
################################################################################ ################################################################################
@ -674,7 +676,7 @@ def main():
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/backendServices".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/backendServices".format(**module.params)
def fetch_list(module, link, query): def fetch_list(module, link, query):

View file

@ -43,7 +43,6 @@ description:
- Add a persistent disk to your instance when you need reliable and affordable storage - Add a persistent disk to your instance when you need reliable and affordable storage
with consistent performance characteristics. with consistent performance characteristics.
short_description: Creates a GCP RegionDisk short_description: Creates a GCP RegionDisk
version_added: '2.8'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -195,6 +194,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -481,7 +481,7 @@ def update_fields(module, request, response):
def label_fingerprint_update(module, request, response): def label_fingerprint_update(module, request, response):
auth = GcpSession(module, 'compute') auth = GcpSession(module, 'compute')
auth.post( auth.post(
''.join(["https://www.googleapis.com/compute/v1/", "projects/{project}/regions/{region}/disks/{name}/setLabels"]).format(**module.params), ''.join(["https://compute.googleapis.com/compute/v1/", "projects/{project}/regions/{region}/disks/{name}/setLabels"]).format(**module.params),
{u'labelFingerprint': response.get('labelFingerprint'), u'labels': module.params.get('labels')}, {u'labelFingerprint': response.get('labelFingerprint'), u'labels': module.params.get('labels')},
) )
@ -489,7 +489,7 @@ def label_fingerprint_update(module, request, response):
def size_gb_update(module, request, response): def size_gb_update(module, request, response):
auth = GcpSession(module, 'compute') auth = GcpSession(module, 'compute')
auth.post( auth.post(
''.join(["https://www.googleapis.com/compute/v1/", "projects/{project}/regions/{region}/disks/{name}/resize"]).format(**module.params), ''.join(["https://compute.googleapis.com/compute/v1/", "projects/{project}/regions/{region}/disks/{name}/resize"]).format(**module.params),
{u'sizeGb': module.params.get('size_gb')}, {u'sizeGb': module.params.get('size_gb')},
) )
@ -527,11 +527,11 @@ def fetch_resource(module, link, kind, allow_not_found=True):
def self_link(module): def self_link(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/disks/{name}".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/disks/{name}".format(**module.params)
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/disks".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/disks".format(**module.params)
def return_if_object(module, response, kind, allow_not_found=False): def return_if_object(module, response, kind, allow_not_found=False):
@ -597,25 +597,25 @@ def response_to_hash(module, response):
def zone_selflink(name, params): def zone_selflink(name, params):
if name is None: if name is None:
return return
url = r"https://www.googleapis.com/compute/v1/projects/.*/zones/.*" url = r"https://compute.googleapis.com/compute/v1/projects/.*/zones/.*"
if not re.match(url, name): if not re.match(url, name):
name = "https://www.googleapis.com/compute/v1/projects/{project}/zones/%s".format(**params) % name name = "https://compute.googleapis.com/compute/v1/projects/{project}/zones/%s".format(**params) % name
return name return name
def region_disk_type_selflink(name, params): def region_disk_type_selflink(name, params):
if name is None: if name is None:
return return
url = r"https://www.googleapis.com/compute/v1/projects/.*/regions/.*/diskTypes/.*" url = r"https://compute.googleapis.com/compute/v1/projects/.*/regions/.*/diskTypes/.*"
if not re.match(url, name): if not re.match(url, name):
name = "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/diskTypes/%s".format(**params) % name name = "https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/diskTypes/%s".format(**params) % name
return name return name
def async_op_url(module, extra_data=None): def async_op_url(module, extra_data=None):
if extra_data is None: if extra_data is None:
extra_data = {} extra_data = {}
url = "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/operations/{op_id}" url = "https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/operations/{op_id}"
combined = extra_data.copy() combined = extra_data.copy()
combined.update(module.params) combined.update(module.params)
return url.format(**combined) return url.format(**combined)

View file

@ -33,7 +33,6 @@ module: gcp_compute_region_disk_info
description: description:
- Gather info for GCP RegionDisk - Gather info for GCP RegionDisk
short_description: Gather info for GCP RegionDisk short_description: Gather info for GCP RegionDisk
version_added: '2.8'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -46,6 +45,7 @@ options:
- Each additional filter in the list will act be added as an AND condition (filter1 - Each additional filter in the list will act be added as an AND condition (filter1
and filter2) . and filter2) .
type: list type: list
elements: str
region: region:
description: description:
- A reference to the region where the disk resides. - A reference to the region where the disk resides.
@ -82,6 +82,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -276,7 +277,7 @@ resources:
################################################################################ ################################################################################
# Imports # Imports
################################################################################ ################################################################################
from ansible.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest from ansible_collections.google.cloud.plugins.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest
import json import json
################################################################################ ################################################################################
@ -295,7 +296,7 @@ def main():
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/disks".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/disks".format(**module.params)
def fetch_list(module, link, query): def fetch_list(module, link, query):

View file

@ -41,7 +41,6 @@ description:
successfully to some number of consecutive probes, it is marked healthy again and successfully to some number of consecutive probes, it is marked healthy again and
can receive new connections. can receive new connections.
short_description: Creates a GCP RegionHealthCheck short_description: Creates a GCP RegionHealthCheck
version_added: '2.10'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -399,6 +398,49 @@ options:
- 'Some valid choices include: "USE_FIXED_PORT", "USE_NAMED_PORT", "USE_SERVING_PORT"' - 'Some valid choices include: "USE_FIXED_PORT", "USE_NAMED_PORT", "USE_SERVING_PORT"'
required: false required: false
type: str type: str
grpc_health_check:
description:
- A nested object resource.
required: false
type: dict
suboptions:
port:
description:
- The port number for the health check request. Must be specified if portName
and portSpecification are not set or if port_specification is USE_FIXED_PORT.
Valid values are 1 through 65535.
required: false
type: int
port_name:
description:
- Port name as defined in InstanceGroup#NamedPort#name. If both port and port_name
are defined, port takes precedence.
required: false
type: str
port_specification:
description:
- 'Specifies how port is selected for health checking, can be one of the following
values: * `USE_FIXED_PORT`: The port number in `port` is used for health
checking.'
- "* `USE_NAMED_PORT`: The `portName` is used for health checking."
- "* `USE_SERVING_PORT`: For NetworkEndpointGroup, the port specified for
each network endpoint is used for health checking. For other backends, the
port or named port specified in the Backend Service is used for health checking."
- If not specified, gRPC health check follows behavior specified in `port`
and `portName` fields.
- 'Some valid choices include: "USE_FIXED_PORT", "USE_NAMED_PORT", "USE_SERVING_PORT"'
required: false
type: str
grpc_service_name:
description:
- 'The gRPC service name for the health check. The value of grpcServiceName
has the following meanings by convention: - Empty serviceName means the
overall status of all services at the backend.'
- "- Non-empty serviceName means the health of that gRPC service, as defined
by the owner of the service."
- The grpcServiceName can only be ASCII.
required: false
type: str
region: region:
description: description:
- The region where the regional health check resides. - The region where the regional health check resides.
@ -435,6 +477,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -796,6 +839,47 @@ http2HealthCheck:
and `portName` fields. and `portName` fields.
returned: success returned: success
type: str type: str
grpcHealthCheck:
description:
- A nested object resource.
returned: success
type: complex
contains:
port:
description:
- The port number for the health check request. Must be specified if portName
and portSpecification are not set or if port_specification is USE_FIXED_PORT.
Valid values are 1 through 65535.
returned: success
type: int
portName:
description:
- Port name as defined in InstanceGroup#NamedPort#name. If both port and port_name
are defined, port takes precedence.
returned: success
type: str
portSpecification:
description:
- 'Specifies how port is selected for health checking, can be one of the following
values: * `USE_FIXED_PORT`: The port number in `port` is used for health checking.'
- "* `USE_NAMED_PORT`: The `portName` is used for health checking."
- "* `USE_SERVING_PORT`: For NetworkEndpointGroup, the port specified for each
network endpoint is used for health checking. For other backends, the port
or named port specified in the Backend Service is used for health checking."
- If not specified, gRPC health check follows behavior specified in `port` and
`portName` fields.
returned: success
type: str
grpcServiceName:
description:
- 'The gRPC service name for the health check. The value of grpcServiceName
has the following meanings by convention: - Empty serviceName means the overall
status of all services at the backend.'
- "- Non-empty serviceName means the health of that gRPC service, as defined
by the owner of the service."
- The grpcServiceName can only be ASCII.
returned: success
type: str
region: region:
description: description:
- The region where the regional health check resides. - The region where the regional health check resides.
@ -895,6 +979,10 @@ def main():
port_specification=dict(type='str'), port_specification=dict(type='str'),
), ),
), ),
grpc_health_check=dict(
type='dict',
options=dict(port=dict(type='int'), port_name=dict(type='str'), port_specification=dict(type='str'), grpc_service_name=dict(type='str')),
),
region=dict(type='str'), region=dict(type='str'),
) )
) )
@ -961,6 +1049,7 @@ def resource_to_request(module):
u'tcpHealthCheck': RegionHealthCheckTcphealthcheck(module.params.get('tcp_health_check', {}), module).to_request(), u'tcpHealthCheck': RegionHealthCheckTcphealthcheck(module.params.get('tcp_health_check', {}), module).to_request(),
u'sslHealthCheck': RegionHealthCheckSslhealthcheck(module.params.get('ssl_health_check', {}), module).to_request(), u'sslHealthCheck': RegionHealthCheckSslhealthcheck(module.params.get('ssl_health_check', {}), module).to_request(),
u'http2HealthCheck': RegionHealthCheckHttp2healthcheck(module.params.get('http2_health_check', {}), module).to_request(), u'http2HealthCheck': RegionHealthCheckHttp2healthcheck(module.params.get('http2_health_check', {}), module).to_request(),
u'grpcHealthCheck': RegionHealthCheckGrpchealthcheck(module.params.get('grpc_health_check', {}), module).to_request(),
} }
return_vals = {} return_vals = {}
for k, v in request.items(): for k, v in request.items():
@ -976,11 +1065,11 @@ def fetch_resource(module, link, kind, allow_not_found=True):
def self_link(module): def self_link(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/healthChecks/{name}".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/healthChecks/{name}".format(**module.params)
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/healthChecks".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/healthChecks".format(**module.params)
def return_if_object(module, response, kind, allow_not_found=False): def return_if_object(module, response, kind, allow_not_found=False):
@ -1040,22 +1129,23 @@ def response_to_hash(module, response):
u'tcpHealthCheck': RegionHealthCheckTcphealthcheck(response.get(u'tcpHealthCheck', {}), module).from_response(), u'tcpHealthCheck': RegionHealthCheckTcphealthcheck(response.get(u'tcpHealthCheck', {}), module).from_response(),
u'sslHealthCheck': RegionHealthCheckSslhealthcheck(response.get(u'sslHealthCheck', {}), module).from_response(), u'sslHealthCheck': RegionHealthCheckSslhealthcheck(response.get(u'sslHealthCheck', {}), module).from_response(),
u'http2HealthCheck': RegionHealthCheckHttp2healthcheck(response.get(u'http2HealthCheck', {}), module).from_response(), u'http2HealthCheck': RegionHealthCheckHttp2healthcheck(response.get(u'http2HealthCheck', {}), module).from_response(),
u'grpcHealthCheck': RegionHealthCheckGrpchealthcheck(response.get(u'grpcHealthCheck', {}), module).from_response(),
} }
def region_selflink(name, params): def region_selflink(name, params):
if name is None: if name is None:
return return
url = r"https://www.googleapis.com/compute/v1/projects/.*/regions/.*" url = r"https://compute.googleapis.com/compute/v1/projects/.*/regions/.*"
if not re.match(url, name): if not re.match(url, name):
name = "https://www.googleapis.com/compute/v1/projects/{project}/regions/%s".format(**params) % name name = "https://compute.googleapis.com/compute/v1/projects/{project}/regions/%s".format(**params) % name
return name return name
def async_op_url(module, extra_data=None): def async_op_url(module, extra_data=None):
if extra_data is None: if extra_data is None:
extra_data = {} extra_data = {}
url = "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/operations/{op_id}" url = "https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/operations/{op_id}"
combined = extra_data.copy() combined = extra_data.copy()
combined.update(module.params) combined.update(module.params)
return url.format(**combined) return url.format(**combined)
@ -1258,5 +1348,34 @@ class RegionHealthCheckHttp2healthcheck(object):
) )
class RegionHealthCheckGrpchealthcheck(object):
def __init__(self, request, module):
self.module = module
if request:
self.request = request
else:
self.request = {}
def to_request(self):
return remove_nones_from_dict(
{
u'port': self.request.get('port'),
u'portName': self.request.get('port_name'),
u'portSpecification': self.request.get('port_specification'),
u'grpcServiceName': self.request.get('grpc_service_name'),
}
)
def from_response(self):
return remove_nones_from_dict(
{
u'port': self.request.get(u'port'),
u'portName': self.request.get(u'portName'),
u'portSpecification': self.request.get(u'portSpecification'),
u'grpcServiceName': self.request.get(u'grpcServiceName'),
}
)
if __name__ == '__main__': if __name__ == '__main__':
main() main()

View file

@ -33,7 +33,6 @@ module: gcp_compute_region_health_check_info
description: description:
- Gather info for GCP RegionHealthCheck - Gather info for GCP RegionHealthCheck
short_description: Gather info for GCP RegionHealthCheck short_description: Gather info for GCP RegionHealthCheck
version_added: '2.10'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -46,6 +45,7 @@ options:
- Each additional filter in the list will act be added as an AND condition (filter1 - Each additional filter in the list will act be added as an AND condition (filter1
and filter2) . and filter2) .
type: list type: list
elements: str
region: region:
description: description:
- The region where the regional health check resides. - The region where the regional health check resides.
@ -82,6 +82,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -456,6 +457,49 @@ resources:
and `portName` fields. and `portName` fields.
returned: success returned: success
type: str type: str
grpcHealthCheck:
description:
- A nested object resource.
returned: success
type: complex
contains:
port:
description:
- The port number for the health check request. Must be specified if portName
and portSpecification are not set or if port_specification is USE_FIXED_PORT.
Valid values are 1 through 65535.
returned: success
type: int
portName:
description:
- Port name as defined in InstanceGroup#NamedPort#name. If both port and
port_name are defined, port takes precedence.
returned: success
type: str
portSpecification:
description:
- 'Specifies how port is selected for health checking, can be one of the
following values: * `USE_FIXED_PORT`: The port number in `port` is used
for health checking.'
- "* `USE_NAMED_PORT`: The `portName` is used for health checking."
- "* `USE_SERVING_PORT`: For NetworkEndpointGroup, the port specified for
each network endpoint is used for health checking. For other backends,
the port or named port specified in the Backend Service is used for health
checking."
- If not specified, gRPC health check follows behavior specified in `port`
and `portName` fields.
returned: success
type: str
grpcServiceName:
description:
- 'The gRPC service name for the health check. The value of grpcServiceName
has the following meanings by convention: - Empty serviceName means the
overall status of all services at the backend.'
- "- Non-empty serviceName means the health of that gRPC service, as defined
by the owner of the service."
- The grpcServiceName can only be ASCII.
returned: success
type: str
region: region:
description: description:
- The region where the regional health check resides. - The region where the regional health check resides.
@ -466,7 +510,7 @@ resources:
################################################################################ ################################################################################
# Imports # Imports
################################################################################ ################################################################################
from ansible.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest from ansible_collections.google.cloud.plugins.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest
import json import json
################################################################################ ################################################################################
@ -485,7 +529,7 @@ def main():
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/healthChecks".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/healthChecks".format(**module.params)
def fetch_list(module, link, query): def fetch_list(module, link, query):

View file

@ -38,7 +38,6 @@ description:
must separately verify the status of the individual instances. must separately verify the status of the individual instances.
- A managed instance group can have up to 1000 VM instances per group. - A managed instance group can have up to 1000 VM instances per group.
short_description: Creates a GCP RegionInstanceGroupManager short_description: Creates a GCP RegionInstanceGroupManager
version_added: '2.10'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -173,6 +172,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -506,11 +506,11 @@ def fetch_resource(module, link, kind, allow_not_found=True):
def self_link(module): def self_link(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{name}".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{name}".format(**module.params)
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers".format(**module.params)
def return_if_object(module, response, kind, allow_not_found=False): def return_if_object(module, response, kind, allow_not_found=False):
@ -574,7 +574,7 @@ def response_to_hash(module, response):
def async_op_url(module, extra_data=None): def async_op_url(module, extra_data=None):
if extra_data is None: if extra_data is None:
extra_data = {} extra_data = {}
url = "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/operations/{op_id}" url = "https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/operations/{op_id}"
combined = extra_data.copy() combined = extra_data.copy()
combined.update(module.params) combined.update(module.params)
return url.format(**combined) return url.format(**combined)

View file

@ -33,7 +33,6 @@ module: gcp_compute_region_instance_group_manager_info
description: description:
- Gather info for GCP RegionInstanceGroupManager - Gather info for GCP RegionInstanceGroupManager
short_description: Gather info for GCP RegionInstanceGroupManager short_description: Gather info for GCP RegionInstanceGroupManager
version_added: '2.10'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -46,6 +45,7 @@ options:
- Each additional filter in the list will act be added as an AND condition (filter1 - Each additional filter in the list will act be added as an AND condition (filter1
and filter2) . and filter2) .
type: list type: list
elements: str
region: region:
description: description:
- The region the managed instance group resides. - The region the managed instance group resides.
@ -82,6 +82,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -284,7 +285,7 @@ resources:
################################################################################ ################################################################################
# Imports # Imports
################################################################################ ################################################################################
from ansible.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest from ansible_collections.google.cloud.plugins.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest
import json import json
################################################################################ ################################################################################
@ -303,7 +304,7 @@ def main():
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers".format(**module.params)
def fetch_list(module, link, query): def fetch_list(module, link, query):

View file

@ -34,7 +34,6 @@ description:
- Represents a RegionTargetHttpProxy resource, which is used by one or more forwarding - Represents a RegionTargetHttpProxy resource, which is used by one or more forwarding
rules to route incoming HTTP requests to a URL map. rules to route incoming HTTP requests to a URL map.
short_description: Creates a GCP RegionTargetHttpProxy short_description: Creates a GCP RegionTargetHttpProxy
version_added: '2.10'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -111,6 +110,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -305,7 +305,9 @@ def update_fields(module, request, response):
def url_map_update(module, request, response): def url_map_update(module, request, response):
auth = GcpSession(module, 'compute') auth = GcpSession(module, 'compute')
auth.post( auth.post(
''.join(["https://www.googleapis.com/compute/v1/", "projects/{project}/regions/{region}/targetHttpProxies/{name}/setUrlMap"]).format(**module.params), ''.join(["https://compute.googleapis.com/compute/v1/", "projects/{project}/regions/{region}/targetHttpProxies/{name}/setUrlMap"]).format(
**module.params
),
{u'urlMap': replace_resource_dict(module.params.get(u'url_map', {}), 'selfLink')}, {u'urlMap': replace_resource_dict(module.params.get(u'url_map', {}), 'selfLink')},
) )
@ -337,11 +339,11 @@ def fetch_resource(module, link, kind, allow_not_found=True):
def self_link(module): def self_link(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/targetHttpProxies/{name}".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/targetHttpProxies/{name}".format(**module.params)
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/targetHttpProxies".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/targetHttpProxies".format(**module.params)
def return_if_object(module, response, kind, allow_not_found=False): def return_if_object(module, response, kind, allow_not_found=False):
@ -398,7 +400,7 @@ def response_to_hash(module, response):
def async_op_url(module, extra_data=None): def async_op_url(module, extra_data=None):
if extra_data is None: if extra_data is None:
extra_data = {} extra_data = {}
url = "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/operations/{op_id}" url = "https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/operations/{op_id}"
combined = extra_data.copy() combined = extra_data.copy()
combined.update(module.params) combined.update(module.params)
return url.format(**combined) return url.format(**combined)

View file

@ -33,7 +33,6 @@ module: gcp_compute_region_target_http_proxy_info
description: description:
- Gather info for GCP RegionTargetHttpProxy - Gather info for GCP RegionTargetHttpProxy
short_description: Gather info for GCP RegionTargetHttpProxy short_description: Gather info for GCP RegionTargetHttpProxy
version_added: '2.10'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -46,6 +45,7 @@ options:
- Each additional filter in the list will act be added as an AND condition (filter1 - Each additional filter in the list will act be added as an AND condition (filter1
and filter2) . and filter2) .
type: list type: list
elements: str
region: region:
description: description:
- The region where the regional proxy resides. - The region where the regional proxy resides.
@ -82,6 +82,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -159,7 +160,7 @@ resources:
################################################################################ ################################################################################
# Imports # Imports
################################################################################ ################################################################################
from ansible.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest from ansible_collections.google.cloud.plugins.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest
import json import json
################################################################################ ################################################################################
@ -178,7 +179,7 @@ def main():
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/targetHttpProxies".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/targetHttpProxies".format(**module.params)
def fetch_list(module, link, query): def fetch_list(module, link, query):

View file

@ -34,7 +34,6 @@ description:
- Represents a RegionTargetHttpsProxy resource, which is used by one or more forwarding - Represents a RegionTargetHttpsProxy resource, which is used by one or more forwarding
rules to route incoming HTTPS requests to a URL map. rules to route incoming HTTPS requests to a URL map.
short_description: Creates a GCP RegionTargetHttpsProxy short_description: Creates a GCP RegionTargetHttpsProxy
version_added: '2.10'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -119,6 +118,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -361,7 +361,7 @@ def update_fields(module, request, response):
def ssl_certificates_update(module, request, response): def ssl_certificates_update(module, request, response):
auth = GcpSession(module, 'compute') auth = GcpSession(module, 'compute')
auth.post( auth.post(
''.join(["https://www.googleapis.com/compute/v1/", "projects/{project}/regions/{region}/targetHttpsProxies/{name}/setSslCertificates"]).format( ''.join(["https://compute.googleapis.com/compute/v1/", "projects/{project}/regions/{region}/targetHttpsProxies/{name}/setSslCertificates"]).format(
**module.params **module.params
), ),
{u'sslCertificates': replace_resource_dict(module.params.get('ssl_certificates', []), 'selfLink')}, {u'sslCertificates': replace_resource_dict(module.params.get('ssl_certificates', []), 'selfLink')},
@ -371,7 +371,9 @@ def ssl_certificates_update(module, request, response):
def url_map_update(module, request, response): def url_map_update(module, request, response):
auth = GcpSession(module, 'compute') auth = GcpSession(module, 'compute')
auth.post( auth.post(
''.join(["https://www.googleapis.com/compute/v1/", "projects/{project}/regions/{region}/targetHttpsProxies/{name}/setUrlMap"]).format(**module.params), ''.join(["https://compute.googleapis.com/compute/v1/", "projects/{project}/regions/{region}/targetHttpsProxies/{name}/setUrlMap"]).format(
**module.params
),
{u'urlMap': replace_resource_dict(module.params.get(u'url_map', {}), 'selfLink')}, {u'urlMap': replace_resource_dict(module.params.get(u'url_map', {}), 'selfLink')},
) )
@ -404,11 +406,11 @@ def fetch_resource(module, link, kind, allow_not_found=True):
def self_link(module): def self_link(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/targetHttpsProxies/{name}".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/targetHttpsProxies/{name}".format(**module.params)
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/targetHttpsProxies".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/targetHttpsProxies".format(**module.params)
def return_if_object(module, response, kind, allow_not_found=False): def return_if_object(module, response, kind, allow_not_found=False):
@ -466,7 +468,7 @@ def response_to_hash(module, response):
def async_op_url(module, extra_data=None): def async_op_url(module, extra_data=None):
if extra_data is None: if extra_data is None:
extra_data = {} extra_data = {}
url = "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/operations/{op_id}" url = "https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/operations/{op_id}"
combined = extra_data.copy() combined = extra_data.copy()
combined.update(module.params) combined.update(module.params)
return url.format(**combined) return url.format(**combined)

View file

@ -33,7 +33,6 @@ module: gcp_compute_region_target_https_proxy_info
description: description:
- Gather info for GCP RegionTargetHttpsProxy - Gather info for GCP RegionTargetHttpsProxy
short_description: Gather info for GCP RegionTargetHttpsProxy short_description: Gather info for GCP RegionTargetHttpsProxy
version_added: '2.10'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -46,6 +45,7 @@ options:
- Each additional filter in the list will act be added as an AND condition (filter1 - Each additional filter in the list will act be added as an AND condition (filter1
and filter2) . and filter2) .
type: list type: list
elements: str
region: region:
description: description:
- The region where the regional proxy resides. - The region where the regional proxy resides.
@ -82,6 +82,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -166,7 +167,7 @@ resources:
################################################################################ ################################################################################
# Imports # Imports
################################################################################ ################################################################################
from ansible.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest from ansible_collections.google.cloud.plugins.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest
import json import json
################################################################################ ################################################################################
@ -185,7 +186,7 @@ def main():
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/targetHttpsProxies".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/targetHttpsProxies".format(**module.params)
def fetch_list(module, link, query): def fetch_list(module, link, query):

View file

@ -34,7 +34,6 @@ description:
- UrlMaps are used to route requests to a backend service based on rules that you - UrlMaps are used to route requests to a backend service based on rules that you
define for the host and path of an incoming URL. define for the host and path of an incoming URL.
short_description: Creates a GCP RegionUrlMap short_description: Creates a GCP RegionUrlMap
version_added: '2.10'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -1622,6 +1621,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -3528,11 +3528,11 @@ def fetch_resource(module, link, kind, allow_not_found=True):
def self_link(module): def self_link(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/urlMaps/{name}".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/urlMaps/{name}".format(**module.params)
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/urlMaps".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/urlMaps".format(**module.params)
def return_if_object(module, response, kind, allow_not_found=False): def return_if_object(module, response, kind, allow_not_found=False):
@ -3594,7 +3594,7 @@ def response_to_hash(module, response):
def async_op_url(module, extra_data=None): def async_op_url(module, extra_data=None):
if extra_data is None: if extra_data is None:
extra_data = {} extra_data = {}
url = "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/operations/{op_id}" url = "https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/operations/{op_id}"
combined = extra_data.copy() combined = extra_data.copy()
combined.update(module.params) combined.update(module.params)
return url.format(**combined) return url.format(**combined)

View file

@ -33,7 +33,6 @@ module: gcp_compute_region_url_map_info
description: description:
- Gather info for GCP RegionUrlMap - Gather info for GCP RegionUrlMap
short_description: Gather info for GCP RegionUrlMap short_description: Gather info for GCP RegionUrlMap
version_added: '2.10'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -46,6 +45,7 @@ options:
- Each additional filter in the list will act be added as an AND condition (filter1 - Each additional filter in the list will act be added as an AND condition (filter1
and filter2) . and filter2) .
type: list type: list
elements: str
region: region:
description: description:
- A reference to the region where the url map resides. - A reference to the region where the url map resides.
@ -82,6 +82,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -1587,7 +1588,7 @@ resources:
################################################################################ ################################################################################
# Imports # Imports
################################################################################ ################################################################################
from ansible.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest from ansible_collections.google.cloud.plugins.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest
import json import json
################################################################################ ################################################################################
@ -1606,7 +1607,7 @@ def main():
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/urlMaps".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/urlMaps".format(**module.params)
def fetch_list(module, link, query): def fetch_list(module, link, query):

View file

@ -38,7 +38,6 @@ description:
preemptible VMs, sole tenant nodes, or other services not listed above like Cloud preemptible VMs, sole tenant nodes, or other services not listed above like Cloud
SQL and Dataflow. SQL and Dataflow.
short_description: Creates a GCP Reservation short_description: Creates a GCP Reservation
version_added: '2.10'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -181,6 +180,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -445,7 +445,7 @@ def update_fields(module, request, response):
def specific_reservation_update(module, request, response): def specific_reservation_update(module, request, response):
auth = GcpSession(module, 'compute') auth = GcpSession(module, 'compute')
auth.post( auth.post(
''.join(["https://www.googleapis.com/compute/v1/", "projects/{project}/zones/{zone}/reservations/{name}/resize"]).format(**module.params), ''.join(["https://compute.googleapis.com/compute/v1/", "projects/{project}/zones/{zone}/reservations/{name}/resize"]).format(**module.params),
{u'specificReservation': ReservationSpecificreservation(module.params.get('specific_reservation', {}), module).to_request()}, {u'specificReservation': ReservationSpecificreservation(module.params.get('specific_reservation', {}), module).to_request()},
) )
@ -477,11 +477,11 @@ def fetch_resource(module, link, allow_not_found=True):
def self_link(module): def self_link(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/reservations/{name}".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/zones/{zone}/reservations/{name}".format(**module.params)
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/reservations".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/zones/{zone}/reservations".format(**module.params)
def return_if_object(module, response, allow_not_found=False): def return_if_object(module, response, allow_not_found=False):
@ -541,7 +541,7 @@ def response_to_hash(module, response):
def async_op_url(module, extra_data=None): def async_op_url(module, extra_data=None):
if extra_data is None: if extra_data is None:
extra_data = {} extra_data = {}
url = "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/operations/{op_id}" url = "https://compute.googleapis.com/compute/v1/projects/{project}/zones/{zone}/operations/{op_id}"
combined = extra_data.copy() combined = extra_data.copy()
combined.update(module.params) combined.update(module.params)
return url.format(**combined) return url.format(**combined)

View file

@ -33,7 +33,6 @@ module: gcp_compute_reservation_info
description: description:
- Gather info for GCP Reservation - Gather info for GCP Reservation
short_description: Gather info for GCP Reservation short_description: Gather info for GCP Reservation
version_added: '2.10'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -46,6 +45,7 @@ options:
- Each additional filter in the list will act be added as an AND condition (filter1 - Each additional filter in the list will act be added as an AND condition (filter1
and filter2) . and filter2) .
type: list type: list
elements: str
zone: zone:
description: description:
- The zone where the reservation is made. - The zone where the reservation is made.
@ -82,6 +82,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -241,7 +242,7 @@ resources:
################################################################################ ################################################################################
# Imports # Imports
################################################################################ ################################################################################
from ansible.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest from ansible_collections.google.cloud.plugins.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest
import json import json
################################################################################ ################################################################################
@ -260,7 +261,7 @@ def main():
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/reservations".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/zones/{zone}/reservations".format(**module.params)
def fetch_list(module, link, query): def fetch_list(module, link, query):

View file

@ -34,7 +34,6 @@ description:
- A policy that can be attached to a resource to specify or schedule actions on that - A policy that can be attached to a resource to specify or schedule actions on that
resource. resource.
short_description: Creates a GCP ResourcePolicy short_description: Creates a GCP ResourcePolicy
version_added: '2.10'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -243,6 +242,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -561,11 +561,11 @@ def fetch_resource(module, link, kind, allow_not_found=True):
def self_link(module): def self_link(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/resourcePolicies/{name}".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/resourcePolicies/{name}".format(**module.params)
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/resourcePolicies".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/resourcePolicies".format(**module.params)
def return_if_object(module, response, kind, allow_not_found=False): def return_if_object(module, response, kind, allow_not_found=False):
@ -620,7 +620,7 @@ def response_to_hash(module, response):
def async_op_url(module, extra_data=None): def async_op_url(module, extra_data=None):
if extra_data is None: if extra_data is None:
extra_data = {} extra_data = {}
url = "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/operations/{op_id}" url = "https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/operations/{op_id}"
combined = extra_data.copy() combined = extra_data.copy()
combined.update(module.params) combined.update(module.params)
return url.format(**combined) return url.format(**combined)

View file

@ -33,7 +33,6 @@ module: gcp_compute_resource_policy_info
description: description:
- Gather info for GCP ResourcePolicy - Gather info for GCP ResourcePolicy
short_description: Gather info for GCP ResourcePolicy short_description: Gather info for GCP ResourcePolicy
version_added: '2.10'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -46,6 +45,7 @@ options:
- Each additional filter in the list will act be added as an AND condition (filter1 - Each additional filter in the list will act be added as an AND condition (filter1
and filter2) . and filter2) .
type: list type: list
elements: str
region: region:
description: description:
- Region where resource policy resides. - Region where resource policy resides.
@ -82,6 +82,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -279,7 +280,7 @@ resources:
################################################################################ ################################################################################
# Imports # Imports
################################################################################ ################################################################################
from ansible.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest from ansible_collections.google.cloud.plugins.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest
import json import json
################################################################################ ################################################################################
@ -298,7 +299,7 @@ def main():
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/resourcePolicies".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/resourcePolicies".format(**module.params)
def fetch_list(module, link, query): def fetch_list(module, link, query):

View file

@ -48,7 +48,6 @@ description:
- A Route resource must have exactly one specification of either nextHopGateway, nextHopInstance, - A Route resource must have exactly one specification of either nextHopGateway, nextHopInstance,
nextHopIp, nextHopVpnTunnel, or nextHopIlb. nextHopIp, nextHopVpnTunnel, or nextHopIlb.
short_description: Creates a GCP Route short_description: Creates a GCP Route
version_added: '2.6'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -75,7 +74,6 @@ options:
the resource. the resource.
required: false required: false
type: str type: str
version_added: '2.7'
name: name:
description: description:
- Name of the resource. Provided by the client when the resource is created. The - Name of the resource. Provided by the client when the resource is created. The
@ -163,7 +161,6 @@ options:
field to "{{ name-of-resource }}"' field to "{{ name-of-resource }}"'
required: false required: false
type: dict type: dict
version_added: '2.10'
project: project:
description: description:
- The Google Cloud Platform project to use. - The Google Cloud Platform project to use.
@ -195,6 +192,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -435,11 +433,11 @@ def fetch_resource(module, link, kind, allow_not_found=True):
def self_link(module): def self_link(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/global/routes/{name}".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/global/routes/{name}".format(**module.params)
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/global/routes".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/global/routes".format(**module.params)
def return_if_object(module, response, kind, allow_not_found=False): def return_if_object(module, response, kind, allow_not_found=False):
@ -503,7 +501,7 @@ def response_to_hash(module, response):
def async_op_url(module, extra_data=None): def async_op_url(module, extra_data=None):
if extra_data is None: if extra_data is None:
extra_data = {} extra_data = {}
url = "https://www.googleapis.com/compute/v1/projects/{project}/global/operations/{op_id}" url = "https://compute.googleapis.com/compute/v1/projects/{project}/global/operations/{op_id}"
combined = extra_data.copy() combined = extra_data.copy()
combined.update(module.params) combined.update(module.params)
return url.format(**combined) return url.format(**combined)

View file

@ -33,7 +33,6 @@ module: gcp_compute_route_info
description: description:
- Gather info for GCP Route - Gather info for GCP Route
short_description: Gather info for GCP Route short_description: Gather info for GCP Route
version_added: '2.7'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -46,6 +45,7 @@ options:
- Each additional filter in the list will act be added as an AND condition (filter1 - Each additional filter in the list will act be added as an AND condition (filter1
and filter2) . and filter2) .
type: list type: list
elements: str
project: project:
description: description:
- The Google Cloud Platform project to use. - The Google Cloud Platform project to use.
@ -77,6 +77,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -200,7 +201,7 @@ resources:
################################################################################ ################################################################################
# Imports # Imports
################################################################################ ################################################################################
from ansible.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest from ansible_collections.google.cloud.plugins.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest
import json import json
################################################################################ ################################################################################
@ -219,7 +220,7 @@ def main():
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/global/routes".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/global/routes".format(**module.params)
def fetch_list(module, link, query): def fetch_list(module, link, query):

View file

@ -33,7 +33,6 @@ module: gcp_compute_router
description: description:
- Represents a Router resource. - Represents a Router resource.
short_description: Creates a GCP Router short_description: Creates a GCP Router
version_added: '2.7'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -160,6 +159,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -405,11 +405,11 @@ def fetch_resource(module, link, kind, allow_not_found=True):
def self_link(module): def self_link(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/routers/{name}".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/routers/{name}".format(**module.params)
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/routers".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/routers".format(**module.params)
def return_if_object(module, response, kind, allow_not_found=False): def return_if_object(module, response, kind, allow_not_found=False):
@ -467,7 +467,7 @@ def response_to_hash(module, response):
def async_op_url(module, extra_data=None): def async_op_url(module, extra_data=None):
if extra_data is None: if extra_data is None:
extra_data = {} extra_data = {}
url = "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/operations/{op_id}" url = "https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/operations/{op_id}"
combined = extra_data.copy() combined = extra_data.copy()
combined.update(module.params) combined.update(module.params)
return url.format(**combined) return url.format(**combined)

View file

@ -33,7 +33,6 @@ module: gcp_compute_router_info
description: description:
- Gather info for GCP Router - Gather info for GCP Router
short_description: Gather info for GCP Router short_description: Gather info for GCP Router
version_added: '2.7'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -46,6 +45,7 @@ options:
- Each additional filter in the list will act be added as an AND condition (filter1 - Each additional filter in the list will act be added as an AND condition (filter1
and filter2) . and filter2) .
type: list type: list
elements: str
region: region:
description: description:
- Region where the router resides. - Region where the router resides.
@ -82,6 +82,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -205,7 +206,7 @@ resources:
################################################################################ ################################################################################
# Imports # Imports
################################################################################ ################################################################################
from ansible.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest from ansible_collections.google.cloud.plugins.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest
import json import json
################################################################################ ################################################################################
@ -224,7 +225,7 @@ def main():
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/routers".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/routers".format(**module.params)
def fetch_list(module, link, query): def fetch_list(module, link, query):

View file

@ -41,7 +41,6 @@ description:
faster and at a much lower cost than if you regularly created a full image of the faster and at a much lower cost than if you regularly created a full image of the
disk. disk.
short_description: Creates a GCP Snapshot short_description: Creates a GCP Snapshot
version_added: '2.9'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -71,6 +70,12 @@ options:
- An optional description of this resource. - An optional description of this resource.
required: false required: false
type: str type: str
storage_locations:
description:
- Cloud Storage bucket storage location of the snapshot (regional or multi-regional).
elements: str
required: false
type: list
labels: labels:
description: description:
- Labels to apply to this Snapshot. - Labels to apply to this Snapshot.
@ -109,6 +114,12 @@ options:
- The name of the encryption key that is stored in Google Cloud KMS. - The name of the encryption key that is stored in Google Cloud KMS.
required: false required: false
type: str type: str
kms_key_service_account:
description:
- The service account used for the encryption request for the given KMS key.
- If absent, the Compute Engine Service Agent service account is used.
required: false
type: str
source_disk_encryption_key: source_disk_encryption_key:
description: description:
- The customer-supplied encryption key of the source snapshot. Required if the - The customer-supplied encryption key of the source snapshot. Required if the
@ -127,6 +138,12 @@ options:
- The name of the encryption key that is stored in Google Cloud KMS. - The name of the encryption key that is stored in Google Cloud KMS.
required: false required: false
type: str type: str
kms_key_service_account:
description:
- The service account used for the encryption request for the given KMS key.
- If absent, the Compute Engine Service Agent service account is used.
required: false
type: str
project: project:
description: description:
- The Google Cloud Platform project to use. - The Google Cloud Platform project to use.
@ -158,6 +175,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -240,6 +258,11 @@ storageBytes:
is expected to change with snapshot creation/deletion. is expected to change with snapshot creation/deletion.
returned: success returned: success
type: int type: int
storageLocations:
description:
- Cloud Storage bucket storage location of the snapshot (regional or multi-regional).
returned: success
type: list
licenses: licenses:
description: description:
- A list of public visible licenses that apply to this snapshot. This can be because - A list of public visible licenses that apply to this snapshot. This can be because
@ -292,6 +315,12 @@ snapshotEncryptionKey:
- The name of the encryption key that is stored in Google Cloud KMS. - The name of the encryption key that is stored in Google Cloud KMS.
returned: success returned: success
type: str type: str
kmsKeyServiceAccount:
description:
- The service account used for the encryption request for the given KMS key.
- If absent, the Compute Engine Service Agent service account is used.
returned: success
type: str
sourceDiskEncryptionKey: sourceDiskEncryptionKey:
description: description:
- The customer-supplied encryption key of the source snapshot. Required if the source - The customer-supplied encryption key of the source snapshot. Required if the source
@ -310,6 +339,12 @@ sourceDiskEncryptionKey:
- The name of the encryption key that is stored in Google Cloud KMS. - The name of the encryption key that is stored in Google Cloud KMS.
returned: success returned: success
type: str type: str
kmsKeyServiceAccount:
description:
- The service account used for the encryption request for the given KMS key.
- If absent, the Compute Engine Service Agent service account is used.
returned: success
type: str
''' '''
################################################################################ ################################################################################
@ -341,11 +376,16 @@ def main():
state=dict(default='present', choices=['present', 'absent'], type='str'), state=dict(default='present', choices=['present', 'absent'], type='str'),
name=dict(required=True, type='str'), name=dict(required=True, type='str'),
description=dict(type='str'), description=dict(type='str'),
storage_locations=dict(type='list', elements='str'),
labels=dict(type='dict'), labels=dict(type='dict'),
source_disk=dict(required=True, type='dict'), source_disk=dict(required=True, type='dict'),
zone=dict(type='str'), zone=dict(type='str'),
snapshot_encryption_key=dict(type='dict', options=dict(raw_key=dict(type='str'), kms_key_name=dict(type='str'))), snapshot_encryption_key=dict(
source_disk_encryption_key=dict(type='dict', options=dict(raw_key=dict(type='str'), kms_key_name=dict(type='str'))), type='dict', options=dict(raw_key=dict(type='str'), kms_key_name=dict(type='str'), kms_key_service_account=dict(type='str'))
),
source_disk_encryption_key=dict(
type='dict', options=dict(raw_key=dict(type='str'), kms_key_name=dict(type='str'), kms_key_service_account=dict(type='str'))
),
) )
) )
@ -398,7 +438,7 @@ def update_fields(module, request, response):
def labels_update(module, request, response): def labels_update(module, request, response):
auth = GcpSession(module, 'compute') auth = GcpSession(module, 'compute')
auth.post( auth.post(
''.join(["https://www.googleapis.com/compute/v1/", "projects/{project}/global/snapshots/{name}/setLabels"]).format(**module.params), ''.join(["https://compute.googleapis.com/compute/v1/", "projects/{project}/global/snapshots/{name}/setLabels"]).format(**module.params),
{u'labels': module.params.get('labels'), u'labelFingerprint': response.get('labelFingerprint')}, {u'labels': module.params.get('labels'), u'labelFingerprint': response.get('labelFingerprint')},
) )
@ -415,6 +455,7 @@ def resource_to_request(module):
u'zone': module.params.get('zone'), u'zone': module.params.get('zone'),
u'name': module.params.get('name'), u'name': module.params.get('name'),
u'description': module.params.get('description'), u'description': module.params.get('description'),
u'storageLocations': module.params.get('storage_locations'),
u'labels': module.params.get('labels'), u'labels': module.params.get('labels'),
} }
return_vals = {} return_vals = {}
@ -431,16 +472,16 @@ def fetch_resource(module, link, kind, allow_not_found=True):
def self_link(module): def self_link(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/global/snapshots/{name}".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/global/snapshots/{name}".format(**module.params)
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/global/snapshots".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/global/snapshots".format(**module.params)
def create_link(module): def create_link(module):
res = {'project': module.params['project'], 'zone': module.params['zone'], 'source_disk': replace_resource_dict(module.params['source_disk'], 'name')} res = {'project': module.params['project'], 'zone': module.params['zone'], 'source_disk': replace_resource_dict(module.params['source_disk'], 'name')}
return "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/disks/{source_disk}/createSnapshot".format(**res) return "https://compute.googleapis.com/compute/v1/projects/{project}/zones/{zone}/disks/{source_disk}/createSnapshot".format(**res)
def return_if_object(module, response, kind, allow_not_found=False): def return_if_object(module, response, kind, allow_not_found=False):
@ -492,6 +533,7 @@ def response_to_hash(module, response):
u'name': module.params.get('name'), u'name': module.params.get('name'),
u'description': module.params.get('description'), u'description': module.params.get('description'),
u'storageBytes': response.get(u'storageBytes'), u'storageBytes': response.get(u'storageBytes'),
u'storageLocations': response.get(u'storageLocations'),
u'licenses': response.get(u'licenses'), u'licenses': response.get(u'licenses'),
u'labels': response.get(u'labels'), u'labels': response.get(u'labels'),
u'labelFingerprint': response.get(u'labelFingerprint'), u'labelFingerprint': response.get(u'labelFingerprint'),
@ -501,16 +543,16 @@ def response_to_hash(module, response):
def license_selflink(name, params): def license_selflink(name, params):
if name is None: if name is None:
return return
url = r"https://www.googleapis.com/compute/v1//projects/.*/global/licenses/.*" url = r"https://compute.googleapis.com/compute/v1//projects/.*/global/licenses/.*"
if not re.match(url, name): if not re.match(url, name):
name = "https://www.googleapis.com/compute/v1//projects/{project}/global/licenses/%s".format(**params) % name name = "https://compute.googleapis.com/compute/v1//projects/{project}/global/licenses/%s".format(**params) % name
return name return name
def async_op_url(module, extra_data=None): def async_op_url(module, extra_data=None):
if extra_data is None: if extra_data is None:
extra_data = {} extra_data = {}
url = "https://www.googleapis.com/compute/v1/" url = "https://compute.googleapis.com/compute/v1/"
combined = extra_data.copy() combined = extra_data.copy()
combined.update(module.params) combined.update(module.params)
return url.format(**combined) return url.format(**combined)
@ -551,10 +593,22 @@ class SnapshotSnapshotencryptionkey(object):
self.request = {} self.request = {}
def to_request(self): def to_request(self):
return remove_nones_from_dict({u'rawKey': self.request.get('raw_key'), u'kmsKeyName': self.request.get('kms_key_name')}) return remove_nones_from_dict(
{
u'rawKey': self.request.get('raw_key'),
u'kmsKeyName': self.request.get('kms_key_name'),
u'kmsKeyServiceAccount': self.request.get('kms_key_service_account'),
}
)
def from_response(self): def from_response(self):
return remove_nones_from_dict({u'rawKey': self.request.get(u'rawKey'), u'kmsKeyName': self.request.get(u'kmsKeyName')}) return remove_nones_from_dict(
{
u'rawKey': self.request.get(u'rawKey'),
u'kmsKeyName': self.request.get(u'kmsKeyName'),
u'kmsKeyServiceAccount': self.request.get(u'kmsKeyServiceAccount'),
}
)
class SnapshotSourcediskencryptionkey(object): class SnapshotSourcediskencryptionkey(object):
@ -566,10 +620,22 @@ class SnapshotSourcediskencryptionkey(object):
self.request = {} self.request = {}
def to_request(self): def to_request(self):
return remove_nones_from_dict({u'rawKey': self.request.get('raw_key'), u'kmsKeyName': self.request.get('kms_key_name')}) return remove_nones_from_dict(
{
u'rawKey': self.request.get('raw_key'),
u'kmsKeyName': self.request.get('kms_key_name'),
u'kmsKeyServiceAccount': self.request.get('kms_key_service_account'),
}
)
def from_response(self): def from_response(self):
return remove_nones_from_dict({u'rawKey': self.request.get(u'rawKey'), u'kmsKeyName': self.request.get(u'kmsKeyName')}) return remove_nones_from_dict(
{
u'rawKey': self.request.get(u'rawKey'),
u'kmsKeyName': self.request.get(u'kmsKeyName'),
u'kmsKeyServiceAccount': self.request.get(u'kmsKeyServiceAccount'),
}
)
if __name__ == '__main__': if __name__ == '__main__':

View file

@ -33,7 +33,6 @@ module: gcp_compute_snapshot_info
description: description:
- Gather info for GCP Snapshot - Gather info for GCP Snapshot
short_description: Gather info for GCP Snapshot short_description: Gather info for GCP Snapshot
version_added: '2.9'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -46,6 +45,7 @@ options:
- Each additional filter in the list will act be added as an AND condition (filter1 - Each additional filter in the list will act be added as an AND condition (filter1
and filter2) . and filter2) .
type: list type: list
elements: str
project: project:
description: description:
- The Google Cloud Platform project to use. - The Google Cloud Platform project to use.
@ -77,6 +77,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -148,6 +149,11 @@ resources:
number is expected to change with snapshot creation/deletion. number is expected to change with snapshot creation/deletion.
returned: success returned: success
type: int type: int
storageLocations:
description:
- Cloud Storage bucket storage location of the snapshot (regional or multi-regional).
returned: success
type: list
licenses: licenses:
description: description:
- A list of public visible licenses that apply to this snapshot. This can be - A list of public visible licenses that apply to this snapshot. This can be
@ -201,6 +207,13 @@ resources:
- The name of the encryption key that is stored in Google Cloud KMS. - The name of the encryption key that is stored in Google Cloud KMS.
returned: success returned: success
type: str type: str
kmsKeyServiceAccount:
description:
- The service account used for the encryption request for the given KMS
key.
- If absent, the Compute Engine Service Agent service account is used.
returned: success
type: str
sourceDiskEncryptionKey: sourceDiskEncryptionKey:
description: description:
- The customer-supplied encryption key of the source snapshot. Required if the - The customer-supplied encryption key of the source snapshot. Required if the
@ -219,12 +232,19 @@ resources:
- The name of the encryption key that is stored in Google Cloud KMS. - The name of the encryption key that is stored in Google Cloud KMS.
returned: success returned: success
type: str type: str
kmsKeyServiceAccount:
description:
- The service account used for the encryption request for the given KMS
key.
- If absent, the Compute Engine Service Agent service account is used.
returned: success
type: str
''' '''
################################################################################ ################################################################################
# Imports # Imports
################################################################################ ################################################################################
from ansible.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest from ansible_collections.google.cloud.plugins.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest
import json import json
################################################################################ ################################################################################
@ -243,7 +263,7 @@ def main():
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/global/snapshots".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/global/snapshots".format(**module.params)
def fetch_list(module, link, query): def fetch_list(module, link, query):

View file

@ -35,7 +35,6 @@ description:
a mechanism to upload an SSL key and certificate to the load balancer to serve secure a mechanism to upload an SSL key and certificate to the load balancer to serve secure
connections from the user. connections from the user.
short_description: Creates a GCP SslCertificate short_description: Creates a GCP SslCertificate
version_added: '2.6'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -108,6 +107,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -299,11 +299,11 @@ def fetch_resource(module, link, kind, allow_not_found=True):
def self_link(module): def self_link(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/global/sslCertificates/{name}".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/global/sslCertificates/{name}".format(**module.params)
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/global/sslCertificates".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/global/sslCertificates".format(**module.params)
def return_if_object(module, response, kind, allow_not_found=False): def return_if_object(module, response, kind, allow_not_found=False):
@ -361,7 +361,7 @@ def response_to_hash(module, response):
def async_op_url(module, extra_data=None): def async_op_url(module, extra_data=None):
if extra_data is None: if extra_data is None:
extra_data = {} extra_data = {}
url = "https://www.googleapis.com/compute/v1/projects/{project}/global/operations/{op_id}" url = "https://compute.googleapis.com/compute/v1/projects/{project}/global/operations/{op_id}"
combined = extra_data.copy() combined = extra_data.copy()
combined.update(module.params) combined.update(module.params)
return url.format(**combined) return url.format(**combined)

View file

@ -33,7 +33,6 @@ module: gcp_compute_ssl_certificate_info
description: description:
- Gather info for GCP SslCertificate - Gather info for GCP SslCertificate
short_description: Gather info for GCP SslCertificate short_description: Gather info for GCP SslCertificate
version_added: '2.7'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -46,6 +45,7 @@ options:
- Each additional filter in the list will act be added as an AND condition (filter1 - Each additional filter in the list will act be added as an AND condition (filter1
and filter2) . and filter2) .
type: list type: list
elements: str
project: project:
description: description:
- The Google Cloud Platform project to use. - The Google Cloud Platform project to use.
@ -77,6 +77,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -154,7 +155,7 @@ resources:
################################################################################ ################################################################################
# Imports # Imports
################################################################################ ################################################################################
from ansible.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest from ansible_collections.google.cloud.plugins.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest
import json import json
################################################################################ ################################################################################
@ -173,7 +174,7 @@ def main():
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/global/sslCertificates".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/global/sslCertificates".format(**module.params)
def fetch_list(module, link, query): def fetch_list(module, link, query):

View file

@ -34,7 +34,6 @@ description:
- Represents a SSL policy. SSL policies give you the ability to control the features - Represents a SSL policy. SSL policies give you the ability to control the features
of SSL that your SSL proxy or HTTPS load balancer negotiates. of SSL that your SSL proxy or HTTPS load balancer negotiates.
short_description: Creates a GCP SslPolicy short_description: Creates a GCP SslPolicy
version_added: '2.7'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -118,6 +117,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -333,11 +333,11 @@ def fetch_resource(module, link, kind, allow_not_found=True):
def self_link(module): def self_link(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/global/sslPolicies/{name}".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/global/sslPolicies/{name}".format(**module.params)
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/global/sslPolicies".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/global/sslPolicies".format(**module.params)
def return_if_object(module, response, kind, allow_not_found=False): def return_if_object(module, response, kind, allow_not_found=False):
@ -399,7 +399,7 @@ def response_to_hash(module, response):
def async_op_url(module, extra_data=None): def async_op_url(module, extra_data=None):
if extra_data is None: if extra_data is None:
extra_data = {} extra_data = {}
url = "https://www.googleapis.com/compute/v1/projects/{project}/global/operations/{op_id}" url = "https://compute.googleapis.com/compute/v1/projects/{project}/global/operations/{op_id}"
combined = extra_data.copy() combined = extra_data.copy()
combined.update(module.params) combined.update(module.params)
return url.format(**combined) return url.format(**combined)

View file

@ -33,7 +33,6 @@ module: gcp_compute_ssl_policy_info
description: description:
- Gather info for GCP SslPolicy - Gather info for GCP SslPolicy
short_description: Gather info for GCP SslPolicy short_description: Gather info for GCP SslPolicy
version_added: '2.7'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -46,6 +45,7 @@ options:
- Each additional filter in the list will act be added as an AND condition (filter1 - Each additional filter in the list will act be added as an AND condition (filter1
and filter2) . and filter2) .
type: list type: list
elements: str
project: project:
description: description:
- The Google Cloud Platform project to use. - The Google Cloud Platform project to use.
@ -77,6 +77,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -190,7 +191,7 @@ resources:
################################################################################ ################################################################################
# Imports # Imports
################################################################################ ################################################################################
from ansible.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest from ansible_collections.google.cloud.plugins.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest
import json import json
################################################################################ ################################################################################
@ -209,7 +210,7 @@ def main():
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/global/sslPolicies".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/global/sslPolicies".format(**module.params)
def fetch_list(module, link, query): def fetch_list(module, link, query):

View file

@ -49,7 +49,6 @@ description:
private IP addresses. You can isolate portions of the network, even entire subnets, private IP addresses. You can isolate portions of the network, even entire subnets,
using firewall rules. using firewall rules.
short_description: Creates a GCP Subnetwork short_description: Creates a GCP Subnetwork
version_added: '2.6'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -107,7 +106,6 @@ options:
elements: dict elements: dict
required: false required: false
type: list type: list
version_added: '2.8'
suboptions: suboptions:
range_name: range_name:
description: description:
@ -166,6 +164,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -173,7 +172,7 @@ options:
- This only alters the User Agent string for any API requests. - This only alters the User Agent string for any API requests.
type: str type: str
notes: notes:
- 'API Reference: U(https://cloud.google.com/compute/docs/reference/rest/beta/subnetworks)' - 'API Reference: U(https://cloud.google.com/compute/docs/reference/rest/v1/subnetworks)'
- 'Private Google Access: U(https://cloud.google.com/vpc/docs/configure-private-google-access)' - 'Private Google Access: U(https://cloud.google.com/vpc/docs/configure-private-google-access)'
- 'Cloud Networking: U(https://cloud.google.com/vpc/docs/using-vpc)' - 'Cloud Networking: U(https://cloud.google.com/vpc/docs/using-vpc)'
- for authentication, you can set service_account_file using the C(gcp_service_account_file) - for authentication, you can set service_account_file using the C(gcp_service_account_file)
@ -385,7 +384,9 @@ def update_fields(module, request, response):
def ip_cidr_range_update(module, request, response): def ip_cidr_range_update(module, request, response):
auth = GcpSession(module, 'compute') auth = GcpSession(module, 'compute')
auth.post( auth.post(
''.join(["https://www.googleapis.com/compute/v1/", "projects/{project}/regions/{region}/subnetworks/{name}/expandIpCidrRange"]).format(**module.params), ''.join(["https://compute.googleapis.com/compute/v1/", "projects/{project}/regions/{region}/subnetworks/{name}/expandIpCidrRange"]).format(
**module.params
),
{u'ipCidrRange': module.params.get('ip_cidr_range')}, {u'ipCidrRange': module.params.get('ip_cidr_range')},
) )
@ -393,7 +394,7 @@ def ip_cidr_range_update(module, request, response):
def secondary_ip_ranges_update(module, request, response): def secondary_ip_ranges_update(module, request, response):
auth = GcpSession(module, 'compute') auth = GcpSession(module, 'compute')
auth.patch( auth.patch(
''.join(["https://www.googleapis.com/compute/v1/", "projects/{project}/regions/{region}/subnetworks/{name}"]).format(**module.params), ''.join(["https://compute.googleapis.com/compute/v1/", "projects/{project}/regions/{region}/subnetworks/{name}"]).format(**module.params),
{u'secondaryIpRanges': SubnetworkSecondaryiprangesArray(module.params.get('secondary_ip_ranges', []), module).to_request()}, {u'secondaryIpRanges': SubnetworkSecondaryiprangesArray(module.params.get('secondary_ip_ranges', []), module).to_request()},
) )
@ -401,7 +402,7 @@ def secondary_ip_ranges_update(module, request, response):
def private_ip_google_access_update(module, request, response): def private_ip_google_access_update(module, request, response):
auth = GcpSession(module, 'compute') auth = GcpSession(module, 'compute')
auth.post( auth.post(
''.join(["https://www.googleapis.com/compute/v1/", "projects/{project}/regions/{region}/subnetworks/{name}/setPrivateIpGoogleAccess"]).format( ''.join(["https://compute.googleapis.com/compute/v1/", "projects/{project}/regions/{region}/subnetworks/{name}/setPrivateIpGoogleAccess"]).format(
**module.params **module.params
), ),
{u'privateIpGoogleAccess': module.params.get('private_ip_google_access')}, {u'privateIpGoogleAccess': module.params.get('private_ip_google_access')},
@ -438,11 +439,11 @@ def fetch_resource(module, link, kind, allow_not_found=True):
def self_link(module): def self_link(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks/{name}".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks/{name}".format(**module.params)
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks".format(**module.params)
def return_if_object(module, response, kind, allow_not_found=False): def return_if_object(module, response, kind, allow_not_found=False):
@ -504,7 +505,7 @@ def response_to_hash(module, response):
def async_op_url(module, extra_data=None): def async_op_url(module, extra_data=None):
if extra_data is None: if extra_data is None:
extra_data = {} extra_data = {}
url = "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/operations/{op_id}" url = "https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/operations/{op_id}"
combined = extra_data.copy() combined = extra_data.copy()
combined.update(module.params) combined.update(module.params)
return url.format(**combined) return url.format(**combined)

View file

@ -33,7 +33,6 @@ module: gcp_compute_subnetwork_info
description: description:
- Gather info for GCP Subnetwork - Gather info for GCP Subnetwork
short_description: Gather info for GCP Subnetwork short_description: Gather info for GCP Subnetwork
version_added: '2.7'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -46,6 +45,7 @@ options:
- Each additional filter in the list will act be added as an AND condition (filter1 - Each additional filter in the list will act be added as an AND condition (filter1
and filter2) . and filter2) .
type: list type: list
elements: str
region: region:
description: description:
- The GCP region for this subnetwork. - The GCP region for this subnetwork.
@ -82,6 +82,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -204,7 +205,7 @@ resources:
################################################################################ ################################################################################
# Imports # Imports
################################################################################ ################################################################################
from ansible.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest from ansible_collections.google.cloud.plugins.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest
import json import json
################################################################################ ################################################################################
@ -223,7 +224,7 @@ def main():
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks".format(**module.params)
def fetch_list(module, link, query): def fetch_list(module, link, query):

View file

@ -34,7 +34,6 @@ description:
- Represents a TargetHttpProxy resource, which is used by one or more global forwarding - Represents a TargetHttpProxy resource, which is used by one or more global forwarding
rule to route incoming HTTP requests to a URL map. rule to route incoming HTTP requests to a URL map.
short_description: Creates a GCP TargetHttpProxy short_description: Creates a GCP TargetHttpProxy
version_added: '2.6'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -106,6 +105,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -292,7 +292,7 @@ def update_fields(module, request, response):
def url_map_update(module, request, response): def url_map_update(module, request, response):
auth = GcpSession(module, 'compute') auth = GcpSession(module, 'compute')
auth.post( auth.post(
''.join(["https://www.googleapis.com/compute/v1/", "projects/{project}/targetHttpProxies/{name}/setUrlMap"]).format(**module.params), ''.join(["https://compute.googleapis.com/compute/v1/", "projects/{project}/targetHttpProxies/{name}/setUrlMap"]).format(**module.params),
{u'urlMap': replace_resource_dict(module.params.get(u'url_map', {}), 'selfLink')}, {u'urlMap': replace_resource_dict(module.params.get(u'url_map', {}), 'selfLink')},
) )
@ -323,11 +323,11 @@ def fetch_resource(module, link, kind, allow_not_found=True):
def self_link(module): def self_link(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/global/targetHttpProxies/{name}".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/global/targetHttpProxies/{name}".format(**module.params)
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/global/targetHttpProxies".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/global/targetHttpProxies".format(**module.params)
def return_if_object(module, response, kind, allow_not_found=False): def return_if_object(module, response, kind, allow_not_found=False):
@ -384,7 +384,7 @@ def response_to_hash(module, response):
def async_op_url(module, extra_data=None): def async_op_url(module, extra_data=None):
if extra_data is None: if extra_data is None:
extra_data = {} extra_data = {}
url = "https://www.googleapis.com/compute/v1/projects/{project}/global/operations/{op_id}" url = "https://compute.googleapis.com/compute/v1/projects/{project}/global/operations/{op_id}"
combined = extra_data.copy() combined = extra_data.copy()
combined.update(module.params) combined.update(module.params)
return url.format(**combined) return url.format(**combined)

View file

@ -33,7 +33,6 @@ module: gcp_compute_target_http_proxy_info
description: description:
- Gather info for GCP TargetHttpProxy - Gather info for GCP TargetHttpProxy
short_description: Gather info for GCP TargetHttpProxy short_description: Gather info for GCP TargetHttpProxy
version_added: '2.7'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -46,6 +45,7 @@ options:
- Each additional filter in the list will act be added as an AND condition (filter1 - Each additional filter in the list will act be added as an AND condition (filter1
and filter2) . and filter2) .
type: list type: list
elements: str
project: project:
description: description:
- The Google Cloud Platform project to use. - The Google Cloud Platform project to use.
@ -77,6 +77,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -148,7 +149,7 @@ resources:
################################################################################ ################################################################################
# Imports # Imports
################################################################################ ################################################################################
from ansible.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest from ansible_collections.google.cloud.plugins.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest
import json import json
################################################################################ ################################################################################
@ -167,7 +168,7 @@ def main():
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/global/targetHttpProxies".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/global/targetHttpProxies".format(**module.params)
def fetch_list(module, link, query): def fetch_list(module, link, query):

View file

@ -34,7 +34,6 @@ description:
- Represents a TargetHttpsProxy resource, which is used by one or more global forwarding - Represents a TargetHttpsProxy resource, which is used by one or more global forwarding
rule to route incoming HTTPS requests to a URL map. rule to route incoming HTTPS requests to a URL map.
short_description: Creates a GCP TargetHttpsProxy short_description: Creates a GCP TargetHttpsProxy
version_added: '2.6'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -73,7 +72,6 @@ options:
- 'Some valid choices include: "NONE", "ENABLE", "DISABLE"' - 'Some valid choices include: "NONE", "ENABLE", "DISABLE"'
required: false required: false
type: str type: str
version_added: '2.7'
ssl_certificates: ssl_certificates:
description: description:
- A list of SslCertificate resources that are used to authenticate connections - A list of SslCertificate resources that are used to authenticate connections
@ -93,7 +91,6 @@ options:
}}"' }}"'
required: false required: false
type: dict type: dict
version_added: '2.8'
url_map: url_map:
description: description:
- A reference to the UrlMap resource that defines the mapping from URL to the - A reference to the UrlMap resource that defines the mapping from URL to the
@ -136,6 +133,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -388,7 +386,7 @@ def update_fields(module, request, response):
def quic_override_update(module, request, response): def quic_override_update(module, request, response):
auth = GcpSession(module, 'compute') auth = GcpSession(module, 'compute')
auth.post( auth.post(
''.join(["https://www.googleapis.com/compute/v1/", "projects/{project}/global/targetHttpsProxies/{name}/setQuicOverride"]).format(**module.params), ''.join(["https://compute.googleapis.com/compute/v1/", "projects/{project}/global/targetHttpsProxies/{name}/setQuicOverride"]).format(**module.params),
{u'quicOverride': module.params.get('quic_override')}, {u'quicOverride': module.params.get('quic_override')},
) )
@ -396,7 +394,7 @@ def quic_override_update(module, request, response):
def ssl_certificates_update(module, request, response): def ssl_certificates_update(module, request, response):
auth = GcpSession(module, 'compute') auth = GcpSession(module, 'compute')
auth.post( auth.post(
''.join(["https://www.googleapis.com/compute/v1/", "projects/{project}/targetHttpsProxies/{name}/setSslCertificates"]).format(**module.params), ''.join(["https://compute.googleapis.com/compute/v1/", "projects/{project}/targetHttpsProxies/{name}/setSslCertificates"]).format(**module.params),
{u'sslCertificates': replace_resource_dict(module.params.get('ssl_certificates', []), 'selfLink')}, {u'sslCertificates': replace_resource_dict(module.params.get('ssl_certificates', []), 'selfLink')},
) )
@ -404,7 +402,7 @@ def ssl_certificates_update(module, request, response):
def ssl_policy_update(module, request, response): def ssl_policy_update(module, request, response):
auth = GcpSession(module, 'compute') auth = GcpSession(module, 'compute')
auth.post( auth.post(
''.join(["https://www.googleapis.com/compute/v1/", "projects/{project}/global/targetHttpsProxies/{name}/setSslPolicy"]).format(**module.params), ''.join(["https://compute.googleapis.com/compute/v1/", "projects/{project}/global/targetHttpsProxies/{name}/setSslPolicy"]).format(**module.params),
{u'sslPolicy': replace_resource_dict(module.params.get(u'ssl_policy', {}), 'selfLink')}, {u'sslPolicy': replace_resource_dict(module.params.get(u'ssl_policy', {}), 'selfLink')},
) )
@ -412,7 +410,7 @@ def ssl_policy_update(module, request, response):
def url_map_update(module, request, response): def url_map_update(module, request, response):
auth = GcpSession(module, 'compute') auth = GcpSession(module, 'compute')
auth.post( auth.post(
''.join(["https://www.googleapis.com/compute/v1/", "projects/{project}/targetHttpsProxies/{name}/setUrlMap"]).format(**module.params), ''.join(["https://compute.googleapis.com/compute/v1/", "projects/{project}/targetHttpsProxies/{name}/setUrlMap"]).format(**module.params),
{u'urlMap': replace_resource_dict(module.params.get(u'url_map', {}), 'selfLink')}, {u'urlMap': replace_resource_dict(module.params.get(u'url_map', {}), 'selfLink')},
) )
@ -446,11 +444,11 @@ def fetch_resource(module, link, kind, allow_not_found=True):
def self_link(module): def self_link(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/global/targetHttpsProxies/{name}".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/global/targetHttpsProxies/{name}".format(**module.params)
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/global/targetHttpsProxies".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/global/targetHttpsProxies".format(**module.params)
def return_if_object(module, response, kind, allow_not_found=False): def return_if_object(module, response, kind, allow_not_found=False):
@ -510,7 +508,7 @@ def response_to_hash(module, response):
def async_op_url(module, extra_data=None): def async_op_url(module, extra_data=None):
if extra_data is None: if extra_data is None:
extra_data = {} extra_data = {}
url = "https://www.googleapis.com/compute/v1/projects/{project}/global/operations/{op_id}" url = "https://compute.googleapis.com/compute/v1/projects/{project}/global/operations/{op_id}"
combined = extra_data.copy() combined = extra_data.copy()
combined.update(module.params) combined.update(module.params)
return url.format(**combined) return url.format(**combined)

View file

@ -33,7 +33,6 @@ module: gcp_compute_target_https_proxy_info
description: description:
- Gather info for GCP TargetHttpsProxy - Gather info for GCP TargetHttpsProxy
short_description: Gather info for GCP TargetHttpsProxy short_description: Gather info for GCP TargetHttpsProxy
version_added: '2.7'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -46,6 +45,7 @@ options:
- Each additional filter in the list will act be added as an AND condition (filter1 - Each additional filter in the list will act be added as an AND condition (filter1
and filter2) . and filter2) .
type: list type: list
elements: str
project: project:
description: description:
- The Google Cloud Platform project to use. - The Google Cloud Platform project to use.
@ -77,6 +77,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -170,7 +171,7 @@ resources:
################################################################################ ################################################################################
# Imports # Imports
################################################################################ ################################################################################
from ansible.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest from ansible_collections.google.cloud.plugins.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest
import json import json
################################################################################ ################################################################################
@ -189,7 +190,7 @@ def main():
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/global/targetHttpsProxies".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/global/targetHttpsProxies".format(**module.params)
def fetch_list(module, link, query): def fetch_list(module, link, query):

View file

@ -37,7 +37,6 @@ description:
instance contains a single virtual machine instance that receives and handles traffic instance contains a single virtual machine instance that receives and handles traffic
from the corresponding forwarding rules. from the corresponding forwarding rules.
short_description: Creates a GCP TargetInstance short_description: Creates a GCP TargetInstance
version_added: '2.10'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -123,6 +122,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -322,11 +322,11 @@ def fetch_resource(module, link, kind, allow_not_found=True):
def self_link(module): def self_link(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/targetInstances/{name}".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/zones/{zone}/targetInstances/{name}".format(**module.params)
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/targetInstances".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/zones/{zone}/targetInstances".format(**module.params)
def return_if_object(module, response, kind, allow_not_found=False): def return_if_object(module, response, kind, allow_not_found=False):
@ -383,7 +383,7 @@ def response_to_hash(module, response):
def async_op_url(module, extra_data=None): def async_op_url(module, extra_data=None):
if extra_data is None: if extra_data is None:
extra_data = {} extra_data = {}
url = "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/operations/{op_id}" url = "https://compute.googleapis.com/compute/v1/projects/{project}/zones/{zone}/operations/{op_id}"
combined = extra_data.copy() combined = extra_data.copy()
combined.update(module.params) combined.update(module.params)
return url.format(**combined) return url.format(**combined)

View file

@ -33,7 +33,6 @@ module: gcp_compute_target_instance_info
description: description:
- Gather info for GCP TargetInstance - Gather info for GCP TargetInstance
short_description: Gather info for GCP TargetInstance short_description: Gather info for GCP TargetInstance
version_added: '2.10'
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
requirements: requirements:
- python >= 2.6 - python >= 2.6
@ -46,6 +45,7 @@ options:
- Each additional filter in the list will act be added as an AND condition (filter1 - Each additional filter in the list will act be added as an AND condition (filter1
and filter2) . and filter2) .
type: list type: list
elements: str
zone: zone:
description: description:
- URL of the zone where the target instance resides. - URL of the zone where the target instance resides.
@ -82,6 +82,7 @@ options:
description: description:
- Array of scopes to be used - Array of scopes to be used
type: list type: list
elements: str
env_type: env_type:
description: description:
- Specifies which Ansible environment you're running this module within. - Specifies which Ansible environment you're running this module within.
@ -161,7 +162,7 @@ resources:
################################################################################ ################################################################################
# Imports # Imports
################################################################################ ################################################################################
from ansible.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest from ansible_collections.google.cloud.plugins.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest
import json import json
################################################################################ ################################################################################
@ -180,7 +181,7 @@ def main():
def collection(module): def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/targetInstances".format(**module.params) return "https://compute.googleapis.com/compute/v1/projects/{project}/zones/{zone}/targetInstances".format(**module.params)
def fetch_list(module, link, query): def fetch_list(module, link, query):

Some files were not shown because too many files have changed in this diff Show more