def augment(self, resources):
        resources = super(KeyVaultStorage, self).augment(resources)

        client = self.get_client()
        extra_fields = ['autoRegenerateKey', 'regenerationPeriod', 'activeKeyName']

        for r in resources:
            sid = StorageAccountId(r['id'])
            data = client.get_storage_account(sid.vault, sid.name).serialize(True)
            r[gap('extra')] = {k: v for k, v in data.items() if k in extra_fields}

        return resources
Exemple #2
0
 def _process_resource(self, resource):
     sid = StorageAccountId(resource['id'])
     self.client.regenerate_storage_account_key(
         sid.vault, sid.name, resource[gap('extra')]['activeKeyName'])
Exemple #3
0
 def __init__(self, *args, **kwargs):
     super(KeyVaultStorageActiveKeyNameFilter,
           self).__init__(*args, **kwargs)
     self.data['key'] = '"{0}".activeKeyName'.format(gap('extra'))
     self.data['op'] = 'eq'
     self.data['value_type'] = 'normalize'
Exemple #4
0
 def __init__(self, *args, **kwargs):
     super(KeyVaultStorageRegenerationPeriodFilter,
           self).__init__(*args, **kwargs)
     self.data['key'] = '"{0}".regenerationPeriod'.format(gap('extra'))
Exemple #5
0
 def __init__(self, *args, **kwargs):
     super(KeyVaultStorageAutoRegenerateKeyFilter,
           self).__init__(*args, **kwargs)
     self.data['key'] = '"{0}".autoRegenerateKey'.format(gap('extra'))
     self.data['op'] = 'eq'