diff --git a/lib/services/hdInsightManagement/lib/models/cluster.js b/lib/services/hdInsightManagement/lib/models/cluster.js index 1729397f80..beac80b0b1 100644 --- a/lib/services/hdInsightManagement/lib/models/cluster.js +++ b/lib/services/hdInsightManagement/lib/models/cluster.js @@ -71,6 +71,20 @@ class Cluster extends models['TrackedResource'] { * @member {array} [properties.errors] The list of errors. * @member {array} [properties.connectivityEndpoints] The list of * connectivity endpoints. + * @member {object} [properties.diskEncryptionProperties] The disk encryption + * properties. + * @member {string} [properties.diskEncryptionProperties.vaultUri] Base key + * vault URI where the customers key is located eg. + * https://myvault.vault.azure.net + * @member {string} [properties.diskEncryptionProperties.keyName] Key name + * that is used for enabling disk encryption. + * @member {string} [properties.diskEncryptionProperties.keyVersion] Specific + * key version that is used for enabling disk encryption. + * @member {string} [properties.diskEncryptionProperties.encryptionAlgorithm] + * Algorithm identifier for encryption, default RSA-OAEP. Possible values + * include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * @member {string} [properties.diskEncryptionProperties.msiResourceId] + * Resource ID of Managed Identity that is used to access the key vault. * @member {object} [identity] The identity of the cluster, if configured. * @member {string} [identity.principalId] The principal id of cluster * identity. This property will only be provided for a system assigned diff --git a/lib/services/hdInsightManagement/lib/models/clusterCreateParametersExtended.js b/lib/services/hdInsightManagement/lib/models/clusterCreateParametersExtended.js index 107334b35e..11b2dba4c9 100644 --- a/lib/services/hdInsightManagement/lib/models/clusterCreateParametersExtended.js +++ b/lib/services/hdInsightManagement/lib/models/clusterCreateParametersExtended.js @@ -60,6 +60,20 @@ class ClusterCreateParametersExtended { * @member {object} [properties.storageProfile] The storage profile. * @member {array} [properties.storageProfile.storageaccounts] The list of * storage accounts in the cluster. + * @member {object} [properties.diskEncryptionProperties] The disk encryption + * properties. + * @member {string} [properties.diskEncryptionProperties.vaultUri] Base key + * vault URI where the customers key is located eg. + * https://myvault.vault.azure.net + * @member {string} [properties.diskEncryptionProperties.keyName] Key name + * that is used for enabling disk encryption. + * @member {string} [properties.diskEncryptionProperties.keyVersion] Specific + * key version that is used for enabling disk encryption. + * @member {string} [properties.diskEncryptionProperties.encryptionAlgorithm] + * Algorithm identifier for encryption, default RSA-OAEP. Possible values + * include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * @member {string} [properties.diskEncryptionProperties.msiResourceId] + * Resource ID of Managed Identity that is used to access the key vault. * @member {object} [identity] The identity of the cluster, if configured. * @member {string} [identity.principalId] The principal id of cluster * identity. This property will only be provided for a system assigned diff --git a/lib/services/hdInsightManagement/lib/models/clusterCreateProperties.js b/lib/services/hdInsightManagement/lib/models/clusterCreateProperties.js index 9e4cec42e3..853e89365f 100644 --- a/lib/services/hdInsightManagement/lib/models/clusterCreateProperties.js +++ b/lib/services/hdInsightManagement/lib/models/clusterCreateProperties.js @@ -55,6 +55,19 @@ class ClusterCreateProperties { * @member {object} [storageProfile] The storage profile. * @member {array} [storageProfile.storageaccounts] The list of storage * accounts in the cluster. + * @member {object} [diskEncryptionProperties] The disk encryption + * properties. + * @member {string} [diskEncryptionProperties.vaultUri] Base key vault URI + * where the customers key is located eg. https://myvault.vault.azure.net + * @member {string} [diskEncryptionProperties.keyName] Key name that is used + * for enabling disk encryption. + * @member {string} [diskEncryptionProperties.keyVersion] Specific key + * version that is used for enabling disk encryption. + * @member {string} [diskEncryptionProperties.encryptionAlgorithm] Algorithm + * identifier for encryption, default RSA-OAEP. Possible values include: + * 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * @member {string} [diskEncryptionProperties.msiResourceId] Resource ID of + * Managed Identity that is used to access the key vault. */ constructor() { } @@ -127,6 +140,14 @@ class ClusterCreateProperties { name: 'Composite', className: 'StorageProfile' } + }, + diskEncryptionProperties: { + required: false, + serializedName: 'diskEncryptionProperties', + type: { + name: 'Composite', + className: 'DiskEncryptionProperties' + } } } } diff --git a/lib/services/hdInsightManagement/lib/models/clusterDiskEncryptionParameters.js b/lib/services/hdInsightManagement/lib/models/clusterDiskEncryptionParameters.js new file mode 100644 index 0000000000..86be7c03a7 --- /dev/null +++ b/lib/services/hdInsightManagement/lib/models/clusterDiskEncryptionParameters.js @@ -0,0 +1,71 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The Disk Encryption Cluster request parameters. + * + */ +class ClusterDiskEncryptionParameters { + /** + * Create a ClusterDiskEncryptionParameters. + * @member {string} [vaultUri] Base key vault URI where the customers key is + * located eg. https://myvault.vault.azure.net + * @member {string} [keyName] Key name that is used for enabling disk + * encryption. + * @member {string} [keyVersion] Specific key version that is used for + * enabling disk encryption. + */ + constructor() { + } + + /** + * Defines the metadata of ClusterDiskEncryptionParameters + * + * @returns {object} metadata of ClusterDiskEncryptionParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'ClusterDiskEncryptionParameters', + type: { + name: 'Composite', + className: 'ClusterDiskEncryptionParameters', + modelProperties: { + vaultUri: { + required: false, + serializedName: 'vaultUri', + type: { + name: 'String' + } + }, + keyName: { + required: false, + serializedName: 'keyName', + type: { + name: 'String' + } + }, + keyVersion: { + required: false, + serializedName: 'keyVersion', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ClusterDiskEncryptionParameters; diff --git a/lib/services/hdInsightManagement/lib/models/clusterGetProperties.js b/lib/services/hdInsightManagement/lib/models/clusterGetProperties.js index bc5dcbc986..8a40081ee5 100644 --- a/lib/services/hdInsightManagement/lib/models/clusterGetProperties.js +++ b/lib/services/hdInsightManagement/lib/models/clusterGetProperties.js @@ -62,6 +62,19 @@ class ClusterGetProperties { * @member {array} [errors] The list of errors. * @member {array} [connectivityEndpoints] The list of connectivity * endpoints. + * @member {object} [diskEncryptionProperties] The disk encryption + * properties. + * @member {string} [diskEncryptionProperties.vaultUri] Base key vault URI + * where the customers key is located eg. https://myvault.vault.azure.net + * @member {string} [diskEncryptionProperties.keyName] Key name that is used + * for enabling disk encryption. + * @member {string} [diskEncryptionProperties.keyVersion] Specific key + * version that is used for enabling disk encryption. + * @member {string} [diskEncryptionProperties.encryptionAlgorithm] Algorithm + * identifier for encryption, default RSA-OAEP. Possible values include: + * 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * @member {string} [diskEncryptionProperties.msiResourceId] Resource ID of + * Managed Identity that is used to access the key vault. */ constructor() { } @@ -186,6 +199,14 @@ class ClusterGetProperties { } } } + }, + diskEncryptionProperties: { + required: false, + serializedName: 'diskEncryptionProperties', + type: { + name: 'Composite', + className: 'DiskEncryptionProperties' + } } } } diff --git a/lib/services/hdInsightManagement/lib/models/diskEncryptionProperties.js b/lib/services/hdInsightManagement/lib/models/diskEncryptionProperties.js new file mode 100644 index 0000000000..b57aae3bb4 --- /dev/null +++ b/lib/services/hdInsightManagement/lib/models/diskEncryptionProperties.js @@ -0,0 +1,90 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The disk encryption properties + * + */ +class DiskEncryptionProperties { + /** + * Create a DiskEncryptionProperties. + * @member {string} [vaultUri] Base key vault URI where the customers key is + * located eg. https://myvault.vault.azure.net + * @member {string} [keyName] Key name that is used for enabling disk + * encryption. + * @member {string} [keyVersion] Specific key version that is used for + * enabling disk encryption. + * @member {string} [encryptionAlgorithm] Algorithm identifier for + * encryption, default RSA-OAEP. Possible values include: 'RSA-OAEP', + * 'RSA-OAEP-256', 'RSA1_5' + * @member {string} [msiResourceId] Resource ID of Managed Identity that is + * used to access the key vault. + */ + constructor() { + } + + /** + * Defines the metadata of DiskEncryptionProperties + * + * @returns {object} metadata of DiskEncryptionProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'DiskEncryptionProperties', + type: { + name: 'Composite', + className: 'DiskEncryptionProperties', + modelProperties: { + vaultUri: { + required: false, + serializedName: 'vaultUri', + type: { + name: 'String' + } + }, + keyName: { + required: false, + serializedName: 'keyName', + type: { + name: 'String' + } + }, + keyVersion: { + required: false, + serializedName: 'keyVersion', + type: { + name: 'String' + } + }, + encryptionAlgorithm: { + required: false, + serializedName: 'encryptionAlgorithm', + type: { + name: 'String' + } + }, + msiResourceId: { + required: false, + serializedName: 'msiResourceId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DiskEncryptionProperties; diff --git a/lib/services/hdInsightManagement/lib/models/index.d.ts b/lib/services/hdInsightManagement/lib/models/index.d.ts index fb99d9d241..4bf5990594 100644 --- a/lib/services/hdInsightManagement/lib/models/index.d.ts +++ b/lib/services/hdInsightManagement/lib/models/index.d.ts @@ -278,6 +278,32 @@ export interface StorageProfile { storageaccounts?: StorageAccount[]; } +/** + * @class + * Initializes a new instance of the DiskEncryptionProperties class. + * @constructor + * The disk encryption properties + * + * @member {string} [vaultUri] Base key vault URI where the customers key is + * located eg. https://myvault.vault.azure.net + * @member {string} [keyName] Key name that is used for enabling disk + * encryption. + * @member {string} [keyVersion] Specific key version that is used for enabling + * disk encryption. + * @member {string} [encryptionAlgorithm] Algorithm identifier for encryption, + * default RSA-OAEP. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', + * 'RSA1_5' + * @member {string} [msiResourceId] Resource ID of Managed Identity that is + * used to access the key vault. + */ +export interface DiskEncryptionProperties { + vaultUri?: string; + keyName?: string; + keyVersion?: string; + encryptionAlgorithm?: string; + msiResourceId?: string; +} + /** * @class * Initializes a new instance of the ClusterCreateProperties class. @@ -321,6 +347,18 @@ export interface StorageProfile { * @member {object} [storageProfile] The storage profile. * @member {array} [storageProfile.storageaccounts] The list of storage * accounts in the cluster. + * @member {object} [diskEncryptionProperties] The disk encryption properties. + * @member {string} [diskEncryptionProperties.vaultUri] Base key vault URI + * where the customers key is located eg. https://myvault.vault.azure.net + * @member {string} [diskEncryptionProperties.keyName] Key name that is used + * for enabling disk encryption. + * @member {string} [diskEncryptionProperties.keyVersion] Specific key version + * that is used for enabling disk encryption. + * @member {string} [diskEncryptionProperties.encryptionAlgorithm] Algorithm + * identifier for encryption, default RSA-OAEP. Possible values include: + * 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * @member {string} [diskEncryptionProperties.msiResourceId] Resource ID of + * Managed Identity that is used to access the key vault. */ export interface ClusterCreateProperties { clusterVersion?: string; @@ -330,6 +368,7 @@ export interface ClusterCreateProperties { securityProfile?: SecurityProfile; computeProfile?: ComputeProfile; storageProfile?: StorageProfile; + diskEncryptionProperties?: DiskEncryptionProperties; } /** @@ -419,6 +458,20 @@ export interface ClusterIdentity { * @member {object} [properties.storageProfile] The storage profile. * @member {array} [properties.storageProfile.storageaccounts] The list of * storage accounts in the cluster. + * @member {object} [properties.diskEncryptionProperties] The disk encryption + * properties. + * @member {string} [properties.diskEncryptionProperties.vaultUri] Base key + * vault URI where the customers key is located eg. + * https://myvault.vault.azure.net + * @member {string} [properties.diskEncryptionProperties.keyName] Key name that + * is used for enabling disk encryption. + * @member {string} [properties.diskEncryptionProperties.keyVersion] Specific + * key version that is used for enabling disk encryption. + * @member {string} [properties.diskEncryptionProperties.encryptionAlgorithm] + * Algorithm identifier for encryption, default RSA-OAEP. Possible values + * include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * @member {string} [properties.diskEncryptionProperties.msiResourceId] + * Resource ID of Managed Identity that is used to access the key vault. * @member {object} [identity] The identity of the cluster, if configured. * @member {string} [identity.principalId] The principal id of cluster * identity. This property will only be provided for a system assigned @@ -546,6 +599,18 @@ export interface ConnectivityEndpoint { * @member {number} [quotaInfo.coresUsed] The cores used by the cluster. * @member {array} [errors] The list of errors. * @member {array} [connectivityEndpoints] The list of connectivity endpoints. + * @member {object} [diskEncryptionProperties] The disk encryption properties. + * @member {string} [diskEncryptionProperties.vaultUri] Base key vault URI + * where the customers key is located eg. https://myvault.vault.azure.net + * @member {string} [diskEncryptionProperties.keyName] Key name that is used + * for enabling disk encryption. + * @member {string} [diskEncryptionProperties.keyVersion] Specific key version + * that is used for enabling disk encryption. + * @member {string} [diskEncryptionProperties.encryptionAlgorithm] Algorithm + * identifier for encryption, default RSA-OAEP. Possible values include: + * 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * @member {string} [diskEncryptionProperties.msiResourceId] Resource ID of + * Managed Identity that is used to access the key vault. */ export interface ClusterGetProperties { clusterVersion?: string; @@ -560,6 +625,7 @@ export interface ClusterGetProperties { quotaInfo?: QuotaInfo; errors?: Errors[]; connectivityEndpoints?: ConnectivityEndpoint[]; + diskEncryptionProperties?: DiskEncryptionProperties; } /** @@ -649,6 +715,20 @@ export interface TrackedResource extends Resource { * @member {array} [properties.errors] The list of errors. * @member {array} [properties.connectivityEndpoints] The list of connectivity * endpoints. + * @member {object} [properties.diskEncryptionProperties] The disk encryption + * properties. + * @member {string} [properties.diskEncryptionProperties.vaultUri] Base key + * vault URI where the customers key is located eg. + * https://myvault.vault.azure.net + * @member {string} [properties.diskEncryptionProperties.keyName] Key name that + * is used for enabling disk encryption. + * @member {string} [properties.diskEncryptionProperties.keyVersion] Specific + * key version that is used for enabling disk encryption. + * @member {string} [properties.diskEncryptionProperties.encryptionAlgorithm] + * Algorithm identifier for encryption, default RSA-OAEP. Possible values + * include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * @member {string} [properties.diskEncryptionProperties.msiResourceId] + * Resource ID of Managed Identity that is used to access the key vault. * @member {object} [identity] The identity of the cluster, if configured. * @member {string} [identity.principalId] The principal id of cluster * identity. This property will only be provided for a system assigned @@ -789,6 +869,25 @@ export interface ClusterResizeParameters { targetInstanceCount?: number; } +/** + * @class + * Initializes a new instance of the ClusterDiskEncryptionParameters class. + * @constructor + * The Disk Encryption Cluster request parameters. + * + * @member {string} [vaultUri] Base key vault URI where the customers key is + * located eg. https://myvault.vault.azure.net + * @member {string} [keyName] Key name that is used for enabling disk + * encryption. + * @member {string} [keyVersion] Specific key version that is used for enabling + * disk encryption. + */ +export interface ClusterDiskEncryptionParameters { + vaultUri?: string; + keyName?: string; + keyVersion?: string; +} + /** * @class * Initializes a new instance of the OperationResource class. diff --git a/lib/services/hdInsightManagement/lib/models/index.js b/lib/services/hdInsightManagement/lib/models/index.js index d9fce93bce..3d79a33a08 100644 --- a/lib/services/hdInsightManagement/lib/models/index.js +++ b/lib/services/hdInsightManagement/lib/models/index.js @@ -32,6 +32,7 @@ exports.Role = require('./role'); exports.ComputeProfile = require('./computeProfile'); exports.StorageAccount = require('./storageAccount'); exports.StorageProfile = require('./storageProfile'); +exports.DiskEncryptionProperties = require('./diskEncryptionProperties'); exports.ClusterCreateProperties = require('./clusterCreateProperties'); exports.ClusterIdentityUserAssignedIdentitiesValue = require('./clusterIdentityUserAssignedIdentitiesValue'); exports.ClusterIdentity = require('./clusterIdentity'); @@ -51,6 +52,7 @@ exports.ScriptActionExecutionSummary = require('./scriptActionExecutionSummary') exports.RuntimeScriptActionDetail = require('./runtimeScriptActionDetail'); exports.ClusterListRuntimeScriptActionDetailResult = require('./clusterListRuntimeScriptActionDetailResult'); exports.ClusterResizeParameters = require('./clusterResizeParameters'); +exports.ClusterDiskEncryptionParameters = require('./clusterDiskEncryptionParameters'); exports.OperationResource = require('./operationResource'); exports.ProxyResource = require('./proxyResource'); exports.ErrorResponse = require('./errorResponse'); diff --git a/lib/services/hdInsightManagement/lib/operations/clusters.js b/lib/services/hdInsightManagement/lib/operations/clusters.js index bc05de32ca..0fa7f3e46f 100644 --- a/lib/services/hdInsightManagement/lib/operations/clusters.js +++ b/lib/services/hdInsightManagement/lib/operations/clusters.js @@ -96,6 +96,28 @@ const WebResource = msRest.WebResource; * @param {array} [parameters.properties.storageProfile.storageaccounts] The * list of storage accounts in the cluster. * + * @param {object} [parameters.properties.diskEncryptionProperties] The disk + * encryption properties. + * + * @param {string} [parameters.properties.diskEncryptionProperties.vaultUri] + * Base key vault URI where the customers key is located eg. + * https://myvault.vault.azure.net + * + * @param {string} [parameters.properties.diskEncryptionProperties.keyName] Key + * name that is used for enabling disk encryption. + * + * @param {string} [parameters.properties.diskEncryptionProperties.keyVersion] + * Specific key version that is used for enabling disk encryption. + * + * @param {string} + * [parameters.properties.diskEncryptionProperties.encryptionAlgorithm] + * Algorithm identifier for encryption, default RSA-OAEP. Possible values + * include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * + * @param {string} + * [parameters.properties.diskEncryptionProperties.msiResourceId] Resource ID + * of Managed Identity that is used to access the key vault. + * * @param {object} [parameters.identity] The identity of the cluster, if * configured. * @@ -899,6 +921,80 @@ function _list(options, callback) { } +/** + * Rotate disk encryption key of the specified HDInsight cluster. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster. + * + * @param {object} parameters The parameters for the disk encryption operation. + * + * @param {string} [parameters.vaultUri] Base key vault URI where the customers + * key is located eg. https://myvault.vault.azure.net + * + * @param {string} [parameters.keyName] Key name that is used for enabling disk + * encryption. + * + * @param {string} [parameters.keyVersion] Specific key version that is used + * for enabling disk encryption. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _rotateDiskEncryptionKey(resourceGroupName, clusterName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginRotateDiskEncryptionKey(resourceGroupName, clusterName, parameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +} + + /** * Executes script actions on the specified HDInsight cluster. * @@ -1050,6 +1146,28 @@ function _executeScriptActions(resourceGroupName, clusterName, parameters, optio * @param {array} [parameters.properties.storageProfile.storageaccounts] The * list of storage accounts in the cluster. * + * @param {object} [parameters.properties.diskEncryptionProperties] The disk + * encryption properties. + * + * @param {string} [parameters.properties.diskEncryptionProperties.vaultUri] + * Base key vault URI where the customers key is located eg. + * https://myvault.vault.azure.net + * + * @param {string} [parameters.properties.diskEncryptionProperties.keyName] Key + * name that is used for enabling disk encryption. + * + * @param {string} [parameters.properties.diskEncryptionProperties.keyVersion] + * Specific key version that is used for enabling disk encryption. + * + * @param {string} + * [parameters.properties.diskEncryptionProperties.encryptionAlgorithm] + * Algorithm identifier for encryption, default RSA-OAEP. Possible values + * include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * + * @param {string} + * [parameters.properties.diskEncryptionProperties.msiResourceId] Resource ID + * of Managed Identity that is used to access the key vault. + * * @param {object} [parameters.identity] The identity of the cluster, if * configured. * @@ -1500,6 +1618,162 @@ function _beginResize(resourceGroupName, clusterName, parameters, options, callb }); } +/** + * Rotate disk encryption key of the specified HDInsight cluster. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster. + * + * @param {object} parameters The parameters for the disk encryption operation. + * + * @param {string} [parameters.vaultUri] Base key vault URI where the customers + * key is located eg. https://myvault.vault.azure.net + * + * @param {string} [parameters.keyName] Key name that is used for enabling disk + * encryption. + * + * @param {string} [parameters.keyVersion] Specific key version that is used + * for enabling disk encryption. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginRotateDiskEncryptionKey(resourceGroupName, clusterName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (clusterName === null || clusterName === undefined || typeof clusterName.valueOf() !== 'string') { + throw new Error('clusterName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/rotatediskencryptionkey'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{clusterName}', encodeURIComponent(clusterName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['ClusterDiskEncryptionParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + /** * Executes script actions on the specified HDInsight cluster. * @@ -1924,10 +2198,12 @@ class Clusters { this._listByResourceGroup = _listByResourceGroup; this._resize = _resize; this._list = _list; + this._rotateDiskEncryptionKey = _rotateDiskEncryptionKey; this._executeScriptActions = _executeScriptActions; this._beginCreate = _beginCreate; this._beginDeleteMethod = _beginDeleteMethod; this._beginResize = _beginResize; + this._beginRotateDiskEncryptionKey = _beginRotateDiskEncryptionKey; this._beginExecuteScriptActions = _beginExecuteScriptActions; this._listByResourceGroupNext = _listByResourceGroupNext; this._listNext = _listNext; @@ -2014,6 +2290,28 @@ class Clusters { * @param {array} [parameters.properties.storageProfile.storageaccounts] The * list of storage accounts in the cluster. * + * @param {object} [parameters.properties.diskEncryptionProperties] The disk + * encryption properties. + * + * @param {string} [parameters.properties.diskEncryptionProperties.vaultUri] + * Base key vault URI where the customers key is located eg. + * https://myvault.vault.azure.net + * + * @param {string} [parameters.properties.diskEncryptionProperties.keyName] Key + * name that is used for enabling disk encryption. + * + * @param {string} [parameters.properties.diskEncryptionProperties.keyVersion] + * Specific key version that is used for enabling disk encryption. + * + * @param {string} + * [parameters.properties.diskEncryptionProperties.encryptionAlgorithm] + * Algorithm identifier for encryption, default RSA-OAEP. Possible values + * include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * + * @param {string} + * [parameters.properties.diskEncryptionProperties.msiResourceId] Resource ID + * of Managed Identity that is used to access the key vault. + * * @param {object} [parameters.identity] The identity of the cluster, if * configured. * @@ -2134,6 +2432,28 @@ class Clusters { * @param {array} [parameters.properties.storageProfile.storageaccounts] The * list of storage accounts in the cluster. * + * @param {object} [parameters.properties.diskEncryptionProperties] The disk + * encryption properties. + * + * @param {string} [parameters.properties.diskEncryptionProperties.vaultUri] + * Base key vault URI where the customers key is located eg. + * https://myvault.vault.azure.net + * + * @param {string} [parameters.properties.diskEncryptionProperties.keyName] Key + * name that is used for enabling disk encryption. + * + * @param {string} [parameters.properties.diskEncryptionProperties.keyVersion] + * Specific key version that is used for enabling disk encryption. + * + * @param {string} + * [parameters.properties.diskEncryptionProperties.encryptionAlgorithm] + * Algorithm identifier for encryption, default RSA-OAEP. Possible values + * include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * + * @param {string} + * [parameters.properties.diskEncryptionProperties.msiResourceId] Resource ID + * of Managed Identity that is used to access the key vault. + * * @param {object} [parameters.identity] The identity of the cluster, if * configured. * @@ -2715,6 +3035,113 @@ class Clusters { } } + /** + * Rotate disk encryption key of the specified HDInsight cluster. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster. + * + * @param {object} parameters The parameters for the disk encryption operation. + * + * @param {string} [parameters.vaultUri] Base key vault URI where the customers + * key is located eg. https://myvault.vault.azure.net + * + * @param {string} [parameters.keyName] Key name that is used for enabling disk + * encryption. + * + * @param {string} [parameters.keyVersion] Specific key version that is used + * for enabling disk encryption. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + rotateDiskEncryptionKeyWithHttpOperationResponse(resourceGroupName, clusterName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._rotateDiskEncryptionKey(resourceGroupName, clusterName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Rotate disk encryption key of the specified HDInsight cluster. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster. + * + * @param {object} parameters The parameters for the disk encryption operation. + * + * @param {string} [parameters.vaultUri] Base key vault URI where the customers + * key is located eg. https://myvault.vault.azure.net + * + * @param {string} [parameters.keyName] Key name that is used for enabling disk + * encryption. + * + * @param {string} [parameters.keyVersion] Specific key version that is used + * for enabling disk encryption. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + rotateDiskEncryptionKey(resourceGroupName, clusterName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._rotateDiskEncryptionKey(resourceGroupName, clusterName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._rotateDiskEncryptionKey(resourceGroupName, clusterName, parameters, options, optionalCallback); + } + } + /** * Executes script actions on the specified HDInsight cluster. * @@ -2897,6 +3324,28 @@ class Clusters { * @param {array} [parameters.properties.storageProfile.storageaccounts] The * list of storage accounts in the cluster. * + * @param {object} [parameters.properties.diskEncryptionProperties] The disk + * encryption properties. + * + * @param {string} [parameters.properties.diskEncryptionProperties.vaultUri] + * Base key vault URI where the customers key is located eg. + * https://myvault.vault.azure.net + * + * @param {string} [parameters.properties.diskEncryptionProperties.keyName] Key + * name that is used for enabling disk encryption. + * + * @param {string} [parameters.properties.diskEncryptionProperties.keyVersion] + * Specific key version that is used for enabling disk encryption. + * + * @param {string} + * [parameters.properties.diskEncryptionProperties.encryptionAlgorithm] + * Algorithm identifier for encryption, default RSA-OAEP. Possible values + * include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * + * @param {string} + * [parameters.properties.diskEncryptionProperties.msiResourceId] Resource ID + * of Managed Identity that is used to access the key vault. + * * @param {object} [parameters.identity] The identity of the cluster, if * configured. * @@ -3017,6 +3466,28 @@ class Clusters { * @param {array} [parameters.properties.storageProfile.storageaccounts] The * list of storage accounts in the cluster. * + * @param {object} [parameters.properties.diskEncryptionProperties] The disk + * encryption properties. + * + * @param {string} [parameters.properties.diskEncryptionProperties.vaultUri] + * Base key vault URI where the customers key is located eg. + * https://myvault.vault.azure.net + * + * @param {string} [parameters.properties.diskEncryptionProperties.keyName] Key + * name that is used for enabling disk encryption. + * + * @param {string} [parameters.properties.diskEncryptionProperties.keyVersion] + * Specific key version that is used for enabling disk encryption. + * + * @param {string} + * [parameters.properties.diskEncryptionProperties.encryptionAlgorithm] + * Algorithm identifier for encryption, default RSA-OAEP. Possible values + * include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * + * @param {string} + * [parameters.properties.diskEncryptionProperties.msiResourceId] Resource ID + * of Managed Identity that is used to access the key vault. + * * @param {object} [parameters.identity] The identity of the cluster, if * configured. * @@ -3258,6 +3729,113 @@ class Clusters { } } + /** + * Rotate disk encryption key of the specified HDInsight cluster. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster. + * + * @param {object} parameters The parameters for the disk encryption operation. + * + * @param {string} [parameters.vaultUri] Base key vault URI where the customers + * key is located eg. https://myvault.vault.azure.net + * + * @param {string} [parameters.keyName] Key name that is used for enabling disk + * encryption. + * + * @param {string} [parameters.keyVersion] Specific key version that is used + * for enabling disk encryption. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginRotateDiskEncryptionKeyWithHttpOperationResponse(resourceGroupName, clusterName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginRotateDiskEncryptionKey(resourceGroupName, clusterName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Rotate disk encryption key of the specified HDInsight cluster. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster. + * + * @param {object} parameters The parameters for the disk encryption operation. + * + * @param {string} [parameters.vaultUri] Base key vault URI where the customers + * key is located eg. https://myvault.vault.azure.net + * + * @param {string} [parameters.keyName] Key name that is used for enabling disk + * encryption. + * + * @param {string} [parameters.keyVersion] Specific key version that is used + * for enabling disk encryption. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginRotateDiskEncryptionKey(resourceGroupName, clusterName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginRotateDiskEncryptionKey(resourceGroupName, clusterName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginRotateDiskEncryptionKey(resourceGroupName, clusterName, parameters, options, optionalCallback); + } + } + /** * Executes script actions on the specified HDInsight cluster. * diff --git a/lib/services/hdInsightManagement/lib/operations/index.d.ts b/lib/services/hdInsightManagement/lib/operations/index.d.ts index 168023edfd..835fee92e0 100644 --- a/lib/services/hdInsightManagement/lib/operations/index.d.ts +++ b/lib/services/hdInsightManagement/lib/operations/index.d.ts @@ -102,6 +102,28 @@ export interface Clusters { * @param {array} [parameters.properties.storageProfile.storageaccounts] The * list of storage accounts in the cluster. * + * @param {object} [parameters.properties.diskEncryptionProperties] The disk + * encryption properties. + * + * @param {string} [parameters.properties.diskEncryptionProperties.vaultUri] + * Base key vault URI where the customers key is located eg. + * https://myvault.vault.azure.net + * + * @param {string} [parameters.properties.diskEncryptionProperties.keyName] Key + * name that is used for enabling disk encryption. + * + * @param {string} [parameters.properties.diskEncryptionProperties.keyVersion] + * Specific key version that is used for enabling disk encryption. + * + * @param {string} + * [parameters.properties.diskEncryptionProperties.encryptionAlgorithm] + * Algorithm identifier for encryption, default RSA-OAEP. Possible values + * include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * + * @param {string} + * [parameters.properties.diskEncryptionProperties.msiResourceId] Resource ID + * of Managed Identity that is used to access the key vault. + * * @param {object} [parameters.identity] The identity of the cluster, if * configured. * @@ -210,6 +232,28 @@ export interface Clusters { * @param {array} [parameters.properties.storageProfile.storageaccounts] The * list of storage accounts in the cluster. * + * @param {object} [parameters.properties.diskEncryptionProperties] The disk + * encryption properties. + * + * @param {string} [parameters.properties.diskEncryptionProperties.vaultUri] + * Base key vault URI where the customers key is located eg. + * https://myvault.vault.azure.net + * + * @param {string} [parameters.properties.diskEncryptionProperties.keyName] Key + * name that is used for enabling disk encryption. + * + * @param {string} [parameters.properties.diskEncryptionProperties.keyVersion] + * Specific key version that is used for enabling disk encryption. + * + * @param {string} + * [parameters.properties.diskEncryptionProperties.encryptionAlgorithm] + * Algorithm identifier for encryption, default RSA-OAEP. Possible values + * include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * + * @param {string} + * [parameters.properties.diskEncryptionProperties.msiResourceId] Resource ID + * of Managed Identity that is used to access the key vault. + * * @param {object} [parameters.identity] The identity of the cluster, if * configured. * @@ -614,6 +658,86 @@ export interface Clusters { list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** + * Rotate disk encryption key of the specified HDInsight cluster. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster. + * + * @param {object} parameters The parameters for the disk encryption operation. + * + * @param {string} [parameters.vaultUri] Base key vault URI where the customers + * key is located eg. https://myvault.vault.azure.net + * + * @param {string} [parameters.keyName] Key name that is used for enabling disk + * encryption. + * + * @param {string} [parameters.keyVersion] Specific key version that is used + * for enabling disk encryption. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + rotateDiskEncryptionKeyWithHttpOperationResponse(resourceGroupName: string, clusterName: string, parameters: models.ClusterDiskEncryptionParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Rotate disk encryption key of the specified HDInsight cluster. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster. + * + * @param {object} parameters The parameters for the disk encryption operation. + * + * @param {string} [parameters.vaultUri] Base key vault URI where the customers + * key is located eg. https://myvault.vault.azure.net + * + * @param {string} [parameters.keyName] Key name that is used for enabling disk + * encryption. + * + * @param {string} [parameters.keyVersion] Specific key version that is used + * for enabling disk encryption. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + rotateDiskEncryptionKey(resourceGroupName: string, clusterName: string, parameters: models.ClusterDiskEncryptionParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + rotateDiskEncryptionKey(resourceGroupName: string, clusterName: string, parameters: models.ClusterDiskEncryptionParameters, callback: ServiceCallback): void; + rotateDiskEncryptionKey(resourceGroupName: string, clusterName: string, parameters: models.ClusterDiskEncryptionParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * Executes script actions on the specified HDInsight cluster. * @@ -769,6 +893,28 @@ export interface Clusters { * @param {array} [parameters.properties.storageProfile.storageaccounts] The * list of storage accounts in the cluster. * + * @param {object} [parameters.properties.diskEncryptionProperties] The disk + * encryption properties. + * + * @param {string} [parameters.properties.diskEncryptionProperties.vaultUri] + * Base key vault URI where the customers key is located eg. + * https://myvault.vault.azure.net + * + * @param {string} [parameters.properties.diskEncryptionProperties.keyName] Key + * name that is used for enabling disk encryption. + * + * @param {string} [parameters.properties.diskEncryptionProperties.keyVersion] + * Specific key version that is used for enabling disk encryption. + * + * @param {string} + * [parameters.properties.diskEncryptionProperties.encryptionAlgorithm] + * Algorithm identifier for encryption, default RSA-OAEP. Possible values + * include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * + * @param {string} + * [parameters.properties.diskEncryptionProperties.msiResourceId] Resource ID + * of Managed Identity that is used to access the key vault. + * * @param {object} [parameters.identity] The identity of the cluster, if * configured. * @@ -877,6 +1023,28 @@ export interface Clusters { * @param {array} [parameters.properties.storageProfile.storageaccounts] The * list of storage accounts in the cluster. * + * @param {object} [parameters.properties.diskEncryptionProperties] The disk + * encryption properties. + * + * @param {string} [parameters.properties.diskEncryptionProperties.vaultUri] + * Base key vault URI where the customers key is located eg. + * https://myvault.vault.azure.net + * + * @param {string} [parameters.properties.diskEncryptionProperties.keyName] Key + * name that is used for enabling disk encryption. + * + * @param {string} [parameters.properties.diskEncryptionProperties.keyVersion] + * Specific key version that is used for enabling disk encryption. + * + * @param {string} + * [parameters.properties.diskEncryptionProperties.encryptionAlgorithm] + * Algorithm identifier for encryption, default RSA-OAEP. Possible values + * include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * + * @param {string} + * [parameters.properties.diskEncryptionProperties.msiResourceId] Resource ID + * of Managed Identity that is used to access the key vault. + * * @param {object} [parameters.identity] The identity of the cluster, if * configured. * @@ -1049,6 +1217,86 @@ export interface Clusters { beginResize(resourceGroupName: string, clusterName: string, parameters: models.ClusterResizeParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** + * Rotate disk encryption key of the specified HDInsight cluster. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster. + * + * @param {object} parameters The parameters for the disk encryption operation. + * + * @param {string} [parameters.vaultUri] Base key vault URI where the customers + * key is located eg. https://myvault.vault.azure.net + * + * @param {string} [parameters.keyName] Key name that is used for enabling disk + * encryption. + * + * @param {string} [parameters.keyVersion] Specific key version that is used + * for enabling disk encryption. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginRotateDiskEncryptionKeyWithHttpOperationResponse(resourceGroupName: string, clusterName: string, parameters: models.ClusterDiskEncryptionParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Rotate disk encryption key of the specified HDInsight cluster. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster. + * + * @param {object} parameters The parameters for the disk encryption operation. + * + * @param {string} [parameters.vaultUri] Base key vault URI where the customers + * key is located eg. https://myvault.vault.azure.net + * + * @param {string} [parameters.keyName] Key name that is used for enabling disk + * encryption. + * + * @param {string} [parameters.keyVersion] Specific key version that is used + * for enabling disk encryption. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginRotateDiskEncryptionKey(resourceGroupName: string, clusterName: string, parameters: models.ClusterDiskEncryptionParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginRotateDiskEncryptionKey(resourceGroupName: string, clusterName: string, parameters: models.ClusterDiskEncryptionParameters, callback: ServiceCallback): void; + beginRotateDiskEncryptionKey(resourceGroupName: string, clusterName: string, parameters: models.ClusterDiskEncryptionParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * Executes script actions on the specified HDInsight cluster. *