Skip to content

Commit

Permalink
Support to list the vaults in same resource group (#1487)
Browse files Browse the repository at this point in the history
* Support to list the vaults in samee resource group

* small change
  • Loading branch information
Fred-sun authored Mar 19, 2024
1 parent 1639d92 commit 6edd731
Showing 1 changed file with 23 additions and 12 deletions.
35 changes: 23 additions & 12 deletions plugins/modules/azure_rm_recoveryservicesvault_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
---
module: azure_rm_recoveryservicesvault_info
version_added: '1.1.0'
short_description: Get Azure Recovery Services vault Details
short_description: Get or list the Azure Recovery Services vault Details
description:
- Get Azure Recovery Services vault Details.
- Get or list the Azure Recovery Services vault Details.
options:
resource_group:
description:
Expand All @@ -23,8 +23,8 @@
type: str
name:
description:
- If this parameter is not configured, all Vaults in the resource group are listed.
- The name of the Azure Recovery Service Vault.
required: true
type: str
extends_documentation_fragment:
- azure.azcollection.azure
Expand All @@ -34,6 +34,10 @@
'''

EXAMPLES = '''
- name: List all Azure Recovery Services Vault in same resource group
azure_rm_recoveryservicesvault_info:
resource_group: 'myResourceGroup'
- name: Get Azure Recovery Services Vault Details.
azure_rm_recoveryservicesvault_info:
resource_group: 'myResourceGroup'
Expand Down Expand Up @@ -110,7 +114,6 @@ def __init__(self):
),
name=dict(
type='str',
required=True
)
)

Expand All @@ -137,13 +140,21 @@ def get_api_version(self):
return '2016-06-01'

def get_url(self):
return '/subscriptions/' \
+ self.subscription_id \
+ '/resourceGroups/' \
+ self.resource_group \
+ '/providers/Microsoft.RecoveryServices' \
+ '/vaults' + '/' \
+ self.name
if self.name is not None:
return '/subscriptions/' \
+ self.subscription_id \
+ '/resourceGroups/' \
+ self.resource_group \
+ '/providers/Microsoft.RecoveryServices' \
+ '/vaults' + '/' \
+ self.name
else:
return '/subscriptions/' \
+ self.subscription_id \
+ '/resourceGroups/' \
+ self.resource_group \
+ '/providers/Microsoft.RecoveryServices' \
+ '/vaults'

def exec_module(self, **kwargs):
for key in list(self.module_arg_spec.keys()):
Expand All @@ -162,7 +173,7 @@ def exec_module(self, **kwargs):
self.mgmt_client = self.get_mgmt_svc_client(GenericRestClient,
base_url=self._cloud_environment.endpoints.resource_manager)

changed = True
changed = False
response = self.get_recovery_service_vault_info()

self.results['response'] = response
Expand Down

0 comments on commit 6edd731

Please sign in to comment.