Search in sources :

Example 1 with StorageAccountSkuType

use of com.microsoft.azure.management.storage.StorageAccountSkuType in project cloudbreak by hortonworks.

the class SkuTypeResolverTest method testResolving.

@Test
public void testResolving() {
    StorageAccountSkuType result = underTest.resolveFromAzureDiskType(pair.getAzureDiskType());
    Assert.assertEquals(pair.getExpectedStorageAccountSkuType().name(), result.name());
}
Also used : StorageAccountSkuType(com.microsoft.azure.management.storage.StorageAccountSkuType) Test(org.junit.Test)

Example 2 with StorageAccountSkuType

use of com.microsoft.azure.management.storage.StorageAccountSkuType in project cloudbreak by hortonworks.

the class SkuTypeResolver method resolveFromAzureDiskType.

public StorageAccountSkuType resolveFromAzureDiskType(AzureDiskType type) {
    StorageAccountSkuType result = null;
    if (type != null) {
        String[] typeComponents = type.value().split("_");
        String prefix = "";
        if (typeComponents[0].toUpperCase().contains("STANDARD")) {
            prefix = "STANDARD";
        } else if (typeComponents[0].toUpperCase().contains("PREMIUM")) {
            prefix = "PREMIUM";
        }
        result = StorageAccountSkuType.fromSkuName(SkuName.fromString(prefix + "_" + typeComponents[typeComponents.length - 1]));
    }
    return result;
}
Also used : StorageAccountSkuType(com.microsoft.azure.management.storage.StorageAccountSkuType)

Aggregations

StorageAccountSkuType (com.microsoft.azure.management.storage.StorageAccountSkuType)2 Test (org.junit.Test)1