예제 #1
0
def create_policy(client, resource_group_name, vault_name, name, policy, backup_management_type, workload_type=None):
    if backup_management_type.lower() == "azurestorage":
        return custom_afs.create_policy(client, resource_group_name, vault_name, name, policy)
    if backup_management_type.lower() == "azureworkload":
        if workload_type is None:
            raise CLIError("Please provide workload type.")
        return custom_wl.create_policy(client, resource_group_name, vault_name, name, policy, workload_type)
    return None
예제 #2
0
def create_policy(client,
                  resource_group_name,
                  vault_name,
                  name,
                  policy,
                  backup_management_type,
                  workload_type=None):
    if backup_management_type.lower() == "azurestorage":
        return custom_afs.create_policy(client, resource_group_name,
                                        vault_name, name, policy)
    if backup_management_type.lower() == "azureworkload":
        if workload_type is None:
            raise RequiredArgumentMissingError(
                "Please provide workload type. Use --workload-type.")
        return custom_wl.create_policy(client, resource_group_name, vault_name,
                                       name, policy, workload_type)
    if backup_management_type.lower() == "azureiaasvm":
        return custom.create_policy(client, resource_group_name, vault_name,
                                    name, policy)
    return None