def create_vault(self, vault_name): params_sku = Sku(name=SkuName.standard, ) params_create = Vault(location=self.location, sku=params_sku, properties=VaultProperties()) self.client.vaults.create_or_update(self.resource_group, vault_name, params_create)
def create_vault(client, vault_name, resource_group_name, location): vault_sku = Sku(name=SkuName.standard) vault_properties = VaultProperties() vault = Vault(location=location, sku=vault_sku, properties=vault_properties) return client.create_or_update(resource_group_name, vault_name, vault)
def create_vault(client, vault_name, region, resource_group_name): vault_sku = Sku(SkuName.standard) vault_properties = VaultProperties() vault = Vault(region, sku=vault_sku, properties=vault_properties) return client.create_or_update(resource_group_name, vault_name, vault, custom_headers=_get_custom_headers())
def create_vault(self): vault = Vault( location='southeastasia', sku=Sku( name=SkuName.standard, ), properties=VaultProperties() ) self.vault_client.vaults.create_or_update(self.resource_group, self.vault_name, vault)
def create_vault(self, rg_name, vault_name, location): """ Create Recovery Services vault. Args: rg_name (str): Azure resource group name vault_name (str): Recovery Services vault name location (str): vault's location """ params_sku = Sku(name=SkuName.standard) params_create = Vault( location=location, sku=params_sku, properties=VaultProperties() ) self.recovery_client.vaults.create_or_update(rg_name, vault_name, params_create)
#!/usr/bin/env python from azure.common.client_factory import get_client_from_cli_profile from azure.mgmt.resource.subscriptions import SubscriptionClient from azure.mgmt.recoveryservices import RecoveryServicesClient from azure.mgmt.recoveryservices.models import (Vault, Sku, SkuName, VaultProperties) if __name__ == "__main__": subscription_client = get_client_from_cli_profile(SubscriptionClient) recoveryservices_client = get_client_from_cli_profile( RecoveryServicesClient) # sku_parameter = Sku(name=SkuName.standard) # sku_parameter = Sku(name=SkuName.rs0) # sku_parameter = Sku(name='RS0') sku_parameter = Sku(name='Standard') vault_model = Vault(location='westus', sku=sku_parameter, properties=VaultProperties(), tags={'tagname': 'tagvalue'}) rsv = recoveryservices_client.vaults.create_or_update( resource_group_name='rgname', vault_name='vaultname', vault=vault_model) rsv_dict = rsv.as_dict() print('#####')