예제 #1
0
 internal Disable(DiskVolumeType volumeType)
 {
     this.volumeType = volumeType;
 }
 ///GENMHASH:60606BD7BB11968C7CA15EA85A54F23D:B21431AE460A6A3EA24A78638D0C7550
 public async Task <Microsoft.Azure.Management.Compute.Fluent.IDiskVolumeEncryptionMonitor> DisableAsync(DiskVolumeType volumeType, CancellationToken cancellationToken = default(CancellationToken))
 {
     return(await virtualMachineEncryptionHelper.DisableEncryptionAsync(volumeType, cancellationToken));
 }
예제 #3
0
 /// <summary>
 /// Creates an instance of type representing settings to disable encryption.
 /// </summary>
 /// <param name="volumeType">The disk volume that user required to disable encryption for.</param>
 /// <return>Disable settings.</return>
 internal static Disable CreateDisable(DiskVolumeType volumeType)
 {
     return(new EncryptionSettings.Disable(volumeType));
 }
예제 #4
0
 /// <summary>
 /// Initializes member variables to their initial values.
 /// </summary>
 /// <remarks>
 /// This function is called by the contructors.
 /// </remarks>
 private void InitializeMembers()
 {
     this.FileGroupType = FileGroupType.Unknown;
     this.layoutType = FileGroupLayoutType.Unknown;
     this.allocationType = FileGroupAllocationType.CrossVolume;
     this.diskVolumeType = DiskVolumeType.Data;
     this.fileGroupName = string.Empty;
     this.allocatedSpace = 0;
     this.fileCount = 0;
 }
 ///GENMHASH:111E7E7282F1AF5C0D13E925EE81F501:FBB9648A0907B504CC31792F37E4880E
 public IDiskVolumeEncryptionMonitor Disable(DiskVolumeType volumeType)
 {
     return(Extensions.Synchronize(() => DisableAsync(volumeType)));
 }
 ///GENMHASH:ED81FD69658AB4C787751DF16402585E:43501F666AB8B6252C9423192FE5CC88
 internal DisableEncryptConfig(DiskVolumeType volumeType)
 {
     this.volumeType = volumeType;
 }
예제 #7
0
 /// <summary>
 /// Creates a deep copy of the passed object.
 /// </summary>
 /// <param name="old">A <b>File Group</b> object to create the deep copy from.</param>
 private void CopyMembers(FileGroup old)
 {
     this.fileGroupType = old.fileGroupType;
     this.layoutType = old.layoutType;
     this.allocationType = old.allocationType;
     this.diskVolumeType = old.diskVolumeType;
     this.fileGroupName = old.fileGroupName;
     this.allocatedSpace = old.allocatedSpace;
     this.fileCount = old.fileCount;
 }
        /// <summary>
        /// Disables encryption on the given disk volume.
        /// </summary>
        /// <param name="volumeType">The disk volume.</param>
        /// <return>An observable that emits the decryption status.</return>
        ///GENMHASH:B980B0A762D67885E3B127392FD42890:A65E5C07D8DA37A2AB5EC199276933B9
        internal async Task <Microsoft.Azure.Management.Compute.Fluent.IDiskVolumeEncryptionMonitor> DisableEncryptionAsync(DiskVolumeType volumeType, CancellationToken cancellationToken = default(CancellationToken))
        {
            EnableDisableEncryptConfig encryptConfig = new DisableEncryptConfig(volumeType);

            await ValidateBeforeDecryptAsync(volumeType, cancellationToken);

            // Update the encryption extension if already installed
            //
            IVirtualMachine virtualMachine = await UpdateEncryptionExtensionAsync(encryptConfig, cancellationToken);

            if (virtualMachine == null)
            {
                // If encryption extension is not then install it
                //
                virtualMachine = await InstallEncryptionExtensionAsync(encryptConfig, cancellationToken);
            }
            // Validate and retrieve the encryption extension status
            //
            string status = await RetrieveEncryptionExtensionStatusStringAsync(ERROR_ENCRYPTION_EXTENSION_STATUS_IS_EMPTY, cancellationToken);

            // Update the VM's OS profile by marking encryption disabled
            //
            virtualMachine = await UpdateVMStorageProfileAsync(encryptConfig, cancellationToken);

            // Gets the encryption status
            //
            return(await GetDiskVolumeEncryptDecryptStatusAsync(virtualMachine, cancellationToken));
        }
