diff --git a/products/compute/ansible.yaml b/products/compute/ansible.yaml index db89665c1ff4..bde644c8cc9e 100644 --- a/products/compute/ansible.yaml +++ b/products/compute/ansible.yaml @@ -43,8 +43,6 @@ datasources: !ruby/object:Overrides::ResourceOverrides exclude: true RegionSslCertificate: !ruby/object:Overrides::Ansible::ResourceOverride exclude: true - ResourcePolicy: !ruby/object:Overrides::Ansible::ResourceOverride - exclude: true RouterBgpPeer: !ruby/object:Overrides::Ansible::ResourceOverride exclude: true RouterNat: !ruby/object:Overrides::Ansible::ResourceOverride @@ -259,8 +257,6 @@ overrides: !ruby/object:Overrides::ResourceOverrides description: | The source snapshot used to create this disk. You can provide this as a partial or full URL to the resource. - ResourcePolicy: !ruby/object:Overrides::Ansible::ResourceOverride - exclude: true Reservation: !ruby/object:Overrides::Ansible::ResourceOverride properties: specificReservation.instanceProperties.minCpuPlatform: !ruby/object:Overrides::Ansible::PropertyOverride diff --git a/products/compute/ansible_version_added.yaml b/products/compute/ansible_version_added.yaml index a6b6a7d60226..d2d9ea19a065 100644 --- a/products/compute/ansible_version_added.yaml +++ b/products/compute/ansible_version_added.yaml @@ -56,6 +56,8 @@ :version_added: '2.10' :RegionHealthCheck: :version_added: '2.10' + :ResourcePolicy: + :version_added: '2.10' :Route: :version_added: '2.7' :Router: @@ -1521,6 +1523,50 @@ :version_added: '2.10' :region: :version_added: '2.10' + :ResourcePolicy: + :version_added: '2.10' + :name: + :version_added: '2.10' + :snapshotSchedulePolicy: + :version_added: '2.10' + :schedule: + :version_added: '2.10' + :hourlySchedule: + :version_added: '2.10' + :hoursInCycle: + :version_added: '2.10' + :startTime: + :version_added: '2.10' + :dailySchedule: + :version_added: '2.10' + :daysInCycle: + :version_added: '2.10' + :startTime: + :version_added: '2.10' + :weeklySchedule: + :version_added: '2.10' + :dayOfWeeks: + :version_added: '2.10' + :startTime: + :version_added: '2.10' + :day: + :version_added: '2.10' + :retentionPolicy: + :version_added: '2.10' + :maxRetentionDays: + :version_added: '2.10' + :onSourceDiskDelete: + :version_added: '2.10' + :snapshotProperties: + :version_added: '2.10' + :labels: + :version_added: '2.10' + :storageLocations: + :version_added: '2.10' + :guestFlush: + :version_added: '2.10' + :region: + :version_added: '2.10' :Route: :version_added: '2.6' :destRange: diff --git a/products/compute/api.yaml b/products/compute/api.yaml index 3f5f1b87f975..7f97a3b6a42e 100644 --- a/products/compute/api.yaml +++ b/products/compute/api.yaml @@ -10513,13 +10513,14 @@ objects: base_url: projects/{{project}}/regions/{{region}}/resourcePolicies input: true has_self_link: true + collection_url_key: 'items' description: | A policy that can be attached to a resource to specify or schedule actions on that resource. async: !ruby/object:Api::OpAsync operation: !ruby/object:Api::OpAsync::Operation kind: 'compute#operation' path: 'name' - base_url: 'projects/{{project}}/global/operations/{{op_id}}' + base_url: 'projects/{{project}}/regions/{{region}}/operations/{{op_id}}' wait_ms: 1000 result: !ruby/object:Api::OpAsync::Result path: 'targetLink' diff --git a/products/compute/examples/ansible/resource_policy.yaml b/products/compute/examples/ansible/resource_policy.yaml new file mode 100644 index 000000000000..7639b2a8ba3c --- /dev/null +++ b/products/compute/examples/ansible/resource_policy.yaml @@ -0,0 +1,26 @@ +# Copyright 2020 Google Inc. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +--- !ruby/object:Provider::Ansible::Example +task: !ruby/object:Provider::Ansible::Task + name: gcp_compute_resource_policy + code: + name: <%= ctx[:name] %> + region: 'us-central1' + snapshot_schedule_policy: + schedule: + daily_schedule: + days_in_cycle: 1 + start_time: "04:00" + project: <%= ctx[:project] %> + auth_kind: <%= ctx[:auth_kind] %> + service_account_file: <%= ctx[:service_account_file] %>