Search in sources :

Example 1 with DiskInner

use of com.microsoft.azure.management.compute.implementation.DiskInner in project cloudbreak by hortonworks.

the class AzureClient method setupDiskEncryptionWithDesIfNeeded.

@VisibleForTesting
void setupDiskEncryptionWithDesIfNeeded(String diskEncryptionSetId, Disk.DefinitionStages.WithCreate withCreate) {
    if (!Strings.isNullOrEmpty(diskEncryptionSetId)) {
        // This is nasty. The DES setter is not exposed in WithCreate, so have to rely on the direct tweaking of the underlying DiskInner.
        Encryption encryption = new Encryption();
        encryption.withDiskEncryptionSetId(diskEncryptionSetId);
        // WithCreate is actually a DiskImpl instance, but that type is not visible.
        DiskInner inner = (DiskInner) ((IndexableRefreshableWrapperImpl) withCreate).inner();
        inner.withEncryption(encryption);
    }
}
Also used : Encryption(com.microsoft.azure.management.compute.Encryption) DiskInner(com.microsoft.azure.management.compute.implementation.DiskInner) VisibleForTesting(com.google.common.annotations.VisibleForTesting)

Aggregations

VisibleForTesting (com.google.common.annotations.VisibleForTesting)1 Encryption (com.microsoft.azure.management.compute.Encryption)1 DiskInner (com.microsoft.azure.management.compute.implementation.DiskInner)1