def _process_resource(self, resource): sid = StorageAccountId(resource['id']) self.client.update_storage_account( sid.vault, sid.name, active_key_name=self.data.get('active-key-name', None), auto_regenerate_key=self.data.get('auto-regenerate-key', None), regeneration_period=self.data.get('regeneration-period', None))
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
def _process_resource(self, resource): sid = StorageAccountId(resource['id']) self.client.regenerate_storage_account_key( sid.vault, sid.name, resource[gap('extra')]['activeKeyName'])