Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ansible - Resource Policy #3275

Merged
merged 5 commits into from
Mar 20, 2020
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions products/compute/ansible.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
46 changes: 46 additions & 0 deletions products/compute/ansible_version_added.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@
:version_added: '2.10'
:RegionHealthCheck:
:version_added: '2.10'
:ResourcePolicy:
:version_added: '2.10'
:Route:
:version_added: '2.7'
:Router:
Expand Down Expand Up @@ -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:
Expand Down
19 changes: 1 addition & 18 deletions products/compute/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10513,26 +10513,9 @@ 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}}'
wait_ms: 1000
result: !ruby/object:Api::OpAsync::Result
path: 'targetLink'
status: !ruby/object:Api::OpAsync::Status
path: 'status'
complete: 'DONE'
allowed:
- 'PENDING'
- 'RUNNING'
- 'DONE'
error: !ruby/object:Api::OpAsync::Error
path: 'error/errors'
message: 'message'
parameters:
- !ruby/object:Api::Type::ResourceRef
name: region
Expand Down
26 changes: 26 additions & 0 deletions products/compute/examples/ansible/resource_policy.yaml
Original file line number Diff line number Diff line change
@@ -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] %>