mirror of
https://github.com/ansible-collections/google.cloud.git
synced 2025-04-06 10:50:28 -07:00
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:
parent
fb1485be7b
commit
7fa00db18c
169 changed files with 2105 additions and 764 deletions
|
@ -34,7 +34,6 @@ description:
|
|||
- A single firewall rule that is evaluated against incoming traffic and provides an
|
||||
action to take on matched requests.
|
||||
short_description: Creates a GCP FirewallRule
|
||||
version_added: '2.9'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -106,6 +105,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- Specifies which Ansible environment you're running this module within.
|
||||
|
|
|
@ -33,7 +33,6 @@ module: gcp_appengine_firewall_rule_info
|
|||
description:
|
||||
- Gather info for GCP FirewallRule
|
||||
short_description: Gather info for GCP FirewallRule
|
||||
version_added: '2.9'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -71,6 +70,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- Specifies which Ansible environment you're running this module within.
|
||||
|
@ -134,7 +134,7 @@ resources:
|
|||
################################################################################
|
||||
# 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
|
||||
|
||||
################################################################################
|
||||
|
|
|
@ -33,7 +33,6 @@ module: gcp_bigquery_dataset
|
|||
description:
|
||||
- Datasets allow you to organize and control access to your tables.
|
||||
short_description: Creates a GCP Dataset
|
||||
version_added: '2.8'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -74,9 +73,9 @@ options:
|
|||
role:
|
||||
description:
|
||||
- Describes the rights granted to the user specified by the other member of
|
||||
the access object. Primitive, Predefined and custom roles are supported.
|
||||
Predefined roles that have equivalent primitive roles are swapped by the
|
||||
API to their Primitive counterparts. See [official docs](U(https://cloud.google.com/bigquery/docs/access-control)).
|
||||
the access object. Basic, predefined, and custom roles are supported. Predefined
|
||||
roles that have equivalent basic roles are swapped by the API to their basic
|
||||
counterparts. See [official docs](U(https://cloud.google.com/bigquery/docs/access-control)).
|
||||
required: false
|
||||
type: str
|
||||
special_group:
|
||||
|
@ -85,7 +84,7 @@ options:
|
|||
Owners of the enclosing project.'
|
||||
- "* `projectReaders`: Readers of the enclosing project."
|
||||
- "* `projectWriters`: Writers of the enclosing project."
|
||||
- "* `allAuthenticatedUsers`: All authenticated BigQuery users. ."
|
||||
- "* `allAuthenticatedUsers`: All authenticated BigQuery users."
|
||||
required: false
|
||||
type: str
|
||||
user_by_email:
|
||||
|
@ -167,7 +166,6 @@ options:
|
|||
the default partition expiration time indicated by this property.'
|
||||
required: false
|
||||
type: int
|
||||
version_added: '2.9'
|
||||
description:
|
||||
description:
|
||||
- A user-friendly description of the dataset.
|
||||
|
@ -208,7 +206,6 @@ options:
|
|||
key.
|
||||
required: false
|
||||
type: dict
|
||||
version_added: '2.10'
|
||||
suboptions:
|
||||
kms_key_name:
|
||||
description:
|
||||
|
@ -248,6 +245,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- Specifies which Ansible environment you're running this module within.
|
||||
|
@ -307,9 +305,9 @@ access:
|
|||
role:
|
||||
description:
|
||||
- Describes the rights granted to the user specified by the other member of
|
||||
the access object. Primitive, Predefined and custom roles are supported. Predefined
|
||||
roles that have equivalent primitive roles are swapped by the API to their
|
||||
Primitive counterparts. See [official docs](U(https://cloud.google.com/bigquery/docs/access-control)).
|
||||
the access object. Basic, predefined, and custom roles are supported. Predefined
|
||||
roles that have equivalent basic roles are swapped by the API to their basic
|
||||
counterparts. See [official docs](U(https://cloud.google.com/bigquery/docs/access-control)).
|
||||
returned: success
|
||||
type: str
|
||||
specialGroup:
|
||||
|
@ -318,7 +316,7 @@ access:
|
|||
Owners of the enclosing project.'
|
||||
- "* `projectReaders`: Readers of the enclosing project."
|
||||
- "* `projectWriters`: Writers of the enclosing project."
|
||||
- "* `allAuthenticatedUsers`: All authenticated BigQuery users. ."
|
||||
- "* `allAuthenticatedUsers`: All authenticated BigQuery users."
|
||||
returned: success
|
||||
type: str
|
||||
userByEmail:
|
||||
|
@ -600,11 +598,11 @@ def fetch_resource(module, link, kind, allow_not_found=True):
|
|||
|
||||
|
||||
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):
|
||||
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):
|
||||
|
|
|
@ -33,7 +33,6 @@ module: gcp_bigquery_dataset_info
|
|||
description:
|
||||
- Gather info for GCP Dataset
|
||||
short_description: Gather info for GCP Dataset
|
||||
version_added: '2.8'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -71,6 +70,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- Specifies which Ansible environment you're running this module within.
|
||||
|
@ -129,9 +129,9 @@ resources:
|
|||
role:
|
||||
description:
|
||||
- Describes the rights granted to the user specified by the other member
|
||||
of the access object. Primitive, Predefined and custom roles are supported.
|
||||
Predefined roles that have equivalent primitive roles are swapped by the
|
||||
API to their Primitive counterparts. See [official docs](U(https://cloud.google.com/bigquery/docs/access-control)).
|
||||
of the access object. Basic, predefined, and custom roles are supported.
|
||||
Predefined roles that have equivalent basic roles are swapped by the API
|
||||
to their basic counterparts. See [official docs](U(https://cloud.google.com/bigquery/docs/access-control)).
|
||||
returned: success
|
||||
type: str
|
||||
specialGroup:
|
||||
|
@ -140,7 +140,7 @@ resources:
|
|||
Owners of the enclosing project.'
|
||||
- "* `projectReaders`: Readers of the enclosing project."
|
||||
- "* `projectWriters`: Writers of the enclosing project."
|
||||
- "* `allAuthenticatedUsers`: All authenticated BigQuery users. ."
|
||||
- "* `allAuthenticatedUsers`: All authenticated BigQuery users."
|
||||
returned: success
|
||||
type: str
|
||||
userByEmail:
|
||||
|
@ -298,7 +298,7 @@ resources:
|
|||
################################################################################
|
||||
# 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
|
||||
|
||||
################################################################################
|
||||
|
@ -317,7 +317,7 @@ def main():
|
|||
|
||||
|
||||
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):
|
||||
|
|
|
@ -33,7 +33,6 @@ module: gcp_bigquery_table
|
|||
description:
|
||||
- A Table that belongs to a Dataset .
|
||||
short_description: Creates a GCP Table
|
||||
version_added: '2.8'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -78,7 +77,6 @@ options:
|
|||
elements: str
|
||||
required: false
|
||||
type: list
|
||||
version_added: '2.9'
|
||||
description:
|
||||
description:
|
||||
- A user-friendly description of the dataset.
|
||||
|
@ -106,7 +104,6 @@ options:
|
|||
buffer.
|
||||
required: false
|
||||
type: int
|
||||
version_added: '2.9'
|
||||
view:
|
||||
description:
|
||||
- The view definition.
|
||||
|
@ -157,7 +154,6 @@ options:
|
|||
or REQUIRED.
|
||||
required: false
|
||||
type: str
|
||||
version_added: '2.9'
|
||||
type:
|
||||
description:
|
||||
- The only type supported is DAY, which will generate one partition per day.
|
||||
|
@ -497,6 +493,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- 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):
|
||||
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):
|
||||
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):
|
||||
|
|
|
@ -33,7 +33,6 @@ module: gcp_bigquery_table_info
|
|||
description:
|
||||
- Gather info for GCP Table
|
||||
short_description: Gather info for GCP Table
|
||||
version_added: '2.8'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -76,6 +75,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- Specifies which Ansible environment you're running this module within.
|
||||
|
@ -574,7 +574,7 @@ resources:
|
|||
################################################################################
|
||||
# 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
|
||||
|
||||
################################################################################
|
||||
|
@ -593,7 +593,7 @@ def main():
|
|||
|
||||
|
||||
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):
|
||||
|
|
|
@ -34,7 +34,6 @@ description:
|
|||
- A collection of Bigtable Tables and the resources that serve them. All tables in
|
||||
an instance are served from all Clusters in the instance.
|
||||
short_description: Creates a GCP Instance
|
||||
version_added: '2.10'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -136,6 +135,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- Specifies which Ansible environment you're running this module within.
|
||||
|
|
|
@ -33,7 +33,6 @@ module: gcp_bigtable_instance_info
|
|||
description:
|
||||
- Gather info for GCP Instance
|
||||
short_description: Gather info for GCP Instance
|
||||
version_added: '2.10'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -71,6 +70,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- Specifies which Ansible environment you're running this module within.
|
||||
|
@ -172,7 +172,7 @@ resources:
|
|||
################################################################################
|
||||
# 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
|
||||
|
||||
################################################################################
|
||||
|
|
|
@ -33,7 +33,6 @@ module: gcp_cloudbuild_trigger
|
|||
description:
|
||||
- Configuration for an automated build in response to source repository changes.
|
||||
short_description: Creates a GCP Trigger
|
||||
version_added: '2.8'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -58,7 +57,6 @@ options:
|
|||
- Name of the trigger. Must be unique within the project.
|
||||
required: false
|
||||
type: str
|
||||
version_added: '2.10'
|
||||
description:
|
||||
description:
|
||||
- Human-readable description of the trigger.
|
||||
|
@ -70,7 +68,6 @@ options:
|
|||
elements: str
|
||||
required: false
|
||||
type: list
|
||||
version_added: '2.10'
|
||||
disabled:
|
||||
description:
|
||||
- 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.
|
||||
required: false
|
||||
type: bool
|
||||
version_added: '2.10'
|
||||
branch_name:
|
||||
description:
|
||||
- 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.
|
||||
required: false
|
||||
type: dict
|
||||
version_added: '2.10'
|
||||
suboptions:
|
||||
storage_source:
|
||||
description:
|
||||
|
@ -286,7 +281,6 @@ options:
|
|||
- Substitutions data for Build resource.
|
||||
required: false
|
||||
type: dict
|
||||
version_added: '2.10'
|
||||
queue_ttl:
|
||||
description:
|
||||
- TTL in queue for this build. If provided and the build is enqueued longer
|
||||
|
@ -296,14 +290,12 @@ options:
|
|||
''s''. Example: "3.5s".'
|
||||
required: false
|
||||
type: str
|
||||
version_added: '2.10'
|
||||
logs_bucket:
|
||||
description:
|
||||
- Google Cloud Storage bucket where logs should be written. Logs file names
|
||||
will be of the format ${logsBucket}/log-${build_id}.txt.
|
||||
required: false
|
||||
type: str
|
||||
version_added: '2.10'
|
||||
timeout:
|
||||
description:
|
||||
- Amount of time that this build should be allowed to run, to second granularity.
|
||||
|
@ -316,14 +308,12 @@ options:
|
|||
required: false
|
||||
default: 600s
|
||||
type: str
|
||||
version_added: '2.10'
|
||||
secrets:
|
||||
description:
|
||||
- Secrets to decrypt using Cloud Key Management Service.
|
||||
elements: dict
|
||||
required: false
|
||||
type: list
|
||||
version_added: '2.10'
|
||||
suboptions:
|
||||
kms_key_name:
|
||||
description:
|
||||
|
@ -464,6 +454,168 @@ options:
|
|||
elements: str
|
||||
required: false
|
||||
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:
|
||||
description:
|
||||
- The Google Cloud Platform project to use.
|
||||
|
@ -495,6 +647,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- Specifies which Ansible environment you're running this module within.
|
||||
|
@ -935,6 +1088,178 @@ build:
|
|||
successfully.
|
||||
returned: success
|
||||
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'),
|
||||
),
|
||||
),
|
||||
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'secrets': TriggerSecretsArray(self.request.get('secrets', []), 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'secrets': TriggerSecretsArray(self.request.get(u'secrets', []), 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')})
|
||||
|
||||
|
||||
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__':
|
||||
main()
|
||||
|
|
|
@ -33,7 +33,6 @@ module: gcp_cloudbuild_trigger_info
|
|||
description:
|
||||
- Gather info for GCP Trigger
|
||||
short_description: Gather info for GCP Trigger
|
||||
version_added: '2.8'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -71,6 +70,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- Specifies which Ansible environment you're running this module within.
|
||||
|
@ -506,12 +506,187 @@ resources:
|
|||
have completed successfully.
|
||||
returned: success
|
||||
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
|
||||
################################################################################
|
||||
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
|
||||
|
||||
################################################################################
|
||||
|
|
|
@ -33,7 +33,6 @@ module: gcp_cloudfunctions_cloud_function
|
|||
description:
|
||||
- A Cloud Function that contains user computation executed in response to an event.
|
||||
short_description: Creates a GCP CloudFunction
|
||||
version_added: '2.9'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -189,6 +188,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- Specifies which Ansible environment you're running this module within.
|
||||
|
|
|
@ -33,7 +33,6 @@ module: gcp_cloudfunctions_cloud_function_info
|
|||
description:
|
||||
- Gather info for GCP CloudFunction
|
||||
short_description: Gather info for GCP CloudFunction
|
||||
version_added: '2.9'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -76,6 +75,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- Specifies which Ansible environment you're running this module within.
|
||||
|
@ -257,7 +257,7 @@ resources:
|
|||
################################################################################
|
||||
# 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
|
||||
|
||||
################################################################################
|
||||
|
|
|
@ -37,7 +37,6 @@ description:
|
|||
in one of the supported regions. If your project does not have an App Engine app,
|
||||
you must create one.
|
||||
short_description: Creates a GCP Job
|
||||
version_added: '2.9'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -84,6 +83,8 @@ options:
|
|||
- 'The allowed duration for this deadline is: * For HTTP targets, between 15 seconds
|
||||
and 30 minutes.'
|
||||
- "* 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''.
|
||||
Example: "3.5s" .'
|
||||
required: false
|
||||
|
@ -324,6 +325,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- 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
|
||||
and 30 minutes.'
|
||||
- "* 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''.
|
||||
Example: "3.5s" .'
|
||||
returned: success
|
||||
|
|
|
@ -33,7 +33,6 @@ module: gcp_cloudscheduler_job_info
|
|||
description:
|
||||
- Gather info for GCP Job
|
||||
short_description: Gather info for GCP Job
|
||||
version_added: '2.9'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -76,6 +75,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- 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
|
||||
seconds and 30 minutes.'
|
||||
- "* 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''.
|
||||
Example: "3.5s" .'
|
||||
returned: success
|
||||
|
@ -358,7 +360,7 @@ resources:
|
|||
################################################################################
|
||||
# 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
|
||||
|
||||
################################################################################
|
||||
|
|
|
@ -33,7 +33,6 @@ module: gcp_cloudtasks_queue
|
|||
description:
|
||||
- A named resource to which messages are sent by publishers.
|
||||
short_description: Creates a GCP Queue
|
||||
version_added: '2.9'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -194,6 +193,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- Specifies which Ansible environment you're running this module within.
|
||||
|
|
|
@ -33,7 +33,6 @@ module: gcp_cloudtasks_queue_info
|
|||
description:
|
||||
- Gather info for GCP Queue
|
||||
short_description: Gather info for GCP Queue
|
||||
version_added: '2.9'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -76,6 +75,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- Specifies which Ansible environment you're running this module within.
|
||||
|
@ -250,7 +250,7 @@ resources:
|
|||
################################################################################
|
||||
# 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
|
||||
|
||||
################################################################################
|
||||
|
|
|
@ -42,7 +42,6 @@ description:
|
|||
a new internal IP address, either by Compute Engine or by you. External IP addresses
|
||||
can be either ephemeral or static.
|
||||
short_description: Creates a GCP Address
|
||||
version_added: '2.6'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -71,7 +70,6 @@ options:
|
|||
required: false
|
||||
default: EXTERNAL
|
||||
type: str
|
||||
version_added: '2.7'
|
||||
description:
|
||||
description:
|
||||
- An optional description of this resource.
|
||||
|
@ -95,7 +93,6 @@ options:
|
|||
- 'Some valid choices include: "GCE_ENDPOINT"'
|
||||
required: false
|
||||
type: str
|
||||
version_added: '2.10'
|
||||
network_tier:
|
||||
description:
|
||||
- The networking tier used for configuring this address. If this field is not
|
||||
|
@ -103,7 +100,6 @@ options:
|
|||
- 'Some valid choices include: "PREMIUM", "STANDARD"'
|
||||
required: false
|
||||
type: str
|
||||
version_added: '2.8'
|
||||
subnetwork:
|
||||
description:
|
||||
- The URL of the subnetwork in which to reserve the address. If an IP address
|
||||
|
@ -117,7 +113,6 @@ options:
|
|||
}}"'
|
||||
required: false
|
||||
type: dict
|
||||
version_added: '2.7'
|
||||
region:
|
||||
description:
|
||||
- URL of the region where the regional address resides.
|
||||
|
@ -155,6 +150,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- 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):
|
||||
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):
|
||||
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):
|
||||
|
@ -436,7 +432,7 @@ def response_to_hash(module, response):
|
|||
def async_op_url(module, extra_data=None):
|
||||
if extra_data is None:
|
||||
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.update(module.params)
|
||||
return url.format(**combined)
|
||||
|
|
|
@ -33,7 +33,6 @@ module: gcp_compute_address_info
|
|||
description:
|
||||
- Gather info for GCP Address
|
||||
short_description: Gather info for GCP Address
|
||||
version_added: '2.7'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -46,6 +45,7 @@ options:
|
|||
- Each additional filter in the list will act be added as an AND condition (filter1
|
||||
and filter2) .
|
||||
type: list
|
||||
elements: str
|
||||
region:
|
||||
description:
|
||||
- URL of the region where the regional address resides.
|
||||
|
@ -83,6 +83,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- Specifies which Ansible environment you're running this module within.
|
||||
|
@ -201,7 +202,7 @@ resources:
|
|||
################################################################################
|
||||
# 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
|
||||
|
||||
################################################################################
|
||||
|
@ -220,7 +221,7 @@ def main():
|
|||
|
||||
|
||||
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):
|
||||
|
|
|
@ -35,7 +35,6 @@ description:
|
|||
- Autoscalers allow you to automatically scale virtual machine instances in managed
|
||||
instance groups according to an autoscaling policy that you define.
|
||||
short_description: Creates a GCP Autoscaler
|
||||
version_added: '2.9'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -112,7 +111,6 @@ options:
|
|||
required: false
|
||||
default: 'ON'
|
||||
type: str
|
||||
version_added: '2.10'
|
||||
cpu_utilization:
|
||||
description:
|
||||
- Defines the CPU utilization policy that allows the autoscaler to scale based
|
||||
|
@ -237,6 +235,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- 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):
|
||||
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):
|
||||
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):
|
||||
|
@ -654,7 +653,7 @@ def response_to_hash(module, response):
|
|||
def async_op_url(module, extra_data=None):
|
||||
if extra_data is None:
|
||||
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.update(module.params)
|
||||
return url.format(**combined)
|
||||
|
|
|
@ -33,7 +33,6 @@ module: gcp_compute_autoscaler_info
|
|||
description:
|
||||
- Gather info for GCP Autoscaler
|
||||
short_description: Gather info for GCP Autoscaler
|
||||
version_added: '2.9'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -46,6 +45,7 @@ options:
|
|||
- Each additional filter in the list will act be added as an AND condition (filter1
|
||||
and filter2) .
|
||||
type: list
|
||||
elements: str
|
||||
zone:
|
||||
description:
|
||||
- URL of the zone where the instance group resides.
|
||||
|
@ -82,6 +82,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- Specifies which Ansible environment you're running this module within.
|
||||
|
@ -261,7 +262,7 @@ resources:
|
|||
################################################################################
|
||||
# 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
|
||||
|
||||
################################################################################
|
||||
|
@ -280,7 +281,7 @@ def main():
|
|||
|
||||
|
||||
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):
|
||||
|
|
|
@ -37,7 +37,6 @@ description:
|
|||
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.
|
||||
short_description: Creates a GCP BackendBucket
|
||||
version_added: '2.6'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -62,7 +61,6 @@ options:
|
|||
- Cloud CDN configuration for this Backend Bucket.
|
||||
required: false
|
||||
type: dict
|
||||
version_added: '2.8'
|
||||
suboptions:
|
||||
signed_url_cache_max_age_sec:
|
||||
description:
|
||||
|
@ -127,6 +125,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- 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):
|
||||
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):
|
||||
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):
|
||||
|
@ -392,7 +391,7 @@ def response_to_hash(module, response):
|
|||
def async_op_url(module, extra_data=None):
|
||||
if extra_data is None:
|
||||
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.update(module.params)
|
||||
return url.format(**combined)
|
||||
|
|
|
@ -33,7 +33,6 @@ module: gcp_compute_backend_bucket_info
|
|||
description:
|
||||
- Gather info for GCP BackendBucket
|
||||
short_description: Gather info for GCP BackendBucket
|
||||
version_added: '2.7'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -46,6 +45,7 @@ options:
|
|||
- Each additional filter in the list will act be added as an AND condition (filter1
|
||||
and filter2) .
|
||||
type: list
|
||||
elements: str
|
||||
project:
|
||||
description:
|
||||
- The Google Cloud Platform project to use.
|
||||
|
@ -77,6 +77,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- Specifies which Ansible environment you're running this module within.
|
||||
|
@ -170,7 +171,7 @@ resources:
|
|||
################################################################################
|
||||
# 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
|
||||
|
||||
################################################################################
|
||||
|
@ -189,7 +190,7 @@ def main():
|
|||
|
||||
|
||||
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):
|
||||
|
|
|
@ -37,7 +37,6 @@ description:
|
|||
- For managed internal load balancing, use a regional backend service instead.
|
||||
- Currently self-managed internal load balancing is only available in beta.
|
||||
short_description: Creates a GCP BackendService
|
||||
version_added: '2.6'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -134,7 +133,6 @@ options:
|
|||
must be set.
|
||||
required: false
|
||||
type: int
|
||||
version_added: '2.9'
|
||||
max_rate:
|
||||
description:
|
||||
- The max requests per second (RPS) of the group.
|
||||
|
@ -159,7 +157,6 @@ options:
|
|||
must be set.
|
||||
required: false
|
||||
type: str
|
||||
version_added: '2.9'
|
||||
max_utilization:
|
||||
description:
|
||||
- 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.
|
||||
required: false
|
||||
type: dict
|
||||
version_added: '2.10'
|
||||
suboptions:
|
||||
max_requests_per_connection:
|
||||
description:
|
||||
|
@ -221,7 +217,6 @@ options:
|
|||
This field is only applicable when locality_lb_policy is set to MAGLEV or RING_HASH.
|
||||
required: false
|
||||
type: dict
|
||||
version_added: '2.10'
|
||||
suboptions:
|
||||
http_cookie:
|
||||
description:
|
||||
|
@ -338,7 +333,6 @@ options:
|
|||
required: false
|
||||
default: '3600'
|
||||
type: int
|
||||
version_added: '2.8'
|
||||
connection_draining:
|
||||
description:
|
||||
- Settings for connection draining .
|
||||
|
@ -358,7 +352,6 @@ options:
|
|||
elements: str
|
||||
required: false
|
||||
type: list
|
||||
version_added: '2.10'
|
||||
description:
|
||||
description:
|
||||
- An optional description of this resource.
|
||||
|
@ -374,7 +367,7 @@ options:
|
|||
- The set of URLs to the HttpHealthCheck or HttpsHealthCheck resource for health
|
||||
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 as a backend.
|
||||
or serverless NEG as a backend.
|
||||
- For internal load balancing, a URL to a HealthCheck resource must be specified
|
||||
instead.
|
||||
elements: str
|
||||
|
@ -385,7 +378,6 @@ options:
|
|||
- Settings for enabling Cloud Identity Aware Proxy.
|
||||
required: false
|
||||
type: dict
|
||||
version_added: '2.7'
|
||||
suboptions:
|
||||
enabled:
|
||||
description:
|
||||
|
@ -411,7 +403,6 @@ options:
|
|||
required: false
|
||||
default: EXTERNAL
|
||||
type: str
|
||||
version_added: '2.7'
|
||||
locality_lb_policy:
|
||||
description:
|
||||
- The load balancing algorithm used within the scope of the locality.
|
||||
|
@ -435,7 +426,6 @@ options:
|
|||
"ORIGINAL_DESTINATION", "MAGLEV"'
|
||||
required: false
|
||||
type: str
|
||||
version_added: '2.10'
|
||||
name:
|
||||
description:
|
||||
- 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.
|
||||
required: false
|
||||
type: dict
|
||||
version_added: '2.10'
|
||||
suboptions:
|
||||
base_ejection_time:
|
||||
description:
|
||||
|
@ -583,7 +572,7 @@ options:
|
|||
- The protocol this BackendService uses to communicate with backends.
|
||||
- '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.'
|
||||
- 'Some valid choices include: "HTTP", "HTTPS", "HTTP2", "TCP", "SSL"'
|
||||
- 'Some valid choices include: "HTTP", "HTTPS", "HTTP2", "TCP", "SSL", "GRPC"'
|
||||
required: false
|
||||
type: str
|
||||
security_policy:
|
||||
|
@ -591,7 +580,6 @@ options:
|
|||
- The security policy associated with this backend service.
|
||||
required: false
|
||||
type: str
|
||||
version_added: '2.8'
|
||||
session_affinity:
|
||||
description:
|
||||
- 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.
|
||||
required: false
|
||||
type: dict
|
||||
version_added: '2.10'
|
||||
suboptions:
|
||||
enable:
|
||||
description:
|
||||
|
@ -663,6 +650,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- Specifies which Ansible environment you're running this module within.
|
||||
|
@ -1032,8 +1020,8 @@ healthChecks:
|
|||
description:
|
||||
- The set of URLs to the HttpHealthCheck or HttpsHealthCheck resource for health
|
||||
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
|
||||
as a backend.
|
||||
- A health check must be specified unless the backend service uses an internet or
|
||||
serverless NEG as a backend.
|
||||
- For internal load balancing, a URL to a HealthCheck resource must be specified
|
||||
instead.
|
||||
returned: success
|
||||
|
@ -1450,7 +1438,7 @@ def update_fields(module, request, response):
|
|||
def security_policy_update(module, request, response):
|
||||
auth = GcpSession(module, 'compute')
|
||||
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')},
|
||||
)
|
||||
|
||||
|
@ -1499,11 +1487,11 @@ def fetch_resource(module, link, kind, allow_not_found=True):
|
|||
|
||||
|
||||
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):
|
||||
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):
|
||||
|
@ -1579,7 +1567,7 @@ def response_to_hash(module, response):
|
|||
def async_op_url(module, extra_data=None):
|
||||
if extra_data is None:
|
||||
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.update(module.params)
|
||||
return url.format(**combined)
|
||||
|
|
|
@ -33,7 +33,6 @@ module: gcp_compute_backend_service_info
|
|||
description:
|
||||
- Gather info for GCP BackendService
|
||||
short_description: Gather info for GCP BackendService
|
||||
version_added: '2.7'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -46,6 +45,7 @@ options:
|
|||
- Each additional filter in the list will act be added as an AND condition (filter1
|
||||
and filter2) .
|
||||
type: list
|
||||
elements: str
|
||||
project:
|
||||
description:
|
||||
- The Google Cloud Platform project to use.
|
||||
|
@ -77,6 +77,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- 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
|
||||
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 as a backend.
|
||||
or serverless NEG as a backend.
|
||||
- For internal load balancing, a URL to a HealthCheck resource must be specified
|
||||
instead.
|
||||
returned: success
|
||||
|
@ -680,7 +681,7 @@ resources:
|
|||
################################################################################
|
||||
# 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
|
||||
|
||||
################################################################################
|
||||
|
@ -699,7 +700,7 @@ def main():
|
|||
|
||||
|
||||
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):
|
||||
|
|
|
@ -43,7 +43,6 @@ description:
|
|||
- Add a persistent disk to your instance when you need reliable and affordable storage
|
||||
with consistent performance characteristics.
|
||||
short_description: Creates a GCP Disk
|
||||
version_added: '2.6'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -69,7 +68,6 @@ options:
|
|||
- Labels to apply to this disk. A list of key->value pairs.
|
||||
required: false
|
||||
type: dict
|
||||
version_added: '2.7'
|
||||
licenses:
|
||||
description:
|
||||
- Any applicable publicly visible licenses.
|
||||
|
@ -105,22 +103,20 @@ options:
|
|||
values for the caller's project.
|
||||
required: false
|
||||
type: int
|
||||
version_added: '2.8'
|
||||
type:
|
||||
description:
|
||||
- URL of the disk type resource describing which disk type to use to create the
|
||||
disk. Provide this when creating the disk.
|
||||
required: false
|
||||
type: str
|
||||
version_added: '2.7'
|
||||
source_image:
|
||||
description:
|
||||
- The source image used to create this disk. If the source image is deleted, this
|
||||
field will not be set.
|
||||
- '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
|
||||
Debian 8 image: projects/debian-cloud/global/images/family/debian-8 Alternatively,
|
||||
use a specific version of a public operating system image: projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD
|
||||
image by its family name. For example, specify family/debian-9 to use the latest
|
||||
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-9-stretch-vYYYYMMDD
|
||||
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 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.
|
||||
required: false
|
||||
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:
|
||||
description:
|
||||
- Encrypts the disk using a customer-supplied encryption key.
|
||||
|
@ -177,6 +179,12 @@ options:
|
|||
must have `roles/cloudkms.cryptoKeyEncrypterDecrypter` to use this feature.
|
||||
required: false
|
||||
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:
|
||||
description:
|
||||
- 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.
|
||||
required: false
|
||||
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:
|
||||
description:
|
||||
- The Google Cloud Platform project to use.
|
||||
|
@ -237,6 +251,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- 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
|
||||
field will not be set.
|
||||
- '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
|
||||
Debian 8 image: projects/debian-cloud/global/images/family/debian-8 Alternatively,
|
||||
use a specific version of a public operating system image: projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD
|
||||
image by its family name. For example, specify family/debian-9 to use the latest
|
||||
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-9-stretch-vYYYYMMDD
|
||||
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
|
||||
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.
|
||||
returned: success
|
||||
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:
|
||||
description:
|
||||
- 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.
|
||||
returned: success
|
||||
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:
|
||||
description:
|
||||
- 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.
|
||||
returned: success
|
||||
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:
|
||||
description:
|
||||
- The unique ID of the snapshot used to create this disk. This value identifies
|
||||
|
@ -518,10 +551,16 @@ def main():
|
|||
type=dict(type='str'),
|
||||
source_image=dict(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'))),
|
||||
disk_encryption_key=dict(type='dict', options=dict(raw_key=dict(type='str'), kms_key_name=dict(type='str'))),
|
||||
source_image_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'))
|
||||
),
|
||||
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_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):
|
||||
auth = GcpSession(module, 'compute')
|
||||
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')},
|
||||
)
|
||||
|
||||
|
@ -584,7 +623,7 @@ def label_fingerprint_update(module, request, response):
|
|||
def size_gb_update(module, request, response):
|
||||
auth = GcpSession(module, 'compute')
|
||||
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')},
|
||||
)
|
||||
|
||||
|
@ -599,6 +638,7 @@ def resource_to_request(module):
|
|||
u'kind': 'compute#disk',
|
||||
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'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'description': module.params.get('description'),
|
||||
u'labels': module.params.get('labels'),
|
||||
|
@ -623,11 +663,11 @@ def fetch_resource(module, link, kind, allow_not_found=True):
|
|||
|
||||
|
||||
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):
|
||||
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):
|
||||
|
@ -693,16 +733,16 @@ def response_to_hash(module, response):
|
|||
def disk_type_selflink(name, params):
|
||||
if name is None:
|
||||
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):
|
||||
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
|
||||
|
||||
|
||||
def async_op_url(module, extra_data=None):
|
||||
if extra_data is None:
|
||||
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.update(module.params)
|
||||
return url.format(**combined)
|
||||
|
@ -743,10 +783,22 @@ class DiskSourceimageencryptionkey(object):
|
|||
self.request = {}
|
||||
|
||||
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):
|
||||
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):
|
||||
|
@ -758,10 +810,22 @@ class DiskDiskencryptionkey(object):
|
|||
self.request = {}
|
||||
|
||||
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):
|
||||
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):
|
||||
|
@ -773,10 +837,22 @@ class DiskSourcesnapshotencryptionkey(object):
|
|||
self.request = {}
|
||||
|
||||
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):
|
||||
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__':
|
||||
|
|
|
@ -33,7 +33,6 @@ module: gcp_compute_disk_info
|
|||
description:
|
||||
- Gather info for GCP Disk
|
||||
short_description: Gather info for GCP Disk
|
||||
version_added: '2.7'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -46,6 +45,7 @@ options:
|
|||
- Each additional filter in the list will act be added as an AND condition (filter1
|
||||
and filter2) .
|
||||
type: list
|
||||
elements: str
|
||||
zone:
|
||||
description:
|
||||
- A reference to the zone where the disk resides.
|
||||
|
@ -82,6 +82,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- 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,
|
||||
this field will not be set.
|
||||
- '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 Debian 8 image: projects/debian-cloud/global/images/family/debian-8
|
||||
the image by its family name. For example, specify family/debian-9 to use
|
||||
the latest 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 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
|
||||
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
|
||||
|
@ -246,6 +247,13 @@ resources:
|
|||
- The name of the encryption key that is stored in Google Cloud KMS.
|
||||
returned: success
|
||||
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:
|
||||
description:
|
||||
- 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.
|
||||
returned: success
|
||||
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:
|
||||
description:
|
||||
- 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.
|
||||
returned: success
|
||||
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:
|
||||
description:
|
||||
- The unique ID of the snapshot used to create this disk. This value identifies
|
||||
|
@ -332,7 +353,7 @@ resources:
|
|||
################################################################################
|
||||
# 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
|
||||
|
||||
################################################################################
|
||||
|
@ -351,7 +372,7 @@ def main():
|
|||
|
||||
|
||||
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):
|
||||
|
|
|
@ -33,7 +33,6 @@ module: gcp_compute_external_vpn_gateway
|
|||
description:
|
||||
- Represents a VPN gateway managed outside of GCP.
|
||||
short_description: Creates a GCP ExternalVpnGateway
|
||||
version_added: '2.10'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -88,7 +87,7 @@ options:
|
|||
description:
|
||||
- IP address of the interface in the external VPN gateway.
|
||||
- Only IPv4 is supported. This IP address can be either from your on-premise
|
||||
gateway or another Cloud provider’s 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.
|
||||
required: false
|
||||
type: str
|
||||
|
@ -123,6 +122,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- Specifies which Ansible environment you're running this module within.
|
||||
|
@ -196,7 +196,7 @@ interfaces:
|
|||
description:
|
||||
- IP address of the interface in the external VPN gateway.
|
||||
- Only IPv4 is supported. This IP address can be either from your on-premise
|
||||
gateway or another Cloud provider’s 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.
|
||||
returned: success
|
||||
type: str
|
||||
|
@ -303,11 +303,11 @@ def fetch_resource(module, link, kind, allow_not_found=True):
|
|||
|
||||
|
||||
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):
|
||||
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):
|
||||
|
@ -363,7 +363,7 @@ def response_to_hash(module, response):
|
|||
def async_op_url(module, extra_data=None):
|
||||
if extra_data is None:
|
||||
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.update(module.params)
|
||||
return url.format(**combined)
|
||||
|
|
|
@ -33,7 +33,6 @@ module: gcp_compute_external_vpn_gateway_info
|
|||
description:
|
||||
- Gather info for GCP ExternalVpnGateway
|
||||
short_description: Gather info for GCP ExternalVpnGateway
|
||||
version_added: '2.10'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -46,6 +45,7 @@ options:
|
|||
- Each additional filter in the list will act be added as an AND condition (filter1
|
||||
and filter2) .
|
||||
type: list
|
||||
elements: str
|
||||
project:
|
||||
description:
|
||||
- The Google Cloud Platform project to use.
|
||||
|
@ -77,6 +77,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- Specifies which Ansible environment you're running this module within.
|
||||
|
@ -149,7 +150,7 @@ resources:
|
|||
description:
|
||||
- IP address of the interface in the external VPN gateway.
|
||||
- Only IPv4 is supported. This IP address can be either from your on-premise
|
||||
gateway or another Cloud provider’s 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.
|
||||
returned: success
|
||||
type: str
|
||||
|
@ -158,7 +159,7 @@ resources:
|
|||
################################################################################
|
||||
# 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
|
||||
|
||||
################################################################################
|
||||
|
@ -177,7 +178,7 @@ def main():
|
|||
|
||||
|
||||
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):
|
||||
|
|
|
@ -40,7 +40,6 @@ description:
|
|||
incoming traffic. For all networks except the default network, you must create any
|
||||
firewall rules you need.
|
||||
short_description: Creates a GCP Firewall
|
||||
version_added: '2.6'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -67,8 +66,8 @@ options:
|
|||
description:
|
||||
- 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
|
||||
well known protocol strings (tcp, udp, icmp, esp, ah, sctp, ipip), or the
|
||||
IP protocol number.
|
||||
well known protocol strings (tcp, udp, icmp, esp, ah, sctp, ipip, all),
|
||||
or the IP protocol number.
|
||||
required: true
|
||||
type: str
|
||||
ports:
|
||||
|
@ -88,14 +87,13 @@ options:
|
|||
elements: dict
|
||||
required: false
|
||||
type: list
|
||||
version_added: '2.8'
|
||||
suboptions:
|
||||
ip_protocol:
|
||||
description:
|
||||
- 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
|
||||
well known protocol strings (tcp, udp, icmp, esp, ah, sctp, ipip), or the
|
||||
IP protocol number.
|
||||
well known protocol strings (tcp, udp, icmp, esp, ah, sctp, ipip, all),
|
||||
or the IP protocol number.
|
||||
required: true
|
||||
type: str
|
||||
ports:
|
||||
|
@ -122,7 +120,6 @@ options:
|
|||
elements: str
|
||||
required: false
|
||||
type: list
|
||||
version_added: '2.8'
|
||||
direction:
|
||||
description:
|
||||
- 'Direction of traffic to which this firewall applies; default is INGRESS. Note:
|
||||
|
@ -131,7 +128,6 @@ options:
|
|||
- 'Some valid choices include: "INGRESS", "EGRESS"'
|
||||
required: false
|
||||
type: str
|
||||
version_added: '2.8'
|
||||
disabled:
|
||||
description:
|
||||
- Denotes whether the firewall rule is disabled, i.e not applied to the network
|
||||
|
@ -140,14 +136,12 @@ options:
|
|||
rule will be enabled.
|
||||
required: false
|
||||
type: bool
|
||||
version_added: '2.8'
|
||||
log_config:
|
||||
description:
|
||||
- This field denotes the logging options for a particular firewall rule.
|
||||
- If logging is enabled, logs will be exported to Cloud Logging.
|
||||
required: false
|
||||
type: dict
|
||||
version_added: '2.10'
|
||||
suboptions:
|
||||
enable:
|
||||
description:
|
||||
|
@ -198,7 +192,6 @@ options:
|
|||
required: false
|
||||
default: '1000'
|
||||
type: int
|
||||
version_added: '2.8'
|
||||
source_ranges:
|
||||
description:
|
||||
- If source ranges are specified, the firewall will apply only to traffic that
|
||||
|
@ -225,7 +218,6 @@ options:
|
|||
elements: str
|
||||
required: false
|
||||
type: list
|
||||
version_added: '2.8'
|
||||
source_tags:
|
||||
description:
|
||||
- If source tags are specified, the firewall will apply only to traffic with source
|
||||
|
@ -249,7 +241,6 @@ options:
|
|||
elements: str
|
||||
required: false
|
||||
type: list
|
||||
version_added: '2.8'
|
||||
target_tags:
|
||||
description:
|
||||
- A list of instance tags indicating sets of instances located in the network
|
||||
|
@ -290,6 +281,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- Specifies which Ansible environment you're running this module within.
|
||||
|
@ -342,8 +334,8 @@ allowed:
|
|||
description:
|
||||
- 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
|
||||
well known protocol strings (tcp, udp, icmp, esp, ah, sctp, ipip), or the
|
||||
IP protocol number.
|
||||
well known protocol strings (tcp, udp, icmp, esp, ah, sctp, ipip, all), or
|
||||
the IP protocol number.
|
||||
returned: success
|
||||
type: str
|
||||
ports:
|
||||
|
@ -370,8 +362,8 @@ denied:
|
|||
description:
|
||||
- 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
|
||||
well known protocol strings (tcp, udp, icmp, esp, ah, sctp, ipip), or the
|
||||
IP protocol number.
|
||||
well known protocol strings (tcp, udp, icmp, esp, ah, sctp, ipip, all), or
|
||||
the IP protocol number.
|
||||
returned: success
|
||||
type: str
|
||||
ports:
|
||||
|
@ -650,11 +642,11 @@ def fetch_resource(module, link, kind, allow_not_found=True):
|
|||
|
||||
|
||||
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):
|
||||
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):
|
||||
|
@ -723,7 +715,7 @@ def response_to_hash(module, response):
|
|||
def async_op_url(module, extra_data=None):
|
||||
if extra_data is None:
|
||||
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.update(module.params)
|
||||
return url.format(**combined)
|
||||
|
|
|
@ -33,7 +33,6 @@ module: gcp_compute_firewall_info
|
|||
description:
|
||||
- Gather info for GCP Firewall
|
||||
short_description: Gather info for GCP Firewall
|
||||
version_added: '2.7'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -46,6 +45,7 @@ options:
|
|||
- Each additional filter in the list will act be added as an AND condition (filter1
|
||||
and filter2) .
|
||||
type: list
|
||||
elements: str
|
||||
project:
|
||||
description:
|
||||
- The Google Cloud Platform project to use.
|
||||
|
@ -77,6 +77,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- Specifies which Ansible environment you're running this module within.
|
||||
|
@ -123,8 +124,8 @@ resources:
|
|||
description:
|
||||
- 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
|
||||
well known protocol strings (tcp, udp, icmp, esp, ah, sctp, ipip), or
|
||||
the IP protocol number.
|
||||
well known protocol strings (tcp, udp, icmp, esp, ah, sctp, ipip, all),
|
||||
or the IP protocol number.
|
||||
returned: success
|
||||
type: str
|
||||
ports:
|
||||
|
@ -152,8 +153,8 @@ resources:
|
|||
description:
|
||||
- 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
|
||||
well known protocol strings (tcp, udp, icmp, esp, ah, sctp, ipip), or
|
||||
the IP protocol number.
|
||||
well known protocol strings (tcp, udp, icmp, esp, ah, sctp, ipip, all),
|
||||
or the IP protocol number.
|
||||
returned: success
|
||||
type: str
|
||||
ports:
|
||||
|
@ -305,7 +306,7 @@ resources:
|
|||
################################################################################
|
||||
# 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
|
||||
|
||||
################################################################################
|
||||
|
@ -324,7 +325,7 @@ def main():
|
|||
|
||||
|
||||
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):
|
||||
|
|
|
@ -35,7 +35,6 @@ description:
|
|||
virtual machines to forward a packet to if it matches the given [IPAddress, IPProtocol,
|
||||
portRange] tuple.
|
||||
short_description: Creates a GCP ForwardingRule
|
||||
version_added: '2.6'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -177,14 +176,12 @@ options:
|
|||
- The forwarded traffic must be of a type appropriate to the target object.
|
||||
required: false
|
||||
type: str
|
||||
version_added: '2.7'
|
||||
allow_global_access:
|
||||
description:
|
||||
- If true, clients can access ILB from all regions.
|
||||
- Otherwise only allows from the local region the ILB is located at.
|
||||
required: false
|
||||
type: bool
|
||||
version_added: '2.10'
|
||||
all_ports:
|
||||
description:
|
||||
- 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.
|
||||
required: false
|
||||
type: bool
|
||||
version_added: '2.8'
|
||||
network_tier:
|
||||
description:
|
||||
- The networking tier used for configuring this address. If this field is not
|
||||
|
@ -201,7 +197,6 @@ options:
|
|||
- 'Some valid choices include: "PREMIUM", "STANDARD"'
|
||||
required: false
|
||||
type: str
|
||||
version_added: '2.8'
|
||||
service_label:
|
||||
description:
|
||||
- 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.
|
||||
required: false
|
||||
type: str
|
||||
version_added: '2.8'
|
||||
region:
|
||||
description:
|
||||
- A reference to the region where the regional forwarding rule resides.
|
||||
|
@ -252,6 +246,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- 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):
|
||||
auth = GcpSession(module, 'compute')
|
||||
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')},
|
||||
)
|
||||
|
||||
|
@ -570,7 +565,7 @@ def target_update(module, request, response):
|
|||
def allow_global_access_update(module, request, response):
|
||||
auth = GcpSession(module, 'compute')
|
||||
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')},
|
||||
)
|
||||
|
||||
|
@ -613,11 +608,11 @@ def fetch_resource(module, link, kind, allow_not_found=True):
|
|||
|
||||
|
||||
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):
|
||||
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):
|
||||
|
@ -687,7 +682,7 @@ def response_to_hash(module, response):
|
|||
def async_op_url(module, extra_data=None):
|
||||
if extra_data is None:
|
||||
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.update(module.params)
|
||||
return url.format(**combined)
|
||||
|
|
|
@ -33,7 +33,6 @@ module: gcp_compute_forwarding_rule_info
|
|||
description:
|
||||
- Gather info for GCP ForwardingRule
|
||||
short_description: Gather info for GCP ForwardingRule
|
||||
version_added: '2.7'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -46,6 +45,7 @@ options:
|
|||
- Each additional filter in the list will act be added as an AND condition (filter1
|
||||
and filter2) .
|
||||
type: list
|
||||
elements: str
|
||||
region:
|
||||
description:
|
||||
- A reference to the region where the regional forwarding rule resides.
|
||||
|
@ -83,6 +83,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- Specifies which Ansible environment you're running this module within.
|
||||
|
@ -288,7 +289,7 @@ resources:
|
|||
################################################################################
|
||||
# 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
|
||||
|
||||
################################################################################
|
||||
|
@ -307,7 +308,7 @@ def main():
|
|||
|
||||
|
||||
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):
|
||||
|
|
|
@ -34,7 +34,6 @@ description:
|
|||
- Represents a Global Address resource. Global addresses are used for HTTP(S) load
|
||||
balancing.
|
||||
short_description: Creates a GCP GlobalAddress
|
||||
version_added: '2.6'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -54,7 +53,6 @@ options:
|
|||
- The static external IP address represented by this resource.
|
||||
required: false
|
||||
type: str
|
||||
version_added: '2.8'
|
||||
description:
|
||||
description:
|
||||
- An optional description of this resource.
|
||||
|
@ -83,7 +81,6 @@ options:
|
|||
- This field is not applicable to addresses with addressType=EXTERNAL.
|
||||
required: false
|
||||
type: int
|
||||
version_added: '2.9'
|
||||
address_type:
|
||||
description:
|
||||
- The type of the address to reserve.
|
||||
|
@ -93,7 +90,6 @@ options:
|
|||
required: false
|
||||
default: EXTERNAL
|
||||
type: str
|
||||
version_added: '2.8'
|
||||
purpose:
|
||||
description:
|
||||
- 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"'
|
||||
required: false
|
||||
type: str
|
||||
version_added: '2.9'
|
||||
network:
|
||||
description:
|
||||
- The URL of the network in which to reserve the IP range. The IP range must be
|
||||
|
@ -115,7 +110,6 @@ options:
|
|||
}}"'
|
||||
required: false
|
||||
type: dict
|
||||
version_added: '2.9'
|
||||
project:
|
||||
description:
|
||||
- The Google Cloud Platform project to use.
|
||||
|
@ -147,6 +141,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- 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):
|
||||
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):
|
||||
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):
|
||||
|
@ -419,16 +414,16 @@ def response_to_hash(module, response):
|
|||
def region_selflink(name, params):
|
||||
if name is None:
|
||||
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):
|
||||
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
|
||||
|
||||
|
||||
def async_op_url(module, extra_data=None):
|
||||
if extra_data is None:
|
||||
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.update(module.params)
|
||||
return url.format(**combined)
|
||||
|
|
|
@ -33,7 +33,6 @@ module: gcp_compute_global_address_info
|
|||
description:
|
||||
- Gather info for GCP GlobalAddress
|
||||
short_description: Gather info for GCP GlobalAddress
|
||||
version_added: '2.7'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -46,6 +45,7 @@ options:
|
|||
- Each additional filter in the list will act be added as an AND condition (filter1
|
||||
and filter2) .
|
||||
type: list
|
||||
elements: str
|
||||
project:
|
||||
description:
|
||||
- The Google Cloud Platform project to use.
|
||||
|
@ -77,6 +77,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- Specifies which Ansible environment you're running this module within.
|
||||
|
@ -186,7 +187,7 @@ resources:
|
|||
################################################################################
|
||||
# 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
|
||||
|
||||
################################################################################
|
||||
|
@ -205,7 +206,7 @@ def main():
|
|||
|
||||
|
||||
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):
|
||||
|
|
|
@ -37,7 +37,6 @@ description:
|
|||
- For more information, see U(https://cloud.google.com/compute/docs/load-balancing/http/)
|
||||
.
|
||||
short_description: Creates a GCP GlobalForwardingRule
|
||||
version_added: '2.6'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -122,7 +121,6 @@ options:
|
|||
elements: dict
|
||||
required: false
|
||||
type: list
|
||||
version_added: '2.10'
|
||||
suboptions:
|
||||
filter_match_criteria:
|
||||
description:
|
||||
|
@ -231,6 +229,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- 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):
|
||||
auth = GcpSession(module, 'compute')
|
||||
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')},
|
||||
)
|
||||
|
||||
|
@ -601,11 +600,11 @@ def fetch_resource(module, link, kind, allow_not_found=True):
|
|||
|
||||
|
||||
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):
|
||||
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):
|
||||
|
@ -669,7 +668,7 @@ def response_to_hash(module, response):
|
|||
def async_op_url(module, extra_data=None):
|
||||
if extra_data is None:
|
||||
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.update(module.params)
|
||||
return url.format(**combined)
|
||||
|
|
|
@ -33,7 +33,6 @@ module: gcp_compute_global_forwarding_rule_info
|
|||
description:
|
||||
- Gather info for GCP GlobalForwardingRule
|
||||
short_description: Gather info for GCP GlobalForwardingRule
|
||||
version_added: '2.7'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -46,6 +45,7 @@ options:
|
|||
- Each additional filter in the list will act be added as an AND condition (filter1
|
||||
and filter2) .
|
||||
type: list
|
||||
elements: str
|
||||
project:
|
||||
description:
|
||||
- The Google Cloud Platform project to use.
|
||||
|
@ -77,6 +77,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- Specifies which Ansible environment you're running this module within.
|
||||
|
@ -265,7 +266,7 @@ resources:
|
|||
################################################################################
|
||||
# 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
|
||||
|
||||
################################################################################
|
||||
|
@ -284,7 +285,7 @@ def main():
|
|||
|
||||
|
||||
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):
|
||||
|
|
|
@ -41,7 +41,6 @@ description:
|
|||
successfully to some number of consecutive probes, it is marked healthy again and
|
||||
can receive new connections.
|
||||
short_description: Creates a GCP HealthCheck
|
||||
version_added: '2.6'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -171,7 +170,6 @@ options:
|
|||
- 'Some valid choices include: "USE_FIXED_PORT", "USE_NAMED_PORT", "USE_SERVING_PORT"'
|
||||
required: false
|
||||
type: str
|
||||
version_added: '2.9'
|
||||
https_health_check:
|
||||
description:
|
||||
- A nested object resource.
|
||||
|
@ -233,7 +231,6 @@ options:
|
|||
- 'Some valid choices include: "USE_FIXED_PORT", "USE_NAMED_PORT", "USE_SERVING_PORT"'
|
||||
required: false
|
||||
type: str
|
||||
version_added: '2.9'
|
||||
tcp_health_check:
|
||||
description:
|
||||
- A nested object resource.
|
||||
|
@ -288,7 +285,6 @@ options:
|
|||
- 'Some valid choices include: "USE_FIXED_PORT", "USE_NAMED_PORT", "USE_SERVING_PORT"'
|
||||
required: false
|
||||
type: str
|
||||
version_added: '2.9'
|
||||
ssl_health_check:
|
||||
description:
|
||||
- A nested object resource.
|
||||
|
@ -343,13 +339,11 @@ options:
|
|||
- 'Some valid choices include: "USE_FIXED_PORT", "USE_NAMED_PORT", "USE_SERVING_PORT"'
|
||||
required: false
|
||||
type: str
|
||||
version_added: '2.9'
|
||||
http2_health_check:
|
||||
description:
|
||||
- A nested object resource.
|
||||
required: false
|
||||
type: dict
|
||||
version_added: '2.10'
|
||||
suboptions:
|
||||
host:
|
||||
description:
|
||||
|
@ -406,6 +400,49 @@ options:
|
|||
- 'Some valid choices include: "USE_FIXED_PORT", "USE_NAMED_PORT", "USE_SERVING_PORT"'
|
||||
required: false
|
||||
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:
|
||||
description:
|
||||
- The Google Cloud Platform project to use.
|
||||
|
@ -437,6 +474,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- Specifies which Ansible environment you're running this module within.
|
||||
|
@ -797,6 +835,47 @@ http2HealthCheck:
|
|||
and `portName` fields.
|
||||
returned: success
|
||||
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'),
|
||||
),
|
||||
),
|
||||
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'sslHealthCheck': HealthCheckSslhealthcheck(module.params.get('ssl_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 = {}
|
||||
for k, v in request.items():
|
||||
|
@ -969,11 +1053,11 @@ def fetch_resource(module, link, kind, allow_not_found=True):
|
|||
|
||||
|
||||
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):
|
||||
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):
|
||||
|
@ -1033,13 +1117,14 @@ def response_to_hash(module, response):
|
|||
u'tcpHealthCheck': HealthCheckTcphealthcheck(response.get(u'tcpHealthCheck', {}), module).from_response(),
|
||||
u'sslHealthCheck': HealthCheckSslhealthcheck(response.get(u'sslHealthCheck', {}), 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):
|
||||
if extra_data is None:
|
||||
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.update(module.params)
|
||||
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__':
|
||||
main()
|
||||
|
|
|
@ -33,7 +33,6 @@ module: gcp_compute_health_check_info
|
|||
description:
|
||||
- Gather info for GCP HealthCheck
|
||||
short_description: Gather info for GCP HealthCheck
|
||||
version_added: '2.7'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -46,6 +45,7 @@ options:
|
|||
- Each additional filter in the list will act be added as an AND condition (filter1
|
||||
and filter2) .
|
||||
type: list
|
||||
elements: str
|
||||
project:
|
||||
description:
|
||||
- The Google Cloud Platform project to use.
|
||||
|
@ -77,6 +77,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- Specifies which Ansible environment you're running this module within.
|
||||
|
@ -450,12 +451,55 @@ resources:
|
|||
and `portName` fields.
|
||||
returned: success
|
||||
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
|
||||
################################################################################
|
||||
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
|
||||
|
||||
################################################################################
|
||||
|
@ -474,7 +518,7 @@ def main():
|
|||
|
||||
|
||||
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):
|
||||
|
|
|
@ -34,7 +34,6 @@ description:
|
|||
- An HttpHealthCheck resource. This resource defines a template for how individual
|
||||
VMs should be checked for health, via HTTP.
|
||||
short_description: Creates a GCP HttpHealthCheck
|
||||
version_added: '2.6'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -144,6 +143,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- 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):
|
||||
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):
|
||||
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):
|
||||
|
@ -422,7 +422,7 @@ def response_to_hash(module, response):
|
|||
def async_op_url(module, extra_data=None):
|
||||
if extra_data is None:
|
||||
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.update(module.params)
|
||||
return url.format(**combined)
|
||||
|
|
|
@ -33,7 +33,6 @@ module: gcp_compute_http_health_check_info
|
|||
description:
|
||||
- Gather info for GCP HttpHealthCheck
|
||||
short_description: Gather info for GCP HttpHealthCheck
|
||||
version_added: '2.7'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -46,6 +45,7 @@ options:
|
|||
- Each additional filter in the list will act be added as an AND condition (filter1
|
||||
and filter2) .
|
||||
type: list
|
||||
elements: str
|
||||
project:
|
||||
description:
|
||||
- The Google Cloud Platform project to use.
|
||||
|
@ -77,6 +77,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- Specifies which Ansible environment you're running this module within.
|
||||
|
@ -187,7 +188,7 @@ resources:
|
|||
################################################################################
|
||||
# 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
|
||||
|
||||
################################################################################
|
||||
|
@ -206,7 +207,7 @@ def main():
|
|||
|
||||
|
||||
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):
|
||||
|
|
|
@ -34,7 +34,6 @@ description:
|
|||
- An HttpsHealthCheck resource. This resource defines a template for how individual
|
||||
VMs should be checked for health, via HTTPS.
|
||||
short_description: Creates a GCP HttpsHealthCheck
|
||||
version_added: '2.6'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -141,6 +140,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- 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):
|
||||
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):
|
||||
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):
|
||||
|
@ -419,7 +419,7 @@ def response_to_hash(module, response):
|
|||
def async_op_url(module, extra_data=None):
|
||||
if extra_data is None:
|
||||
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.update(module.params)
|
||||
return url.format(**combined)
|
||||
|
|
|
@ -33,7 +33,6 @@ module: gcp_compute_https_health_check_info
|
|||
description:
|
||||
- Gather info for GCP HttpsHealthCheck
|
||||
short_description: Gather info for GCP HttpsHealthCheck
|
||||
version_added: '2.7'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -46,6 +45,7 @@ options:
|
|||
- Each additional filter in the list will act be added as an AND condition (filter1
|
||||
and filter2) .
|
||||
type: list
|
||||
elements: str
|
||||
project:
|
||||
description:
|
||||
- The Google Cloud Platform project to use.
|
||||
|
@ -77,6 +77,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- Specifies which Ansible environment you're running this module within.
|
||||
|
@ -187,7 +188,7 @@ resources:
|
|||
################################################################################
|
||||
# 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
|
||||
|
||||
################################################################################
|
||||
|
@ -206,7 +207,7 @@ def main():
|
|||
|
||||
|
||||
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):
|
||||
|
|
|
@ -43,7 +43,6 @@ description:
|
|||
You can create a custom image from root persistent disks and other images. Then,
|
||||
use the custom image to create an instance.
|
||||
short_description: Creates a GCP Image
|
||||
version_added: '2.6'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -88,8 +87,8 @@ options:
|
|||
type:
|
||||
description:
|
||||
- The type of supported feature.
|
||||
- 'Some valid choices include: "MULTI_IP_SUBNET", "SECURE_BOOT", "UEFI_COMPATIBLE",
|
||||
"VIRTIO_SCSI_MULTIQUEUE", "WINDOWS"'
|
||||
- 'Some valid choices include: "MULTI_IP_SUBNET", "SECURE_BOOT", "SEV_CAPABLE",
|
||||
"UEFI_COMPATIBLE", "VIRTIO_SCSI_MULTIQUEUE", "WINDOWS"'
|
||||
required: true
|
||||
type: str
|
||||
image_encryption_key:
|
||||
|
@ -111,7 +110,6 @@ options:
|
|||
- Labels to apply to this Image.
|
||||
required: false
|
||||
type: dict
|
||||
version_added: '2.8'
|
||||
licenses:
|
||||
description:
|
||||
- Any applicable license URI.
|
||||
|
@ -186,6 +184,31 @@ options:
|
|||
of a given disk name.
|
||||
required: false
|
||||
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:
|
||||
description:
|
||||
- The type of the image used to create this disk. The default and only value is
|
||||
|
@ -224,6 +247,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- Specifies which Ansible environment you're running this module within.
|
||||
|
@ -460,6 +484,21 @@ sourceDiskId:
|
|||
of a given disk name.
|
||||
returned: success
|
||||
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:
|
||||
description:
|
||||
- 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_encryption_key=dict(type='dict', options=dict(raw_key=dict(type='str'))),
|
||||
source_disk_id=dict(type='str'),
|
||||
source_image=dict(type='dict'),
|
||||
source_snapshot=dict(type='dict'),
|
||||
source_type=dict(type='str'),
|
||||
)
|
||||
)
|
||||
|
@ -560,7 +601,7 @@ def update_fields(module, request, response):
|
|||
def labels_update(module, request, response):
|
||||
auth = GcpSession(module, 'compute')
|
||||
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')},
|
||||
)
|
||||
|
||||
|
@ -585,6 +626,8 @@ def resource_to_request(module):
|
|||
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'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'),
|
||||
}
|
||||
return_vals = {}
|
||||
|
@ -601,11 +644,11 @@ def fetch_resource(module, link, kind, allow_not_found=True):
|
|||
|
||||
|
||||
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):
|
||||
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):
|
||||
|
@ -668,6 +711,8 @@ def response_to_hash(module, response):
|
|||
u'sourceDisk': response.get(u'sourceDisk'),
|
||||
u'sourceDiskEncryptionKey': ImageSourcediskencryptionkey(response.get(u'sourceDiskEncryptionKey', {}), module).from_response(),
|
||||
u'sourceDiskId': response.get(u'sourceDiskId'),
|
||||
u'sourceImage': response.get(u'sourceImage'),
|
||||
u'sourceSnapshot': response.get(u'sourceSnapshot'),
|
||||
u'sourceType': response.get(u'sourceType'),
|
||||
}
|
||||
|
||||
|
@ -675,16 +720,16 @@ def response_to_hash(module, response):
|
|||
def license_selflink(name, params):
|
||||
if name is None:
|
||||
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):
|
||||
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
|
||||
|
||||
|
||||
def async_op_url(module, extra_data=None):
|
||||
if extra_data is None:
|
||||
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.update(module.params)
|
||||
return url.format(**combined)
|
||||
|
|
|
@ -33,7 +33,6 @@ module: gcp_compute_image_info
|
|||
description:
|
||||
- Gather info for GCP Image
|
||||
short_description: Gather info for GCP Image
|
||||
version_added: '2.7'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -46,6 +45,7 @@ options:
|
|||
- Each additional filter in the list will act be added as an AND condition (filter1
|
||||
and filter2) .
|
||||
type: list
|
||||
elements: str
|
||||
project:
|
||||
description:
|
||||
- The Google Cloud Platform project to use.
|
||||
|
@ -77,6 +77,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- Specifies which Ansible environment you're running this module within.
|
||||
|
@ -307,6 +308,21 @@ resources:
|
|||
of a given disk name.
|
||||
returned: success
|
||||
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:
|
||||
description:
|
||||
- The type of the image used to create this disk. The default and only value
|
||||
|
@ -318,7 +334,7 @@ resources:
|
|||
################################################################################
|
||||
# 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
|
||||
|
||||
################################################################################
|
||||
|
@ -337,7 +353,7 @@ def main():
|
|||
|
||||
|
||||
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):
|
||||
|
|
|
@ -33,7 +33,6 @@ module: gcp_compute_instance
|
|||
description:
|
||||
- An instance is a virtual machine (VM) hosted on Google's infrastructure.
|
||||
short_description: Creates a GCP Instance
|
||||
version_added: '2.6'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -62,7 +61,6 @@ options:
|
|||
- Whether the resource should be protected against deletion.
|
||||
required: false
|
||||
type: bool
|
||||
version_added: '2.9'
|
||||
disks:
|
||||
description:
|
||||
- An array of disks that are associated with the instances that are created from
|
||||
|
@ -233,13 +231,11 @@ options:
|
|||
when using zonal DNS.
|
||||
required: false
|
||||
type: str
|
||||
version_added: '2.9'
|
||||
labels:
|
||||
description:
|
||||
- Labels to apply to this instance. A list of key->value pairs.
|
||||
required: false
|
||||
type: dict
|
||||
version_added: '2.9'
|
||||
metadata:
|
||||
description:
|
||||
- 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.
|
||||
required: false
|
||||
type: bool
|
||||
version_added: '2.10'
|
||||
public_ptr_domain_name:
|
||||
description:
|
||||
- The DNS domain name for the public PTR record. You can set this field
|
||||
only if the setPublicPtr field is enabled.
|
||||
required: false
|
||||
type: str
|
||||
version_added: '2.10'
|
||||
network_tier:
|
||||
description:
|
||||
- This signifies the networking tier used for configuring this access
|
||||
|
@ -338,7 +332,6 @@ options:
|
|||
- 'Some valid choices include: "PREMIUM", "STANDARD"'
|
||||
required: false
|
||||
type: str
|
||||
version_added: '2.10'
|
||||
alias_ip_ranges:
|
||||
description:
|
||||
- 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.
|
||||
required: false
|
||||
type: dict
|
||||
version_added: '2.9'
|
||||
suboptions:
|
||||
enable_secure_boot:
|
||||
description:
|
||||
|
@ -475,7 +467,6 @@ options:
|
|||
"SUSPENDING", "SUSPENDED", "TERMINATED"'
|
||||
required: false
|
||||
type: str
|
||||
version_added: '2.8'
|
||||
tags:
|
||||
description:
|
||||
- A list of tags to apply to this instance. Tags are used to identify valid sources
|
||||
|
@ -537,6 +528,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- 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):
|
||||
auth = GcpSession(module, 'compute')
|
||||
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')},
|
||||
)
|
||||
|
||||
|
@ -1225,7 +1217,7 @@ def label_fingerprint_update(module, request, response):
|
|||
def machine_type_update(module, request, response):
|
||||
auth = GcpSession(module, 'compute')
|
||||
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)},
|
||||
)
|
||||
|
||||
|
@ -1270,11 +1262,11 @@ def fetch_resource(module, link, kind, allow_not_found=True):
|
|||
|
||||
|
||||
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):
|
||||
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):
|
||||
|
@ -1350,25 +1342,25 @@ def response_to_hash(module, response):
|
|||
def disk_type_selflink(name, params):
|
||||
if name is None:
|
||||
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):
|
||||
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
|
||||
|
||||
|
||||
def machine_type_selflink(name, params):
|
||||
if name is None:
|
||||
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):
|
||||
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
|
||||
|
||||
|
||||
def async_op_url(module, extra_data=None):
|
||||
if extra_data is None:
|
||||
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.update(module.params)
|
||||
return url.format(**combined)
|
||||
|
|
|
@ -36,7 +36,6 @@ description:
|
|||
template. Unlike managed instance groups, you must create and add instances to an
|
||||
instance group manually.
|
||||
short_description: Creates a GCP InstanceGroup
|
||||
version_added: '2.6'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -126,7 +125,6 @@ options:
|
|||
elements: dict
|
||||
required: false
|
||||
type: list
|
||||
version_added: '2.8'
|
||||
project:
|
||||
description:
|
||||
- The Google Cloud Platform project to use.
|
||||
|
@ -158,6 +156,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- 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):
|
||||
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):
|
||||
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):
|
||||
|
@ -442,16 +441,16 @@ def response_to_hash(module, response):
|
|||
def region_selflink(name, params):
|
||||
if name is None:
|
||||
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):
|
||||
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
|
||||
|
||||
|
||||
def async_op_url(module, extra_data=None):
|
||||
if extra_data is None:
|
||||
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.update(module.params)
|
||||
return url.format(**combined)
|
||||
|
|
|
@ -33,7 +33,6 @@ module: gcp_compute_instance_group_info
|
|||
description:
|
||||
- Gather info for GCP InstanceGroup
|
||||
short_description: Gather info for GCP InstanceGroup
|
||||
version_added: '2.7'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -46,6 +45,7 @@ options:
|
|||
- Each additional filter in the list will act be added as an AND condition (filter1
|
||||
and filter2) .
|
||||
type: list
|
||||
elements: str
|
||||
zone:
|
||||
description:
|
||||
- A reference to the zone where the instance group resides.
|
||||
|
@ -82,6 +82,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- Specifies which Ansible environment you're running this module within.
|
||||
|
@ -196,7 +197,7 @@ resources:
|
|||
################################################################################
|
||||
# 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
|
||||
|
||||
################################################################################
|
||||
|
@ -215,7 +216,7 @@ def main():
|
|||
|
||||
|
||||
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):
|
||||
|
|
|
@ -38,7 +38,6 @@ description:
|
|||
must separately verify the status of the individual instances.
|
||||
- A managed instance group can have up to 1000 VM instances per group.
|
||||
short_description: Creates a GCP InstanceGroupManager
|
||||
version_added: '2.6'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -155,6 +154,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- 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):
|
||||
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):
|
||||
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):
|
||||
|
@ -543,16 +543,16 @@ def response_to_hash(module, response):
|
|||
def region_selflink(name, params):
|
||||
if name is None:
|
||||
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):
|
||||
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
|
||||
|
||||
|
||||
def async_op_url(module, extra_data=None):
|
||||
if extra_data is None:
|
||||
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.update(module.params)
|
||||
return url.format(**combined)
|
||||
|
|
|
@ -33,7 +33,6 @@ module: gcp_compute_instance_group_manager_info
|
|||
description:
|
||||
- Gather info for GCP InstanceGroupManager
|
||||
short_description: Gather info for GCP InstanceGroupManager
|
||||
version_added: '2.7'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -46,6 +45,7 @@ options:
|
|||
- Each additional filter in the list will act be added as an AND condition (filter1
|
||||
and filter2) .
|
||||
type: list
|
||||
elements: str
|
||||
zone:
|
||||
description:
|
||||
- The zone the managed instance group resides.
|
||||
|
@ -82,6 +82,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- Specifies which Ansible environment you're running this module within.
|
||||
|
@ -271,7 +272,7 @@ resources:
|
|||
################################################################################
|
||||
# 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
|
||||
|
||||
################################################################################
|
||||
|
@ -290,7 +291,7 @@ def main():
|
|||
|
||||
|
||||
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):
|
||||
|
|
|
@ -33,7 +33,6 @@ module: gcp_compute_instance_info
|
|||
description:
|
||||
- Gather info for GCP Instance
|
||||
short_description: Gather info for GCP Instance
|
||||
version_added: '2.7'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -46,6 +45,7 @@ options:
|
|||
- Each additional filter in the list will act be added as an AND condition (filter1
|
||||
and filter2) .
|
||||
type: list
|
||||
elements: str
|
||||
zone:
|
||||
description:
|
||||
- A reference to the zone where the machine resides.
|
||||
|
@ -82,6 +82,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- Specifies which Ansible environment you're running this module within.
|
||||
|
@ -580,7 +581,7 @@ resources:
|
|||
################################################################################
|
||||
# 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
|
||||
|
||||
################################################################################
|
||||
|
@ -599,7 +600,7 @@ def main():
|
|||
|
||||
|
||||
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):
|
||||
|
|
|
@ -39,7 +39,6 @@ description:
|
|||
- 'Tip: Disks should be set to autoDelete=true so that leftover disks are not left
|
||||
behind on machine deletion.'
|
||||
short_description: Creates a GCP InstanceTemplate
|
||||
version_added: '2.6'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -236,7 +235,6 @@ options:
|
|||
- Labels to apply to this address. A list of key->value pairs.
|
||||
required: false
|
||||
type: dict
|
||||
version_added: '2.9'
|
||||
machine_type:
|
||||
description:
|
||||
- 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.
|
||||
required: false
|
||||
type: bool
|
||||
version_added: '2.10'
|
||||
public_ptr_domain_name:
|
||||
description:
|
||||
- The DNS domain name for the public PTR record. You can set this
|
||||
field only if the setPublicPtr field is enabled.
|
||||
required: false
|
||||
type: str
|
||||
version_added: '2.10'
|
||||
network_tier:
|
||||
description:
|
||||
- This signifies the networking tier used for configuring this access
|
||||
|
@ -345,7 +341,6 @@ options:
|
|||
- 'Some valid choices include: "PREMIUM", "STANDARD"'
|
||||
required: false
|
||||
type: str
|
||||
version_added: '2.10'
|
||||
alias_ip_ranges:
|
||||
description:
|
||||
- An array of alias IP ranges for this network interface. Can only be
|
||||
|
@ -508,6 +503,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- 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):
|
||||
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):
|
||||
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):
|
||||
|
@ -1207,16 +1203,16 @@ def response_to_hash(module, response):
|
|||
def disk_type_selflink(name, params):
|
||||
if name is None:
|
||||
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):
|
||||
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
|
||||
|
||||
|
||||
def async_op_url(module, extra_data=None):
|
||||
if extra_data is None:
|
||||
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.update(module.params)
|
||||
return url.format(**combined)
|
||||
|
|
|
@ -33,7 +33,6 @@ module: gcp_compute_instance_template_info
|
|||
description:
|
||||
- Gather info for GCP InstanceTemplate
|
||||
short_description: Gather info for GCP InstanceTemplate
|
||||
version_added: '2.7'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -46,6 +45,7 @@ options:
|
|||
- Each additional filter in the list will act be added as an AND condition (filter1
|
||||
and filter2) .
|
||||
type: list
|
||||
elements: str
|
||||
project:
|
||||
description:
|
||||
- The Google Cloud Platform project to use.
|
||||
|
@ -77,6 +77,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- Specifies which Ansible environment you're running this module within.
|
||||
|
@ -543,7 +544,7 @@ resources:
|
|||
################################################################################
|
||||
# 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
|
||||
|
||||
################################################################################
|
||||
|
@ -562,7 +563,7 @@ def main():
|
|||
|
||||
|
||||
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):
|
||||
|
|
|
@ -34,7 +34,6 @@ description:
|
|||
- Represents an InterconnectAttachment (VLAN attachment) resource. For more information,
|
||||
see Creating VLAN Attachments.
|
||||
short_description: Creates a GCP InterconnectAttachment
|
||||
version_added: '2.8'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -56,7 +55,6 @@ options:
|
|||
required: false
|
||||
default: 'true'
|
||||
type: bool
|
||||
version_added: '2.9'
|
||||
interconnect:
|
||||
description:
|
||||
- URL of the underlying Interconnect object that this attachment's traffic will
|
||||
|
@ -82,7 +80,6 @@ options:
|
|||
"BPS_50G"'
|
||||
required: false
|
||||
type: str
|
||||
version_added: '2.9'
|
||||
edge_availability_domain:
|
||||
description:
|
||||
- Desired availability domain for the attachment. Only available for type PARTNER,
|
||||
|
@ -176,6 +173,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- 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):
|
||||
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):
|
||||
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):
|
||||
|
@ -533,16 +531,16 @@ def response_to_hash(module, response):
|
|||
def region_selflink(name, params):
|
||||
if name is None:
|
||||
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):
|
||||
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
|
||||
|
||||
|
||||
def async_op_url(module, extra_data=None):
|
||||
if extra_data is None:
|
||||
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.update(module.params)
|
||||
return url.format(**combined)
|
||||
|
|
|
@ -33,7 +33,6 @@ module: gcp_compute_interconnect_attachment_info
|
|||
description:
|
||||
- Gather info for GCP InterconnectAttachment
|
||||
short_description: Gather info for GCP InterconnectAttachment
|
||||
version_added: '2.8'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -46,6 +45,7 @@ options:
|
|||
- Each additional filter in the list will act be added as an AND condition (filter1
|
||||
and filter2) .
|
||||
type: list
|
||||
elements: str
|
||||
region:
|
||||
description:
|
||||
- Region where the regional interconnect attachment resides.
|
||||
|
@ -82,6 +82,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- Specifies which Ansible environment you're running this module within.
|
||||
|
@ -267,7 +268,7 @@ resources:
|
|||
################################################################################
|
||||
# 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
|
||||
|
||||
################################################################################
|
||||
|
@ -286,7 +287,7 @@ def main():
|
|||
|
||||
|
||||
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):
|
||||
|
|
|
@ -33,7 +33,6 @@ module: gcp_compute_network
|
|||
description:
|
||||
- Manages a VPC network or legacy network resource on GCP.
|
||||
short_description: Creates a GCP Network
|
||||
version_added: '2.6'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -79,7 +78,6 @@ options:
|
|||
to determine what type of network-wide routing behavior to enforce.
|
||||
required: false
|
||||
type: dict
|
||||
version_added: '2.8'
|
||||
suboptions:
|
||||
routing_mode:
|
||||
description:
|
||||
|
@ -122,6 +120,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- 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):
|
||||
auth = GcpSession(module, 'compute')
|
||||
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()},
|
||||
)
|
||||
|
||||
|
@ -332,11 +331,11 @@ def fetch_resource(module, link, kind, allow_not_found=True):
|
|||
|
||||
|
||||
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):
|
||||
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):
|
||||
|
@ -396,7 +395,7 @@ def response_to_hash(module, response):
|
|||
def async_op_url(module, extra_data=None):
|
||||
if extra_data is None:
|
||||
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.update(module.params)
|
||||
return url.format(**combined)
|
||||
|
|
|
@ -40,7 +40,6 @@ description:
|
|||
you can distribute traffic in a granular fashion among applications or containers
|
||||
running within VM instances.
|
||||
short_description: Creates a GCP NetworkEndpointGroup
|
||||
version_added: '2.10'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -140,6 +139,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- 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):
|
||||
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):
|
||||
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):
|
||||
|
@ -415,7 +415,7 @@ def response_to_hash(module, response):
|
|||
def async_op_url(module, extra_data=None):
|
||||
if extra_data is None:
|
||||
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.update(module.params)
|
||||
return url.format(**combined)
|
||||
|
|
|
@ -33,7 +33,6 @@ module: gcp_compute_network_endpoint_group_info
|
|||
description:
|
||||
- Gather info for GCP NetworkEndpointGroup
|
||||
short_description: Gather info for GCP NetworkEndpointGroup
|
||||
version_added: '2.10'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -46,6 +45,7 @@ options:
|
|||
- Each additional filter in the list will act be added as an AND condition (filter1
|
||||
and filter2) .
|
||||
type: list
|
||||
elements: str
|
||||
zone:
|
||||
description:
|
||||
- Zone where the network endpoint group is located.
|
||||
|
@ -82,6 +82,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- Specifies which Ansible environment you're running this module within.
|
||||
|
@ -175,7 +176,7 @@ resources:
|
|||
################################################################################
|
||||
# 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
|
||||
|
||||
################################################################################
|
||||
|
@ -194,7 +195,7 @@ def main():
|
|||
|
||||
|
||||
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):
|
||||
|
|
|
@ -33,7 +33,6 @@ module: gcp_compute_network_info
|
|||
description:
|
||||
- Gather info for GCP Network
|
||||
short_description: Gather info for GCP Network
|
||||
version_added: '2.7'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -46,6 +45,7 @@ options:
|
|||
- Each additional filter in the list will act be added as an AND condition (filter1
|
||||
and filter2) .
|
||||
type: list
|
||||
elements: str
|
||||
project:
|
||||
description:
|
||||
- The Google Cloud Platform project to use.
|
||||
|
@ -77,6 +77,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- Specifies which Ansible environment you're running this module within.
|
||||
|
@ -179,7 +180,7 @@ resources:
|
|||
################################################################################
|
||||
# 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
|
||||
|
||||
################################################################################
|
||||
|
@ -198,7 +199,7 @@ def main():
|
|||
|
||||
|
||||
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):
|
||||
|
|
|
@ -33,7 +33,6 @@ module: gcp_compute_node_group
|
|||
description:
|
||||
- Represents a NodeGroup resource to manage a group of sole-tenant nodes.
|
||||
short_description: Creates a GCP NodeGroup
|
||||
version_added: '2.10'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -109,6 +108,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- 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):
|
||||
auth = GcpSession(module, 'compute')
|
||||
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')},
|
||||
)
|
||||
|
||||
|
@ -297,15 +297,15 @@ def fetch_resource(module, link, kind, allow_not_found=True):
|
|||
|
||||
|
||||
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):
|
||||
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):
|
||||
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):
|
||||
|
@ -362,25 +362,25 @@ def response_to_hash(module, response):
|
|||
def region_selflink(name, params):
|
||||
if name is None:
|
||||
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):
|
||||
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
|
||||
|
||||
|
||||
def zone_selflink(name, params):
|
||||
if name is None:
|
||||
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):
|
||||
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
|
||||
|
||||
|
||||
def async_op_url(module, extra_data=None):
|
||||
if extra_data is None:
|
||||
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.update(module.params)
|
||||
return url.format(**combined)
|
||||
|
|
|
@ -33,7 +33,6 @@ module: gcp_compute_node_group_info
|
|||
description:
|
||||
- Gather info for GCP NodeGroup
|
||||
short_description: Gather info for GCP NodeGroup
|
||||
version_added: '2.10'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -46,6 +45,7 @@ options:
|
|||
- Each additional filter in the list will act be added as an AND condition (filter1
|
||||
and filter2) .
|
||||
type: list
|
||||
elements: str
|
||||
zone:
|
||||
description:
|
||||
- Zone where this node group is located .
|
||||
|
@ -82,6 +82,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- Specifies which Ansible environment you're running this module within.
|
||||
|
@ -153,7 +154,7 @@ resources:
|
|||
################################################################################
|
||||
# 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
|
||||
|
||||
################################################################################
|
||||
|
@ -172,7 +173,7 @@ def main():
|
|||
|
||||
|
||||
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):
|
||||
|
|
|
@ -35,7 +35,6 @@ description:
|
|||
sole-tenant nodes, such as node type, vCPU and memory requirements, node affinity
|
||||
labels, and region.
|
||||
short_description: Creates a GCP NodeTemplate
|
||||
version_added: '2.10'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -125,6 +124,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- 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):
|
||||
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):
|
||||
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):
|
||||
|
@ -383,16 +383,16 @@ def response_to_hash(module, response):
|
|||
def region_selflink(name, params):
|
||||
if name is None:
|
||||
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):
|
||||
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
|
||||
|
||||
|
||||
def async_op_url(module, extra_data=None):
|
||||
if extra_data is None:
|
||||
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.update(module.params)
|
||||
return url.format(**combined)
|
||||
|
|
|
@ -33,7 +33,6 @@ module: gcp_compute_node_template_info
|
|||
description:
|
||||
- Gather info for GCP NodeTemplate
|
||||
short_description: Gather info for GCP NodeTemplate
|
||||
version_added: '2.10'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -46,6 +45,7 @@ options:
|
|||
- Each additional filter in the list will act be added as an AND condition (filter1
|
||||
and filter2) .
|
||||
type: list
|
||||
elements: str
|
||||
region:
|
||||
description:
|
||||
- Region where nodes using the node template will be created .
|
||||
|
@ -82,6 +82,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- Specifies which Ansible environment you're running this module within.
|
||||
|
@ -177,7 +178,7 @@ resources:
|
|||
################################################################################
|
||||
# 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
|
||||
|
||||
################################################################################
|
||||
|
@ -196,7 +197,7 @@ def main():
|
|||
|
||||
|
||||
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):
|
||||
|
|
|
@ -35,7 +35,6 @@ description:
|
|||
- Autoscalers allow you to automatically scale virtual machine instances in managed
|
||||
instance groups according to an autoscaling policy that you define.
|
||||
short_description: Creates a GCP RegionAutoscaler
|
||||
version_added: '2.10'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -213,6 +212,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- 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):
|
||||
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):
|
||||
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):
|
||||
|
@ -625,7 +625,7 @@ def response_to_hash(module, response):
|
|||
def async_op_url(module, extra_data=None):
|
||||
if extra_data is None:
|
||||
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.update(module.params)
|
||||
return url.format(**combined)
|
||||
|
|
|
@ -33,7 +33,6 @@ module: gcp_compute_region_autoscaler_info
|
|||
description:
|
||||
- Gather info for GCP RegionAutoscaler
|
||||
short_description: Gather info for GCP RegionAutoscaler
|
||||
version_added: '2.10'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -46,6 +45,7 @@ options:
|
|||
- Each additional filter in the list will act be added as an AND condition (filter1
|
||||
and filter2) .
|
||||
type: list
|
||||
elements: str
|
||||
region:
|
||||
description:
|
||||
- URL of the region where the instance group resides.
|
||||
|
@ -82,6 +82,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- Specifies which Ansible environment you're running this module within.
|
||||
|
@ -261,7 +262,7 @@ resources:
|
|||
################################################################################
|
||||
# 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
|
||||
|
||||
################################################################################
|
||||
|
@ -280,7 +281,7 @@ def main():
|
|||
|
||||
|
||||
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):
|
||||
|
|
|
@ -34,7 +34,6 @@ description:
|
|||
- A Region Backend Service defines a regionally-scoped group of virtual machines that
|
||||
will serve traffic for load balancing.
|
||||
short_description: Creates a GCP RegionBackendService
|
||||
version_added: '2.10'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -339,9 +338,11 @@ options:
|
|||
health_checks:
|
||||
description:
|
||||
- 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
|
||||
required: true
|
||||
required: false
|
||||
type: list
|
||||
load_balancing_scheme:
|
||||
description:
|
||||
|
@ -529,7 +530,8 @@ options:
|
|||
- The protocol this RegionBackendService uses to communicate with backends.
|
||||
- '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.'
|
||||
- 'Some valid choices include: "HTTP", "HTTPS", "HTTP2", "SSL", "TCP", "UDP"'
|
||||
- 'Some valid choices include: "HTTP", "HTTPS", "HTTP2", "SSL", "TCP", "UDP",
|
||||
"GRPC"'
|
||||
required: false
|
||||
type: str
|
||||
session_affinity:
|
||||
|
@ -616,6 +618,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- Specifies which Ansible environment you're running this module within.
|
||||
|
@ -959,7 +962,8 @@ fingerprint:
|
|||
healthChecks:
|
||||
description:
|
||||
- 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
|
||||
type: list
|
||||
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')
|
||||
),
|
||||
),
|
||||
health_checks=dict(required=True, type='list', elements='str'),
|
||||
health_checks=dict(type='list', elements='str'),
|
||||
load_balancing_scheme=dict(default='INTERNAL', type='str'),
|
||||
locality_lb_policy=dict(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):
|
||||
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):
|
||||
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):
|
||||
|
@ -1456,7 +1460,7 @@ def response_to_hash(module, response):
|
|||
def async_op_url(module, extra_data=None):
|
||||
if extra_data is None:
|
||||
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.update(module.params)
|
||||
return url.format(**combined)
|
||||
|
|
|
@ -33,7 +33,6 @@ module: gcp_compute_region_backend_service_info
|
|||
description:
|
||||
- Gather info for GCP RegionBackendService
|
||||
short_description: Gather info for GCP RegionBackendService
|
||||
version_added: '2.10'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -46,6 +45,7 @@ options:
|
|||
- Each additional filter in the list will act be added as an AND condition (filter1
|
||||
and filter2) .
|
||||
type: list
|
||||
elements: str
|
||||
region:
|
||||
description:
|
||||
- A reference to the region where the regional backend service resides.
|
||||
|
@ -82,6 +82,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- Specifies which Ansible environment you're running this module within.
|
||||
|
@ -415,8 +416,9 @@ resources:
|
|||
healthChecks:
|
||||
description:
|
||||
- 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
|
||||
type: list
|
||||
id:
|
||||
|
@ -655,7 +657,7 @@ resources:
|
|||
################################################################################
|
||||
# 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
|
||||
|
||||
################################################################################
|
||||
|
@ -674,7 +676,7 @@ def main():
|
|||
|
||||
|
||||
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):
|
||||
|
|
|
@ -43,7 +43,6 @@ description:
|
|||
- Add a persistent disk to your instance when you need reliable and affordable storage
|
||||
with consistent performance characteristics.
|
||||
short_description: Creates a GCP RegionDisk
|
||||
version_added: '2.8'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -195,6 +194,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- 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):
|
||||
auth = GcpSession(module, 'compute')
|
||||
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')},
|
||||
)
|
||||
|
||||
|
@ -489,7 +489,7 @@ def label_fingerprint_update(module, request, response):
|
|||
def size_gb_update(module, request, response):
|
||||
auth = GcpSession(module, 'compute')
|
||||
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')},
|
||||
)
|
||||
|
||||
|
@ -527,11 +527,11 @@ def fetch_resource(module, link, kind, allow_not_found=True):
|
|||
|
||||
|
||||
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):
|
||||
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):
|
||||
|
@ -597,25 +597,25 @@ def response_to_hash(module, response):
|
|||
def zone_selflink(name, params):
|
||||
if name is None:
|
||||
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):
|
||||
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
|
||||
|
||||
|
||||
def region_disk_type_selflink(name, params):
|
||||
if name is None:
|
||||
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):
|
||||
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
|
||||
|
||||
|
||||
def async_op_url(module, extra_data=None):
|
||||
if extra_data is None:
|
||||
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.update(module.params)
|
||||
return url.format(**combined)
|
||||
|
|
|
@ -33,7 +33,6 @@ module: gcp_compute_region_disk_info
|
|||
description:
|
||||
- Gather info for GCP RegionDisk
|
||||
short_description: Gather info for GCP RegionDisk
|
||||
version_added: '2.8'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -46,6 +45,7 @@ options:
|
|||
- Each additional filter in the list will act be added as an AND condition (filter1
|
||||
and filter2) .
|
||||
type: list
|
||||
elements: str
|
||||
region:
|
||||
description:
|
||||
- A reference to the region where the disk resides.
|
||||
|
@ -82,6 +82,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- Specifies which Ansible environment you're running this module within.
|
||||
|
@ -276,7 +277,7 @@ resources:
|
|||
################################################################################
|
||||
# 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
|
||||
|
||||
################################################################################
|
||||
|
@ -295,7 +296,7 @@ def main():
|
|||
|
||||
|
||||
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):
|
||||
|
|
|
@ -41,7 +41,6 @@ description:
|
|||
successfully to some number of consecutive probes, it is marked healthy again and
|
||||
can receive new connections.
|
||||
short_description: Creates a GCP RegionHealthCheck
|
||||
version_added: '2.10'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -399,6 +398,49 @@ options:
|
|||
- 'Some valid choices include: "USE_FIXED_PORT", "USE_NAMED_PORT", "USE_SERVING_PORT"'
|
||||
required: false
|
||||
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:
|
||||
description:
|
||||
- The region where the regional health check resides.
|
||||
|
@ -435,6 +477,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- Specifies which Ansible environment you're running this module within.
|
||||
|
@ -796,6 +839,47 @@ http2HealthCheck:
|
|||
and `portName` fields.
|
||||
returned: success
|
||||
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:
|
||||
description:
|
||||
- The region where the regional health check resides.
|
||||
|
@ -895,6 +979,10 @@ def main():
|
|||
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'),
|
||||
)
|
||||
)
|
||||
|
@ -961,6 +1049,7 @@ def resource_to_request(module):
|
|||
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'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 = {}
|
||||
for k, v in request.items():
|
||||
|
@ -976,11 +1065,11 @@ def fetch_resource(module, link, kind, allow_not_found=True):
|
|||
|
||||
|
||||
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):
|
||||
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):
|
||||
|
@ -1040,22 +1129,23 @@ def response_to_hash(module, response):
|
|||
u'tcpHealthCheck': RegionHealthCheckTcphealthcheck(response.get(u'tcpHealthCheck', {}), module).from_response(),
|
||||
u'sslHealthCheck': RegionHealthCheckSslhealthcheck(response.get(u'sslHealthCheck', {}), 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):
|
||||
if name is None:
|
||||
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):
|
||||
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
|
||||
|
||||
|
||||
def async_op_url(module, extra_data=None):
|
||||
if extra_data is None:
|
||||
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.update(module.params)
|
||||
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__':
|
||||
main()
|
||||
|
|
|
@ -33,7 +33,6 @@ module: gcp_compute_region_health_check_info
|
|||
description:
|
||||
- Gather info for GCP RegionHealthCheck
|
||||
short_description: Gather info for GCP RegionHealthCheck
|
||||
version_added: '2.10'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -46,6 +45,7 @@ options:
|
|||
- Each additional filter in the list will act be added as an AND condition (filter1
|
||||
and filter2) .
|
||||
type: list
|
||||
elements: str
|
||||
region:
|
||||
description:
|
||||
- The region where the regional health check resides.
|
||||
|
@ -82,6 +82,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- Specifies which Ansible environment you're running this module within.
|
||||
|
@ -456,6 +457,49 @@ resources:
|
|||
and `portName` fields.
|
||||
returned: success
|
||||
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:
|
||||
description:
|
||||
- The region where the regional health check resides.
|
||||
|
@ -466,7 +510,7 @@ resources:
|
|||
################################################################################
|
||||
# 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
|
||||
|
||||
################################################################################
|
||||
|
@ -485,7 +529,7 @@ def main():
|
|||
|
||||
|
||||
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):
|
||||
|
|
|
@ -38,7 +38,6 @@ description:
|
|||
must separately verify the status of the individual instances.
|
||||
- A managed instance group can have up to 1000 VM instances per group.
|
||||
short_description: Creates a GCP RegionInstanceGroupManager
|
||||
version_added: '2.10'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -173,6 +172,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- 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):
|
||||
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):
|
||||
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):
|
||||
|
@ -574,7 +574,7 @@ def response_to_hash(module, response):
|
|||
def async_op_url(module, extra_data=None):
|
||||
if extra_data is None:
|
||||
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.update(module.params)
|
||||
return url.format(**combined)
|
||||
|
|
|
@ -33,7 +33,6 @@ module: gcp_compute_region_instance_group_manager_info
|
|||
description:
|
||||
- Gather info for GCP RegionInstanceGroupManager
|
||||
short_description: Gather info for GCP RegionInstanceGroupManager
|
||||
version_added: '2.10'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -46,6 +45,7 @@ options:
|
|||
- Each additional filter in the list will act be added as an AND condition (filter1
|
||||
and filter2) .
|
||||
type: list
|
||||
elements: str
|
||||
region:
|
||||
description:
|
||||
- The region the managed instance group resides.
|
||||
|
@ -82,6 +82,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- Specifies which Ansible environment you're running this module within.
|
||||
|
@ -284,7 +285,7 @@ resources:
|
|||
################################################################################
|
||||
# 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
|
||||
|
||||
################################################################################
|
||||
|
@ -303,7 +304,7 @@ def main():
|
|||
|
||||
|
||||
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):
|
||||
|
|
|
@ -34,7 +34,6 @@ description:
|
|||
- Represents a RegionTargetHttpProxy resource, which is used by one or more forwarding
|
||||
rules to route incoming HTTP requests to a URL map.
|
||||
short_description: Creates a GCP RegionTargetHttpProxy
|
||||
version_added: '2.10'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -111,6 +110,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- 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):
|
||||
auth = GcpSession(module, 'compute')
|
||||
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')},
|
||||
)
|
||||
|
||||
|
@ -337,11 +339,11 @@ def fetch_resource(module, link, kind, allow_not_found=True):
|
|||
|
||||
|
||||
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):
|
||||
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):
|
||||
|
@ -398,7 +400,7 @@ def response_to_hash(module, response):
|
|||
def async_op_url(module, extra_data=None):
|
||||
if extra_data is None:
|
||||
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.update(module.params)
|
||||
return url.format(**combined)
|
||||
|
|
|
@ -33,7 +33,6 @@ module: gcp_compute_region_target_http_proxy_info
|
|||
description:
|
||||
- Gather info for GCP RegionTargetHttpProxy
|
||||
short_description: Gather info for GCP RegionTargetHttpProxy
|
||||
version_added: '2.10'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -46,6 +45,7 @@ options:
|
|||
- Each additional filter in the list will act be added as an AND condition (filter1
|
||||
and filter2) .
|
||||
type: list
|
||||
elements: str
|
||||
region:
|
||||
description:
|
||||
- The region where the regional proxy resides.
|
||||
|
@ -82,6 +82,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- Specifies which Ansible environment you're running this module within.
|
||||
|
@ -159,7 +160,7 @@ resources:
|
|||
################################################################################
|
||||
# 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
|
||||
|
||||
################################################################################
|
||||
|
@ -178,7 +179,7 @@ def main():
|
|||
|
||||
|
||||
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):
|
||||
|
|
|
@ -34,7 +34,6 @@ description:
|
|||
- Represents a RegionTargetHttpsProxy resource, which is used by one or more forwarding
|
||||
rules to route incoming HTTPS requests to a URL map.
|
||||
short_description: Creates a GCP RegionTargetHttpsProxy
|
||||
version_added: '2.10'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -119,6 +118,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- 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):
|
||||
auth = GcpSession(module, 'compute')
|
||||
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
|
||||
),
|
||||
{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):
|
||||
auth = GcpSession(module, 'compute')
|
||||
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')},
|
||||
)
|
||||
|
||||
|
@ -404,11 +406,11 @@ def fetch_resource(module, link, kind, allow_not_found=True):
|
|||
|
||||
|
||||
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):
|
||||
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):
|
||||
|
@ -466,7 +468,7 @@ def response_to_hash(module, response):
|
|||
def async_op_url(module, extra_data=None):
|
||||
if extra_data is None:
|
||||
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.update(module.params)
|
||||
return url.format(**combined)
|
||||
|
|
|
@ -33,7 +33,6 @@ module: gcp_compute_region_target_https_proxy_info
|
|||
description:
|
||||
- Gather info for GCP RegionTargetHttpsProxy
|
||||
short_description: Gather info for GCP RegionTargetHttpsProxy
|
||||
version_added: '2.10'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -46,6 +45,7 @@ options:
|
|||
- Each additional filter in the list will act be added as an AND condition (filter1
|
||||
and filter2) .
|
||||
type: list
|
||||
elements: str
|
||||
region:
|
||||
description:
|
||||
- The region where the regional proxy resides.
|
||||
|
@ -82,6 +82,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- Specifies which Ansible environment you're running this module within.
|
||||
|
@ -166,7 +167,7 @@ resources:
|
|||
################################################################################
|
||||
# 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
|
||||
|
||||
################################################################################
|
||||
|
@ -185,7 +186,7 @@ def main():
|
|||
|
||||
|
||||
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):
|
||||
|
|
|
@ -34,7 +34,6 @@ description:
|
|||
- 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.
|
||||
short_description: Creates a GCP RegionUrlMap
|
||||
version_added: '2.10'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -1622,6 +1621,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- 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):
|
||||
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):
|
||||
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):
|
||||
|
@ -3594,7 +3594,7 @@ def response_to_hash(module, response):
|
|||
def async_op_url(module, extra_data=None):
|
||||
if extra_data is None:
|
||||
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.update(module.params)
|
||||
return url.format(**combined)
|
||||
|
|
|
@ -33,7 +33,6 @@ module: gcp_compute_region_url_map_info
|
|||
description:
|
||||
- Gather info for GCP RegionUrlMap
|
||||
short_description: Gather info for GCP RegionUrlMap
|
||||
version_added: '2.10'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -46,6 +45,7 @@ options:
|
|||
- Each additional filter in the list will act be added as an AND condition (filter1
|
||||
and filter2) .
|
||||
type: list
|
||||
elements: str
|
||||
region:
|
||||
description:
|
||||
- A reference to the region where the url map resides.
|
||||
|
@ -82,6 +82,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- Specifies which Ansible environment you're running this module within.
|
||||
|
@ -1587,7 +1588,7 @@ resources:
|
|||
################################################################################
|
||||
# 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
|
||||
|
||||
################################################################################
|
||||
|
@ -1606,7 +1607,7 @@ def main():
|
|||
|
||||
|
||||
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):
|
||||
|
|
|
@ -38,7 +38,6 @@ description:
|
|||
preemptible VMs, sole tenant nodes, or other services not listed above like Cloud
|
||||
SQL and Dataflow.
|
||||
short_description: Creates a GCP Reservation
|
||||
version_added: '2.10'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -181,6 +180,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- 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):
|
||||
auth = GcpSession(module, 'compute')
|
||||
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()},
|
||||
)
|
||||
|
||||
|
@ -477,11 +477,11 @@ def fetch_resource(module, link, allow_not_found=True):
|
|||
|
||||
|
||||
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):
|
||||
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):
|
||||
|
@ -541,7 +541,7 @@ def response_to_hash(module, response):
|
|||
def async_op_url(module, extra_data=None):
|
||||
if extra_data is None:
|
||||
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.update(module.params)
|
||||
return url.format(**combined)
|
||||
|
|
|
@ -33,7 +33,6 @@ module: gcp_compute_reservation_info
|
|||
description:
|
||||
- Gather info for GCP Reservation
|
||||
short_description: Gather info for GCP Reservation
|
||||
version_added: '2.10'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -46,6 +45,7 @@ options:
|
|||
- Each additional filter in the list will act be added as an AND condition (filter1
|
||||
and filter2) .
|
||||
type: list
|
||||
elements: str
|
||||
zone:
|
||||
description:
|
||||
- The zone where the reservation is made.
|
||||
|
@ -82,6 +82,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- Specifies which Ansible environment you're running this module within.
|
||||
|
@ -241,7 +242,7 @@ resources:
|
|||
################################################################################
|
||||
# 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
|
||||
|
||||
################################################################################
|
||||
|
@ -260,7 +261,7 @@ def main():
|
|||
|
||||
|
||||
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):
|
||||
|
|
|
@ -34,7 +34,6 @@ description:
|
|||
- A policy that can be attached to a resource to specify or schedule actions on that
|
||||
resource.
|
||||
short_description: Creates a GCP ResourcePolicy
|
||||
version_added: '2.10'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -243,6 +242,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- 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):
|
||||
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):
|
||||
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):
|
||||
|
@ -620,7 +620,7 @@ def response_to_hash(module, response):
|
|||
def async_op_url(module, extra_data=None):
|
||||
if extra_data is None:
|
||||
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.update(module.params)
|
||||
return url.format(**combined)
|
||||
|
|
|
@ -33,7 +33,6 @@ module: gcp_compute_resource_policy_info
|
|||
description:
|
||||
- Gather info for GCP ResourcePolicy
|
||||
short_description: Gather info for GCP ResourcePolicy
|
||||
version_added: '2.10'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -46,6 +45,7 @@ options:
|
|||
- Each additional filter in the list will act be added as an AND condition (filter1
|
||||
and filter2) .
|
||||
type: list
|
||||
elements: str
|
||||
region:
|
||||
description:
|
||||
- Region where resource policy resides.
|
||||
|
@ -82,6 +82,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- Specifies which Ansible environment you're running this module within.
|
||||
|
@ -279,7 +280,7 @@ resources:
|
|||
################################################################################
|
||||
# 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
|
||||
|
||||
################################################################################
|
||||
|
@ -298,7 +299,7 @@ def main():
|
|||
|
||||
|
||||
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):
|
||||
|
|
|
@ -48,7 +48,6 @@ description:
|
|||
- A Route resource must have exactly one specification of either nextHopGateway, nextHopInstance,
|
||||
nextHopIp, nextHopVpnTunnel, or nextHopIlb.
|
||||
short_description: Creates a GCP Route
|
||||
version_added: '2.6'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -75,7 +74,6 @@ options:
|
|||
the resource.
|
||||
required: false
|
||||
type: str
|
||||
version_added: '2.7'
|
||||
name:
|
||||
description:
|
||||
- Name of the resource. Provided by the client when the resource is created. The
|
||||
|
@ -163,7 +161,6 @@ options:
|
|||
field to "{{ name-of-resource }}"'
|
||||
required: false
|
||||
type: dict
|
||||
version_added: '2.10'
|
||||
project:
|
||||
description:
|
||||
- The Google Cloud Platform project to use.
|
||||
|
@ -195,6 +192,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- 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):
|
||||
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):
|
||||
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):
|
||||
|
@ -503,7 +501,7 @@ def response_to_hash(module, response):
|
|||
def async_op_url(module, extra_data=None):
|
||||
if extra_data is None:
|
||||
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.update(module.params)
|
||||
return url.format(**combined)
|
||||
|
|
|
@ -33,7 +33,6 @@ module: gcp_compute_route_info
|
|||
description:
|
||||
- Gather info for GCP Route
|
||||
short_description: Gather info for GCP Route
|
||||
version_added: '2.7'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -46,6 +45,7 @@ options:
|
|||
- Each additional filter in the list will act be added as an AND condition (filter1
|
||||
and filter2) .
|
||||
type: list
|
||||
elements: str
|
||||
project:
|
||||
description:
|
||||
- The Google Cloud Platform project to use.
|
||||
|
@ -77,6 +77,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- Specifies which Ansible environment you're running this module within.
|
||||
|
@ -200,7 +201,7 @@ resources:
|
|||
################################################################################
|
||||
# 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
|
||||
|
||||
################################################################################
|
||||
|
@ -219,7 +220,7 @@ def main():
|
|||
|
||||
|
||||
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):
|
||||
|
|
|
@ -33,7 +33,6 @@ module: gcp_compute_router
|
|||
description:
|
||||
- Represents a Router resource.
|
||||
short_description: Creates a GCP Router
|
||||
version_added: '2.7'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -160,6 +159,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- 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):
|
||||
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):
|
||||
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):
|
||||
|
@ -467,7 +467,7 @@ def response_to_hash(module, response):
|
|||
def async_op_url(module, extra_data=None):
|
||||
if extra_data is None:
|
||||
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.update(module.params)
|
||||
return url.format(**combined)
|
||||
|
|
|
@ -33,7 +33,6 @@ module: gcp_compute_router_info
|
|||
description:
|
||||
- Gather info for GCP Router
|
||||
short_description: Gather info for GCP Router
|
||||
version_added: '2.7'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -46,6 +45,7 @@ options:
|
|||
- Each additional filter in the list will act be added as an AND condition (filter1
|
||||
and filter2) .
|
||||
type: list
|
||||
elements: str
|
||||
region:
|
||||
description:
|
||||
- Region where the router resides.
|
||||
|
@ -82,6 +82,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- Specifies which Ansible environment you're running this module within.
|
||||
|
@ -205,7 +206,7 @@ resources:
|
|||
################################################################################
|
||||
# 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
|
||||
|
||||
################################################################################
|
||||
|
@ -224,7 +225,7 @@ def main():
|
|||
|
||||
|
||||
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):
|
||||
|
|
|
@ -41,7 +41,6 @@ description:
|
|||
faster and at a much lower cost than if you regularly created a full image of the
|
||||
disk.
|
||||
short_description: Creates a GCP Snapshot
|
||||
version_added: '2.9'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -71,6 +70,12 @@ options:
|
|||
- An optional description of this resource.
|
||||
required: false
|
||||
type: str
|
||||
storage_locations:
|
||||
description:
|
||||
- Cloud Storage bucket storage location of the snapshot (regional or multi-regional).
|
||||
elements: str
|
||||
required: false
|
||||
type: list
|
||||
labels:
|
||||
description:
|
||||
- Labels to apply to this Snapshot.
|
||||
|
@ -109,6 +114,12 @@ options:
|
|||
- The name of the encryption key that is stored in Google Cloud KMS.
|
||||
required: false
|
||||
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:
|
||||
description:
|
||||
- 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.
|
||||
required: false
|
||||
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:
|
||||
description:
|
||||
- The Google Cloud Platform project to use.
|
||||
|
@ -158,6 +175,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- Specifies which Ansible environment you're running this module within.
|
||||
|
@ -240,6 +258,11 @@ storageBytes:
|
|||
is expected to change with snapshot creation/deletion.
|
||||
returned: success
|
||||
type: int
|
||||
storageLocations:
|
||||
description:
|
||||
- Cloud Storage bucket storage location of the snapshot (regional or multi-regional).
|
||||
returned: success
|
||||
type: list
|
||||
licenses:
|
||||
description:
|
||||
- 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.
|
||||
returned: success
|
||||
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:
|
||||
description:
|
||||
- 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.
|
||||
returned: success
|
||||
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'),
|
||||
name=dict(required=True, type='str'),
|
||||
description=dict(type='str'),
|
||||
storage_locations=dict(type='list', elements='str'),
|
||||
labels=dict(type='dict'),
|
||||
source_disk=dict(required=True, type='dict'),
|
||||
zone=dict(type='str'),
|
||||
snapshot_encryption_key=dict(type='dict', options=dict(raw_key=dict(type='str'), kms_key_name=dict(type='str'))),
|
||||
source_disk_encryption_key=dict(type='dict', options=dict(raw_key=dict(type='str'), kms_key_name=dict(type='str'))),
|
||||
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'))
|
||||
),
|
||||
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):
|
||||
auth = GcpSession(module, 'compute')
|
||||
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')},
|
||||
)
|
||||
|
||||
|
@ -415,6 +455,7 @@ def resource_to_request(module):
|
|||
u'zone': module.params.get('zone'),
|
||||
u'name': module.params.get('name'),
|
||||
u'description': module.params.get('description'),
|
||||
u'storageLocations': module.params.get('storage_locations'),
|
||||
u'labels': module.params.get('labels'),
|
||||
}
|
||||
return_vals = {}
|
||||
|
@ -431,16 +472,16 @@ def fetch_resource(module, link, kind, allow_not_found=True):
|
|||
|
||||
|
||||
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):
|
||||
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):
|
||||
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):
|
||||
|
@ -492,6 +533,7 @@ def response_to_hash(module, response):
|
|||
u'name': module.params.get('name'),
|
||||
u'description': module.params.get('description'),
|
||||
u'storageBytes': response.get(u'storageBytes'),
|
||||
u'storageLocations': response.get(u'storageLocations'),
|
||||
u'licenses': response.get(u'licenses'),
|
||||
u'labels': response.get(u'labels'),
|
||||
u'labelFingerprint': response.get(u'labelFingerprint'),
|
||||
|
@ -501,16 +543,16 @@ def response_to_hash(module, response):
|
|||
def license_selflink(name, params):
|
||||
if name is None:
|
||||
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):
|
||||
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
|
||||
|
||||
|
||||
def async_op_url(module, extra_data=None):
|
||||
if extra_data is None:
|
||||
extra_data = {}
|
||||
url = "https://www.googleapis.com/compute/v1/"
|
||||
url = "https://compute.googleapis.com/compute/v1/"
|
||||
combined = extra_data.copy()
|
||||
combined.update(module.params)
|
||||
return url.format(**combined)
|
||||
|
@ -551,10 +593,22 @@ class SnapshotSnapshotencryptionkey(object):
|
|||
self.request = {}
|
||||
|
||||
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):
|
||||
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):
|
||||
|
@ -566,10 +620,22 @@ class SnapshotSourcediskencryptionkey(object):
|
|||
self.request = {}
|
||||
|
||||
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):
|
||||
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__':
|
||||
|
|
|
@ -33,7 +33,6 @@ module: gcp_compute_snapshot_info
|
|||
description:
|
||||
- Gather info for GCP Snapshot
|
||||
short_description: Gather info for GCP Snapshot
|
||||
version_added: '2.9'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -46,6 +45,7 @@ options:
|
|||
- Each additional filter in the list will act be added as an AND condition (filter1
|
||||
and filter2) .
|
||||
type: list
|
||||
elements: str
|
||||
project:
|
||||
description:
|
||||
- The Google Cloud Platform project to use.
|
||||
|
@ -77,6 +77,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- Specifies which Ansible environment you're running this module within.
|
||||
|
@ -148,6 +149,11 @@ resources:
|
|||
number is expected to change with snapshot creation/deletion.
|
||||
returned: success
|
||||
type: int
|
||||
storageLocations:
|
||||
description:
|
||||
- Cloud Storage bucket storage location of the snapshot (regional or multi-regional).
|
||||
returned: success
|
||||
type: list
|
||||
licenses:
|
||||
description:
|
||||
- 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.
|
||||
returned: success
|
||||
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:
|
||||
description:
|
||||
- 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.
|
||||
returned: success
|
||||
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
|
||||
################################################################################
|
||||
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
|
||||
|
||||
################################################################################
|
||||
|
@ -243,7 +263,7 @@ def main():
|
|||
|
||||
|
||||
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):
|
||||
|
|
|
@ -35,7 +35,6 @@ description:
|
|||
a mechanism to upload an SSL key and certificate to the load balancer to serve secure
|
||||
connections from the user.
|
||||
short_description: Creates a GCP SslCertificate
|
||||
version_added: '2.6'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -108,6 +107,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- 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):
|
||||
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):
|
||||
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):
|
||||
|
@ -361,7 +361,7 @@ def response_to_hash(module, response):
|
|||
def async_op_url(module, extra_data=None):
|
||||
if extra_data is None:
|
||||
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.update(module.params)
|
||||
return url.format(**combined)
|
||||
|
|
|
@ -33,7 +33,6 @@ module: gcp_compute_ssl_certificate_info
|
|||
description:
|
||||
- Gather info for GCP SslCertificate
|
||||
short_description: Gather info for GCP SslCertificate
|
||||
version_added: '2.7'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -46,6 +45,7 @@ options:
|
|||
- Each additional filter in the list will act be added as an AND condition (filter1
|
||||
and filter2) .
|
||||
type: list
|
||||
elements: str
|
||||
project:
|
||||
description:
|
||||
- The Google Cloud Platform project to use.
|
||||
|
@ -77,6 +77,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- Specifies which Ansible environment you're running this module within.
|
||||
|
@ -154,7 +155,7 @@ resources:
|
|||
################################################################################
|
||||
# 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
|
||||
|
||||
################################################################################
|
||||
|
@ -173,7 +174,7 @@ def main():
|
|||
|
||||
|
||||
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):
|
||||
|
|
|
@ -34,7 +34,6 @@ description:
|
|||
- 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.
|
||||
short_description: Creates a GCP SslPolicy
|
||||
version_added: '2.7'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -118,6 +117,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- 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):
|
||||
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):
|
||||
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):
|
||||
|
@ -399,7 +399,7 @@ def response_to_hash(module, response):
|
|||
def async_op_url(module, extra_data=None):
|
||||
if extra_data is None:
|
||||
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.update(module.params)
|
||||
return url.format(**combined)
|
||||
|
|
|
@ -33,7 +33,6 @@ module: gcp_compute_ssl_policy_info
|
|||
description:
|
||||
- Gather info for GCP SslPolicy
|
||||
short_description: Gather info for GCP SslPolicy
|
||||
version_added: '2.7'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -46,6 +45,7 @@ options:
|
|||
- Each additional filter in the list will act be added as an AND condition (filter1
|
||||
and filter2) .
|
||||
type: list
|
||||
elements: str
|
||||
project:
|
||||
description:
|
||||
- The Google Cloud Platform project to use.
|
||||
|
@ -77,6 +77,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- Specifies which Ansible environment you're running this module within.
|
||||
|
@ -190,7 +191,7 @@ resources:
|
|||
################################################################################
|
||||
# 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
|
||||
|
||||
################################################################################
|
||||
|
@ -209,7 +210,7 @@ def main():
|
|||
|
||||
|
||||
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):
|
||||
|
|
|
@ -49,7 +49,6 @@ description:
|
|||
private IP addresses. You can isolate portions of the network, even entire subnets,
|
||||
using firewall rules.
|
||||
short_description: Creates a GCP Subnetwork
|
||||
version_added: '2.6'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -107,7 +106,6 @@ options:
|
|||
elements: dict
|
||||
required: false
|
||||
type: list
|
||||
version_added: '2.8'
|
||||
suboptions:
|
||||
range_name:
|
||||
description:
|
||||
|
@ -166,6 +164,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- 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.
|
||||
type: str
|
||||
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)'
|
||||
- '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)
|
||||
|
@ -385,7 +384,9 @@ def update_fields(module, request, response):
|
|||
def ip_cidr_range_update(module, request, response):
|
||||
auth = GcpSession(module, 'compute')
|
||||
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')},
|
||||
)
|
||||
|
||||
|
@ -393,7 +394,7 @@ def ip_cidr_range_update(module, request, response):
|
|||
def secondary_ip_ranges_update(module, request, response):
|
||||
auth = GcpSession(module, 'compute')
|
||||
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()},
|
||||
)
|
||||
|
||||
|
@ -401,7 +402,7 @@ def secondary_ip_ranges_update(module, request, response):
|
|||
def private_ip_google_access_update(module, request, response):
|
||||
auth = GcpSession(module, 'compute')
|
||||
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
|
||||
),
|
||||
{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):
|
||||
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):
|
||||
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):
|
||||
|
@ -504,7 +505,7 @@ def response_to_hash(module, response):
|
|||
def async_op_url(module, extra_data=None):
|
||||
if extra_data is None:
|
||||
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.update(module.params)
|
||||
return url.format(**combined)
|
||||
|
|
|
@ -33,7 +33,6 @@ module: gcp_compute_subnetwork_info
|
|||
description:
|
||||
- Gather info for GCP Subnetwork
|
||||
short_description: Gather info for GCP Subnetwork
|
||||
version_added: '2.7'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -46,6 +45,7 @@ options:
|
|||
- Each additional filter in the list will act be added as an AND condition (filter1
|
||||
and filter2) .
|
||||
type: list
|
||||
elements: str
|
||||
region:
|
||||
description:
|
||||
- The GCP region for this subnetwork.
|
||||
|
@ -82,6 +82,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- Specifies which Ansible environment you're running this module within.
|
||||
|
@ -204,7 +205,7 @@ resources:
|
|||
################################################################################
|
||||
# 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
|
||||
|
||||
################################################################################
|
||||
|
@ -223,7 +224,7 @@ def main():
|
|||
|
||||
|
||||
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):
|
||||
|
|
|
@ -34,7 +34,6 @@ description:
|
|||
- Represents a TargetHttpProxy resource, which is used by one or more global forwarding
|
||||
rule to route incoming HTTP requests to a URL map.
|
||||
short_description: Creates a GCP TargetHttpProxy
|
||||
version_added: '2.6'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -106,6 +105,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- 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):
|
||||
auth = GcpSession(module, 'compute')
|
||||
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')},
|
||||
)
|
||||
|
||||
|
@ -323,11 +323,11 @@ def fetch_resource(module, link, kind, allow_not_found=True):
|
|||
|
||||
|
||||
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):
|
||||
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):
|
||||
|
@ -384,7 +384,7 @@ def response_to_hash(module, response):
|
|||
def async_op_url(module, extra_data=None):
|
||||
if extra_data is None:
|
||||
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.update(module.params)
|
||||
return url.format(**combined)
|
||||
|
|
|
@ -33,7 +33,6 @@ module: gcp_compute_target_http_proxy_info
|
|||
description:
|
||||
- Gather info for GCP TargetHttpProxy
|
||||
short_description: Gather info for GCP TargetHttpProxy
|
||||
version_added: '2.7'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -46,6 +45,7 @@ options:
|
|||
- Each additional filter in the list will act be added as an AND condition (filter1
|
||||
and filter2) .
|
||||
type: list
|
||||
elements: str
|
||||
project:
|
||||
description:
|
||||
- The Google Cloud Platform project to use.
|
||||
|
@ -77,6 +77,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- Specifies which Ansible environment you're running this module within.
|
||||
|
@ -148,7 +149,7 @@ resources:
|
|||
################################################################################
|
||||
# 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
|
||||
|
||||
################################################################################
|
||||
|
@ -167,7 +168,7 @@ def main():
|
|||
|
||||
|
||||
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):
|
||||
|
|
|
@ -34,7 +34,6 @@ description:
|
|||
- Represents a TargetHttpsProxy resource, which is used by one or more global forwarding
|
||||
rule to route incoming HTTPS requests to a URL map.
|
||||
short_description: Creates a GCP TargetHttpsProxy
|
||||
version_added: '2.6'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -73,7 +72,6 @@ options:
|
|||
- 'Some valid choices include: "NONE", "ENABLE", "DISABLE"'
|
||||
required: false
|
||||
type: str
|
||||
version_added: '2.7'
|
||||
ssl_certificates:
|
||||
description:
|
||||
- A list of SslCertificate resources that are used to authenticate connections
|
||||
|
@ -93,7 +91,6 @@ options:
|
|||
}}"'
|
||||
required: false
|
||||
type: dict
|
||||
version_added: '2.8'
|
||||
url_map:
|
||||
description:
|
||||
- A reference to the UrlMap resource that defines the mapping from URL to the
|
||||
|
@ -136,6 +133,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- 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):
|
||||
auth = GcpSession(module, 'compute')
|
||||
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')},
|
||||
)
|
||||
|
||||
|
@ -396,7 +394,7 @@ def quic_override_update(module, request, response):
|
|||
def ssl_certificates_update(module, request, response):
|
||||
auth = GcpSession(module, 'compute')
|
||||
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')},
|
||||
)
|
||||
|
||||
|
@ -404,7 +402,7 @@ def ssl_certificates_update(module, request, response):
|
|||
def ssl_policy_update(module, request, response):
|
||||
auth = GcpSession(module, 'compute')
|
||||
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')},
|
||||
)
|
||||
|
||||
|
@ -412,7 +410,7 @@ def ssl_policy_update(module, request, response):
|
|||
def url_map_update(module, request, response):
|
||||
auth = GcpSession(module, 'compute')
|
||||
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')},
|
||||
)
|
||||
|
||||
|
@ -446,11 +444,11 @@ def fetch_resource(module, link, kind, allow_not_found=True):
|
|||
|
||||
|
||||
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):
|
||||
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):
|
||||
|
@ -510,7 +508,7 @@ def response_to_hash(module, response):
|
|||
def async_op_url(module, extra_data=None):
|
||||
if extra_data is None:
|
||||
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.update(module.params)
|
||||
return url.format(**combined)
|
||||
|
|
|
@ -33,7 +33,6 @@ module: gcp_compute_target_https_proxy_info
|
|||
description:
|
||||
- Gather info for GCP TargetHttpsProxy
|
||||
short_description: Gather info for GCP TargetHttpsProxy
|
||||
version_added: '2.7'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -46,6 +45,7 @@ options:
|
|||
- Each additional filter in the list will act be added as an AND condition (filter1
|
||||
and filter2) .
|
||||
type: list
|
||||
elements: str
|
||||
project:
|
||||
description:
|
||||
- The Google Cloud Platform project to use.
|
||||
|
@ -77,6 +77,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- Specifies which Ansible environment you're running this module within.
|
||||
|
@ -170,7 +171,7 @@ resources:
|
|||
################################################################################
|
||||
# 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
|
||||
|
||||
################################################################################
|
||||
|
@ -189,7 +190,7 @@ def main():
|
|||
|
||||
|
||||
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):
|
||||
|
|
|
@ -37,7 +37,6 @@ description:
|
|||
instance contains a single virtual machine instance that receives and handles traffic
|
||||
from the corresponding forwarding rules.
|
||||
short_description: Creates a GCP TargetInstance
|
||||
version_added: '2.10'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -123,6 +122,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- 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):
|
||||
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):
|
||||
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):
|
||||
|
@ -383,7 +383,7 @@ def response_to_hash(module, response):
|
|||
def async_op_url(module, extra_data=None):
|
||||
if extra_data is None:
|
||||
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.update(module.params)
|
||||
return url.format(**combined)
|
||||
|
|
|
@ -33,7 +33,6 @@ module: gcp_compute_target_instance_info
|
|||
description:
|
||||
- Gather info for GCP TargetInstance
|
||||
short_description: Gather info for GCP TargetInstance
|
||||
version_added: '2.10'
|
||||
author: Google Inc. (@googlecloudplatform)
|
||||
requirements:
|
||||
- python >= 2.6
|
||||
|
@ -46,6 +45,7 @@ options:
|
|||
- Each additional filter in the list will act be added as an AND condition (filter1
|
||||
and filter2) .
|
||||
type: list
|
||||
elements: str
|
||||
zone:
|
||||
description:
|
||||
- URL of the zone where the target instance resides.
|
||||
|
@ -82,6 +82,7 @@ options:
|
|||
description:
|
||||
- Array of scopes to be used
|
||||
type: list
|
||||
elements: str
|
||||
env_type:
|
||||
description:
|
||||
- Specifies which Ansible environment you're running this module within.
|
||||
|
@ -161,7 +162,7 @@ resources:
|
|||
################################################################################
|
||||
# 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
|
||||
|
||||
################################################################################
|
||||
|
@ -180,7 +181,7 @@ def main():
|
|||
|
||||
|
||||
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):
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue