diff --git a/lib/services/datafactoryManagement/lib/models/activity.js b/lib/services/datafactoryManagement/lib/models/activity.js index bcaeef0394..4c29060000 100644 --- a/lib/services/datafactoryManagement/lib/models/activity.js +++ b/lib/services/datafactoryManagement/lib/models/activity.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * A pipeline activity. * diff --git a/lib/services/datafactoryManagement/lib/models/activityRunsQueryResponse.js b/lib/services/datafactoryManagement/lib/models/activityRunsQueryResponse.js index b26c2970f0..5880f16e60 100644 --- a/lib/services/datafactoryManagement/lib/models/activityRunsQueryResponse.js +++ b/lib/services/datafactoryManagement/lib/models/activityRunsQueryResponse.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * A list activity runs. * diff --git a/lib/services/datafactoryManagement/lib/models/azureMLWebServiceFile.js b/lib/services/datafactoryManagement/lib/models/azureMLWebServiceFile.js index 0e0fc87c7e..6dead8f0e1 100644 --- a/lib/services/datafactoryManagement/lib/models/azureMLWebServiceFile.js +++ b/lib/services/datafactoryManagement/lib/models/azureMLWebServiceFile.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Azure ML WebService Input/Output file * diff --git a/lib/services/datafactoryManagement/lib/models/createLinkedIntegrationRuntimeRequest.js b/lib/services/datafactoryManagement/lib/models/createLinkedIntegrationRuntimeRequest.js new file mode 100644 index 0000000000..b9f5655fa3 --- /dev/null +++ b/lib/services/datafactoryManagement/lib/models/createLinkedIntegrationRuntimeRequest.js @@ -0,0 +1,79 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The linked integration runtime information. + * + */ +class CreateLinkedIntegrationRuntimeRequest { + /** + * Create a CreateLinkedIntegrationRuntimeRequest. + * @member {string} [name] The name of the linked integration runtime. + * @member {string} [subscriptionId] The ID of the subscription that the + * linked integration runtime belongs to. + * @member {string} [dataFactoryName] The name of the data factory that the + * linked integration runtime belongs to. + * @member {string} [dataFactoryLocation] The location of the data factory + * that the linked integration runtime belongs to. + */ + constructor() { + } + + /** + * Defines the metadata of CreateLinkedIntegrationRuntimeRequest + * + * @returns {object} metadata of CreateLinkedIntegrationRuntimeRequest + * + */ + mapper() { + return { + required: false, + serializedName: 'CreateLinkedIntegrationRuntimeRequest', + type: { + name: 'Composite', + className: 'CreateLinkedIntegrationRuntimeRequest', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + subscriptionId: { + required: false, + serializedName: 'subscriptionId', + type: { + name: 'String' + } + }, + dataFactoryName: { + required: false, + serializedName: 'dataFactoryName', + type: { + name: 'String' + } + }, + dataFactoryLocation: { + required: false, + serializedName: 'dataFactoryLocation', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = CreateLinkedIntegrationRuntimeRequest; diff --git a/lib/services/datafactoryManagement/lib/models/customActivityReferenceObject.js b/lib/services/datafactoryManagement/lib/models/customActivityReferenceObject.js index 70054de792..40d1bca23d 100644 --- a/lib/services/datafactoryManagement/lib/models/customActivityReferenceObject.js +++ b/lib/services/datafactoryManagement/lib/models/customActivityReferenceObject.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Reference objects for custom activity * diff --git a/lib/services/datafactoryManagement/lib/models/dataset.js b/lib/services/datafactoryManagement/lib/models/dataset.js index 32e93147b4..21e2959d7c 100644 --- a/lib/services/datafactoryManagement/lib/models/dataset.js +++ b/lib/services/datafactoryManagement/lib/models/dataset.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The Azure Data Factory nested object which identifies data within different * data stores, such as tables, files, folders, and documents. diff --git a/lib/services/datafactoryManagement/lib/models/factoryRepoUpdate.js b/lib/services/datafactoryManagement/lib/models/factoryRepoUpdate.js index 07344d1733..5d5753ac57 100644 --- a/lib/services/datafactoryManagement/lib/models/factoryRepoUpdate.js +++ b/lib/services/datafactoryManagement/lib/models/factoryRepoUpdate.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Factory's git repo information. * diff --git a/lib/services/datafactoryManagement/lib/models/factoryUpdateParameters.js b/lib/services/datafactoryManagement/lib/models/factoryUpdateParameters.js index f3075d7c39..2e579e7b49 100644 --- a/lib/services/datafactoryManagement/lib/models/factoryUpdateParameters.js +++ b/lib/services/datafactoryManagement/lib/models/factoryUpdateParameters.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Parameters for updating a factory resource. * diff --git a/lib/services/datafactoryManagement/lib/models/index.d.ts b/lib/services/datafactoryManagement/lib/models/index.d.ts index 4f9f3f21f8..2a8d18265a 100644 --- a/lib/services/datafactoryManagement/lib/models/index.d.ts +++ b/lib/services/datafactoryManagement/lib/models/index.d.ts @@ -353,6 +353,27 @@ export interface LinkedIntegrationRuntimeRequest { linkedFactoryName: string; } +/** + * @class + * Initializes a new instance of the CreateLinkedIntegrationRuntimeRequest class. + * @constructor + * The linked integration runtime information. + * + * @member {string} [name] The name of the linked integration runtime. + * @member {string} [subscriptionId] The ID of the subscription that the linked + * integration runtime belongs to. + * @member {string} [dataFactoryName] The name of the data factory that the + * linked integration runtime belongs to. + * @member {string} [dataFactoryLocation] The location of the data factory that + * the linked integration runtime belongs to. + */ +export interface CreateLinkedIntegrationRuntimeRequest { + name?: string; + subscriptionId?: string; + dataFactoryName?: string; + dataFactoryLocation?: string; +} + /** * @class * Initializes a new instance of the ParameterSpecification class. @@ -6800,7 +6821,7 @@ export interface LinkedIntegrationRuntime { * @member {date} [lastStartTime] The time the node last started up. * @member {date} [lastStopTime] The integration runtime node last stop time. * @member {string} [lastUpdateResult] The result of the last integration - * runtime node update. Possible values include: 'Succeed', 'Fail' + * runtime node update. Possible values include: 'None', 'Succeed', 'Fail' * @member {date} [lastStartUpdateTime] The last time for the integration * runtime node update start. * @member {date} [lastEndUpdateTime] The last time for the integration runtime @@ -6870,6 +6891,8 @@ export interface SelfHostedIntegrationRuntimeNode { * @member {string} [pushedVersion] The version that the integration runtime is * going to update to. * @member {string} [latestVersion] The latest version on download center. + * @member {date} [autoUpdateETA] The estimated time when the self-hosted + * integration runtime will be updated. */ export interface SelfHostedIntegrationRuntimeStatus extends IntegrationRuntimeStatus { readonly createTime?: Date; @@ -6887,6 +6910,7 @@ export interface SelfHostedIntegrationRuntimeStatus extends IntegrationRuntimeSt links?: LinkedIntegrationRuntime[]; readonly pushedVersion?: string; readonly latestVersion?: string; + readonly autoUpdateETA?: Date; } /** diff --git a/lib/services/datafactoryManagement/lib/models/index.js b/lib/services/datafactoryManagement/lib/models/index.js index dc0dc7ee2c..6bffa44c83 100644 --- a/lib/services/datafactoryManagement/lib/models/index.js +++ b/lib/services/datafactoryManagement/lib/models/index.js @@ -37,6 +37,7 @@ exports.IntegrationRuntimeStatusListResponse = require('./integrationRuntimeStat exports.UpdateIntegrationRuntimeRequest = require('./updateIntegrationRuntimeRequest'); exports.UpdateIntegrationRuntimeNodeRequest = require('./updateIntegrationRuntimeNodeRequest'); exports.LinkedIntegrationRuntimeRequest = require('./linkedIntegrationRuntimeRequest'); +exports.CreateLinkedIntegrationRuntimeRequest = require('./createLinkedIntegrationRuntimeRequest'); exports.ParameterSpecification = require('./parameterSpecification'); exports.LinkedService = require('./linkedService'); exports.LinkedServiceResource = require('./linkedServiceResource'); diff --git a/lib/services/datafactoryManagement/lib/models/integrationRuntimeComputeProperties.js b/lib/services/datafactoryManagement/lib/models/integrationRuntimeComputeProperties.js index 123bf8b39b..a7488bb60f 100644 --- a/lib/services/datafactoryManagement/lib/models/integrationRuntimeComputeProperties.js +++ b/lib/services/datafactoryManagement/lib/models/integrationRuntimeComputeProperties.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The compute resource properties for managed integration runtime. * diff --git a/lib/services/datafactoryManagement/lib/models/integrationRuntimeCustomSetupScriptProperties.js b/lib/services/datafactoryManagement/lib/models/integrationRuntimeCustomSetupScriptProperties.js index bede46378a..904f95a41b 100644 --- a/lib/services/datafactoryManagement/lib/models/integrationRuntimeCustomSetupScriptProperties.js +++ b/lib/services/datafactoryManagement/lib/models/integrationRuntimeCustomSetupScriptProperties.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Custom setup script properties for a managed dedicated integration runtime. * diff --git a/lib/services/datafactoryManagement/lib/models/integrationRuntimeMonitoringData.js b/lib/services/datafactoryManagement/lib/models/integrationRuntimeMonitoringData.js index 7211d4e39c..adc167e9f4 100644 --- a/lib/services/datafactoryManagement/lib/models/integrationRuntimeMonitoringData.js +++ b/lib/services/datafactoryManagement/lib/models/integrationRuntimeMonitoringData.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Get monitoring data response. * diff --git a/lib/services/datafactoryManagement/lib/models/integrationRuntimeSsisCatalogInfo.js b/lib/services/datafactoryManagement/lib/models/integrationRuntimeSsisCatalogInfo.js index 8d9c23c8fe..5ed2eb2dd6 100644 --- a/lib/services/datafactoryManagement/lib/models/integrationRuntimeSsisCatalogInfo.js +++ b/lib/services/datafactoryManagement/lib/models/integrationRuntimeSsisCatalogInfo.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Catalog information for managed dedicated integration runtime. * diff --git a/lib/services/datafactoryManagement/lib/models/integrationRuntimeSsisProperties.js b/lib/services/datafactoryManagement/lib/models/integrationRuntimeSsisProperties.js index f161a3e77a..ea953568e6 100644 --- a/lib/services/datafactoryManagement/lib/models/integrationRuntimeSsisProperties.js +++ b/lib/services/datafactoryManagement/lib/models/integrationRuntimeSsisProperties.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * SSIS properties for managed integration runtime. * diff --git a/lib/services/datafactoryManagement/lib/models/integrationRuntimeStatusListResponse.js b/lib/services/datafactoryManagement/lib/models/integrationRuntimeStatusListResponse.js index fd28131a36..4f34ccbdac 100644 --- a/lib/services/datafactoryManagement/lib/models/integrationRuntimeStatusListResponse.js +++ b/lib/services/datafactoryManagement/lib/models/integrationRuntimeStatusListResponse.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * A list of integration runtime status. * diff --git a/lib/services/datafactoryManagement/lib/models/integrationRuntimeStatusResponse.js b/lib/services/datafactoryManagement/lib/models/integrationRuntimeStatusResponse.js index 62527efd0e..44584c0246 100644 --- a/lib/services/datafactoryManagement/lib/models/integrationRuntimeStatusResponse.js +++ b/lib/services/datafactoryManagement/lib/models/integrationRuntimeStatusResponse.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Integration runtime status response. * diff --git a/lib/services/datafactoryManagement/lib/models/linkedService.js b/lib/services/datafactoryManagement/lib/models/linkedService.js index 09c619c7c3..3d831cc9de 100644 --- a/lib/services/datafactoryManagement/lib/models/linkedService.js +++ b/lib/services/datafactoryManagement/lib/models/linkedService.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The Azure Data Factory nested object which contains the information and * credential which can be used to connect with related store or compute diff --git a/lib/services/datafactoryManagement/lib/models/managedIntegrationRuntimeNode.js b/lib/services/datafactoryManagement/lib/models/managedIntegrationRuntimeNode.js index 6a2e7482d0..fe419bacb0 100644 --- a/lib/services/datafactoryManagement/lib/models/managedIntegrationRuntimeNode.js +++ b/lib/services/datafactoryManagement/lib/models/managedIntegrationRuntimeNode.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Properties of integration runtime node. * diff --git a/lib/services/datafactoryManagement/lib/models/operation.js b/lib/services/datafactoryManagement/lib/models/operation.js index cf05c5065c..4a090ac126 100644 --- a/lib/services/datafactoryManagement/lib/models/operation.js +++ b/lib/services/datafactoryManagement/lib/models/operation.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Azure Data Factory API operation definition. * diff --git a/lib/services/datafactoryManagement/lib/models/operationMetricSpecification.js b/lib/services/datafactoryManagement/lib/models/operationMetricSpecification.js index 24e35a16bf..88eb059f42 100644 --- a/lib/services/datafactoryManagement/lib/models/operationMetricSpecification.js +++ b/lib/services/datafactoryManagement/lib/models/operationMetricSpecification.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Details about an operation related to metrics. * diff --git a/lib/services/datafactoryManagement/lib/models/operationServiceSpecification.js b/lib/services/datafactoryManagement/lib/models/operationServiceSpecification.js index abd318a42c..4855871b0c 100644 --- a/lib/services/datafactoryManagement/lib/models/operationServiceSpecification.js +++ b/lib/services/datafactoryManagement/lib/models/operationServiceSpecification.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Details about a service operation. * diff --git a/lib/services/datafactoryManagement/lib/models/pipelineRun.js b/lib/services/datafactoryManagement/lib/models/pipelineRun.js index 21e91bbe11..86dc7f9d4f 100644 --- a/lib/services/datafactoryManagement/lib/models/pipelineRun.js +++ b/lib/services/datafactoryManagement/lib/models/pipelineRun.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Information about a pipeline run. * diff --git a/lib/services/datafactoryManagement/lib/models/pipelineRunsQueryResponse.js b/lib/services/datafactoryManagement/lib/models/pipelineRunsQueryResponse.js index dd7d5de0c4..1d496f3b18 100644 --- a/lib/services/datafactoryManagement/lib/models/pipelineRunsQueryResponse.js +++ b/lib/services/datafactoryManagement/lib/models/pipelineRunsQueryResponse.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * A list pipeline runs. * diff --git a/lib/services/datafactoryManagement/lib/models/recurrenceSchedule.js b/lib/services/datafactoryManagement/lib/models/recurrenceSchedule.js index ecafc6daf6..3d8ea0c58f 100644 --- a/lib/services/datafactoryManagement/lib/models/recurrenceSchedule.js +++ b/lib/services/datafactoryManagement/lib/models/recurrenceSchedule.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The recurrence schedule. * diff --git a/lib/services/datafactoryManagement/lib/models/redshiftUnloadSettings.js b/lib/services/datafactoryManagement/lib/models/redshiftUnloadSettings.js index d21c28bc7a..a9ec022557 100644 --- a/lib/services/datafactoryManagement/lib/models/redshiftUnloadSettings.js +++ b/lib/services/datafactoryManagement/lib/models/redshiftUnloadSettings.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The Amazon S3 settings needed for the interim Amazon S3 when copying from * Amazon Redshift with unload. With this, data from Amazon Redshift source diff --git a/lib/services/datafactoryManagement/lib/models/runFilterParameters.js b/lib/services/datafactoryManagement/lib/models/runFilterParameters.js index f50f95451c..f7a5f9050a 100644 --- a/lib/services/datafactoryManagement/lib/models/runFilterParameters.js +++ b/lib/services/datafactoryManagement/lib/models/runFilterParameters.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Query parameters for listing runs. * diff --git a/lib/services/datafactoryManagement/lib/models/scheduleTriggerRecurrence.js b/lib/services/datafactoryManagement/lib/models/scheduleTriggerRecurrence.js index 1150426250..242369efe8 100644 --- a/lib/services/datafactoryManagement/lib/models/scheduleTriggerRecurrence.js +++ b/lib/services/datafactoryManagement/lib/models/scheduleTriggerRecurrence.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The workflow trigger recurrence. * diff --git a/lib/services/datafactoryManagement/lib/models/selfHostedIntegrationRuntimeNode.js b/lib/services/datafactoryManagement/lib/models/selfHostedIntegrationRuntimeNode.js index 37fdfd315a..1631a5ba75 100644 --- a/lib/services/datafactoryManagement/lib/models/selfHostedIntegrationRuntimeNode.js +++ b/lib/services/datafactoryManagement/lib/models/selfHostedIntegrationRuntimeNode.js @@ -39,7 +39,7 @@ class SelfHostedIntegrationRuntimeNode { * @member {date} [lastStartTime] The time the node last started up. * @member {date} [lastStopTime] The integration runtime node last stop time. * @member {string} [lastUpdateResult] The result of the last integration - * runtime node update. Possible values include: 'Succeed', 'Fail' + * runtime node update. Possible values include: 'None', 'Succeed', 'Fail' * @member {date} [lastStartUpdateTime] The last time for the integration * runtime node update start. * @member {date} [lastEndUpdateTime] The last time for the integration diff --git a/lib/services/datafactoryManagement/lib/models/selfHostedIntegrationRuntimeStatus.js b/lib/services/datafactoryManagement/lib/models/selfHostedIntegrationRuntimeStatus.js index e6c28cd409..90e39520b5 100644 --- a/lib/services/datafactoryManagement/lib/models/selfHostedIntegrationRuntimeStatus.js +++ b/lib/services/datafactoryManagement/lib/models/selfHostedIntegrationRuntimeStatus.js @@ -49,6 +49,8 @@ class SelfHostedIntegrationRuntimeStatus extends models['IntegrationRuntimeStatu * @member {string} [pushedVersion] The version that the integration runtime * is going to update to. * @member {string} [latestVersion] The latest version on download center. + * @member {date} [autoUpdateETA] The estimated time when the self-hosted + * integration runtime will be updated. */ constructor() { super(); @@ -256,6 +258,14 @@ class SelfHostedIntegrationRuntimeStatus extends models['IntegrationRuntimeStatu type: { name: 'String' } + }, + autoUpdateETA: { + required: false, + readOnly: true, + serializedName: 'typeProperties.autoUpdateETA', + type: { + name: 'DateTime' + } } } } diff --git a/lib/services/datafactoryManagement/lib/models/stagingSettings.js b/lib/services/datafactoryManagement/lib/models/stagingSettings.js index ea31675ede..ffe94eb2dc 100644 --- a/lib/services/datafactoryManagement/lib/models/stagingSettings.js +++ b/lib/services/datafactoryManagement/lib/models/stagingSettings.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Staging settings. * diff --git a/lib/services/datafactoryManagement/lib/models/triggerPipelineReference.js b/lib/services/datafactoryManagement/lib/models/triggerPipelineReference.js index 6b84ae8172..1859d0502d 100644 --- a/lib/services/datafactoryManagement/lib/models/triggerPipelineReference.js +++ b/lib/services/datafactoryManagement/lib/models/triggerPipelineReference.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Pipeline that needs to be triggered with the given parameters. * diff --git a/lib/services/datafactoryManagement/lib/models/triggerRunsQueryResponse.js b/lib/services/datafactoryManagement/lib/models/triggerRunsQueryResponse.js index 6f15714f1c..133ef162a0 100644 --- a/lib/services/datafactoryManagement/lib/models/triggerRunsQueryResponse.js +++ b/lib/services/datafactoryManagement/lib/models/triggerRunsQueryResponse.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * A list of trigger runs. * diff --git a/lib/services/datafactoryManagement/lib/models/webActivityAuthentication.js b/lib/services/datafactoryManagement/lib/models/webActivityAuthentication.js index 58b641b21e..111bce21c5 100644 --- a/lib/services/datafactoryManagement/lib/models/webActivityAuthentication.js +++ b/lib/services/datafactoryManagement/lib/models/webActivityAuthentication.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Web activity authentication properties. * diff --git a/lib/services/datafactoryManagement/lib/operations/index.d.ts b/lib/services/datafactoryManagement/lib/operations/index.d.ts index 948d9d23be..7fe94b2e33 100644 --- a/lib/services/datafactoryManagement/lib/operations/index.d.ts +++ b/lib/services/datafactoryManagement/lib/operations/index.d.ts @@ -1833,6 +1833,102 @@ export interface IntegrationRuntimes { removeLinks(resourceGroupName: string, factoryName: string, integrationRuntimeName: string, linkedIntegrationRuntimeRequest: models.LinkedIntegrationRuntimeRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** + * Create a linked integration runtime entry in a shared integration runtime. + * + * @param {string} resourceGroupName The resource group name. + * + * @param {string} factoryName The factory name. + * + * @param {string} integrationRuntimeName The integration runtime name. + * + * @param {object} createLinkedIntegrationRuntimeRequest The linked integration + * runtime properties. + * + * @param {string} [createLinkedIntegrationRuntimeRequest.name] The name of the + * linked integration runtime. + * + * @param {string} [createLinkedIntegrationRuntimeRequest.subscriptionId] The + * ID of the subscription that the linked integration runtime belongs to. + * + * @param {string} [createLinkedIntegrationRuntimeRequest.dataFactoryName] The + * name of the data factory that the linked integration runtime belongs to. + * + * @param {string} [createLinkedIntegrationRuntimeRequest.dataFactoryLocation] + * The location of the data factory that the linked integration runtime belongs + * to. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createLinkedIntegrationRuntimeWithHttpOperationResponse(resourceGroupName: string, factoryName: string, integrationRuntimeName: string, createLinkedIntegrationRuntimeRequest: models.CreateLinkedIntegrationRuntimeRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Create a linked integration runtime entry in a shared integration runtime. + * + * @param {string} resourceGroupName The resource group name. + * + * @param {string} factoryName The factory name. + * + * @param {string} integrationRuntimeName The integration runtime name. + * + * @param {object} createLinkedIntegrationRuntimeRequest The linked integration + * runtime properties. + * + * @param {string} [createLinkedIntegrationRuntimeRequest.name] The name of the + * linked integration runtime. + * + * @param {string} [createLinkedIntegrationRuntimeRequest.subscriptionId] The + * ID of the subscription that the linked integration runtime belongs to. + * + * @param {string} [createLinkedIntegrationRuntimeRequest.dataFactoryName] The + * name of the data factory that the linked integration runtime belongs to. + * + * @param {string} [createLinkedIntegrationRuntimeRequest.dataFactoryLocation] + * The location of the data factory that the linked integration runtime belongs + * to. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {IntegrationRuntimeStatusResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {IntegrationRuntimeStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link IntegrationRuntimeStatusResponse} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createLinkedIntegrationRuntime(resourceGroupName: string, factoryName: string, integrationRuntimeName: string, createLinkedIntegrationRuntimeRequest: models.CreateLinkedIntegrationRuntimeRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createLinkedIntegrationRuntime(resourceGroupName: string, factoryName: string, integrationRuntimeName: string, createLinkedIntegrationRuntimeRequest: models.CreateLinkedIntegrationRuntimeRequest, callback: ServiceCallback): void; + createLinkedIntegrationRuntime(resourceGroupName: string, factoryName: string, integrationRuntimeName: string, createLinkedIntegrationRuntimeRequest: models.CreateLinkedIntegrationRuntimeRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * Starts a ManagedReserved type integration runtime. * @@ -2026,6 +2122,74 @@ export interface IntegrationRuntimes { export interface IntegrationRuntimeNodes { + /** + * Gets a self-hosted integration runtime node. + * + * @param {string} resourceGroupName The resource group name. + * + * @param {string} factoryName The factory name. + * + * @param {string} integrationRuntimeName The integration runtime name. + * + * @param {string} nodeName The integration runtime node name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, factoryName: string, integrationRuntimeName: string, nodeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a self-hosted integration runtime node. + * + * @param {string} resourceGroupName The resource group name. + * + * @param {string} factoryName The factory name. + * + * @param {string} integrationRuntimeName The integration runtime name. + * + * @param {string} nodeName The integration runtime node name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {SelfHostedIntegrationRuntimeNode} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {SelfHostedIntegrationRuntimeNode} [result] - The deserialized result object if an error did not occur. + * See {@link SelfHostedIntegrationRuntimeNode} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, factoryName: string, integrationRuntimeName: string, nodeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, factoryName: string, integrationRuntimeName: string, nodeName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, factoryName: string, integrationRuntimeName: string, nodeName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * Deletes a self-hosted integration runtime node. * diff --git a/lib/services/datafactoryManagement/lib/operations/integrationRuntimeNodes.js b/lib/services/datafactoryManagement/lib/operations/integrationRuntimeNodes.js index 2baea2efc0..94c3e7a4fc 100644 --- a/lib/services/datafactoryManagement/lib/operations/integrationRuntimeNodes.js +++ b/lib/services/datafactoryManagement/lib/operations/integrationRuntimeNodes.js @@ -14,6 +14,220 @@ const msRest = require('ms-rest'); const msRestAzure = require('ms-rest-azure'); const WebResource = msRest.WebResource; +/** + * Gets a self-hosted integration runtime node. + * + * @param {string} resourceGroupName The resource group name. + * + * @param {string} factoryName The factory name. + * + * @param {string} integrationRuntimeName The integration runtime name. + * + * @param {string} nodeName The integration runtime node name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SelfHostedIntegrationRuntimeNode} 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. + */ +function _get(resourceGroupName, factoryName, integrationRuntimeName, nodeName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); + } + } + if (factoryName === null || factoryName === undefined || typeof factoryName.valueOf() !== 'string') { + throw new Error('factoryName cannot be null or undefined and it must be of type string.'); + } + if (factoryName !== null && factoryName !== undefined) { + if (factoryName.length > 63) + { + throw new Error('"factoryName" should satisfy the constraint - "MaxLength": 63'); + } + if (factoryName.length < 3) + { + throw new Error('"factoryName" should satisfy the constraint - "MinLength": 3'); + } + if (factoryName.match(/^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$/) === null) + { + throw new Error('"factoryName" should satisfy the constraint - "Pattern": /^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$/'); + } + } + if (integrationRuntimeName === null || integrationRuntimeName === undefined || typeof integrationRuntimeName.valueOf() !== 'string') { + throw new Error('integrationRuntimeName cannot be null or undefined and it must be of type string.'); + } + if (integrationRuntimeName !== null && integrationRuntimeName !== undefined) { + if (integrationRuntimeName.length > 63) + { + throw new Error('"integrationRuntimeName" should satisfy the constraint - "MaxLength": 63'); + } + if (integrationRuntimeName.length < 3) + { + throw new Error('"integrationRuntimeName" should satisfy the constraint - "MinLength": 3'); + } + if (integrationRuntimeName.match(/^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$/) === null) + { + throw new Error('"integrationRuntimeName" should satisfy the constraint - "Pattern": /^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$/'); + } + } + if (nodeName === null || nodeName === undefined || typeof nodeName.valueOf() !== 'string') { + throw new Error('nodeName cannot be null or undefined and it must be of type string.'); + } + if (nodeName !== null && nodeName !== undefined) { + if (nodeName.length > 150) + { + throw new Error('"nodeName" should satisfy the constraint - "MaxLength": 150'); + } + if (nodeName.length < 1) + { + throw new Error('"nodeName" should satisfy the constraint - "MinLength": 1'); + } + if (nodeName.match(/^[a-z0-9A-Z][a-z0-9A-Z_-]{0,149}$/) === null) + { + throw new Error('"nodeName" should satisfy the constraint - "Pattern": /^[a-z0-9A-Z][a-z0-9A-Z_-]{0,149}$/'); + } + } + 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/integrationRuntimes/{integrationRuntimeName}/nodes/{nodeName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{factoryName}', encodeURIComponent(factoryName)); + requestUrl = requestUrl.replace('{integrationRuntimeName}', encodeURIComponent(integrationRuntimeName)); + requestUrl = requestUrl.replace('{nodeName}', encodeURIComponent(nodeName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + 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) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SelfHostedIntegrationRuntimeNode']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + /** * Deletes a self-hosted integration runtime node. * @@ -669,11 +883,107 @@ class IntegrationRuntimeNodes { */ constructor(client) { this.client = client; + this._get = _get; this._deleteMethod = _deleteMethod; this._update = _update; this._getIpAddress = _getIpAddress; } + /** + * Gets a self-hosted integration runtime node. + * + * @param {string} resourceGroupName The resource group name. + * + * @param {string} factoryName The factory name. + * + * @param {string} integrationRuntimeName The integration runtime name. + * + * @param {string} nodeName The integration runtime node name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, factoryName, integrationRuntimeName, nodeName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, factoryName, integrationRuntimeName, nodeName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a self-hosted integration runtime node. + * + * @param {string} resourceGroupName The resource group name. + * + * @param {string} factoryName The factory name. + * + * @param {string} integrationRuntimeName The integration runtime name. + * + * @param {string} nodeName The integration runtime node name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {SelfHostedIntegrationRuntimeNode} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SelfHostedIntegrationRuntimeNode} 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. + */ + get(resourceGroupName, factoryName, integrationRuntimeName, nodeName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(resourceGroupName, factoryName, integrationRuntimeName, nodeName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, factoryName, integrationRuntimeName, nodeName, options, optionalCallback); + } + } + /** * Deletes a self-hosted integration runtime node. * diff --git a/lib/services/datafactoryManagement/lib/operations/integrationRuntimes.js b/lib/services/datafactoryManagement/lib/operations/integrationRuntimes.js index b4ed1c3ab9..4c3876c597 100644 --- a/lib/services/datafactoryManagement/lib/operations/integrationRuntimes.js +++ b/lib/services/datafactoryManagement/lib/operations/integrationRuntimes.js @@ -2718,6 +2718,233 @@ function _removeLinks(resourceGroupName, factoryName, integrationRuntimeName, li }); } +/** + * Create a linked integration runtime entry in a shared integration runtime. + * + * @param {string} resourceGroupName The resource group name. + * + * @param {string} factoryName The factory name. + * + * @param {string} integrationRuntimeName The integration runtime name. + * + * @param {object} createLinkedIntegrationRuntimeRequest The linked integration + * runtime properties. + * + * @param {string} [createLinkedIntegrationRuntimeRequest.name] The name of the + * linked integration runtime. + * + * @param {string} [createLinkedIntegrationRuntimeRequest.subscriptionId] The + * ID of the subscription that the linked integration runtime belongs to. + * + * @param {string} [createLinkedIntegrationRuntimeRequest.dataFactoryName] The + * name of the data factory that the linked integration runtime belongs to. + * + * @param {string} [createLinkedIntegrationRuntimeRequest.dataFactoryLocation] + * The location of the data factory that the linked integration runtime belongs + * to. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link IntegrationRuntimeStatusResponse} 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. + */ +function _createLinkedIntegrationRuntime(resourceGroupName, factoryName, integrationRuntimeName, createLinkedIntegrationRuntimeRequest, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); + } + } + if (factoryName === null || factoryName === undefined || typeof factoryName.valueOf() !== 'string') { + throw new Error('factoryName cannot be null or undefined and it must be of type string.'); + } + if (factoryName !== null && factoryName !== undefined) { + if (factoryName.length > 63) + { + throw new Error('"factoryName" should satisfy the constraint - "MaxLength": 63'); + } + if (factoryName.length < 3) + { + throw new Error('"factoryName" should satisfy the constraint - "MinLength": 3'); + } + if (factoryName.match(/^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$/) === null) + { + throw new Error('"factoryName" should satisfy the constraint - "Pattern": /^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$/'); + } + } + if (integrationRuntimeName === null || integrationRuntimeName === undefined || typeof integrationRuntimeName.valueOf() !== 'string') { + throw new Error('integrationRuntimeName cannot be null or undefined and it must be of type string.'); + } + if (integrationRuntimeName !== null && integrationRuntimeName !== undefined) { + if (integrationRuntimeName.length > 63) + { + throw new Error('"integrationRuntimeName" should satisfy the constraint - "MaxLength": 63'); + } + if (integrationRuntimeName.length < 3) + { + throw new Error('"integrationRuntimeName" should satisfy the constraint - "MinLength": 3'); + } + if (integrationRuntimeName.match(/^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$/) === null) + { + throw new Error('"integrationRuntimeName" should satisfy the constraint - "Pattern": /^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$/'); + } + } + 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 (createLinkedIntegrationRuntimeRequest === null || createLinkedIntegrationRuntimeRequest === undefined) { + throw new Error('createLinkedIntegrationRuntimeRequest cannot be null or undefined.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/integrationRuntimes/{integrationRuntimeName}/linkedIntegrationRuntime'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{factoryName}', encodeURIComponent(factoryName)); + requestUrl = requestUrl.replace('{integrationRuntimeName}', encodeURIComponent(integrationRuntimeName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (createLinkedIntegrationRuntimeRequest !== null && createLinkedIntegrationRuntimeRequest !== undefined) { + let requestModelMapper = new client.models['CreateLinkedIntegrationRuntimeRequest']().mapper(); + requestModel = client.serialize(requestModelMapper, createLinkedIntegrationRuntimeRequest, 'createLinkedIntegrationRuntimeRequest'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(createLinkedIntegrationRuntimeRequest, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + 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) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['IntegrationRuntimeStatusResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + /** * Starts a ManagedReserved type integration runtime. * @@ -3238,6 +3465,7 @@ class IntegrationRuntimes { this._getMonitoringData = _getMonitoringData; this._upgrade = _upgrade; this._removeLinks = _removeLinks; + this._createLinkedIntegrationRuntime = _createLinkedIntegrationRuntime; this._beginStart = _beginStart; this._beginStop = _beginStop; this._listByFactoryNext = _listByFactoryNext; @@ -4694,6 +4922,129 @@ class IntegrationRuntimes { } } + /** + * Create a linked integration runtime entry in a shared integration runtime. + * + * @param {string} resourceGroupName The resource group name. + * + * @param {string} factoryName The factory name. + * + * @param {string} integrationRuntimeName The integration runtime name. + * + * @param {object} createLinkedIntegrationRuntimeRequest The linked integration + * runtime properties. + * + * @param {string} [createLinkedIntegrationRuntimeRequest.name] The name of the + * linked integration runtime. + * + * @param {string} [createLinkedIntegrationRuntimeRequest.subscriptionId] The + * ID of the subscription that the linked integration runtime belongs to. + * + * @param {string} [createLinkedIntegrationRuntimeRequest.dataFactoryName] The + * name of the data factory that the linked integration runtime belongs to. + * + * @param {string} [createLinkedIntegrationRuntimeRequest.dataFactoryLocation] + * The location of the data factory that the linked integration runtime belongs + * to. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createLinkedIntegrationRuntimeWithHttpOperationResponse(resourceGroupName, factoryName, integrationRuntimeName, createLinkedIntegrationRuntimeRequest, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createLinkedIntegrationRuntime(resourceGroupName, factoryName, integrationRuntimeName, createLinkedIntegrationRuntimeRequest, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Create a linked integration runtime entry in a shared integration runtime. + * + * @param {string} resourceGroupName The resource group name. + * + * @param {string} factoryName The factory name. + * + * @param {string} integrationRuntimeName The integration runtime name. + * + * @param {object} createLinkedIntegrationRuntimeRequest The linked integration + * runtime properties. + * + * @param {string} [createLinkedIntegrationRuntimeRequest.name] The name of the + * linked integration runtime. + * + * @param {string} [createLinkedIntegrationRuntimeRequest.subscriptionId] The + * ID of the subscription that the linked integration runtime belongs to. + * + * @param {string} [createLinkedIntegrationRuntimeRequest.dataFactoryName] The + * name of the data factory that the linked integration runtime belongs to. + * + * @param {string} [createLinkedIntegrationRuntimeRequest.dataFactoryLocation] + * The location of the data factory that the linked integration runtime belongs + * to. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {IntegrationRuntimeStatusResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link IntegrationRuntimeStatusResponse} 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. + */ + createLinkedIntegrationRuntime(resourceGroupName, factoryName, integrationRuntimeName, createLinkedIntegrationRuntimeRequest, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createLinkedIntegrationRuntime(resourceGroupName, factoryName, integrationRuntimeName, createLinkedIntegrationRuntimeRequest, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createLinkedIntegrationRuntime(resourceGroupName, factoryName, integrationRuntimeName, createLinkedIntegrationRuntimeRequest, options, optionalCallback); + } + } + /** * Starts a ManagedReserved type integration runtime. * diff --git a/lib/services/datafactoryManagement/package-lock.json b/lib/services/datafactoryManagement/package-lock.json index 5ba01f15fd..fec6fe4d40 100644 --- a/lib/services/datafactoryManagement/package-lock.json +++ b/lib/services/datafactoryManagement/package-lock.json @@ -1,6 +1,6 @@ { "name": "azure-arm-datafactory", - "version": "2.0.0", + "version": "2.1.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/lib/services/datafactoryManagement/package.json b/lib/services/datafactoryManagement/package.json index 4eb0501b60..d464c3c0db 100644 --- a/lib/services/datafactoryManagement/package.json +++ b/lib/services/datafactoryManagement/package.json @@ -2,7 +2,7 @@ "name": "azure-arm-datafactory", "author": "Microsoft Corporation", "description": "DataFactoryManagementClient Library with typescript type definitions for node", - "version": "2.0.0", + "version": "2.1.0", "dependencies": { "ms-rest": "^2.3.3", "ms-rest-azure": "^2.5.5" @@ -14,7 +14,7 @@ "license": "MIT", "main": "./lib/dataFactoryManagementClient.js", "types": "./lib/dataFactoryManagementClient.d.ts", - "homepage": "https://github.com/azure/azure-sdk-for-node/lib/services/datafactoryManagement", + "homepage": "https://github.com/azure/azure-sdk-for-node/tree/master/lib/services/datafactoryManagement", "repository": { "type": "git", "url": "https://github.com/azure/azure-sdk-for-node.git"