Search in sources :

Example 1 with WithCreate

use of com.microsoft.azure.management.storage.StorageAccount.DefinitionStages.WithCreate in project cloudbreak by hortonworks.

the class AzureClient method createStorageAccount.

public StorageAccount createStorageAccount(String resourceGroup, String storageName, String storageLocation, SkuName accType, Boolean encryted, Map<String, String> tags, Map<String, String> costFollowerTags) {
    Map<String, String> resultTags = new HashMap<>();
    for (Entry<String, String> entry : costFollowerTags.entrySet()) {
        resultTags.put(entry.getKey(), entry.getValue());
    }
    resultTags.putAll(tags);
    return handleAuthException(() -> {
        WithCreate withCreate = azure.storageAccounts().define(storageName).withRegion(storageLocation).withExistingResourceGroup(resourceGroup).withTags(resultTags).withSku(accType);
        if (encryted) {
            withCreate.withEncryption();
        }
        return withCreate.create();
    });
}
Also used : WithCreate(com.microsoft.azure.management.storage.StorageAccount.DefinitionStages.WithCreate) HashMap(java.util.HashMap)

Aggregations

WithCreate (com.microsoft.azure.management.storage.StorageAccount.DefinitionStages.WithCreate)1 HashMap (java.util.HashMap)1