예제 #9
0
        /// <summary>
        /// Disables encryption on the given disk volume.
        /// </summary>
        /// <param name="volumeType">The disk volume.</param>
        /// <return>An observable that emits the decryption status.</return>
        ///GENMHASH:B980B0A762D67885E3B127392FD42890:A65E5C07D8DA37A2AB5EC199276933B9
        internal async Task <Microsoft.Azure.Management.Compute.Fluent.IDiskVolumeEncryptionMonitor> DisableEncryptionAsync(DiskVolumeType volumeType, CancellationToken cancellationToken = default(CancellationToken))
        {
            var encryptConfig = EncryptionSettings.CreateDisable(volumeType);

            await ValidateBeforeDecryptAsync(volumeType, cancellationToken);

            // Update the encryption extension if already installed
            //
            IVirtualMachineExtension extension = await GetEncryptionExtensionInstalledInVMAsync(cancellationToken);

            IVirtualMachine virtualMachine = await UpdateEncryptionExtensionAsync(encryptConfig, extension, cancellationToken);

            bool isNoAAD = EncryptionExtensionIdentifier.IsNoAADVersion(osType, extension.VersionName);

            if (virtualMachine != null && !isNoAAD)
            {
                // Validate and retrieve the encryption extension status
                //
                string status = await RetrieveEncryptionExtensionStatusStringAsync(ERROR_ENCRYPTION_EXTENSION_STATUS_IS_EMPTY, cancellationToken);

                // Update the VM's OS profile by marking encryption disabled
                //
                virtualMachine = await UpdateVMStorageProfileAsync(encryptConfig, cancellationToken);
            }
            // Gets the encryption status
            //
            return(await GetDiskVolumeEncryptDecryptStatusAsync(virtualMachine, isNoAAD, cancellationToken));
        }
 /// <summary>
 /// Specifies the volume to encrypt.
 /// </summary>
 /// <param name="volumeType">The volume type.</param>
 /// <return>VirtualMachineEncryptionConfiguration.</return>
 ///GENMHASH:501A833E385B5DF04F6014D8C9E9807A:6E251199682F8B60497C7AE7344772AB
 public T WithVolumeType(DiskVolumeType volumeType)
 {
     this.volumeType = volumeType;
     return(self());
 }
예제 #11
0
        /// <summary>
        /// Initializes member variables to their initial values.
        /// </summary>
        /// <remarks>
        /// This function is called by the contructors.
        /// </remarks>
        private void InitializeMembers()
        {
            base.EntityType = EntityType.DiskVolume;
            base.EntityGroup = EntityGroup.Cluster;

            this.diskVolumeType = DiskVolumeType.Unknown;
            this.localPath = new ExpressionProperty(this, Constants.DiskVolumeLocalPath);
            this.uncPath = new ExpressionProperty(this, Constants.DiskVolumeUncPath);
            this.fullSpace = 0;
            this.allocatedSpace = 0;
            this.reservedSpace = 0;
            this.speed = 0;
        }
예제 #12
0
 /// <summary>
 /// Creates a deep copy of the passed object.
 /// </summary>
 /// <param name="old">A <b>Disk Volume</b> object to create the deep copy from.</param>
 private void CopyMembers(DiskVolume old)
 {
     this.diskVolumeType = old.diskVolumeType;
     this.localPath = new ExpressionProperty(old.localPath);
     this.uncPath = new ExpressionProperty(old.uncPath);
     this.fullSpace = old.fullSpace;
     this.allocatedSpace = old.allocatedSpace;
     this.reservedSpace = old.reservedSpace;
     this.speed = old.speed;
 }