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

Add new module to manage backup policies #373

Merged
merged 37 commits into from
Mar 4, 2021
Merged
Show file tree
Hide file tree
Changes from 34 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
b592a80
init from role assignment
coleneubauer Dec 14, 2020
6fb71bb
init backup policy module
coleneubauer Dec 14, 2020
f351e3f
test
coleneubauer Dec 16, 2020
1ca2238
test
coleneubauer Dec 16, 2020
486a017
test
coleneubauer Dec 16, 2020
db5adca
bad bool casing
coleneubauer Dec 16, 2020
1c8e1c0
test
coleneubauer Dec 16, 2020
de079e5
update set_results
coleneubauer Dec 16, 2020
2957784
init policy create
coleneubauer Dec 16, 2020
b5ed0bf
adding model to common
coleneubauer Dec 16, 2020
2aaa94d
updated needs hardcoded values removed
coleneubauer Dec 17, 2020
eac8665
Added daily and weekly support for VM backups
coleneubauer Dec 18, 2020
451f45e
added another error check on params
coleneubauer Dec 18, 2020
3e4389e
Merge branch 'dev' into dev
coleneubauer Dec 21, 2020
de363ee
spacing
coleneubauer Dec 21, 2020
6bc663e
Merge branch 'dev' of github.com:coleneubauer/azure into dev
coleneubauer Dec 21, 2020
e0d8b34
Merge branch 'dev' into dev
coleneubauer Dec 22, 2020
6f0c46e
Added integration tests
coleneubauer Dec 22, 2020
0fd867a
Merge branch 'dev' of github.com:coleneubauer/azure into dev
coleneubauer Dec 22, 2020
45dda40
Added idempotence test
coleneubauer Dec 22, 2020
8084dc8
fix sanity test issues
coleneubauer Dec 31, 2020
38bc5f5
Add new dependencies to requirements-azure.txt
coleneubauer Jan 6, 2021
1a4e011
Apply suggestions from code review
coleneubauer Jan 7, 2021
12bb955
Update params to be more inline with other modules
coleneubauer Jan 7, 2021
118e31f
Merge branch 'dev' of github.com:coleneubauer/azure into dev
coleneubauer Jan 7, 2021
9eafb5c
Apply suggestions from code review
coleneubauer Jan 7, 2021
92a7332
Merge branch 'dev' into dev
coleneubauer Jan 7, 2021
874342b
Merge branch 'dev' into dev
coleneubauer Jan 14, 2021
841008b
Update with info module
coleneubauer Jan 14, 2021
75bca24
Changes from sanity test
coleneubauer Jan 14, 2021
5be187a
update test block
coleneubauer Jan 15, 2021
09c1d09
update test block
coleneubauer Jan 15, 2021
56dba85
Change var name
coleneubauer Jan 15, 2021
5e0f80f
Fix noncompliant module
coleneubauer Jan 15, 2021
3a5647f
Merge branch 'dev' into dev
coleneubauer Feb 9, 2021
b12c883
Update test facts setup
coleneubauer Feb 9, 2021
f3d6213
Merge branch 'dev' into dev
haiyuazhang Mar 4, 2021
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
16 changes: 16 additions & 0 deletions plugins/module_utils/azure_rm_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,9 @@ def default_api_version(self):
from msrestazure import AzureConfiguration
from msrest.authentication import Authentication
from azure.mgmt.resource.locks import ManagementLockClient
from azure.mgmt.recoveryservicesbackup import RecoveryServicesBackupClient
import azure.mgmt.recoveryservicesbackup.models as RecoveryServicesBackupModels

except ImportError as exc:
Authentication = object
HAS_AZURE_EXC = traceback.format_exc()
Expand Down Expand Up @@ -424,6 +427,7 @@ def __init__(self, derived_arg_spec, bypass_checks=False, no_log=False,
self._automation_client = None
self._IoThub_client = None
self._lock_client = None
self._recovery_services_backup_client = None

self.check_mode = self.module.check_mode
self.api_profile = self.module.params.get('api_profile')
Expand Down Expand Up @@ -1252,6 +1256,18 @@ def lock_models(self):
self.log("Getting lock models")
return ManagementLockClient.models('2016-09-01')

@property
def recovery_services_backup_client(self):
self.log('Getting recovery services backup client')
if not self._recovery_services_backup_client:
self._recovery_services_backup_client = self.get_mgmt_svc_client(RecoveryServicesBackupClient,
base_url=self._cloud_environment.endpoints.resource_manager)
return self._recovery_services_backup_client

@property
def recovery_services_backup_models(self):
return RecoveryServicesBackupModels


class AzureSASAuthentication(Authentication):
"""Simple SAS Authentication.
Expand Down
Loading