diff --git a/lib/services/dataLake.Analytics/lib/account/dataLakeAnalyticsAccountManagementClient.d.ts b/lib/services/dataLake.Analytics/lib/account/dataLakeAnalyticsAccountManagementClient.d.ts index f2b7e2675c..fbdf64b099 100644 --- a/lib/services/dataLake.Analytics/lib/account/dataLakeAnalyticsAccountManagementClient.d.ts +++ b/lib/services/dataLake.Analytics/lib/account/dataLakeAnalyticsAccountManagementClient.d.ts @@ -56,9 +56,10 @@ declare class DataLakeAnalyticsAccountManagementClient { generateClientRequestId: boolean; // Operation groups + firewallRules: operations.FirewallRules; storageAccounts: operations.StorageAccounts; dataLakeStoreAccounts: operations.DataLakeStoreAccounts; - account: operations.Account; + accountOperations: operations.AccountOperations; } export = DataLakeAnalyticsAccountManagementClient; diff --git a/lib/services/dataLake.Analytics/lib/account/dataLakeAnalyticsAccountManagementClient.js b/lib/services/dataLake.Analytics/lib/account/dataLakeAnalyticsAccountManagementClient.js index 2a5ae1bb10..84f2d9c67f 100644 --- a/lib/services/dataLake.Analytics/lib/account/dataLakeAnalyticsAccountManagementClient.js +++ b/lib/services/dataLake.Analytics/lib/account/dataLakeAnalyticsAccountManagementClient.js @@ -85,9 +85,10 @@ function DataLakeAnalyticsAccountManagementClient(credentials, subscriptionId, b if(options.generateClientRequestId !== null && options.generateClientRequestId !== undefined) { this.generateClientRequestId = options.generateClientRequestId; } + this.firewallRules = new operations.FirewallRules(this); this.storageAccounts = new operations.StorageAccounts(this); this.dataLakeStoreAccounts = new operations.DataLakeStoreAccounts(this); - this.account = new operations.Account(this); + this.accountOperations = new operations.AccountOperations(this); this.models = models; msRest.addSerializationMixin(this); } diff --git a/lib/services/dataLake.Analytics/lib/account/models/dataLakeAnalyticsAccount.js b/lib/services/dataLake.Analytics/lib/account/models/dataLakeAnalyticsAccount.js index 494ebf2ec0..7da4079f76 100644 --- a/lib/services/dataLake.Analytics/lib/account/models/dataLakeAnalyticsAccount.js +++ b/lib/services/dataLake.Analytics/lib/account/models/dataLakeAnalyticsAccount.js @@ -61,6 +61,30 @@ var util = require('util'); * * @member {string} [endpoint] the full CName endpoint for this account. * + * @member {string} [newTier] the commitment tier for the next month. Possible + * values include: 'Consumption', 'Commitment_100AUHours', + * 'Commitment_500AUHours', 'Commitment_1000AUHours', 'Commitment_5000AUHours', + * 'Commitment_10000AUHours', 'Commitment_50000AUHours', + * 'Commitment_100000AUHours', 'Commitment_500000AUHours' + * + * @member {string} [currentTier] the commitment tier in use for the current + * month. Possible values include: 'Consumption', 'Commitment_100AUHours', + * 'Commitment_500AUHours', 'Commitment_1000AUHours', 'Commitment_5000AUHours', + * 'Commitment_10000AUHours', 'Commitment_50000AUHours', + * 'Commitment_100000AUHours', 'Commitment_500000AUHours' + * + * @member {string} [firewallState] The current state of the IP address + * firewall for this Data Lake Analytics account. Possible values include: + * 'Enabled', 'Disabled' + * + * @member {string} [firewallAllowAzureIps] The current state of allowing or + * disallowing IPs originating within Azure through the firewall. If the + * firewall is disabled, this is not enforced. Possible values include: + * 'Enabled', 'Disabled' + * + * @member {array} [firewallRules] The list of firewall rules associated with + * this Data Lake Analytics account. + * */ function DataLakeAnalyticsAccount() { DataLakeAnalyticsAccount['super_'].call(this); @@ -255,6 +279,54 @@ DataLakeAnalyticsAccount.prototype.mapper = function () { type: { name: 'String' } + }, + newTier: { + required: false, + serializedName: 'properties.newTier', + type: { + name: 'Enum', + allowedValues: [ 'Consumption', 'Commitment_100AUHours', 'Commitment_500AUHours', 'Commitment_1000AUHours', 'Commitment_5000AUHours', 'Commitment_10000AUHours', 'Commitment_50000AUHours', 'Commitment_100000AUHours', 'Commitment_500000AUHours' ] + } + }, + currentTier: { + required: false, + readOnly: true, + serializedName: 'properties.currentTier', + type: { + name: 'Enum', + allowedValues: [ 'Consumption', 'Commitment_100AUHours', 'Commitment_500AUHours', 'Commitment_1000AUHours', 'Commitment_5000AUHours', 'Commitment_10000AUHours', 'Commitment_50000AUHours', 'Commitment_100000AUHours', 'Commitment_500000AUHours' ] + } + }, + firewallState: { + required: false, + serializedName: 'properties.firewallState', + type: { + name: 'Enum', + allowedValues: [ 'Enabled', 'Disabled' ] + } + }, + firewallAllowAzureIps: { + required: false, + serializedName: 'properties.firewallAllowAzureIps', + type: { + name: 'Enum', + allowedValues: [ 'Enabled', 'Disabled' ] + } + }, + firewallRules: { + required: false, + serializedName: 'properties.firewallRules', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'FirewallRuleElementType', + type: { + name: 'Composite', + className: 'FirewallRule' + } + } + } } } } diff --git a/lib/services/dataLake.Analytics/lib/account/models/dataLakeAnalyticsAccountUpdateParameters.js b/lib/services/dataLake.Analytics/lib/account/models/dataLakeAnalyticsAccountUpdateParameters.js index 903555bc43..4687d634ce 100644 --- a/lib/services/dataLake.Analytics/lib/account/models/dataLakeAnalyticsAccountUpdateParameters.js +++ b/lib/services/dataLake.Analytics/lib/account/models/dataLakeAnalyticsAccountUpdateParameters.js @@ -10,6 +10,10 @@ 'use strict'; +var models = require('./index'); + +var util = require('util'); + /** * @class * Initializes a new instance of the DataLakeAnalyticsAccountUpdateParameters class. @@ -28,6 +32,24 @@ * @member {number} [maxJobCount] the maximum supported jobs running under the * account at the same time. * + * @member {string} [newTier] the commitment tier to use for next month. + * Possible values include: 'Consumption', 'Commitment_100AUHours', + * 'Commitment_500AUHours', 'Commitment_1000AUHours', 'Commitment_5000AUHours', + * 'Commitment_10000AUHours', 'Commitment_50000AUHours', + * 'Commitment_100000AUHours', 'Commitment_500000AUHours' + * + * @member {string} [firewallState] The current state of the IP address + * firewall for this Data Lake Analytics account. Possible values include: + * 'Enabled', 'Disabled' + * + * @member {string} [firewallAllowAzureIps] The current state of allowing or + * disallowing IPs originating within Azure through the firewall. If the + * firewall is disabled, this is not enforced. Possible values include: + * 'Enabled', 'Disabled' + * + * @member {array} [firewallRules] The list of firewall rules associated with + * this Data Lake Analytics account. + * */ function DataLakeAnalyticsAccountUpdateParameters() { } @@ -90,6 +112,45 @@ DataLakeAnalyticsAccountUpdateParameters.prototype.mapper = function () { type: { name: 'Number' } + }, + newTier: { + required: false, + serializedName: 'properties.newTier', + type: { + name: 'Enum', + allowedValues: [ 'Consumption', 'Commitment_100AUHours', 'Commitment_500AUHours', 'Commitment_1000AUHours', 'Commitment_5000AUHours', 'Commitment_10000AUHours', 'Commitment_50000AUHours', 'Commitment_100000AUHours', 'Commitment_500000AUHours' ] + } + }, + firewallState: { + required: false, + serializedName: 'properties.firewallState', + type: { + name: 'Enum', + allowedValues: [ 'Enabled', 'Disabled' ] + } + }, + firewallAllowAzureIps: { + required: false, + serializedName: 'properties.firewallAllowAzureIps', + type: { + name: 'Enum', + allowedValues: [ 'Enabled', 'Disabled' ] + } + }, + firewallRules: { + required: false, + serializedName: 'properties.firewallRules', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'FirewallRuleElementType', + type: { + name: 'Composite', + className: 'FirewallRule' + } + } + } } } } diff --git a/lib/services/dataLake.Analytics/lib/account/models/dataLakeAnalyticsFirewallRuleListResult.js b/lib/services/dataLake.Analytics/lib/account/models/dataLakeAnalyticsFirewallRuleListResult.js new file mode 100644 index 0000000000..02eedbe682 --- /dev/null +++ b/lib/services/dataLake.Analytics/lib/account/models/dataLakeAnalyticsFirewallRuleListResult.js @@ -0,0 +1,72 @@ +/* + * 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'; + +var util = require('util'); + +/** + * @class + * Initializes a new instance of the DataLakeAnalyticsFirewallRuleListResult class. + * @constructor + * Data Lake Analytics firewall rule list information. + * + * @member {string} [nextLink] the link (url) to the next page of results. + * + */ +function DataLakeAnalyticsFirewallRuleListResult() { +} + +util.inherits(DataLakeAnalyticsFirewallRuleListResult, Array); + +/** + * Defines the metadata of DataLakeAnalyticsFirewallRuleListResult + * + * @returns {object} metadata of DataLakeAnalyticsFirewallRuleListResult + * + */ +DataLakeAnalyticsFirewallRuleListResult.prototype.mapper = function () { + return { + required: false, + serializedName: 'DataLakeAnalyticsFirewallRuleListResult', + type: { + name: 'Composite', + className: 'DataLakeAnalyticsFirewallRuleListResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'FirewallRuleElementType', + type: { + name: 'Composite', + className: 'FirewallRule' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; +}; + +module.exports = DataLakeAnalyticsFirewallRuleListResult; diff --git a/lib/services/dataLake.Analytics/lib/account/models/firewallRule.js b/lib/services/dataLake.Analytics/lib/account/models/firewallRule.js new file mode 100644 index 0000000000..3c505272f7 --- /dev/null +++ b/lib/services/dataLake.Analytics/lib/account/models/firewallRule.js @@ -0,0 +1,93 @@ +/* + * 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'; + +var models = require('./index'); + +var util = require('util'); + +/** + * @class + * Initializes a new instance of the FirewallRule class. + * @constructor + * Data Lake Analytics firewall rule information + * + * @member {string} startIpAddress the start IP address for the firewall rule. + * This can be either ipv4 or ipv6. Start and End should be in the same + * protocol. + * + * @member {string} endIpAddress the end IP address for the firewall rule. This + * can be either ipv4 or ipv6. Start and End should be in the same protocol. + * + */ +function FirewallRule() { + FirewallRule['super_'].call(this); +} + +util.inherits(FirewallRule, models['OptionalSubResource']); + +/** + * Defines the metadata of FirewallRule + * + * @returns {object} metadata of FirewallRule + * + */ +FirewallRule.prototype.mapper = function () { + return { + required: false, + serializedName: 'FirewallRule', + type: { + name: 'Composite', + className: 'FirewallRule', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + startIpAddress: { + required: true, + serializedName: 'properties.startIpAddress', + type: { + name: 'String' + } + }, + endIpAddress: { + required: true, + serializedName: 'properties.endIpAddress', + type: { + name: 'String' + } + } + } + } + }; +}; + +module.exports = FirewallRule; diff --git a/lib/services/dataLake.Analytics/lib/account/models/index.d.ts b/lib/services/dataLake.Analytics/lib/account/models/index.d.ts index 4e0d1e568a..8921227176 100644 --- a/lib/services/dataLake.Analytics/lib/account/models/index.d.ts +++ b/lib/services/dataLake.Analytics/lib/account/models/index.d.ts @@ -25,7 +25,7 @@ exports.CloudError = msRestAzure.CloudError; * @member {string} [type] Resource type * */ -export interface SubResource extends BaseResource { +export interface SubResource { id?: string; name: string; type?: string; @@ -165,6 +165,45 @@ export interface DataLakeAnalyticsAccountListDataLakeStoreResult { nextLink?: string; } +/** + * @class + * Initializes a new instance of the OptionalSubResource class. + * @constructor + * The Resource model definition for a nested resource with no required + * properties. + * + * @member {string} [id] Resource Id + * + * @member {string} [name] Resource name + * + * @member {string} [type] Resource type + * + */ +export interface OptionalSubResource { + id?: string; + name?: string; + type?: string; +} + +/** + * @class + * Initializes a new instance of the FirewallRule class. + * @constructor + * Data Lake Analytics firewall rule information + * + * @member {string} startIpAddress the start IP address for the firewall rule. + * This can be either ipv4 or ipv6. Start and End should be in the same + * protocol. + * + * @member {string} endIpAddress the end IP address for the firewall rule. This + * can be either ipv4 or ipv6. Start and End should be in the same protocol. + * + */ +export interface FirewallRule extends OptionalSubResource { + startIpAddress: string; + endIpAddress: string; +} + /** * @class * Initializes a new instance of the AddDataLakeStoreParameters class. @@ -233,12 +272,34 @@ export interface UpdateStorageAccountParameters { * @member {number} [maxJobCount] the maximum supported jobs running under the * account at the same time. * + * @member {string} [newTier] the commitment tier to use for next month. + * Possible values include: 'Consumption', 'Commitment_100AUHours', + * 'Commitment_500AUHours', 'Commitment_1000AUHours', 'Commitment_5000AUHours', + * 'Commitment_10000AUHours', 'Commitment_50000AUHours', + * 'Commitment_100000AUHours', 'Commitment_500000AUHours' + * + * @member {string} [firewallState] The current state of the IP address + * firewall for this Data Lake Analytics account. Possible values include: + * 'Enabled', 'Disabled' + * + * @member {string} [firewallAllowAzureIps] The current state of allowing or + * disallowing IPs originating within Azure through the firewall. If the + * firewall is disabled, this is not enforced. Possible values include: + * 'Enabled', 'Disabled' + * + * @member {array} [firewallRules] The list of firewall rules associated with + * this Data Lake Analytics account. + * */ export interface DataLakeAnalyticsAccountUpdateParameters { tags?: { [propertyName: string]: string }; maxDegreeOfParallelism?: number; queryStoreRetention?: number; maxJobCount?: number; + newTier?: string; + firewallState?: string; + firewallAllowAzureIps?: string; + firewallRules?: FirewallRule[]; } /** @@ -313,6 +374,30 @@ export interface Resource extends BaseResource { * * @member {string} [endpoint] the full CName endpoint for this account. * + * @member {string} [newTier] the commitment tier for the next month. Possible + * values include: 'Consumption', 'Commitment_100AUHours', + * 'Commitment_500AUHours', 'Commitment_1000AUHours', 'Commitment_5000AUHours', + * 'Commitment_10000AUHours', 'Commitment_50000AUHours', + * 'Commitment_100000AUHours', 'Commitment_500000AUHours' + * + * @member {string} [currentTier] the commitment tier in use for the current + * month. Possible values include: 'Consumption', 'Commitment_100AUHours', + * 'Commitment_500AUHours', 'Commitment_1000AUHours', 'Commitment_5000AUHours', + * 'Commitment_10000AUHours', 'Commitment_50000AUHours', + * 'Commitment_100000AUHours', 'Commitment_500000AUHours' + * + * @member {string} [firewallState] The current state of the IP address + * firewall for this Data Lake Analytics account. Possible values include: + * 'Enabled', 'Disabled' + * + * @member {string} [firewallAllowAzureIps] The current state of allowing or + * disallowing IPs originating within Azure through the firewall. If the + * firewall is disabled, this is not enforced. Possible values include: + * 'Enabled', 'Disabled' + * + * @member {array} [firewallRules] The list of firewall rules associated with + * this Data Lake Analytics account. + * */ export interface DataLakeAnalyticsAccount extends Resource { provisioningState?: string; @@ -328,6 +413,11 @@ export interface DataLakeAnalyticsAccount extends Resource { creationTime?: Date; lastModifiedTime?: Date; endpoint?: string; + newTier?: string; + currentTier?: string; + firewallState?: string; + firewallAllowAzureIps?: string; + firewallRules?: FirewallRule[]; } /** @@ -348,24 +438,54 @@ export interface DataLakeAnalyticsAccountListResult { /** * @class - * Initializes a new instance of the ErrorDetails class. + * Initializes a new instance of the DataLakeAnalyticsFirewallRuleListResult class. * @constructor - * Generic resource error details information. + * Data Lake Analytics firewall rule list information. * - * @member {string} [code] the HTTP status code or error code associated with - * this error + * @member {array} [value] the results of the list operation * - * @member {string} [message] the error message localized based on - * Accept-Language + * @member {string} [nextLink] the link (url) to the next page of results. * - * @member {string} [target] the target of the particular error (for example, - * the name of the property in error). + */ +export interface DataLakeAnalyticsFirewallRuleListResult { + value?: FirewallRule[]; + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the UpdateFirewallRuleParameters class. + * @constructor + * Data Lake Analytics firewall rule update parameters + * + * @member {string} [startIpAddress] the start IP address for the firewall + * rule. This can be either ipv4 or ipv6. Start and End should be in the same + * protocol. + * + * @member {string} [endIpAddress] the end IP address for the firewall rule. + * This can be either ipv4 or ipv6. Start and End should be in the same + * protocol. * */ -export interface ErrorDetails { - code?: string; - message?: string; - target?: string; +export interface UpdateFirewallRuleParameters { + startIpAddress?: string; + endIpAddress?: string; +} + +/** + * @class + * Initializes a new instance of the DataLakeAnalyticsFirewallRuleListResult class. + * @constructor + * Data Lake Analytics firewall rule list information. + * + * @member {array} [value] the results of the list operation + * + * @member {string} [nextLink] the link (url) to the next page of results. + * + */ +export interface DataLakeAnalyticsFirewallRuleListResult { + value?: FirewallRule[]; + nextLink?: string; } /** @@ -451,6 +571,19 @@ export interface DataLakeAnalyticsAccountListResult { } +/** + * @class + * Initializes a new instance of the DataLakeAnalyticsFirewallRuleListResult class. + * @constructor + * Data Lake Analytics firewall rule list information. + * + * @member {string} [nextLink] the link (url) to the next page of results. + * + */ +export interface DataLakeAnalyticsFirewallRuleListResult extends Array { + nextLink?: string; +} + /** * @class * Initializes a new instance of the ListStorageContainersResult class. diff --git a/lib/services/dataLake.Analytics/lib/account/models/index.js b/lib/services/dataLake.Analytics/lib/account/models/index.js index e6505fd4aa..817b7a9f46 100644 --- a/lib/services/dataLake.Analytics/lib/account/models/index.js +++ b/lib/services/dataLake.Analytics/lib/account/models/index.js @@ -27,6 +27,8 @@ exports.ListSasTokensResult = require('./listSasTokensResult'); exports.DataLakeStoreAccountInfo = require('./dataLakeStoreAccountInfo'); exports.DataLakeAnalyticsAccountListStorageAccountsResult = require('./dataLakeAnalyticsAccountListStorageAccountsResult'); exports.DataLakeAnalyticsAccountListDataLakeStoreResult = require('./dataLakeAnalyticsAccountListDataLakeStoreResult'); +exports.OptionalSubResource = require('./optionalSubResource'); +exports.FirewallRule = require('./firewallRule'); exports.AddDataLakeStoreParameters = require('./addDataLakeStoreParameters'); exports.AddStorageAccountParameters = require('./addStorageAccountParameters'); exports.UpdateStorageAccountParameters = require('./updateStorageAccountParameters'); @@ -34,7 +36,9 @@ exports.DataLakeAnalyticsAccountUpdateParameters = require('./dataLakeAnalyticsA exports.Resource = require('./resource'); exports.DataLakeAnalyticsAccount = require('./dataLakeAnalyticsAccount'); exports.DataLakeAnalyticsAccountListResult = require('./dataLakeAnalyticsAccountListResult'); -exports.ErrorDetails = require('./errorDetails'); +exports.DataLakeAnalyticsFirewallRuleListResult = require('./dataLakeAnalyticsFirewallRuleListResult'); +exports.UpdateFirewallRuleParameters = require('./updateFirewallRuleParameters'); +exports.DataLakeAnalyticsFirewallRuleListResult = require('./dataLakeAnalyticsFirewallRuleListResult'); exports.ListStorageContainersResult = require('./listStorageContainersResult'); exports.ListSasTokensResult = require('./listSasTokensResult'); exports.DataLakeAnalyticsAccountListStorageAccountsResult = require('./dataLakeAnalyticsAccountListStorageAccountsResult'); diff --git a/lib/services/dataLake.Analytics/lib/account/models/errorDetails.js b/lib/services/dataLake.Analytics/lib/account/models/optionalSubResource.js similarity index 50% rename from lib/services/dataLake.Analytics/lib/account/models/errorDetails.js rename to lib/services/dataLake.Analytics/lib/account/models/optionalSubResource.js index 7bcb4fe30c..5148db03a4 100644 --- a/lib/services/dataLake.Analytics/lib/account/models/errorDetails.js +++ b/lib/services/dataLake.Analytics/lib/account/models/optionalSubResource.js @@ -12,57 +12,54 @@ /** * @class - * Initializes a new instance of the ErrorDetails class. + * Initializes a new instance of the OptionalSubResource class. * @constructor - * Generic resource error details information. + * The Resource model definition for a nested resource with no required + * properties. * - * @member {string} [code] the HTTP status code or error code associated with - * this error + * @member {string} [id] Resource Id * - * @member {string} [message] the error message localized based on - * Accept-Language + * @member {string} [name] Resource name * - * @member {string} [target] the target of the particular error (for example, - * the name of the property in error). + * @member {string} [type] Resource type * */ -function ErrorDetails() { +function OptionalSubResource() { } /** - * Defines the metadata of ErrorDetails + * Defines the metadata of OptionalSubResource * - * @returns {object} metadata of ErrorDetails + * @returns {object} metadata of OptionalSubResource * */ -ErrorDetails.prototype.mapper = function () { +OptionalSubResource.prototype.mapper = function () { return { required: false, - serializedName: 'ErrorDetails', + serializedName: 'OptionalSubResource', type: { name: 'Composite', - className: 'ErrorDetails', + className: 'OptionalSubResource', modelProperties: { - code: { + id: { required: false, readOnly: true, - serializedName: 'code', + serializedName: 'id', type: { name: 'String' } }, - message: { + name: { required: false, - readOnly: true, - serializedName: 'message', + serializedName: 'name', type: { name: 'String' } }, - target: { + type: { required: false, readOnly: true, - serializedName: 'target', + serializedName: 'type', type: { name: 'String' } @@ -72,4 +69,4 @@ ErrorDetails.prototype.mapper = function () { }; }; -module.exports = ErrorDetails; +module.exports = OptionalSubResource; diff --git a/lib/services/dataLake.Analytics/lib/account/models/subResource.js b/lib/services/dataLake.Analytics/lib/account/models/subResource.js index bed4662bcf..5cb5a8bf15 100644 --- a/lib/services/dataLake.Analytics/lib/account/models/subResource.js +++ b/lib/services/dataLake.Analytics/lib/account/models/subResource.js @@ -10,10 +10,6 @@ 'use strict'; -var models = require('./index'); - -var util = require('util'); - /** * @class * Initializes a new instance of the SubResource class. @@ -28,11 +24,8 @@ var util = require('util'); * */ function SubResource() { - SubResource['super_'].call(this); } -util.inherits(SubResource, models['BaseResource']); - /** * Defines the metadata of SubResource * diff --git a/lib/services/dataLake.Analytics/lib/account/models/updateFirewallRuleParameters.js b/lib/services/dataLake.Analytics/lib/account/models/updateFirewallRuleParameters.js new file mode 100644 index 0000000000..49ba06331a --- /dev/null +++ b/lib/services/dataLake.Analytics/lib/account/models/updateFirewallRuleParameters.js @@ -0,0 +1,64 @@ +/* + * 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'; + +/** + * @class + * Initializes a new instance of the UpdateFirewallRuleParameters class. + * @constructor + * Data Lake Analytics firewall rule update parameters + * + * @member {string} [startIpAddress] the start IP address for the firewall + * rule. This can be either ipv4 or ipv6. Start and End should be in the same + * protocol. + * + * @member {string} [endIpAddress] the end IP address for the firewall rule. + * This can be either ipv4 or ipv6. Start and End should be in the same + * protocol. + * + */ +function UpdateFirewallRuleParameters() { +} + +/** + * Defines the metadata of UpdateFirewallRuleParameters + * + * @returns {object} metadata of UpdateFirewallRuleParameters + * + */ +UpdateFirewallRuleParameters.prototype.mapper = function () { + return { + required: false, + serializedName: 'UpdateFirewallRuleParameters', + type: { + name: 'Composite', + className: 'UpdateFirewallRuleParameters', + modelProperties: { + startIpAddress: { + required: false, + serializedName: 'properties.startIpAddress', + type: { + name: 'String' + } + }, + endIpAddress: { + required: false, + serializedName: 'properties.endIpAddress', + type: { + name: 'String' + } + } + } + } + }; +}; + +module.exports = UpdateFirewallRuleParameters; diff --git a/lib/services/dataLake.Analytics/lib/account/operations/account.js b/lib/services/dataLake.Analytics/lib/account/operations/accountOperations.js similarity index 93% rename from lib/services/dataLake.Analytics/lib/account/operations/account.js rename to lib/services/dataLake.Analytics/lib/account/operations/accountOperations.js index 5369febab6..a9aa569882 100644 --- a/lib/services/dataLake.Analytics/lib/account/operations/account.js +++ b/lib/services/dataLake.Analytics/lib/account/operations/accountOperations.js @@ -17,15 +17,15 @@ var WebResource = msRest.WebResource; /** * @class - * Account + * AccountOperations * __NOTE__: An instance of this class is automatically created for an * instance of the DataLakeAnalyticsAccountManagementClient. - * Initializes a new instance of the Account class. + * Initializes a new instance of the AccountOperations class. * @constructor * * @param {DataLakeAnalyticsAccountManagementClient} client Reference to the service client. */ -function Account(client) { +function AccountOperations(client) { this.client = client; } @@ -75,7 +75,7 @@ function Account(client) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -Account.prototype.listByResourceGroup = function (resourceGroupName, options, callback) { +AccountOperations.prototype.listByResourceGroup = function (resourceGroupName, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -287,7 +287,7 @@ Account.prototype.listByResourceGroup = function (resourceGroupName, options, ca * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -Account.prototype.list = function (options, callback) { +AccountOperations.prototype.list = function (options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -480,7 +480,7 @@ Account.prototype.list = function (options, callback) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -Account.prototype.get = function (resourceGroupName, accountName, options, callback) { +AccountOperations.prototype.get = function (resourceGroupName, accountName, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -627,7 +627,7 @@ Account.prototype.get = function (resourceGroupName, accountName, options, callb * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -Account.prototype.deleteMethod = function (resourceGroupName, accountName, options, callback) { +AccountOperations.prototype.deleteMethod = function (resourceGroupName, accountName, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -696,6 +696,24 @@ Account.prototype.deleteMethod = function (resourceGroupName, accountName, optio * @param {array} [parameters.storageAccounts] the list of Azure Blob storage * accounts associated with this account. * + * @param {string} [parameters.newTier] the commitment tier for the next month. + * Possible values include: 'Consumption', 'Commitment_100AUHours', + * 'Commitment_500AUHours', 'Commitment_1000AUHours', 'Commitment_5000AUHours', + * 'Commitment_10000AUHours', 'Commitment_50000AUHours', + * 'Commitment_100000AUHours', 'Commitment_500000AUHours' + * + * @param {string} [parameters.firewallState] The current state of the IP + * address firewall for this Data Lake Analytics account. Possible values + * include: 'Enabled', 'Disabled' + * + * @param {string} [parameters.firewallAllowAzureIps] The current state of + * allowing or disallowing IPs originating within Azure through the firewall. + * If the firewall is disabled, this is not enforced. Possible values include: + * 'Enabled', 'Disabled' + * + * @param {array} [parameters.firewallRules] The list of firewall rules + * associated with this Data Lake Analytics account. + * * @param {string} parameters.location Resource location * * @param {object} [parameters.tags] Resource tags @@ -719,7 +737,7 @@ Account.prototype.deleteMethod = function (resourceGroupName, accountName, optio * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -Account.prototype.create = function (resourceGroupName, accountName, parameters, options, callback) { +AccountOperations.prototype.create = function (resourceGroupName, accountName, parameters, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -796,6 +814,24 @@ Account.prototype.create = function (resourceGroupName, accountName, parameters, * @param {number} [options.parameters.maxJobCount] the maximum supported jobs * running under the account at the same time. * + * @param {string} [options.parameters.newTier] the commitment tier to use for + * next month. Possible values include: 'Consumption', 'Commitment_100AUHours', + * 'Commitment_500AUHours', 'Commitment_1000AUHours', 'Commitment_5000AUHours', + * 'Commitment_10000AUHours', 'Commitment_50000AUHours', + * 'Commitment_100000AUHours', 'Commitment_500000AUHours' + * + * @param {string} [options.parameters.firewallState] The current state of the + * IP address firewall for this Data Lake Analytics account. Possible values + * include: 'Enabled', 'Disabled' + * + * @param {string} [options.parameters.firewallAllowAzureIps] The current state + * of allowing or disallowing IPs originating within Azure through the + * firewall. If the firewall is disabled, this is not enforced. Possible values + * include: 'Enabled', 'Disabled' + * + * @param {array} [options.parameters.firewallRules] The list of firewall rules + * associated with this Data Lake Analytics account. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -813,7 +849,7 @@ Account.prototype.create = function (resourceGroupName, accountName, parameters, * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -Account.prototype.update = function (resourceGroupName, accountName, options, callback) { +AccountOperations.prototype.update = function (resourceGroupName, accountName, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -890,7 +926,7 @@ Account.prototype.update = function (resourceGroupName, accountName, options, ca * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -Account.prototype.beginDeleteMethod = function (resourceGroupName, accountName, options, callback) { +AccountOperations.prototype.beginDeleteMethod = function (resourceGroupName, accountName, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -1021,6 +1057,24 @@ Account.prototype.beginDeleteMethod = function (resourceGroupName, accountName, * @param {array} [parameters.storageAccounts] the list of Azure Blob storage * accounts associated with this account. * + * @param {string} [parameters.newTier] the commitment tier for the next month. + * Possible values include: 'Consumption', 'Commitment_100AUHours', + * 'Commitment_500AUHours', 'Commitment_1000AUHours', 'Commitment_5000AUHours', + * 'Commitment_10000AUHours', 'Commitment_50000AUHours', + * 'Commitment_100000AUHours', 'Commitment_500000AUHours' + * + * @param {string} [parameters.firewallState] The current state of the IP + * address firewall for this Data Lake Analytics account. Possible values + * include: 'Enabled', 'Disabled' + * + * @param {string} [parameters.firewallAllowAzureIps] The current state of + * allowing or disallowing IPs originating within Azure through the firewall. + * If the firewall is disabled, this is not enforced. Possible values include: + * 'Enabled', 'Disabled' + * + * @param {array} [parameters.firewallRules] The list of firewall rules + * associated with this Data Lake Analytics account. + * * @param {string} parameters.location Resource location * * @param {object} [parameters.tags] Resource tags @@ -1044,7 +1098,7 @@ Account.prototype.beginDeleteMethod = function (resourceGroupName, accountName, * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -Account.prototype.beginCreate = function (resourceGroupName, accountName, parameters, options, callback) { +AccountOperations.prototype.beginCreate = function (resourceGroupName, accountName, parameters, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -1223,6 +1277,24 @@ Account.prototype.beginCreate = function (resourceGroupName, accountName, parame * @param {number} [options.parameters.maxJobCount] the maximum supported jobs * running under the account at the same time. * + * @param {string} [options.parameters.newTier] the commitment tier to use for + * next month. Possible values include: 'Consumption', 'Commitment_100AUHours', + * 'Commitment_500AUHours', 'Commitment_1000AUHours', 'Commitment_5000AUHours', + * 'Commitment_10000AUHours', 'Commitment_50000AUHours', + * 'Commitment_100000AUHours', 'Commitment_500000AUHours' + * + * @param {string} [options.parameters.firewallState] The current state of the + * IP address firewall for this Data Lake Analytics account. Possible values + * include: 'Enabled', 'Disabled' + * + * @param {string} [options.parameters.firewallAllowAzureIps] The current state + * of allowing or disallowing IPs originating within Azure through the + * firewall. If the firewall is disabled, this is not enforced. Possible values + * include: 'Enabled', 'Disabled' + * + * @param {array} [options.parameters.firewallRules] The list of firewall rules + * associated with this Data Lake Analytics account. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -1240,7 +1312,7 @@ Account.prototype.beginCreate = function (resourceGroupName, accountName, parame * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -Account.prototype.beginUpdate = function (resourceGroupName, accountName, options, callback) { +AccountOperations.prototype.beginUpdate = function (resourceGroupName, accountName, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -1417,7 +1489,7 @@ Account.prototype.beginUpdate = function (resourceGroupName, accountName, option * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -Account.prototype.listByResourceGroupNext = function (nextPageLink, options, callback) { +AccountOperations.prototype.listByResourceGroupNext = function (nextPageLink, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -1545,7 +1617,7 @@ Account.prototype.listByResourceGroupNext = function (nextPageLink, options, cal * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -Account.prototype.listNext = function (nextPageLink, options, callback) { +AccountOperations.prototype.listNext = function (nextPageLink, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -1648,4 +1720,4 @@ Account.prototype.listNext = function (nextPageLink, options, callback) { }; -module.exports = Account; +module.exports = AccountOperations; diff --git a/lib/services/dataLake.Analytics/lib/account/operations/firewallRules.js b/lib/services/dataLake.Analytics/lib/account/operations/firewallRules.js new file mode 100644 index 0000000000..87ca75e9c8 --- /dev/null +++ b/lib/services/dataLake.Analytics/lib/account/operations/firewallRules.js @@ -0,0 +1,955 @@ +/* + * 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'; + +var util = require('util'); +var msRest = require('ms-rest'); +var msRestAzure = require('ms-rest-azure'); +var WebResource = msRest.WebResource; + +/** + * @class + * FirewallRules + * __NOTE__: An instance of this class is automatically created for an + * instance of the DataLakeAnalyticsAccountManagementClient. + * Initializes a new instance of the FirewallRules class. + * @constructor + * + * @param {DataLakeAnalyticsAccountManagementClient} client Reference to the service client. + */ +function FirewallRules(client) { + this.client = client; +} + +/** + * Creates or updates the specified firewall rule. During update, the firewall + * rule with the specified name will be replaced with this new firewall rule. + * + * @param {string} resourceGroupName The name of the Azure resource group that + * contains the Data Lake Analytics account. + * + * @param {string} accountName The name of the Data Lake Analytics account to + * add or replace the firewall rule. + * + * @param {string} firewallRuleName The name of the firewall rule to create or + * update. + * + * @param {object} parameters Parameters supplied to create or update the + * firewall rule. + * + * @param {string} parameters.startIpAddress the start IP address for the + * firewall rule. This can be either ipv4 or ipv6. Start and End should be in + * the same protocol. + * + * @param {string} parameters.endIpAddress the end IP address for the firewall + * rule. This can be either ipv4 or ipv6. Start and End should be in the same + * protocol. + * + * @param {string} [parameters.name] Resource name + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link FirewallRule} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +FirewallRules.prototype.createOrUpdate = function (resourceGroupName, accountName, firewallRuleName, parameters, options, callback) { + var client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + 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 (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName cannot be null or undefined and it must be of type string.'); + } + if (firewallRuleName === null || firewallRuleName === undefined || typeof firewallRuleName.valueOf() !== 'string') { + throw new Error('firewallRuleName 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.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 (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 (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 + var baseUrl = this.client.baseUri; + var requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/firewallRules/{firewallRuleName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); + requestUrl = requestUrl.replace('{firewallRuleName}', encodeURIComponent(firewallRuleName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + var queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + 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(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + // Serialize Request + var requestContent = null; + var requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + var requestModelMapper = new client.models['FirewallRule']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + var serializationError = new Error(util.format('Error "%s" occurred in serializing the ' + + 'payload - "%s"', error.message, util.inspect(parameters, {depth: null}))); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['FirewallRule']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * Updates the specified firewall rule. + * + * @param {string} resourceGroupName The name of the Azure resource group that + * contains the Data Lake Analytics account. + * + * @param {string} accountName The name of the Data Lake Analytics account to + * which to update the firewall rule. + * + * @param {string} firewallRuleName The name of the firewall rule to update. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.parameters] Parameters supplied to update the + * firewall rule. + * + * @param {string} [options.parameters.startIpAddress] the start IP address for + * the firewall rule. This can be either ipv4 or ipv6. Start and End should be + * in the same protocol. + * + * @param {string} [options.parameters.endIpAddress] the end IP address for the + * firewall rule. This can be either ipv4 or ipv6. Start and End should be in + * the same protocol. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link FirewallRule} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +FirewallRules.prototype.update = function (resourceGroupName, accountName, firewallRuleName, options, callback) { + var client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + var parameters = (options && options.parameters !== undefined) ? options.parameters : undefined; + // Validate + try { + 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 (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName cannot be null or undefined and it must be of type string.'); + } + if (firewallRuleName === null || firewallRuleName === undefined || typeof firewallRuleName.valueOf() !== 'string') { + throw new Error('firewallRuleName 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 (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 (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 + var baseUrl = this.client.baseUri; + var requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/firewallRules/{firewallRuleName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); + requestUrl = requestUrl.replace('{firewallRuleName}', encodeURIComponent(firewallRuleName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + var queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + 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(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + // Serialize Request + var requestContent = null; + var requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + var requestModelMapper = new client.models['UpdateFirewallRuleParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + var serializationError = new Error(util.format('Error "%s" occurred in serializing the ' + + 'payload - "%s"', error.message, util.inspect(parameters, {depth: null}))); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['FirewallRule']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * Deletes the specified firewall rule from the specified Data Lake Analytics + * account + * + * @param {string} resourceGroupName The name of the Azure resource group that + * contains the Data Lake Analytics account. + * + * @param {string} accountName The name of the Data Lake Analytics account from + * which to delete the firewall rule. + * + * @param {string} firewallRuleName The name of the firewall rule to delete. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} 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. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +FirewallRules.prototype.deleteMethod = function (resourceGroupName, accountName, firewallRuleName, options, callback) { + var client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + 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 (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName cannot be null or undefined and it must be of type string.'); + } + if (firewallRuleName === null || firewallRuleName === undefined || typeof firewallRuleName.valueOf() !== 'string') { + throw new Error('firewallRuleName 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 (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 (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 + var baseUrl = this.client.baseUri; + var requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/firewallRules/{firewallRuleName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); + requestUrl = requestUrl.replace('{firewallRuleName}', encodeURIComponent(firewallRuleName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + var queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + 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(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 204) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + var internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * Gets the specified Data Lake Analytics firewall rule. + * + * @param {string} resourceGroupName The name of the Azure resource group that + * contains the Data Lake Analytics account. + * + * @param {string} accountName The name of the Data Lake Analytics account from + * which to get the firewall rule. + * + * @param {string} firewallRuleName The name of the firewall rule to retrieve. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link FirewallRule} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +FirewallRules.prototype.get = function (resourceGroupName, accountName, firewallRuleName, options, callback) { + var client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + 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 (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName cannot be null or undefined and it must be of type string.'); + } + if (firewallRuleName === null || firewallRuleName === undefined || typeof firewallRuleName.valueOf() !== 'string') { + throw new Error('firewallRuleName 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 (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 (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 + var baseUrl = this.client.baseUri; + var requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/firewallRules/{firewallRuleName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); + requestUrl = requestUrl.replace('{firewallRuleName}', encodeURIComponent(firewallRuleName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + var queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + 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(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['FirewallRule']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * Lists the Data Lake Analytics firewall rules within the specified Data Lake + * Analytics account. + * + * @param {string} resourceGroupName The name of the Azure resource group that + * contains the Data Lake Analytics account. + * + * @param {string} accountName The name of the Data Lake Analytics account from + * which to get the firewall rules. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link DataLakeAnalyticsFirewallRuleListResult} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +FirewallRules.prototype.listByAccount = function (resourceGroupName, accountName, options, callback) { + var client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + 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 (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName 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 (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 (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 + var baseUrl = this.client.baseUri; + var requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/firewallRules'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + var queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + 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(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['DataLakeAnalyticsFirewallRuleListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * Lists the Data Lake Analytics firewall rules within the specified Data Lake + * Analytics account. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link DataLakeAnalyticsFirewallRuleListResult} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +FirewallRules.prototype.listByAccountNext = function (nextPageLink, options, callback) { + var client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + 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 + var requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + 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(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['DataLakeAnalyticsFirewallRuleListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + + +module.exports = FirewallRules; diff --git a/lib/services/dataLake.Analytics/lib/account/operations/index.d.ts b/lib/services/dataLake.Analytics/lib/account/operations/index.d.ts index b58e68314b..7b7a7246ec 100644 --- a/lib/services/dataLake.Analytics/lib/account/operations/index.d.ts +++ b/lib/services/dataLake.Analytics/lib/account/operations/index.d.ts @@ -12,6 +12,169 @@ import { ServiceClientOptions, RequestOptions, ServiceCallback } from 'ms-rest'; import * as models from '../models'; +/** + * @class + * FirewallRules + * __NOTE__: An instance of this class is automatically created for an + * instance of the DataLakeAnalyticsAccountManagementClient. + */ +export interface FirewallRules { + + /** + * Creates or updates the specified firewall rule. During update, the firewall + * rule with the specified name will be replaced with this new firewall rule. + * + * @param {string} resourceGroupName The name of the Azure resource group that + * contains the Data Lake Analytics account. + * + * @param {string} accountName The name of the Data Lake Analytics account to + * add or replace the firewall rule. + * + * @param {string} firewallRuleName The name of the firewall rule to create or + * update. + * + * @param {object} parameters Parameters supplied to create or update the + * firewall rule. + * + * @param {string} parameters.startIpAddress the start IP address for the + * firewall rule. This can be either ipv4 or ipv6. Start and End should be in + * the same protocol. + * + * @param {string} parameters.endIpAddress the end IP address for the firewall + * rule. This can be either ipv4 or ipv6. Start and End should be in the same + * protocol. + * + * @param {string} [parameters.name] Resource name + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + createOrUpdate(resourceGroupName: string, accountName: string, firewallRuleName: string, parameters: models.FirewallRule, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, accountName: string, firewallRuleName: string, parameters: models.FirewallRule, callback: ServiceCallback): void; + + /** + * Updates the specified firewall rule. + * + * @param {string} resourceGroupName The name of the Azure resource group that + * contains the Data Lake Analytics account. + * + * @param {string} accountName The name of the Data Lake Analytics account to + * which to update the firewall rule. + * + * @param {string} firewallRuleName The name of the firewall rule to update. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.parameters] Parameters supplied to update the + * firewall rule. + * + * @param {string} [options.parameters.startIpAddress] the start IP address for + * the firewall rule. This can be either ipv4 or ipv6. Start and End should be + * in the same protocol. + * + * @param {string} [options.parameters.endIpAddress] the end IP address for the + * firewall rule. This can be either ipv4 or ipv6. Start and End should be in + * the same protocol. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + update(resourceGroupName: string, accountName: string, firewallRuleName: string, options: { parameters? : models.UpdateFirewallRuleParameters, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + update(resourceGroupName: string, accountName: string, firewallRuleName: string, callback: ServiceCallback): void; + + /** + * Deletes the specified firewall rule from the specified Data Lake Analytics + * account + * + * @param {string} resourceGroupName The name of the Azure resource group that + * contains the Data Lake Analytics account. + * + * @param {string} accountName The name of the Data Lake Analytics account from + * which to delete the firewall rule. + * + * @param {string} firewallRuleName The name of the firewall rule to delete. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + deleteMethod(resourceGroupName: string, accountName: string, firewallRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, accountName: string, firewallRuleName: string, callback: ServiceCallback): void; + + /** + * Gets the specified Data Lake Analytics firewall rule. + * + * @param {string} resourceGroupName The name of the Azure resource group that + * contains the Data Lake Analytics account. + * + * @param {string} accountName The name of the Data Lake Analytics account from + * which to get the firewall rule. + * + * @param {string} firewallRuleName The name of the firewall rule to retrieve. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + get(resourceGroupName: string, accountName: string, firewallRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, accountName: string, firewallRuleName: string, callback: ServiceCallback): void; + + /** + * Lists the Data Lake Analytics firewall rules within the specified Data Lake + * Analytics account. + * + * @param {string} resourceGroupName The name of the Azure resource group that + * contains the Data Lake Analytics account. + * + * @param {string} accountName The name of the Data Lake Analytics account from + * which to get the firewall rules. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + listByAccount(resourceGroupName: string, accountName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByAccount(resourceGroupName: string, accountName: string, callback: ServiceCallback): void; + + /** + * Lists the Data Lake Analytics firewall rules within the specified Data Lake + * Analytics account. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + listByAccountNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByAccountNext(nextPageLink: string, callback: ServiceCallback): void; +} + /** * @class * StorageAccounts @@ -463,11 +626,11 @@ export interface DataLakeStoreAccounts { /** * @class - * Account + * AccountOperations * __NOTE__: An instance of this class is automatically created for an * instance of the DataLakeAnalyticsAccountManagementClient. */ -export interface Account { +export interface AccountOperations { /** * Gets the first page of Data Lake Analytics accounts, if any, within a @@ -615,6 +778,24 @@ export interface Account { * @param {array} [parameters.storageAccounts] the list of Azure Blob storage * accounts associated with this account. * + * @param {string} [parameters.newTier] the commitment tier for the next month. + * Possible values include: 'Consumption', 'Commitment_100AUHours', + * 'Commitment_500AUHours', 'Commitment_1000AUHours', 'Commitment_5000AUHours', + * 'Commitment_10000AUHours', 'Commitment_50000AUHours', + * 'Commitment_100000AUHours', 'Commitment_500000AUHours' + * + * @param {string} [parameters.firewallState] The current state of the IP + * address firewall for this Data Lake Analytics account. Possible values + * include: 'Enabled', 'Disabled' + * + * @param {string} [parameters.firewallAllowAzureIps] The current state of + * allowing or disallowing IPs originating within Azure through the firewall. + * If the firewall is disabled, this is not enforced. Possible values include: + * 'Enabled', 'Disabled' + * + * @param {array} [parameters.firewallRules] The list of firewall rules + * associated with this Data Lake Analytics account. + * * @param {string} parameters.location Resource location * * @param {object} [parameters.tags] Resource tags @@ -656,6 +837,24 @@ export interface Account { * @param {number} [options.parameters.maxJobCount] the maximum supported jobs * running under the account at the same time. * + * @param {string} [options.parameters.newTier] the commitment tier to use for + * next month. Possible values include: 'Consumption', 'Commitment_100AUHours', + * 'Commitment_500AUHours', 'Commitment_1000AUHours', 'Commitment_5000AUHours', + * 'Commitment_10000AUHours', 'Commitment_50000AUHours', + * 'Commitment_100000AUHours', 'Commitment_500000AUHours' + * + * @param {string} [options.parameters.firewallState] The current state of the + * IP address firewall for this Data Lake Analytics account. Possible values + * include: 'Enabled', 'Disabled' + * + * @param {string} [options.parameters.firewallAllowAzureIps] The current state + * of allowing or disallowing IPs originating within Azure through the + * firewall. If the firewall is disabled, this is not enforced. Possible values + * include: 'Enabled', 'Disabled' + * + * @param {array} [options.parameters.firewallRules] The list of firewall rules + * associated with this Data Lake Analytics account. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -718,6 +917,24 @@ export interface Account { * @param {array} [parameters.storageAccounts] the list of Azure Blob storage * accounts associated with this account. * + * @param {string} [parameters.newTier] the commitment tier for the next month. + * Possible values include: 'Consumption', 'Commitment_100AUHours', + * 'Commitment_500AUHours', 'Commitment_1000AUHours', 'Commitment_5000AUHours', + * 'Commitment_10000AUHours', 'Commitment_50000AUHours', + * 'Commitment_100000AUHours', 'Commitment_500000AUHours' + * + * @param {string} [parameters.firewallState] The current state of the IP + * address firewall for this Data Lake Analytics account. Possible values + * include: 'Enabled', 'Disabled' + * + * @param {string} [parameters.firewallAllowAzureIps] The current state of + * allowing or disallowing IPs originating within Azure through the firewall. + * If the firewall is disabled, this is not enforced. Possible values include: + * 'Enabled', 'Disabled' + * + * @param {array} [parameters.firewallRules] The list of firewall rules + * associated with this Data Lake Analytics account. + * * @param {string} parameters.location Resource location * * @param {object} [parameters.tags] Resource tags @@ -759,6 +976,24 @@ export interface Account { * @param {number} [options.parameters.maxJobCount] the maximum supported jobs * running under the account at the same time. * + * @param {string} [options.parameters.newTier] the commitment tier to use for + * next month. Possible values include: 'Consumption', 'Commitment_100AUHours', + * 'Commitment_500AUHours', 'Commitment_1000AUHours', 'Commitment_5000AUHours', + * 'Commitment_10000AUHours', 'Commitment_50000AUHours', + * 'Commitment_100000AUHours', 'Commitment_500000AUHours' + * + * @param {string} [options.parameters.firewallState] The current state of the + * IP address firewall for this Data Lake Analytics account. Possible values + * include: 'Enabled', 'Disabled' + * + * @param {string} [options.parameters.firewallAllowAzureIps] The current state + * of allowing or disallowing IPs originating within Azure through the + * firewall. If the firewall is disabled, this is not enforced. Possible values + * include: 'Enabled', 'Disabled' + * + * @param {array} [options.parameters.firewallRules] The list of firewall rules + * associated with this Data Lake Analytics account. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * diff --git a/lib/services/dataLake.Analytics/lib/account/operations/index.js b/lib/services/dataLake.Analytics/lib/account/operations/index.js index edce737381..61685cae54 100644 --- a/lib/services/dataLake.Analytics/lib/account/operations/index.js +++ b/lib/services/dataLake.Analytics/lib/account/operations/index.js @@ -14,6 +14,7 @@ 'use strict'; +exports.FirewallRules = require('./firewallRules'); exports.StorageAccounts = require('./storageAccounts'); exports.DataLakeStoreAccounts = require('./dataLakeStoreAccounts'); -exports.Account = require('./account'); +exports.AccountOperations = require('./accountOperations'); diff --git a/lib/services/dataLake.Store/lib/account/dataLakeStoreAccountManagementClient.d.ts b/lib/services/dataLake.Store/lib/account/dataLakeStoreAccountManagementClient.d.ts index 06dec3c195..5d04e307bc 100644 --- a/lib/services/dataLake.Store/lib/account/dataLakeStoreAccountManagementClient.d.ts +++ b/lib/services/dataLake.Store/lib/account/dataLakeStoreAccountManagementClient.d.ts @@ -58,7 +58,7 @@ declare class DataLakeStoreAccountManagementClient { // Operation groups firewallRules: operations.FirewallRules; trustedIdProviders: operations.TrustedIdProviders; - account: operations.Account; + accountOperations: operations.AccountOperations; } export = DataLakeStoreAccountManagementClient; diff --git a/lib/services/dataLake.Store/lib/account/dataLakeStoreAccountManagementClient.js b/lib/services/dataLake.Store/lib/account/dataLakeStoreAccountManagementClient.js index 16a823786d..7e03cbe8ec 100644 --- a/lib/services/dataLake.Store/lib/account/dataLakeStoreAccountManagementClient.js +++ b/lib/services/dataLake.Store/lib/account/dataLakeStoreAccountManagementClient.js @@ -87,7 +87,7 @@ function DataLakeStoreAccountManagementClient(credentials, subscriptionId, baseU } this.firewallRules = new operations.FirewallRules(this); this.trustedIdProviders = new operations.TrustedIdProviders(this); - this.account = new operations.Account(this); + this.accountOperations = new operations.AccountOperations(this); this.models = models; msRest.addSerializationMixin(this); } diff --git a/lib/services/dataLake.Store/lib/account/models/dataLakeStoreAccount.js b/lib/services/dataLake.Store/lib/account/models/dataLakeStoreAccount.js index 93037ff38e..770dff114b 100644 --- a/lib/services/dataLake.Store/lib/account/models/dataLakeStoreAccount.js +++ b/lib/services/dataLake.Store/lib/account/models/dataLakeStoreAccount.js @@ -68,6 +68,11 @@ var util = require('util'); * firewall for this Data Lake store account. Possible values include: * 'Enabled', 'Disabled' * + * @member {string} [firewallAllowAzureIps] The current state of allowing or + * disallowing IPs originating within Azure through the firewall. If the + * firewall is disabled, this is not enforced. Possible values include: + * 'Enabled', 'Disabled' + * * @member {array} [firewallRules] The list of firewall rules associated with * this Data Lake store account. * @@ -85,6 +90,15 @@ var util = require('util'); * @member {string} [defaultGroup] the default owner group for all new folders * and files created in the Data Lake Store account. * + * @member {string} [newTier] the commitment tier to use for next month. + * Possible values include: 'Consumption', 'Commitment_1TB', 'Commitment_10TB', + * 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', 'Commitment_5PB' + * + * @member {string} [currentTier] the commitment tier in use for the current + * month. Possible values include: 'Consumption', 'Commitment_1TB', + * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', + * 'Commitment_5PB' + * */ function DataLakeStoreAccount() { DataLakeStoreAccount['super_'].call(this); @@ -218,6 +232,14 @@ DataLakeStoreAccount.prototype.mapper = function () { allowedValues: [ 'Enabled', 'Disabled' ] } }, + firewallAllowAzureIps: { + required: false, + serializedName: 'properties.firewallAllowAzureIps', + type: { + name: 'Enum', + allowedValues: [ 'Enabled', 'Disabled' ] + } + }, firewallRules: { required: false, serializedName: 'properties.firewallRules', @@ -278,6 +300,23 @@ DataLakeStoreAccount.prototype.mapper = function () { type: { name: 'String' } + }, + newTier: { + required: false, + serializedName: 'properties.newTier', + type: { + name: 'Enum', + allowedValues: [ 'Consumption', 'Commitment_1TB', 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', 'Commitment_5PB' ] + } + }, + currentTier: { + required: false, + readOnly: true, + serializedName: 'properties.currentTier', + type: { + name: 'Enum', + allowedValues: [ 'Consumption', 'Commitment_1TB', 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', 'Commitment_5PB' ] + } } } } diff --git a/lib/services/dataLake.Store/lib/account/models/dataLakeStoreAccountUpdateParameters.js b/lib/services/dataLake.Store/lib/account/models/dataLakeStoreAccountUpdateParameters.js index 0f5a27cdeb..22daaea062 100644 --- a/lib/services/dataLake.Store/lib/account/models/dataLakeStoreAccountUpdateParameters.js +++ b/lib/services/dataLake.Store/lib/account/models/dataLakeStoreAccountUpdateParameters.js @@ -23,6 +23,11 @@ * remove existing rules, they will just be ignored until the firewall is * re-enabled. Possible values include: 'Enabled', 'Disabled' * + * @member {string} [firewallAllowAzureIps] The current state of allowing or + * disallowing IPs originating within Azure through the firewall. If the + * firewall is disabled, this is not enforced. Possible values include: + * 'Enabled', 'Disabled' + * * @member {string} [trustedIdProviderState] The current state of the trusted * identity provider feature for this Data Lake store account. Disabling * trusted identity provider functionality does not remove the providers, they @@ -32,6 +37,10 @@ * @member {string} [defaultGroup] the default owner group for all new folders * and files created in the Data Lake Store account. * + * @member {string} [newTier] the commitment tier to use for next month. + * Possible values include: 'Consumption', 'Commitment_1TB', 'Commitment_10TB', + * 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', 'Commitment_5PB' + * */ function DataLakeStoreAccountUpdateParameters() { } @@ -72,6 +81,14 @@ DataLakeStoreAccountUpdateParameters.prototype.mapper = function () { allowedValues: [ 'Enabled', 'Disabled' ] } }, + firewallAllowAzureIps: { + required: false, + serializedName: 'properties.firewallAllowAzureIps', + type: { + name: 'Enum', + allowedValues: [ 'Enabled', 'Disabled' ] + } + }, trustedIdProviderState: { required: false, serializedName: 'properties.trustedIdProviderState', @@ -86,6 +103,14 @@ DataLakeStoreAccountUpdateParameters.prototype.mapper = function () { type: { name: 'String' } + }, + newTier: { + required: false, + serializedName: 'properties.newTier', + type: { + name: 'Enum', + allowedValues: [ 'Consumption', 'Commitment_1TB', 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', 'Commitment_5PB' ] + } } } } diff --git a/lib/services/dataLake.Store/lib/account/models/firewallRule.js b/lib/services/dataLake.Store/lib/account/models/firewallRule.js index d35186d0b0..7062c46690 100644 --- a/lib/services/dataLake.Store/lib/account/models/firewallRule.js +++ b/lib/services/dataLake.Store/lib/account/models/firewallRule.js @@ -21,8 +21,11 @@ var util = require('util'); * Data Lake Store firewall rule information * * @member {string} startIpAddress the start IP address for the firewall rule. + * This can be either ipv4 or ipv6. Start and End should be in the same + * protocol. * - * @member {string} endIpAddress the end IP address for the firewall rule. + * @member {string} endIpAddress the end IP address for the firewall rule. This + * can be either ipv4 or ipv6. Start and End should be in the same protocol. * */ function FirewallRule() { diff --git a/lib/services/dataLake.Store/lib/account/models/index.d.ts b/lib/services/dataLake.Store/lib/account/models/index.d.ts index e00685ca50..71b7ca7ac8 100644 --- a/lib/services/dataLake.Store/lib/account/models/index.d.ts +++ b/lib/services/dataLake.Store/lib/account/models/index.d.ts @@ -12,6 +12,26 @@ import * as msRestAzure from 'ms-rest-azure'; exports.BaseResource = msRestAzure.BaseResource; exports.CloudError = msRestAzure.CloudError; +/** + * @class + * Initializes a new instance of the UpdateFirewallRuleParameters class. + * @constructor + * Data Lake Analytics firewall rule update parameters + * + * @member {string} [startIpAddress] the start IP address for the firewall + * rule. This can be either ipv4 or ipv6. Start and End should be in the same + * protocol. + * + * @member {string} [endIpAddress] the end IP address for the firewall rule. + * This can be either ipv4 or ipv6. Start and End should be in the same + * protocol. + * + */ +export interface UpdateFirewallRuleParameters { + startIpAddress?: string; + endIpAddress?: string; +} + /** * @class * Initializes a new instance of the SubResource class. @@ -25,7 +45,7 @@ exports.CloudError = msRestAzure.CloudError; * @member {string} [type] Resource type * */ -export interface SubResource extends BaseResource { +export interface SubResource { id?: string; name?: string; type?: string; @@ -38,8 +58,11 @@ export interface SubResource extends BaseResource { * Data Lake Store firewall rule information * * @member {string} startIpAddress the start IP address for the firewall rule. + * This can be either ipv4 or ipv6. Start and End should be in the same + * protocol. * - * @member {string} endIpAddress the end IP address for the firewall rule. + * @member {string} endIpAddress the end IP address for the firewall rule. This + * can be either ipv4 or ipv6. Start and End should be in the same protocol. * */ export interface FirewallRule extends SubResource { @@ -47,11 +70,24 @@ export interface FirewallRule extends SubResource { endIpAddress: string; } +/** + * @class + * Initializes a new instance of the UpdateTrustedIdProviderParameters class. + * @constructor + * Data Lake Store Trusted Identity Provider update parameters + * + * @member {string} [idProvider] The URL of this trusted identity provider + * + */ +export interface UpdateTrustedIdProviderParameters { + idProvider?: string; +} + /** * @class * Initializes a new instance of the TrustedIdProvider class. * @constructor - * Data Lake Store firewall rule information + * Data Lake Store Trusted Identity Provider information * * @member {string} idProvider The URL of this trusted identity provider * @@ -173,6 +209,11 @@ export interface EncryptionConfig { * remove existing rules, they will just be ignored until the firewall is * re-enabled. Possible values include: 'Enabled', 'Disabled' * + * @member {string} [firewallAllowAzureIps] The current state of allowing or + * disallowing IPs originating within Azure through the firewall. If the + * firewall is disabled, this is not enforced. Possible values include: + * 'Enabled', 'Disabled' + * * @member {string} [trustedIdProviderState] The current state of the trusted * identity provider feature for this Data Lake store account. Disabling * trusted identity provider functionality does not remove the providers, they @@ -182,12 +223,18 @@ export interface EncryptionConfig { * @member {string} [defaultGroup] the default owner group for all new folders * and files created in the Data Lake Store account. * + * @member {string} [newTier] the commitment tier to use for next month. + * Possible values include: 'Consumption', 'Commitment_1TB', 'Commitment_10TB', + * 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', 'Commitment_5PB' + * */ export interface DataLakeStoreAccountUpdateParameters { tags?: { [propertyName: string]: string }; firewallState?: string; + firewallAllowAzureIps?: string; trustedIdProviderState?: string; defaultGroup?: string; + newTier?: string; } /** @@ -269,6 +316,11 @@ export interface Resource extends BaseResource { * firewall for this Data Lake store account. Possible values include: * 'Enabled', 'Disabled' * + * @member {string} [firewallAllowAzureIps] The current state of allowing or + * disallowing IPs originating within Azure through the firewall. If the + * firewall is disabled, this is not enforced. Possible values include: + * 'Enabled', 'Disabled' + * * @member {array} [firewallRules] The list of firewall rules associated with * this Data Lake store account. * @@ -286,6 +338,15 @@ export interface Resource extends BaseResource { * @member {string} [defaultGroup] the default owner group for all new folders * and files created in the Data Lake Store account. * + * @member {string} [newTier] the commitment tier to use for next month. + * Possible values include: 'Consumption', 'Commitment_1TB', 'Commitment_10TB', + * 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', 'Commitment_5PB' + * + * @member {string} [currentTier] the commitment tier in use for the current + * month. Possible values include: 'Consumption', 'Commitment_1TB', + * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', + * 'Commitment_5PB' + * */ export interface DataLakeStoreAccount extends Resource { identity?: EncryptionIdentity; @@ -296,12 +357,15 @@ export interface DataLakeStoreAccount extends Resource { encryptionProvisioningState?: string; encryptionConfig?: EncryptionConfig; firewallState?: string; + firewallAllowAzureIps?: string; firewallRules?: FirewallRule[]; trustedIdProviderState?: string; trustedIdProviders?: TrustedIdProvider[]; lastModifiedTime?: Date; endpoint?: string; defaultGroup?: string; + newTier?: string; + currentTier?: string; } /** diff --git a/lib/services/dataLake.Store/lib/account/models/index.js b/lib/services/dataLake.Store/lib/account/models/index.js index 3195e41bd2..34a451b8e9 100644 --- a/lib/services/dataLake.Store/lib/account/models/index.js +++ b/lib/services/dataLake.Store/lib/account/models/index.js @@ -18,8 +18,10 @@ var msRestAzure = require('ms-rest-azure'); exports.BaseResource = msRestAzure.BaseResource; exports.CloudError = msRestAzure.CloudError; +exports.UpdateFirewallRuleParameters = require('./updateFirewallRuleParameters'); exports.SubResource = require('./subResource'); exports.FirewallRule = require('./firewallRule'); +exports.UpdateTrustedIdProviderParameters = require('./updateTrustedIdProviderParameters'); exports.TrustedIdProvider = require('./trustedIdProvider'); exports.DataLakeStoreTrustedIdProviderListResult = require('./dataLakeStoreTrustedIdProviderListResult'); exports.DataLakeStoreFirewallRuleListResult = require('./dataLakeStoreFirewallRuleListResult'); diff --git a/lib/services/dataLake.Store/lib/account/models/subResource.js b/lib/services/dataLake.Store/lib/account/models/subResource.js index 63202f8d2f..4e952ea0f5 100644 --- a/lib/services/dataLake.Store/lib/account/models/subResource.js +++ b/lib/services/dataLake.Store/lib/account/models/subResource.js @@ -10,10 +10,6 @@ 'use strict'; -var models = require('./index'); - -var util = require('util'); - /** * @class * Initializes a new instance of the SubResource class. @@ -28,11 +24,8 @@ var util = require('util'); * */ function SubResource() { - SubResource['super_'].call(this); } -util.inherits(SubResource, models['BaseResource']); - /** * Defines the metadata of SubResource * diff --git a/lib/services/dataLake.Store/lib/account/models/trustedIdProvider.js b/lib/services/dataLake.Store/lib/account/models/trustedIdProvider.js index dfd6e6f8d7..0b2cb32540 100644 --- a/lib/services/dataLake.Store/lib/account/models/trustedIdProvider.js +++ b/lib/services/dataLake.Store/lib/account/models/trustedIdProvider.js @@ -18,7 +18,7 @@ var util = require('util'); * @class * Initializes a new instance of the TrustedIdProvider class. * @constructor - * Data Lake Store firewall rule information + * Data Lake Store Trusted Identity Provider information * * @member {string} idProvider The URL of this trusted identity provider * diff --git a/lib/services/dataLake.Store/lib/account/models/updateFirewallRuleParameters.js b/lib/services/dataLake.Store/lib/account/models/updateFirewallRuleParameters.js new file mode 100644 index 0000000000..49ba06331a --- /dev/null +++ b/lib/services/dataLake.Store/lib/account/models/updateFirewallRuleParameters.js @@ -0,0 +1,64 @@ +/* + * 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'; + +/** + * @class + * Initializes a new instance of the UpdateFirewallRuleParameters class. + * @constructor + * Data Lake Analytics firewall rule update parameters + * + * @member {string} [startIpAddress] the start IP address for the firewall + * rule. This can be either ipv4 or ipv6. Start and End should be in the same + * protocol. + * + * @member {string} [endIpAddress] the end IP address for the firewall rule. + * This can be either ipv4 or ipv6. Start and End should be in the same + * protocol. + * + */ +function UpdateFirewallRuleParameters() { +} + +/** + * Defines the metadata of UpdateFirewallRuleParameters + * + * @returns {object} metadata of UpdateFirewallRuleParameters + * + */ +UpdateFirewallRuleParameters.prototype.mapper = function () { + return { + required: false, + serializedName: 'UpdateFirewallRuleParameters', + type: { + name: 'Composite', + className: 'UpdateFirewallRuleParameters', + modelProperties: { + startIpAddress: { + required: false, + serializedName: 'properties.startIpAddress', + type: { + name: 'String' + } + }, + endIpAddress: { + required: false, + serializedName: 'properties.endIpAddress', + type: { + name: 'String' + } + } + } + } + }; +}; + +module.exports = UpdateFirewallRuleParameters; diff --git a/lib/services/dataLake.Store/lib/account/models/updateTrustedIdProviderParameters.js b/lib/services/dataLake.Store/lib/account/models/updateTrustedIdProviderParameters.js new file mode 100644 index 0000000000..e12f6969d4 --- /dev/null +++ b/lib/services/dataLake.Store/lib/account/models/updateTrustedIdProviderParameters.js @@ -0,0 +1,51 @@ +/* + * 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'; + +/** + * @class + * Initializes a new instance of the UpdateTrustedIdProviderParameters class. + * @constructor + * Data Lake Store Trusted Identity Provider update parameters + * + * @member {string} [idProvider] The URL of this trusted identity provider + * + */ +function UpdateTrustedIdProviderParameters() { +} + +/** + * Defines the metadata of UpdateTrustedIdProviderParameters + * + * @returns {object} metadata of UpdateTrustedIdProviderParameters + * + */ +UpdateTrustedIdProviderParameters.prototype.mapper = function () { + return { + required: false, + serializedName: 'UpdateTrustedIdProviderParameters', + type: { + name: 'Composite', + className: 'UpdateTrustedIdProviderParameters', + modelProperties: { + idProvider: { + required: false, + serializedName: 'properties.idProvider', + type: { + name: 'String' + } + } + } + } + }; +}; + +module.exports = UpdateTrustedIdProviderParameters; diff --git a/lib/services/dataLake.Store/lib/account/operations/account.js b/lib/services/dataLake.Store/lib/account/operations/accountOperations.js similarity index 95% rename from lib/services/dataLake.Store/lib/account/operations/account.js rename to lib/services/dataLake.Store/lib/account/operations/accountOperations.js index 75e5e2edb9..634d67c081 100644 --- a/lib/services/dataLake.Store/lib/account/operations/account.js +++ b/lib/services/dataLake.Store/lib/account/operations/accountOperations.js @@ -17,15 +17,15 @@ var WebResource = msRest.WebResource; /** * @class - * Account + * AccountOperations * __NOTE__: An instance of this class is automatically created for an * instance of the DataLakeStoreAccountManagementClient. - * Initializes a new instance of the Account class. + * Initializes a new instance of the AccountOperations class. * @constructor * * @param {DataLakeStoreAccountManagementClient} client Reference to the service client. */ -function Account(client) { +function AccountOperations(client) { this.client = client; } @@ -75,6 +75,11 @@ function Account(client) { * address firewall for this Data Lake store account. Possible values include: * 'Enabled', 'Disabled' * + * @param {string} [parameters.firewallAllowAzureIps] The current state of + * allowing or disallowing IPs originating within Azure through the firewall. + * If the firewall is disabled, this is not enforced. Possible values include: + * 'Enabled', 'Disabled' + * * @param {array} [parameters.firewallRules] The list of firewall rules * associated with this Data Lake store account. * @@ -88,6 +93,11 @@ function Account(client) { * @param {string} [parameters.defaultGroup] the default owner group for all * new folders and files created in the Data Lake Store account. * + * @param {string} [parameters.newTier] the commitment tier to use for next + * month. Possible values include: 'Consumption', 'Commitment_1TB', + * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', + * 'Commitment_5PB' + * * @param {string} parameters.location Resource location * * @param {object} [parameters.tags] Resource tags @@ -110,7 +120,7 @@ function Account(client) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -Account.prototype.create = function (resourceGroupName, name, parameters, options, callback) { +AccountOperations.prototype.create = function (resourceGroupName, name, parameters, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -179,6 +189,11 @@ Account.prototype.create = function (resourceGroupName, name, parameters, option * does not remove existing rules, they will just be ignored until the firewall * is re-enabled. Possible values include: 'Enabled', 'Disabled' * + * @param {string} [parameters.firewallAllowAzureIps] The current state of + * allowing or disallowing IPs originating within Azure through the firewall. + * If the firewall is disabled, this is not enforced. Possible values include: + * 'Enabled', 'Disabled' + * * @param {string} [parameters.trustedIdProviderState] The current state of the * trusted identity provider feature for this Data Lake store account. * Disabling trusted identity provider functionality does not remove the @@ -188,6 +203,11 @@ Account.prototype.create = function (resourceGroupName, name, parameters, option * @param {string} [parameters.defaultGroup] the default owner group for all * new folders and files created in the Data Lake Store account. * + * @param {string} [parameters.newTier] the commitment tier to use for next + * month. Possible values include: 'Consumption', 'Commitment_1TB', + * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', + * 'Commitment_5PB' + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -206,7 +226,7 @@ Account.prototype.create = function (resourceGroupName, name, parameters, option * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -Account.prototype.update = function (resourceGroupName, name, parameters, options, callback) { +AccountOperations.prototype.update = function (resourceGroupName, name, parameters, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -282,7 +302,7 @@ Account.prototype.update = function (resourceGroupName, name, parameters, option * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -Account.prototype.deleteMethod = function (resourceGroupName, name, options, callback) { +AccountOperations.prototype.deleteMethod = function (resourceGroupName, name, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -344,7 +364,7 @@ Account.prototype.deleteMethod = function (resourceGroupName, name, options, cal * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -Account.prototype.get = function (resourceGroupName, name, options, callback) { +AccountOperations.prototype.get = function (resourceGroupName, name, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -490,7 +510,7 @@ Account.prototype.get = function (resourceGroupName, name, options, callback) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -Account.prototype.enableKeyVault = function (resourceGroupName, accountName, options, callback) { +AccountOperations.prototype.enableKeyVault = function (resourceGroupName, accountName, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -635,7 +655,7 @@ Account.prototype.enableKeyVault = function (resourceGroupName, accountName, opt * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -Account.prototype.listByResourceGroup = function (resourceGroupName, options, callback) { +AccountOperations.prototype.listByResourceGroup = function (resourceGroupName, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -847,7 +867,7 @@ Account.prototype.listByResourceGroup = function (resourceGroupName, options, ca * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -Account.prototype.list = function (options, callback) { +AccountOperations.prototype.list = function (options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -1057,6 +1077,11 @@ Account.prototype.list = function (options, callback) { * address firewall for this Data Lake store account. Possible values include: * 'Enabled', 'Disabled' * + * @param {string} [parameters.firewallAllowAzureIps] The current state of + * allowing or disallowing IPs originating within Azure through the firewall. + * If the firewall is disabled, this is not enforced. Possible values include: + * 'Enabled', 'Disabled' + * * @param {array} [parameters.firewallRules] The list of firewall rules * associated with this Data Lake store account. * @@ -1070,6 +1095,11 @@ Account.prototype.list = function (options, callback) { * @param {string} [parameters.defaultGroup] the default owner group for all * new folders and files created in the Data Lake Store account. * + * @param {string} [parameters.newTier] the commitment tier to use for next + * month. Possible values include: 'Consumption', 'Commitment_1TB', + * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', + * 'Commitment_5PB' + * * @param {string} parameters.location Resource location * * @param {object} [parameters.tags] Resource tags @@ -1092,7 +1122,7 @@ Account.prototype.list = function (options, callback) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -Account.prototype.beginCreate = function (resourceGroupName, name, parameters, options, callback) { +AccountOperations.prototype.beginCreate = function (resourceGroupName, name, parameters, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -1267,6 +1297,11 @@ Account.prototype.beginCreate = function (resourceGroupName, name, parameters, o * does not remove existing rules, they will just be ignored until the firewall * is re-enabled. Possible values include: 'Enabled', 'Disabled' * + * @param {string} [parameters.firewallAllowAzureIps] The current state of + * allowing or disallowing IPs originating within Azure through the firewall. + * If the firewall is disabled, this is not enforced. Possible values include: + * 'Enabled', 'Disabled' + * * @param {string} [parameters.trustedIdProviderState] The current state of the * trusted identity provider feature for this Data Lake store account. * Disabling trusted identity provider functionality does not remove the @@ -1276,6 +1311,11 @@ Account.prototype.beginCreate = function (resourceGroupName, name, parameters, o * @param {string} [parameters.defaultGroup] the default owner group for all * new folders and files created in the Data Lake Store account. * + * @param {string} [parameters.newTier] the commitment tier to use for next + * month. Possible values include: 'Consumption', 'Commitment_1TB', + * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', + * 'Commitment_5PB' + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -1294,7 +1334,7 @@ Account.prototype.beginCreate = function (resourceGroupName, name, parameters, o * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -Account.prototype.beginUpdate = function (resourceGroupName, name, parameters, options, callback) { +AccountOperations.prototype.beginUpdate = function (resourceGroupName, name, parameters, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -1472,7 +1512,7 @@ Account.prototype.beginUpdate = function (resourceGroupName, name, parameters, o * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -Account.prototype.beginDeleteMethod = function (resourceGroupName, name, options, callback) { +AccountOperations.prototype.beginDeleteMethod = function (resourceGroupName, name, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -1597,7 +1637,7 @@ Account.prototype.beginDeleteMethod = function (resourceGroupName, name, options * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -Account.prototype.listByResourceGroupNext = function (nextPageLink, options, callback) { +AccountOperations.prototype.listByResourceGroupNext = function (nextPageLink, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -1725,7 +1765,7 @@ Account.prototype.listByResourceGroupNext = function (nextPageLink, options, cal * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -Account.prototype.listNext = function (nextPageLink, options, callback) { +AccountOperations.prototype.listNext = function (nextPageLink, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -1828,4 +1868,4 @@ Account.prototype.listNext = function (nextPageLink, options, callback) { }; -module.exports = Account; +module.exports = AccountOperations; diff --git a/lib/services/dataLake.Store/lib/account/operations/firewallRules.js b/lib/services/dataLake.Store/lib/account/operations/firewallRules.js index 7b4fb5c958..33db047f56 100644 --- a/lib/services/dataLake.Store/lib/account/operations/firewallRules.js +++ b/lib/services/dataLake.Store/lib/account/operations/firewallRules.js @@ -36,8 +36,8 @@ function FirewallRules(client) { * @param {string} resourceGroupName The name of the Azure resource group that * contains the Data Lake Store account. * - * @param {string} accountName The name of the Data Lake Store account to which - * to add the firewall rule. + * @param {string} accountName The name of the Data Lake Store account to add + * or replace the firewall rule. * * @param {string} firewallRuleName The name of the firewall rule to create or * update. @@ -46,10 +46,12 @@ function FirewallRules(client) { * firewall rule. * * @param {string} parameters.startIpAddress the start IP address for the - * firewall rule. + * firewall rule. This can be either ipv4 or ipv6. Start and End should be in + * the same protocol. * * @param {string} parameters.endIpAddress the end IP address for the firewall - * rule. + * rule. This can be either ipv4 or ipv6. Start and End should be in the same + * protocol. * * @param {string} [parameters.name] Resource name * @@ -211,6 +213,184 @@ FirewallRules.prototype.createOrUpdate = function (resourceGroupName, accountNam }); }; +/** + * Updates the specified firewall rule. + * + * @param {string} resourceGroupName The name of the Azure resource group that + * contains the Data Lake Store account. + * + * @param {string} accountName The name of the Data Lake Store account to which + * to update the firewall rule. + * + * @param {string} firewallRuleName The name of the firewall rule to update. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.parameters] Parameters supplied to update the + * firewall rule. + * + * @param {string} [options.parameters.startIpAddress] the start IP address for + * the firewall rule. This can be either ipv4 or ipv6. Start and End should be + * in the same protocol. + * + * @param {string} [options.parameters.endIpAddress] the end IP address for the + * firewall rule. This can be either ipv4 or ipv6. Start and End should be in + * the same protocol. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link FirewallRule} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +FirewallRules.prototype.update = function (resourceGroupName, accountName, firewallRuleName, options, callback) { + var client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + var parameters = (options && options.parameters !== undefined) ? options.parameters : undefined; + // Validate + try { + 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 (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName cannot be null or undefined and it must be of type string.'); + } + if (firewallRuleName === null || firewallRuleName === undefined || typeof firewallRuleName.valueOf() !== 'string') { + throw new Error('firewallRuleName 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 (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 (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 + var baseUrl = this.client.baseUri; + var requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}/firewallRules/{firewallRuleName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); + requestUrl = requestUrl.replace('{firewallRuleName}', encodeURIComponent(firewallRuleName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + var queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + 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(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + // Serialize Request + var requestContent = null; + var requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + var requestModelMapper = new client.models['UpdateFirewallRuleParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + var serializationError = new Error(util.format('Error "%s" occurred in serializing the ' + + 'payload - "%s"', error.message, util.inspect(parameters, {depth: null}))); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['FirewallRule']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + /** * Deletes the specified firewall rule from the specified Data Lake Store * account diff --git a/lib/services/dataLake.Store/lib/account/operations/index.d.ts b/lib/services/dataLake.Store/lib/account/operations/index.d.ts index 65c0f75265..8ed1915eb7 100644 --- a/lib/services/dataLake.Store/lib/account/operations/index.d.ts +++ b/lib/services/dataLake.Store/lib/account/operations/index.d.ts @@ -27,8 +27,8 @@ export interface FirewallRules { * @param {string} resourceGroupName The name of the Azure resource group that * contains the Data Lake Store account. * - * @param {string} accountName The name of the Data Lake Store account to which - * to add the firewall rule. + * @param {string} accountName The name of the Data Lake Store account to add + * or replace the firewall rule. * * @param {string} firewallRuleName The name of the firewall rule to create or * update. @@ -37,10 +37,12 @@ export interface FirewallRules { * firewall rule. * * @param {string} parameters.startIpAddress the start IP address for the - * firewall rule. + * firewall rule. This can be either ipv4 or ipv6. Start and End should be in + * the same protocol. * * @param {string} parameters.endIpAddress the end IP address for the firewall - * rule. + * rule. This can be either ipv4 or ipv6. Start and End should be in the same + * protocol. * * @param {string} [parameters.name] Resource name * @@ -55,6 +57,39 @@ export interface FirewallRules { createOrUpdate(resourceGroupName: string, accountName: string, firewallRuleName: string, parameters: models.FirewallRule, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; createOrUpdate(resourceGroupName: string, accountName: string, firewallRuleName: string, parameters: models.FirewallRule, callback: ServiceCallback): void; + /** + * Updates the specified firewall rule. + * + * @param {string} resourceGroupName The name of the Azure resource group that + * contains the Data Lake Store account. + * + * @param {string} accountName The name of the Data Lake Store account to which + * to update the firewall rule. + * + * @param {string} firewallRuleName The name of the firewall rule to update. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.parameters] Parameters supplied to update the + * firewall rule. + * + * @param {string} [options.parameters.startIpAddress] the start IP address for + * the firewall rule. This can be either ipv4 or ipv6. Start and End should be + * in the same protocol. + * + * @param {string} [options.parameters.endIpAddress] the end IP address for the + * firewall rule. This can be either ipv4 or ipv6. Start and End should be in + * the same protocol. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + update(resourceGroupName: string, accountName: string, firewallRuleName: string, options: { parameters? : models.UpdateFirewallRuleParameters, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + update(resourceGroupName: string, accountName: string, firewallRuleName: string, callback: ServiceCallback): void; + /** * Deletes the specified firewall rule from the specified Data Lake Store * account @@ -156,13 +191,13 @@ export interface TrustedIdProviders { * @param {string} resourceGroupName The name of the Azure resource group that * contains the Data Lake Store account. * - * @param {string} accountName The name of the Data Lake Store account to which - * to add the trusted identity provider. + * @param {string} accountName The name of the Data Lake Store account to add + * or replace the trusted identity provider. * * @param {string} trustedIdProviderName The name of the trusted identity * provider. This is used for differentiation of providers in the account. * - * @param {object} parameters Parameters supplied to create the create the + * @param {object} parameters Parameters supplied to create or replace the * trusted identity provider. * * @param {string} parameters.idProvider The URL of this trusted identity @@ -181,6 +216,35 @@ export interface TrustedIdProviders { createOrUpdate(resourceGroupName: string, accountName: string, trustedIdProviderName: string, parameters: models.TrustedIdProvider, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; createOrUpdate(resourceGroupName: string, accountName: string, trustedIdProviderName: string, parameters: models.TrustedIdProvider, callback: ServiceCallback): void; + /** + * Updates the specified trusted identity provider. + * + * @param {string} resourceGroupName The name of the Azure resource group that + * contains the Data Lake Store account. + * + * @param {string} accountName The name of the Data Lake Store account to which + * to update the trusted identity provider. + * + * @param {string} trustedIdProviderName The name of the trusted identity + * provider. This is used for differentiation of providers in the account. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.parameters] Parameters supplied to update the + * trusted identity provider. + * + * @param {string} [options.parameters.idProvider] The URL of this trusted + * identity provider + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + update(resourceGroupName: string, accountName: string, trustedIdProviderName: string, options: { parameters? : models.UpdateTrustedIdProviderParameters, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + update(resourceGroupName: string, accountName: string, trustedIdProviderName: string, callback: ServiceCallback): void; + /** * Deletes the specified trusted identity provider from the specified Data Lake * Store account @@ -270,11 +334,11 @@ export interface TrustedIdProviders { /** * @class - * Account + * AccountOperations * __NOTE__: An instance of this class is automatically created for an * instance of the DataLakeStoreAccountManagementClient. */ -export interface Account { +export interface AccountOperations { /** * Creates the specified Data Lake Store account. @@ -321,6 +385,11 @@ export interface Account { * address firewall for this Data Lake store account. Possible values include: * 'Enabled', 'Disabled' * + * @param {string} [parameters.firewallAllowAzureIps] The current state of + * allowing or disallowing IPs originating within Azure through the firewall. + * If the firewall is disabled, this is not enforced. Possible values include: + * 'Enabled', 'Disabled' + * * @param {array} [parameters.firewallRules] The list of firewall rules * associated with this Data Lake store account. * @@ -334,6 +403,11 @@ export interface Account { * @param {string} [parameters.defaultGroup] the default owner group for all * new folders and files created in the Data Lake Store account. * + * @param {string} [parameters.newTier] the commitment tier to use for next + * month. Possible values include: 'Consumption', 'Commitment_1TB', + * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', + * 'Commitment_5PB' + * * @param {string} parameters.location Resource location * * @param {object} [parameters.tags] Resource tags @@ -367,6 +441,11 @@ export interface Account { * does not remove existing rules, they will just be ignored until the firewall * is re-enabled. Possible values include: 'Enabled', 'Disabled' * + * @param {string} [parameters.firewallAllowAzureIps] The current state of + * allowing or disallowing IPs originating within Azure through the firewall. + * If the firewall is disabled, this is not enforced. Possible values include: + * 'Enabled', 'Disabled' + * * @param {string} [parameters.trustedIdProviderState] The current state of the * trusted identity provider feature for this Data Lake store account. * Disabling trusted identity provider functionality does not remove the @@ -376,6 +455,11 @@ export interface Account { * @param {string} [parameters.defaultGroup] the default owner group for all * new folders and files created in the Data Lake Store account. * + * @param {string} [parameters.newTier] the commitment tier to use for next + * month. Possible values include: 'Consumption', 'Commitment_1TB', + * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', + * 'Commitment_5PB' + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -564,6 +648,11 @@ export interface Account { * address firewall for this Data Lake store account. Possible values include: * 'Enabled', 'Disabled' * + * @param {string} [parameters.firewallAllowAzureIps] The current state of + * allowing or disallowing IPs originating within Azure through the firewall. + * If the firewall is disabled, this is not enforced. Possible values include: + * 'Enabled', 'Disabled' + * * @param {array} [parameters.firewallRules] The list of firewall rules * associated with this Data Lake store account. * @@ -577,6 +666,11 @@ export interface Account { * @param {string} [parameters.defaultGroup] the default owner group for all * new folders and files created in the Data Lake Store account. * + * @param {string} [parameters.newTier] the commitment tier to use for next + * month. Possible values include: 'Consumption', 'Commitment_1TB', + * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', + * 'Commitment_5PB' + * * @param {string} parameters.location Resource location * * @param {object} [parameters.tags] Resource tags @@ -610,6 +704,11 @@ export interface Account { * does not remove existing rules, they will just be ignored until the firewall * is re-enabled. Possible values include: 'Enabled', 'Disabled' * + * @param {string} [parameters.firewallAllowAzureIps] The current state of + * allowing or disallowing IPs originating within Azure through the firewall. + * If the firewall is disabled, this is not enforced. Possible values include: + * 'Enabled', 'Disabled' + * * @param {string} [parameters.trustedIdProviderState] The current state of the * trusted identity provider feature for this Data Lake store account. * Disabling trusted identity provider functionality does not remove the @@ -619,6 +718,11 @@ export interface Account { * @param {string} [parameters.defaultGroup] the default owner group for all * new folders and files created in the Data Lake Store account. * + * @param {string} [parameters.newTier] the commitment tier to use for next + * month. Possible values include: 'Consumption', 'Commitment_1TB', + * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', + * 'Commitment_5PB' + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the diff --git a/lib/services/dataLake.Store/lib/account/operations/index.js b/lib/services/dataLake.Store/lib/account/operations/index.js index 6579c20d81..d751336dd8 100644 --- a/lib/services/dataLake.Store/lib/account/operations/index.js +++ b/lib/services/dataLake.Store/lib/account/operations/index.js @@ -16,4 +16,4 @@ exports.FirewallRules = require('./firewallRules'); exports.TrustedIdProviders = require('./trustedIdProviders'); -exports.Account = require('./account'); +exports.AccountOperations = require('./accountOperations'); diff --git a/lib/services/dataLake.Store/lib/account/operations/trustedIdProviders.js b/lib/services/dataLake.Store/lib/account/operations/trustedIdProviders.js index 031871f3ce..8a20027661 100644 --- a/lib/services/dataLake.Store/lib/account/operations/trustedIdProviders.js +++ b/lib/services/dataLake.Store/lib/account/operations/trustedIdProviders.js @@ -37,13 +37,13 @@ function TrustedIdProviders(client) { * @param {string} resourceGroupName The name of the Azure resource group that * contains the Data Lake Store account. * - * @param {string} accountName The name of the Data Lake Store account to which - * to add the trusted identity provider. + * @param {string} accountName The name of the Data Lake Store account to add + * or replace the trusted identity provider. * * @param {string} trustedIdProviderName The name of the trusted identity * provider. This is used for differentiation of providers in the account. * - * @param {object} parameters Parameters supplied to create the create the + * @param {object} parameters Parameters supplied to create or replace the * trusted identity provider. * * @param {string} parameters.idProvider The URL of this trusted identity @@ -209,6 +209,180 @@ TrustedIdProviders.prototype.createOrUpdate = function (resourceGroupName, accou }); }; +/** + * Updates the specified trusted identity provider. + * + * @param {string} resourceGroupName The name of the Azure resource group that + * contains the Data Lake Store account. + * + * @param {string} accountName The name of the Data Lake Store account to which + * to update the trusted identity provider. + * + * @param {string} trustedIdProviderName The name of the trusted identity + * provider. This is used for differentiation of providers in the account. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.parameters] Parameters supplied to update the + * trusted identity provider. + * + * @param {string} [options.parameters.idProvider] The URL of this trusted + * identity provider + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link TrustedIdProvider} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +TrustedIdProviders.prototype.update = function (resourceGroupName, accountName, trustedIdProviderName, options, callback) { + var client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + var parameters = (options && options.parameters !== undefined) ? options.parameters : undefined; + // Validate + try { + 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 (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName cannot be null or undefined and it must be of type string.'); + } + if (trustedIdProviderName === null || trustedIdProviderName === undefined || typeof trustedIdProviderName.valueOf() !== 'string') { + throw new Error('trustedIdProviderName 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 (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 (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 + var baseUrl = this.client.baseUri; + var requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}/trustedIdProviders/{trustedIdProviderName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); + requestUrl = requestUrl.replace('{trustedIdProviderName}', encodeURIComponent(trustedIdProviderName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + var queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + 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(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + // Serialize Request + var requestContent = null; + var requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + var requestModelMapper = new client.models['UpdateTrustedIdProviderParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + var serializationError = new Error(util.format('Error "%s" occurred in serializing the ' + + 'payload - "%s"', error.message, util.inspect(parameters, {depth: null}))); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['TrustedIdProvider']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + /** * Deletes the specified trusted identity provider from the specified Data Lake * Store account diff --git a/lib/services/dataLake.Store/lib/filesystem/operations/fileSystem.js b/lib/services/dataLake.Store/lib/filesystem/operations/fileSystem.js index af0ed531fa..e1f7f8f102 100644 --- a/lib/services/dataLake.Store/lib/filesystem/operations/fileSystem.js +++ b/lib/services/dataLake.Store/lib/filesystem/operations/fileSystem.js @@ -30,12 +30,14 @@ function FileSystem(client) { } /** - * Appends to the specified file. This method supports multiple concurrent - * appends to the file. NOTE: ConcurrentAppend and normal (serial) Append - * CANNOT be used interchangeably; once a file has been appended to using - * either of these append options, it can only be appended to using that append - * option. ConcurrentAppend DOES NOT guarantee order and can result in - * duplicated data landing in the target file. + * Appends to the specified file, optionally first creating the file if it does + * not yet exist. This method supports multiple concurrent appends to the file. + * NOTE: The target must not contain data added by Create or normal (serial) + * Append. ConcurrentAppend and Append cannot be used interchangeably; once a + * target file has been modified using either of these append options, the + * other append option cannot be used on the target file. ConcurrentAppend does + * not guarantee order and can result in duplicated data landing in the target + * file. * * @param {string} accountName The Azure Data Lake Store account to execute * filesystem operations on. @@ -816,8 +818,8 @@ FileSystem.prototype.concat = function (accountName, destinationPath, sources, o * with '/') of the destination file resulting from the concatenation. * * @param {object} streamContents A list of Data Lake Store paths (starting - * with '/') of the source files. Must be in the format: sources= + * with '/') of the source files. Must be a comma-separated path list in the + * format: sources=/file/path/1.txt,/file/path/2.txt,/file/path/lastfile.csv * * @param {object} [options] Optional Parameters. * @@ -1205,7 +1207,7 @@ FileSystem.prototype.getContentSummary = function (accountName, getContentSummar // Construct URL var baseUrl = this.client.baseUri; - var requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'webhdfs/va/{getContentSummaryFilePath}'; + var requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'webhdfs/v1/{getContentSummaryFilePath}'; requestUrl = requestUrl.replace('{accountName}', accountName); requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); requestUrl = requestUrl.replace('{getContentSummaryFilePath}', encodeURIComponent(getContentSummaryFilePath)); @@ -1444,12 +1446,10 @@ FileSystem.prototype.getFileStatus = function (accountName, getFilePath, options }; /** - * Appends to the specified file. This method does not support multiple - * concurrent appends to the file. NOTE: Concurrent append and normal (serial) - * append CANNOT be used interchangeably. Once a file has been appended to - * using either append option, it can only be appended to using that append - * option. Use the ConcurrentAppend option if you would like support for - * concurrent appends. + * Appends to the specified file. NOTE: The target must not contain data added + * by ConcurrentAppend. ConcurrentAppend and Append cannot be used + * interchangeably; once a target file has been modified using either of these + * append options, the other append option cannot be used on the target file. * * @param {string} accountName The Azure Data Lake Store account to execute * filesystem operations on. @@ -1617,7 +1617,8 @@ FileSystem.prototype.append = function (accountName, directFilePath, streamConte }; /** - * Creates a file with optionally specified content. + * Creates a file with optionally specified content. NOTE: If content is + * provided, the resulting file cannot be modified using ConcurrentAppend. * * @param {string} accountName The Azure Data Lake Store account to execute * filesystem operations on. diff --git a/lib/services/dataLake.Store/lib/filesystem/operations/index.d.ts b/lib/services/dataLake.Store/lib/filesystem/operations/index.d.ts index 6fd5db6470..3bfb50b34c 100644 --- a/lib/services/dataLake.Store/lib/filesystem/operations/index.d.ts +++ b/lib/services/dataLake.Store/lib/filesystem/operations/index.d.ts @@ -22,12 +22,14 @@ import * as models from '../models'; export interface FileSystem { /** - * Appends to the specified file. This method supports multiple concurrent - * appends to the file. NOTE: ConcurrentAppend and normal (serial) Append - * CANNOT be used interchangeably; once a file has been appended to using - * either of these append options, it can only be appended to using that append - * option. ConcurrentAppend DOES NOT guarantee order and can result in - * duplicated data landing in the target file. + * Appends to the specified file, optionally first creating the file if it does + * not yet exist. This method supports multiple concurrent appends to the file. + * NOTE: The target must not contain data added by Create or normal (serial) + * Append. ConcurrentAppend and Append cannot be used interchangeably; once a + * target file has been modified using either of these append options, the + * other append option cannot be used on the target file. ConcurrentAppend does + * not guarantee order and can result in duplicated data landing in the target + * file. * * @param {string} accountName The Azure Data Lake Store account to execute * filesystem operations on. @@ -174,8 +176,8 @@ export interface FileSystem { * with '/') of the destination file resulting from the concatenation. * * @param {object} streamContents A list of Data Lake Store paths (starting - * with '/') of the source files. Must be in the format: sources= + * with '/') of the source files. Must be a comma-separated path list in the + * format: sources=/file/path/1.txt,/file/path/2.txt,/file/path/lastfile.csv * * @param {object} [options] Optional Parameters. * @@ -271,12 +273,10 @@ export interface FileSystem { getFileStatus(accountName: string, getFilePath: string, callback: ServiceCallback): void; /** - * Appends to the specified file. This method does not support multiple - * concurrent appends to the file. NOTE: Concurrent append and normal (serial) - * append CANNOT be used interchangeably. Once a file has been appended to - * using either append option, it can only be appended to using that append - * option. Use the ConcurrentAppend option if you would like support for - * concurrent appends. + * Appends to the specified file. NOTE: The target must not contain data added + * by ConcurrentAppend. ConcurrentAppend and Append cannot be used + * interchangeably; once a target file has been modified using either of these + * append options, the other append option cannot be used on the target file. * * @param {string} accountName The Azure Data Lake Store account to execute * filesystem operations on. @@ -309,7 +309,8 @@ export interface FileSystem { append(accountName: string, directFilePath: string, streamContents: stream.Readable, callback: ServiceCallback): void; /** - * Creates a file with optionally specified content. + * Creates a file with optionally specified content. NOTE: If content is + * provided, the resulting file cannot be modified using ConcurrentAppend. * * @param {string} accountName The Azure Data Lake Store account to execute * filesystem operations on.