diff --git a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/a2AEnableProtectionInput.js b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/a2AEnableProtectionInput.js index 75ffc9b759..b0f3bb4210 100644 --- a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/a2AEnableProtectionInput.js +++ b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/a2AEnableProtectionInput.js @@ -39,7 +39,7 @@ class A2AEnableProtectionInput extends models['EnableProtectionProviderSpecificI * @member {object} [diskEncryptionInfo.diskEncryptionKeyInfo] The recovery * KeyVault reference for secret. * @member {string} - * [diskEncryptionInfo.diskEncryptionKeyInfo.secretIdentifier] The secret url + * [diskEncryptionInfo.diskEncryptionKeyInfo.secretIdentifier] The secret url * / identifier. * @member {string} * [diskEncryptionInfo.diskEncryptionKeyInfo.keyVaultResourceArmId] The @@ -47,7 +47,7 @@ class A2AEnableProtectionInput extends models['EnableProtectionProviderSpecificI * @member {object} [diskEncryptionInfo.keyEncryptionKeyInfo] The recovery * KeyVault reference for key. * @member {string} [diskEncryptionInfo.keyEncryptionKeyInfo.keyIdentifier] - * The key url / identifier. + * The key url / identifier. * @member {string} * [diskEncryptionInfo.keyEncryptionKeyInfo.keyVaultResourceArmId] The * KeyVault resource ARM id for key. diff --git a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/a2ASwitchProtectionInput.js b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/a2ASwitchProtectionInput.js index 69b6fa4f23..64b4ef5ec5 100644 --- a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/a2ASwitchProtectionInput.js +++ b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/a2ASwitchProtectionInput.js @@ -37,7 +37,7 @@ class A2ASwitchProtectionInput extends models['SwitchProtectionProviderSpecificI * @member {object} [diskEncryptionInfo.diskEncryptionKeyInfo] The recovery * KeyVault reference for secret. * @member {string} - * [diskEncryptionInfo.diskEncryptionKeyInfo.secretIdentifier] The secret url + * [diskEncryptionInfo.diskEncryptionKeyInfo.secretIdentifier] The secret url * / identifier. * @member {string} * [diskEncryptionInfo.diskEncryptionKeyInfo.keyVaultResourceArmId] The @@ -45,7 +45,7 @@ class A2ASwitchProtectionInput extends models['SwitchProtectionProviderSpecificI * @member {object} [diskEncryptionInfo.keyEncryptionKeyInfo] The recovery * KeyVault reference for key. * @member {string} [diskEncryptionInfo.keyEncryptionKeyInfo.keyIdentifier] - * The key url / identifier. + * The key url / identifier. * @member {string} * [diskEncryptionInfo.keyEncryptionKeyInfo.keyVaultResourceArmId] The * KeyVault resource ARM id for key. diff --git a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/a2AUpdateReplicationProtectedItemInput.js b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/a2AUpdateReplicationProtectedItemInput.js index 2bcbc09fe6..b512fac0f5 100644 --- a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/a2AUpdateReplicationProtectedItemInput.js +++ b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/a2AUpdateReplicationProtectedItemInput.js @@ -32,7 +32,7 @@ class A2AUpdateReplicationProtectedItemInput extends models['UpdateReplicationPr * @member {object} [diskEncryptionInfo.diskEncryptionKeyInfo] The recovery * KeyVault reference for secret. * @member {string} - * [diskEncryptionInfo.diskEncryptionKeyInfo.secretIdentifier] The secret url + * [diskEncryptionInfo.diskEncryptionKeyInfo.secretIdentifier] The secret url * / identifier. * @member {string} * [diskEncryptionInfo.diskEncryptionKeyInfo.keyVaultResourceArmId] The @@ -40,7 +40,7 @@ class A2AUpdateReplicationProtectedItemInput extends models['UpdateReplicationPr * @member {object} [diskEncryptionInfo.keyEncryptionKeyInfo] The recovery * KeyVault reference for key. * @member {string} [diskEncryptionInfo.keyEncryptionKeyInfo.keyIdentifier] - * The key url / identifier. + * The key url / identifier. * @member {string} * [diskEncryptionInfo.keyEncryptionKeyInfo.keyVaultResourceArmId] The * KeyVault resource ARM id for key. diff --git a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/addRecoveryServicesProviderInput.js b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/addRecoveryServicesProviderInput.js new file mode 100644 index 0000000000..0763c47362 --- /dev/null +++ b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/addRecoveryServicesProviderInput.js @@ -0,0 +1,95 @@ +/* + * 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'; + +/** + * Input required to add a provider. + * + */ +class AddRecoveryServicesProviderInput { + /** + * Create a AddRecoveryServicesProviderInput. + * @member {object} properties The properties of an add provider request. + * @member {string} [properties.machineName] The name of the machine where + * the provider is getting added. + * @member {object} [properties.authenticationIdentityInput] The identity + * provider input for DRA authentication. + * @member {string} [properties.authenticationIdentityInput.tenantId] The + * tenant Id for the service principal with which the on-premise + * management/data plane components would communicate with our Azure + * services. + * @member {string} [properties.authenticationIdentityInput.applicationId] + * The application/client Id for the service principal with which the + * on-premise management/data plane components would communicate with our + * Azure services. + * @member {string} [properties.authenticationIdentityInput.objectId] The + * object Id of the service principal with which the on-premise + * management/data plane components would communicate with our Azure + * services. + * @member {string} [properties.authenticationIdentityInput.audience] The + * intended Audience of the service principal with which the on-premise + * management/data plane components would communicate with our Azure + * services. + * @member {string} [properties.authenticationIdentityInput.aadAuthority] The + * base authority for Azure Active Directory authentication. + * @member {object} [properties.resourceAccessIdentityInput] The identity + * provider input for resource access. + * @member {string} [properties.resourceAccessIdentityInput.tenantId] The + * tenant Id for the service principal with which the on-premise + * management/data plane components would communicate with our Azure + * services. + * @member {string} [properties.resourceAccessIdentityInput.applicationId] + * The application/client Id for the service principal with which the + * on-premise management/data plane components would communicate with our + * Azure services. + * @member {string} [properties.resourceAccessIdentityInput.objectId] The + * object Id of the service principal with which the on-premise + * management/data plane components would communicate with our Azure + * services. + * @member {string} [properties.resourceAccessIdentityInput.audience] The + * intended Audience of the service principal with which the on-premise + * management/data plane components would communicate with our Azure + * services. + * @member {string} [properties.resourceAccessIdentityInput.aadAuthority] The + * base authority for Azure Active Directory authentication. + */ + constructor() { + } + + /** + * Defines the metadata of AddRecoveryServicesProviderInput + * + * @returns {object} metadata of AddRecoveryServicesProviderInput + * + */ + mapper() { + return { + required: false, + serializedName: 'AddRecoveryServicesProviderInput', + type: { + name: 'Composite', + className: 'AddRecoveryServicesProviderInput', + modelProperties: { + properties: { + required: true, + serializedName: 'properties', + type: { + name: 'Composite', + className: 'AddRecoveryServicesProviderInputProperties' + } + } + } + } + }; + } +} + +module.exports = AddRecoveryServicesProviderInput; diff --git a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/addRecoveryServicesProviderInputProperties.js b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/addRecoveryServicesProviderInputProperties.js new file mode 100644 index 0000000000..f1ef4e1748 --- /dev/null +++ b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/addRecoveryServicesProviderInputProperties.js @@ -0,0 +1,105 @@ +/* + * 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 properties of an add provider request. + * + */ +class AddRecoveryServicesProviderInputProperties { + /** + * Create a AddRecoveryServicesProviderInputProperties. + * @member {string} machineName The name of the machine where the provider is + * getting added. + * @member {object} authenticationIdentityInput The identity provider input + * for DRA authentication. + * @member {string} [authenticationIdentityInput.tenantId] The tenant Id for + * the service principal with which the on-premise management/data plane + * components would communicate with our Azure services. + * @member {string} [authenticationIdentityInput.applicationId] The + * application/client Id for the service principal with which the on-premise + * management/data plane components would communicate with our Azure + * services. + * @member {string} [authenticationIdentityInput.objectId] The object Id of + * the service principal with which the on-premise management/data plane + * components would communicate with our Azure services. + * @member {string} [authenticationIdentityInput.audience] The intended + * Audience of the service principal with which the on-premise + * management/data plane components would communicate with our Azure + * services. + * @member {string} [authenticationIdentityInput.aadAuthority] The base + * authority for Azure Active Directory authentication. + * @member {object} resourceAccessIdentityInput The identity provider input + * for resource access. + * @member {string} [resourceAccessIdentityInput.tenantId] The tenant Id for + * the service principal with which the on-premise management/data plane + * components would communicate with our Azure services. + * @member {string} [resourceAccessIdentityInput.applicationId] The + * application/client Id for the service principal with which the on-premise + * management/data plane components would communicate with our Azure + * services. + * @member {string} [resourceAccessIdentityInput.objectId] The object Id of + * the service principal with which the on-premise management/data plane + * components would communicate with our Azure services. + * @member {string} [resourceAccessIdentityInput.audience] The intended + * Audience of the service principal with which the on-premise + * management/data plane components would communicate with our Azure + * services. + * @member {string} [resourceAccessIdentityInput.aadAuthority] The base + * authority for Azure Active Directory authentication. + */ + constructor() { + } + + /** + * Defines the metadata of AddRecoveryServicesProviderInputProperties + * + * @returns {object} metadata of AddRecoveryServicesProviderInputProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'AddRecoveryServicesProviderInputProperties', + type: { + name: 'Composite', + className: 'AddRecoveryServicesProviderInputProperties', + modelProperties: { + machineName: { + required: true, + serializedName: 'machineName', + type: { + name: 'String' + } + }, + authenticationIdentityInput: { + required: true, + serializedName: 'authenticationIdentityInput', + type: { + name: 'Composite', + className: 'IdentityProviderInput' + } + }, + resourceAccessIdentityInput: { + required: true, + serializedName: 'resourceAccessIdentityInput', + type: { + name: 'Composite', + className: 'IdentityProviderInput' + } + } + } + } + }; + } +} + +module.exports = AddRecoveryServicesProviderInputProperties; diff --git a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/currentJobDetails.js b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/currentJobDetails.js new file mode 100644 index 0000000000..9fbd0e0a0c --- /dev/null +++ b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/currentJobDetails.js @@ -0,0 +1,68 @@ +/* + * 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'; + +/** + * Current job details of the migraton item. + * + */ +class CurrentJobDetails { + /** + * Create a CurrentJobDetails. + * @member {string} [jobName] The job name. + * @member {string} [jobId] The ARM Id of the job being executed. + * @member {date} [startTime] The start time of the job. + */ + constructor() { + } + + /** + * Defines the metadata of CurrentJobDetails + * + * @returns {object} metadata of CurrentJobDetails + * + */ + mapper() { + return { + required: false, + serializedName: 'CurrentJobDetails', + type: { + name: 'Composite', + className: 'CurrentJobDetails', + modelProperties: { + jobName: { + required: false, + serializedName: 'jobName', + type: { + name: 'String' + } + }, + jobId: { + required: false, + serializedName: 'jobId', + type: { + name: 'String' + } + }, + startTime: { + required: false, + serializedName: 'startTime', + type: { + name: 'DateTime' + } + } + } + } + }; + } +} + +module.exports = CurrentJobDetails; diff --git a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/diskEncryptionInfo.js b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/diskEncryptionInfo.js index 8d1e08230d..a0ccf53ebd 100644 --- a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/diskEncryptionInfo.js +++ b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/diskEncryptionInfo.js @@ -19,15 +19,15 @@ class DiskEncryptionInfo { * Create a DiskEncryptionInfo. * @member {object} [diskEncryptionKeyInfo] The recovery KeyVault reference * for secret. - * @member {string} [diskEncryptionKeyInfo.secretIdentifier] The secret url / + * @member {string} [diskEncryptionKeyInfo.secretIdentifier] The secret url / * identifier. * @member {string} [diskEncryptionKeyInfo.keyVaultResourceArmId] The * KeyVault resource ARM id for secret. * @member {object} [keyEncryptionKeyInfo] The recovery KeyVault reference * for key. - * @member {string} [keyEncryptionKeyInfo.keyIdentifier] The key url / + * @member {string} [keyEncryptionKeyInfo.keyIdentifier] The key url / * identifier. - * @member {string} [keyEncryptionKeyInfo.keyVaultResourceArmId] The KeyVault + * @member {string} [keyEncryptionKeyInfo.keyVaultResourceArmId] The KeyVault * resource ARM id for key. */ constructor() { diff --git a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/diskEncryptionKeyInfo.js b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/diskEncryptionKeyInfo.js index 5321de7665..7d8d1dc173 100644 --- a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/diskEncryptionKeyInfo.js +++ b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/diskEncryptionKeyInfo.js @@ -17,8 +17,8 @@ class DiskEncryptionKeyInfo { /** * Create a DiskEncryptionKeyInfo. - * @member {string} [secretIdentifier] The secret url / identifier. - * @member {string} [keyVaultResourceArmId] The KeyVault resource ARM id for + * @member {string} [secretIdentifier] The secret url / identifier. + * @member {string} [keyVaultResourceArmId] The KeyVault resource ARM id for * secret. */ constructor() { diff --git a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/enableMigrationInput.js b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/enableMigrationInput.js new file mode 100644 index 0000000000..b4d3e9847c --- /dev/null +++ b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/enableMigrationInput.js @@ -0,0 +1,58 @@ +/* + * 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'; + +/** + * Enable migration input. + * + */ +class EnableMigrationInput { + /** + * Create a EnableMigrationInput. + * @member {object} properties Enable migration input properties. + * @member {string} [properties.policyId] The policy Id. + * @member {object} [properties.providerSpecificDetails] The provider + * specific details. + * @member {string} [properties.providerSpecificDetails.instanceType] + * Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of EnableMigrationInput + * + * @returns {object} metadata of EnableMigrationInput + * + */ + mapper() { + return { + required: false, + serializedName: 'EnableMigrationInput', + type: { + name: 'Composite', + className: 'EnableMigrationInput', + modelProperties: { + properties: { + required: true, + serializedName: 'properties', + type: { + name: 'Composite', + className: 'EnableMigrationInputProperties' + } + } + } + } + }; + } +} + +module.exports = EnableMigrationInput; diff --git a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/enableMigrationInputProperties.js b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/enableMigrationInputProperties.js new file mode 100644 index 0000000000..5e93cc5b62 --- /dev/null +++ b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/enableMigrationInputProperties.js @@ -0,0 +1,68 @@ +/* + * 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'; + +/** + * Enable migration input properties. + * + */ +class EnableMigrationInputProperties { + /** + * Create a EnableMigrationInputProperties. + * @member {string} policyId The policy Id. + * @member {object} providerSpecificDetails The provider specific details. + * @member {string} [providerSpecificDetails.instanceType] Polymorphic + * Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of EnableMigrationInputProperties + * + * @returns {object} metadata of EnableMigrationInputProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'EnableMigrationInputProperties', + type: { + name: 'Composite', + className: 'EnableMigrationInputProperties', + modelProperties: { + policyId: { + required: true, + serializedName: 'policyId', + type: { + name: 'String' + } + }, + providerSpecificDetails: { + required: true, + serializedName: 'providerSpecificDetails', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'instanceType', + clientName: 'instanceType' + }, + uberParent: 'EnableMigrationProviderSpecificInput', + className: 'EnableMigrationProviderSpecificInput' + } + } + } + } + }; + } +} + +module.exports = EnableMigrationInputProperties; diff --git a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/enableMigrationProviderSpecificInput.js b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/enableMigrationProviderSpecificInput.js new file mode 100644 index 0000000000..1826c960af --- /dev/null +++ b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/enableMigrationProviderSpecificInput.js @@ -0,0 +1,58 @@ +/* + * 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'; + +/** + * Enable migration provider specific input. + * + */ +class EnableMigrationProviderSpecificInput { + /** + * Create a EnableMigrationProviderSpecificInput. + * @member {string} instanceType Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of EnableMigrationProviderSpecificInput + * + * @returns {object} metadata of EnableMigrationProviderSpecificInput + * + */ + mapper() { + return { + required: false, + serializedName: 'EnableMigrationProviderSpecificInput', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'instanceType', + clientName: 'instanceType' + }, + uberParent: 'EnableMigrationProviderSpecificInput', + className: 'EnableMigrationProviderSpecificInput', + modelProperties: { + instanceType: { + required: true, + serializedName: 'instanceType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = EnableMigrationProviderSpecificInput; diff --git a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/identityProviderDetails.js b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/identityProviderDetails.js new file mode 100644 index 0000000000..ba8bdccaf2 --- /dev/null +++ b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/identityProviderDetails.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'; + +/** + * Identity provider details. + * + */ +class IdentityProviderDetails { + /** + * Create a IdentityProviderDetails. + * @member {string} [tenantId] The tenant Id for the service principal with + * which the on-premise management/data plane components would communicate + * with our Azure services. + * @member {string} [applicationId] The application/client Id for the service + * principal with which the on-premise management/data plane components would + * communicate with our Azure services. + * @member {string} [objectId] The object Id of the service principal with + * which the on-premise management/data plane components would communicate + * with our Azure services. + * @member {string} [audience] The intended Audience of the service principal + * with which the on-premise management/data plane components would + * communicate with our Azure services. + * @member {string} [aadAuthority] The base authority for Azure Active + * Directory authentication. + */ + constructor() { + } + + /** + * Defines the metadata of IdentityProviderDetails + * + * @returns {object} metadata of IdentityProviderDetails + * + */ + mapper() { + return { + required: false, + serializedName: 'IdentityProviderDetails', + type: { + name: 'Composite', + className: 'IdentityProviderDetails', + modelProperties: { + tenantId: { + required: false, + serializedName: 'tenantId', + type: { + name: 'String' + } + }, + applicationId: { + required: false, + serializedName: 'applicationId', + type: { + name: 'String' + } + }, + objectId: { + required: false, + serializedName: 'objectId', + type: { + name: 'String' + } + }, + audience: { + required: false, + serializedName: 'audience', + type: { + name: 'String' + } + }, + aadAuthority: { + required: false, + serializedName: 'aadAuthority', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = IdentityProviderDetails; diff --git a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/identityProviderInput.js b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/identityProviderInput.js new file mode 100644 index 0000000000..254ad34fc1 --- /dev/null +++ b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/identityProviderInput.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'; + +/** + * Identity provider input. + * + */ +class IdentityProviderInput { + /** + * Create a IdentityProviderInput. + * @member {string} tenantId The tenant Id for the service principal with + * which the on-premise management/data plane components would communicate + * with our Azure services. + * @member {string} applicationId The application/client Id for the service + * principal with which the on-premise management/data plane components would + * communicate with our Azure services. + * @member {string} objectId The object Id of the service principal with + * which the on-premise management/data plane components would communicate + * with our Azure services. + * @member {string} audience The intended Audience of the service principal + * with which the on-premise management/data plane components would + * communicate with our Azure services. + * @member {string} aadAuthority The base authority for Azure Active + * Directory authentication. + */ + constructor() { + } + + /** + * Defines the metadata of IdentityProviderInput + * + * @returns {object} metadata of IdentityProviderInput + * + */ + mapper() { + return { + required: false, + serializedName: 'IdentityProviderInput', + type: { + name: 'Composite', + className: 'IdentityProviderInput', + modelProperties: { + tenantId: { + required: true, + serializedName: 'tenantId', + type: { + name: 'String' + } + }, + applicationId: { + required: true, + serializedName: 'applicationId', + type: { + name: 'String' + } + }, + objectId: { + required: true, + serializedName: 'objectId', + type: { + name: 'String' + } + }, + audience: { + required: true, + serializedName: 'audience', + type: { + name: 'String' + } + }, + aadAuthority: { + required: true, + serializedName: 'aadAuthority', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = IdentityProviderInput; diff --git a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/index.d.ts b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/index.d.ts index dbc8398198..dcb67267ff 100644 --- a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/index.d.ts +++ b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/index.d.ts @@ -135,8 +135,8 @@ export interface A2AVmManagedDiskInputDetails { * @constructor * Disk Encryption Key Information (BitLocker Encryption Key (BEK) on Windows). * - * @member {string} [secretIdentifier] The secret url / identifier. - * @member {string} [keyVaultResourceArmId] The KeyVault resource ARM id for + * @member {string} [secretIdentifier] The secret url / identifier. + * @member {string} [keyVaultResourceArmId] The KeyVault resource ARM id for * secret. */ export interface DiskEncryptionKeyInfo { @@ -150,8 +150,8 @@ export interface DiskEncryptionKeyInfo { * @constructor * Key Encryption Key (KEK) information. * - * @member {string} [keyIdentifier] The key url / identifier. - * @member {string} [keyVaultResourceArmId] The KeyVault resource ARM id for + * @member {string} [keyIdentifier] The key url / identifier. + * @member {string} [keyVaultResourceArmId] The KeyVault resource ARM id for * key. */ export interface KeyEncryptionKeyInfo { @@ -167,15 +167,15 @@ export interface KeyEncryptionKeyInfo { * * @member {object} [diskEncryptionKeyInfo] The recovery KeyVault reference for * secret. - * @member {string} [diskEncryptionKeyInfo.secretIdentifier] The secret url / + * @member {string} [diskEncryptionKeyInfo.secretIdentifier] The secret url / * identifier. - * @member {string} [diskEncryptionKeyInfo.keyVaultResourceArmId] The KeyVault + * @member {string} [diskEncryptionKeyInfo.keyVaultResourceArmId] The KeyVault * resource ARM id for secret. * @member {object} [keyEncryptionKeyInfo] The recovery KeyVault reference for * key. - * @member {string} [keyEncryptionKeyInfo.keyIdentifier] The key url / + * @member {string} [keyEncryptionKeyInfo.keyIdentifier] The key url / * identifier. - * @member {string} [keyEncryptionKeyInfo.keyVaultResourceArmId] The KeyVault + * @member {string} [keyEncryptionKeyInfo.keyVaultResourceArmId] The KeyVault * resource ARM id for key. */ export interface DiskEncryptionInfo { @@ -220,7 +220,7 @@ export interface EnableProtectionProviderSpecificInput { * @member {object} [diskEncryptionInfo.diskEncryptionKeyInfo] The recovery * KeyVault reference for secret. * @member {string} [diskEncryptionInfo.diskEncryptionKeyInfo.secretIdentifier] - * The secret url / identifier. + * The secret url / identifier. * @member {string} * [diskEncryptionInfo.diskEncryptionKeyInfo.keyVaultResourceArmId] The * KeyVault resource ARM id for secret. @@ -229,7 +229,7 @@ export interface EnableProtectionProviderSpecificInput { * @member {string} [diskEncryptionInfo.keyEncryptionKeyInfo.keyIdentifier] The * key url / identifier. * @member {string} - * [diskEncryptionInfo.keyEncryptionKeyInfo.keyVaultResourceArmId] The KeyVault + * [diskEncryptionInfo.keyEncryptionKeyInfo.keyVaultResourceArmId] The KeyVault * resource ARM id for key. */ export interface A2AEnableProtectionInput extends EnableProtectionProviderSpecificInput { @@ -831,7 +831,7 @@ export interface SwitchProtectionProviderSpecificInput { * @member {object} [diskEncryptionInfo.diskEncryptionKeyInfo] The recovery * KeyVault reference for secret. * @member {string} [diskEncryptionInfo.diskEncryptionKeyInfo.secretIdentifier] - * The secret url / identifier. + * The secret url / identifier. * @member {string} * [diskEncryptionInfo.diskEncryptionKeyInfo.keyVaultResourceArmId] The * KeyVault resource ARM id for secret. @@ -840,7 +840,7 @@ export interface SwitchProtectionProviderSpecificInput { * @member {string} [diskEncryptionInfo.keyEncryptionKeyInfo.keyIdentifier] The * key url / identifier. * @member {string} - * [diskEncryptionInfo.keyEncryptionKeyInfo.keyVaultResourceArmId] The KeyVault + * [diskEncryptionInfo.keyEncryptionKeyInfo.keyVaultResourceArmId] The KeyVault * resource ARM id for key. */ export interface A2ASwitchProtectionInput extends SwitchProtectionProviderSpecificInput { @@ -930,7 +930,7 @@ export interface UpdateReplicationProtectedItemProviderInput { * @member {object} [diskEncryptionInfo.diskEncryptionKeyInfo] The recovery * KeyVault reference for secret. * @member {string} [diskEncryptionInfo.diskEncryptionKeyInfo.secretIdentifier] - * The secret url / identifier. + * The secret url / identifier. * @member {string} * [diskEncryptionInfo.diskEncryptionKeyInfo.keyVaultResourceArmId] The * KeyVault resource ARM id for secret. @@ -939,7 +939,7 @@ export interface UpdateReplicationProtectedItemProviderInput { * @member {string} [diskEncryptionInfo.keyEncryptionKeyInfo.keyIdentifier] The * key url / identifier. * @member {string} - * [diskEncryptionInfo.keyEncryptionKeyInfo.keyVaultResourceArmId] The KeyVault + * [diskEncryptionInfo.keyEncryptionKeyInfo.keyVaultResourceArmId] The KeyVault * resource ARM id for key. */ export interface A2AUpdateReplicationProtectedItemInput extends UpdateReplicationProtectedItemProviderInput { @@ -950,6 +950,128 @@ export interface A2AUpdateReplicationProtectedItemInput extends UpdateReplicatio diskEncryptionInfo?: DiskEncryptionInfo; } +/** + * @class + * Initializes a new instance of the IdentityProviderInput class. + * @constructor + * Identity provider input. + * + * @member {string} tenantId The tenant Id for the service principal with which + * the on-premise management/data plane components would communicate with our + * Azure services. + * @member {string} applicationId The application/client Id for the service + * principal with which the on-premise management/data plane components would + * communicate with our Azure services. + * @member {string} objectId The object Id of the service principal with which + * the on-premise management/data plane components would communicate with our + * Azure services. + * @member {string} audience The intended Audience of the service principal + * with which the on-premise management/data plane components would communicate + * with our Azure services. + * @member {string} aadAuthority The base authority for Azure Active Directory + * authentication. + */ +export interface IdentityProviderInput { + tenantId: string; + applicationId: string; + objectId: string; + audience: string; + aadAuthority: string; +} + +/** + * @class + * Initializes a new instance of the AddRecoveryServicesProviderInputProperties class. + * @constructor + * The properties of an add provider request. + * + * @member {string} machineName The name of the machine where the provider is + * getting added. + * @member {object} authenticationIdentityInput The identity provider input for + * DRA authentication. + * @member {string} [authenticationIdentityInput.tenantId] The tenant Id for + * the service principal with which the on-premise management/data plane + * components would communicate with our Azure services. + * @member {string} [authenticationIdentityInput.applicationId] The + * application/client Id for the service principal with which the on-premise + * management/data plane components would communicate with our Azure services. + * @member {string} [authenticationIdentityInput.objectId] The object Id of the + * service principal with which the on-premise management/data plane components + * would communicate with our Azure services. + * @member {string} [authenticationIdentityInput.audience] The intended + * Audience of the service principal with which the on-premise management/data + * plane components would communicate with our Azure services. + * @member {string} [authenticationIdentityInput.aadAuthority] The base + * authority for Azure Active Directory authentication. + * @member {object} resourceAccessIdentityInput The identity provider input for + * resource access. + * @member {string} [resourceAccessIdentityInput.tenantId] The tenant Id for + * the service principal with which the on-premise management/data plane + * components would communicate with our Azure services. + * @member {string} [resourceAccessIdentityInput.applicationId] The + * application/client Id for the service principal with which the on-premise + * management/data plane components would communicate with our Azure services. + * @member {string} [resourceAccessIdentityInput.objectId] The object Id of the + * service principal with which the on-premise management/data plane components + * would communicate with our Azure services. + * @member {string} [resourceAccessIdentityInput.audience] The intended + * Audience of the service principal with which the on-premise management/data + * plane components would communicate with our Azure services. + * @member {string} [resourceAccessIdentityInput.aadAuthority] The base + * authority for Azure Active Directory authentication. + */ +export interface AddRecoveryServicesProviderInputProperties { + machineName: string; + authenticationIdentityInput: IdentityProviderInput; + resourceAccessIdentityInput: IdentityProviderInput; +} + +/** + * @class + * Initializes a new instance of the AddRecoveryServicesProviderInput class. + * @constructor + * Input required to add a provider. + * + * @member {object} properties The properties of an add provider request. + * @member {string} [properties.machineName] The name of the machine where the + * provider is getting added. + * @member {object} [properties.authenticationIdentityInput] The identity + * provider input for DRA authentication. + * @member {string} [properties.authenticationIdentityInput.tenantId] The + * tenant Id for the service principal with which the on-premise + * management/data plane components would communicate with our Azure services. + * @member {string} [properties.authenticationIdentityInput.applicationId] The + * application/client Id for the service principal with which the on-premise + * management/data plane components would communicate with our Azure services. + * @member {string} [properties.authenticationIdentityInput.objectId] The + * object Id of the service principal with which the on-premise management/data + * plane components would communicate with our Azure services. + * @member {string} [properties.authenticationIdentityInput.audience] The + * intended Audience of the service principal with which the on-premise + * management/data plane components would communicate with our Azure services. + * @member {string} [properties.authenticationIdentityInput.aadAuthority] The + * base authority for Azure Active Directory authentication. + * @member {object} [properties.resourceAccessIdentityInput] The identity + * provider input for resource access. + * @member {string} [properties.resourceAccessIdentityInput.tenantId] The + * tenant Id for the service principal with which the on-premise + * management/data plane components would communicate with our Azure services. + * @member {string} [properties.resourceAccessIdentityInput.applicationId] The + * application/client Id for the service principal with which the on-premise + * management/data plane components would communicate with our Azure services. + * @member {string} [properties.resourceAccessIdentityInput.objectId] The + * object Id of the service principal with which the on-premise management/data + * plane components would communicate with our Azure services. + * @member {string} [properties.resourceAccessIdentityInput.audience] The + * intended Audience of the service principal with which the on-premise + * management/data plane components would communicate with our Azure services. + * @member {string} [properties.resourceAccessIdentityInput.aadAuthority] The + * base authority for Azure Active Directory authentication. + */ +export interface AddRecoveryServicesProviderInput { + properties: AddRecoveryServicesProviderInputProperties; +} + /** * @class * Initializes a new instance of the AddVCenterRequestProperties class. @@ -1760,6 +1882,22 @@ export interface CreateRecoveryPlanInput { properties: CreateRecoveryPlanInputProperties; } +/** + * @class + * Initializes a new instance of the CurrentJobDetails class. + * @constructor + * Current job details of the migraton item. + * + * @member {string} [jobName] The job name. + * @member {string} [jobId] The ARM Id of the job being executed. + * @member {date} [startTime] The start time of the job. + */ +export interface CurrentJobDetails { + jobName?: string; + jobId?: string; + startTime?: Date; +} + /** * @class * Initializes a new instance of the CurrentScenarioDetails class. @@ -1955,6 +2093,51 @@ export interface Display { description?: string; } +/** + * @class + * Initializes a new instance of the EnableMigrationProviderSpecificInput class. + * @constructor + * Enable migration provider specific input. + * + * @member {string} instanceType Polymorphic Discriminator + */ +export interface EnableMigrationProviderSpecificInput { + instanceType: string; +} + +/** + * @class + * Initializes a new instance of the EnableMigrationInputProperties class. + * @constructor + * Enable migration input properties. + * + * @member {string} policyId The policy Id. + * @member {object} providerSpecificDetails The provider specific details. + * @member {string} [providerSpecificDetails.instanceType] Polymorphic + * Discriminator + */ +export interface EnableMigrationInputProperties { + policyId: string; + providerSpecificDetails: EnableMigrationProviderSpecificInput; +} + +/** + * @class + * Initializes a new instance of the EnableMigrationInput class. + * @constructor + * Enable migration input. + * + * @member {object} properties Enable migration input properties. + * @member {string} [properties.policyId] The policy Id. + * @member {object} [properties.providerSpecificDetails] The provider specific + * details. + * @member {string} [properties.providerSpecificDetails.instanceType] + * Polymorphic Discriminator + */ +export interface EnableMigrationInput { + properties: EnableMigrationInputProperties; +} + /** * @class * Initializes a new instance of the EnableProtectionInputProperties class. @@ -3219,13 +3402,10 @@ export interface HyperVVirtualMachineDetails extends ConfigurationSettings { /** * @class - * Initializes a new instance of the IdentityInformation class. + * Initializes a new instance of the IdentityProviderDetails class. * @constructor - * Identity details. + * Identity provider details. * - * @member {string} [identityProviderType] The identity provider type. Value is - * the ToString() of a IdentityProviderType value. Possible values include: - * 'RecoveryServicesActiveDirectory' * @member {string} [tenantId] The tenant Id for the service principal with * which the on-premise management/data plane components would communicate with * our Azure services. @@ -3240,17 +3420,13 @@ export interface HyperVVirtualMachineDetails extends ConfigurationSettings { * with our Azure services. * @member {string} [aadAuthority] The base authority for Azure Active * Directory authentication. - * @member {string} [certificateThumbprint] The certificate thumbprint. - * Applicable only if IdentityProviderType is RecoveryServicesActiveDirectory. */ -export interface IdentityInformation { - identityProviderType?: string; +export interface IdentityProviderDetails { tenantId?: string; applicationId?: string; objectId?: string; audience?: string; aadAuthority?: string; - certificateThumbprint?: string; } /** @@ -4398,6 +4574,205 @@ export interface MasterTargetServer { marsAgentVersionDetails?: VersionDetails; } +/** + * @class + * Initializes a new instance of the MigrateProviderSpecificInput class. + * @constructor + * Migrate provider specific input. + * + * @member {string} instanceType Polymorphic Discriminator + */ +export interface MigrateProviderSpecificInput { + instanceType: string; +} + +/** + * @class + * Initializes a new instance of the MigrateInputProperties class. + * @constructor + * Migrate input properties. + * + * @member {object} providerSpecificDetails The provider specific details. + * @member {string} [providerSpecificDetails.instanceType] Polymorphic + * Discriminator + */ +export interface MigrateInputProperties { + providerSpecificDetails: MigrateProviderSpecificInput; +} + +/** + * @class + * Initializes a new instance of the MigrateInput class. + * @constructor + * Input for migrate. + * + * @member {object} properties Migrate input properties. + * @member {object} [properties.providerSpecificDetails] The provider specific + * details. + * @member {string} [properties.providerSpecificDetails.instanceType] + * Polymorphic Discriminator + */ +export interface MigrateInput { + properties: MigrateInputProperties; +} + +/** + * @class + * Initializes a new instance of the MigrationProviderSpecificSettings class. + * @constructor + * Migration provider specific settings. + * + * @member {string} instanceType Polymorphic Discriminator + */ +export interface MigrationProviderSpecificSettings { + instanceType: string; +} + +/** + * @class + * Initializes a new instance of the MigrationItemProperties class. + * @constructor + * Migration item properties. + * + * @member {string} [machineName] The on-premise virtual machine name. + * @member {string} [policyId] The ARM Id of policy governing this item. + * @member {string} [policyFriendlyName] The name of policy governing this + * item. + * @member {string} [recoveryServicesProviderId] The recovery services provider + * ARM Id. + * @member {string} [migrationState] The migration status. Possible values + * include: 'None', 'EnableMigrationInProgress', 'EnableMigrationFailed', + * 'DisableMigrationInProgress', 'DisableMigrationFailed', + * 'InitialSeedingInProgress', 'InitialSeedingFailed', 'Replicating', + * 'MigrationInProgress', 'MigrationSucceeded', 'MigrationFailed' + * @member {string} [migrationStateDescription] The migration state + * description. + * @member {string} [testMigrateState] The test migrate state. Possible values + * include: 'None', 'TestMigrationInProgress', 'TestMigrationSucceeded', + * 'TestMigrationFailed', 'TestMigrationCleanupInProgress' + * @member {string} [testMigrateStateDescription] The test migrate state + * description. + * @member {string} [health] The consolidated health. + * @member {array} [healthErrors] The list of health errors. + * @member {array} [allowedOperations] The allowed operations on the migration + * item, based on the current migration state of the item. + * @member {object} [currentJob] The current job details. + * @member {string} [currentJob.jobName] The job name. + * @member {string} [currentJob.jobId] The ARM Id of the job being executed. + * @member {date} [currentJob.startTime] The start time of the job. + * @member {object} [providerSpecificDetails] The migration provider custom + * settings. + * @member {string} [providerSpecificDetails.instanceType] Polymorphic + * Discriminator + */ +export interface MigrationItemProperties { + readonly machineName?: string; + readonly policyId?: string; + readonly policyFriendlyName?: string; + readonly recoveryServicesProviderId?: string; + readonly migrationState?: string; + readonly migrationStateDescription?: string; + readonly testMigrateState?: string; + readonly testMigrateStateDescription?: string; + readonly health?: string; + readonly healthErrors?: HealthError[]; + readonly allowedOperations?: string[]; + readonly currentJob?: CurrentJobDetails; + providerSpecificDetails?: MigrationProviderSpecificSettings; +} + +/** + * @class + * Initializes a new instance of the MigrationItem class. + * @constructor + * Migration item. + * + * @member {object} [properties] The migration item properties. + * @member {string} [properties.machineName] The on-premise virtual machine + * name. + * @member {string} [properties.policyId] The ARM Id of policy governing this + * item. + * @member {string} [properties.policyFriendlyName] The name of policy + * governing this item. + * @member {string} [properties.recoveryServicesProviderId] The recovery + * services provider ARM Id. + * @member {string} [properties.migrationState] The migration status. Possible + * values include: 'None', 'EnableMigrationInProgress', + * 'EnableMigrationFailed', 'DisableMigrationInProgress', + * 'DisableMigrationFailed', 'InitialSeedingInProgress', + * 'InitialSeedingFailed', 'Replicating', 'MigrationInProgress', + * 'MigrationSucceeded', 'MigrationFailed' + * @member {string} [properties.migrationStateDescription] The migration state + * description. + * @member {string} [properties.testMigrateState] The test migrate state. + * Possible values include: 'None', 'TestMigrationInProgress', + * 'TestMigrationSucceeded', 'TestMigrationFailed', + * 'TestMigrationCleanupInProgress' + * @member {string} [properties.testMigrateStateDescription] The test migrate + * state description. + * @member {string} [properties.health] The consolidated health. + * @member {array} [properties.healthErrors] The list of health errors. + * @member {array} [properties.allowedOperations] The allowed operations on the + * migration item, based on the current migration state of the item. + * @member {object} [properties.currentJob] The current job details. + * @member {string} [properties.currentJob.jobName] The job name. + * @member {string} [properties.currentJob.jobId] The ARM Id of the job being + * executed. + * @member {date} [properties.currentJob.startTime] The start time of the job. + * @member {object} [properties.providerSpecificDetails] The migration provider + * custom settings. + * @member {string} [properties.providerSpecificDetails.instanceType] + * Polymorphic Discriminator + */ +export interface MigrationItem extends Resource { + properties?: MigrationItemProperties; +} + +/** + * @class + * Initializes a new instance of the MigrationItemsQueryParameter class. + * @constructor + * Query parameter to enumerate migration items. + * + * @member {string} [sourceFabricName] The source fabric name filter. + * @member {string} [instanceType] The replication provider type. + */ +export interface MigrationItemsQueryParameter { + sourceFabricName?: string; + instanceType?: string; +} + +/** + * @class + * Initializes a new instance of the MigrationRecoveryPointProperties class. + * @constructor + * Migration item recovery point properties. + * + * @member {date} [recoveryPointTime] The recovery point time. + * @member {string} [recoveryPointType] The recovery point type. Possible + * values include: 'NotSpecified', 'ApplicationConsistent', 'CrashConsistent' + */ +export interface MigrationRecoveryPointProperties { + readonly recoveryPointTime?: Date; + readonly recoveryPointType?: string; +} + +/** + * @class + * Initializes a new instance of the MigrationRecoveryPoint class. + * @constructor + * Recovery point for a migration item. + * + * @member {object} [properties] Recovery point properties. + * @member {date} [properties.recoveryPointTime] The recovery point time. + * @member {string} [properties.recoveryPointType] The recovery point type. + * Possible values include: 'NotSpecified', 'ApplicationConsistent', + * 'CrashConsistent' + */ +export interface MigrationRecoveryPoint extends Resource { + properties?: MigrationRecoveryPointProperties; +} + /** * @class * Initializes a new instance of the MobilityServiceUpdate class. @@ -5458,27 +5833,38 @@ export interface RecoveryPoint extends Resource { * @member {array} [healthErrorDetails] The recovery services provider health * error details. * @member {string} [draIdentifier] The DRA Id. - * @member {object} [identityDetails] The identity details. - * @member {string} [identityDetails.identityProviderType] The identity - * provider type. Value is the ToString() of a IdentityProviderType value. - * Possible values include: 'RecoveryServicesActiveDirectory' - * @member {string} [identityDetails.tenantId] The tenant Id for the service - * principal with which the on-premise management/data plane components would - * communicate with our Azure services. - * @member {string} [identityDetails.applicationId] The application/client Id - * for the service principal with which the on-premise management/data plane + * @member {object} [authenticationIdentityDetails] The authentication identity + * details. + * @member {string} [authenticationIdentityDetails.tenantId] The tenant Id for + * the service principal with which the on-premise management/data plane * components would communicate with our Azure services. - * @member {string} [identityDetails.objectId] The object Id of the service - * principal with which the on-premise management/data plane components would - * communicate with our Azure services. - * @member {string} [identityDetails.audience] The intended Audience of the - * service principal with which the on-premise management/data plane components - * would communicate with our Azure services. - * @member {string} [identityDetails.aadAuthority] The base authority for Azure - * Active Directory authentication. - * @member {string} [identityDetails.certificateThumbprint] The certificate - * thumbprint. Applicable only if IdentityProviderType is - * RecoveryServicesActiveDirectory. + * @member {string} [authenticationIdentityDetails.applicationId] The + * application/client Id for the service principal with which the on-premise + * management/data plane components would communicate with our Azure services. + * @member {string} [authenticationIdentityDetails.objectId] The object Id of + * the service principal with which the on-premise management/data plane + * components would communicate with our Azure services. + * @member {string} [authenticationIdentityDetails.audience] The intended + * Audience of the service principal with which the on-premise management/data + * plane components would communicate with our Azure services. + * @member {string} [authenticationIdentityDetails.aadAuthority] The base + * authority for Azure Active Directory authentication. + * @member {object} [resourceAccessIdentityDetails] The resource access + * identity details. + * @member {string} [resourceAccessIdentityDetails.tenantId] The tenant Id for + * the service principal with which the on-premise management/data plane + * components would communicate with our Azure services. + * @member {string} [resourceAccessIdentityDetails.applicationId] The + * application/client Id for the service principal with which the on-premise + * management/data plane components would communicate with our Azure services. + * @member {string} [resourceAccessIdentityDetails.objectId] The object Id of + * the service principal with which the on-premise management/data plane + * components would communicate with our Azure services. + * @member {string} [resourceAccessIdentityDetails.audience] The intended + * Audience of the service principal with which the on-premise management/data + * plane components would communicate with our Azure services. + * @member {string} [resourceAccessIdentityDetails.aadAuthority] The base + * authority for Azure Active Directory authentication. * @member {object} [providerVersionDetails] The provider version details. * @member {string} [providerVersionDetails.version] The agent version. * @member {date} [providerVersionDetails.expiryDate] Version expiry date. @@ -5500,7 +5886,8 @@ export interface RecoveryServicesProviderProperties { allowedScenarios?: string[]; healthErrorDetails?: HealthError[]; draIdentifier?: string; - identityDetails?: IdentityInformation; + authenticationIdentityDetails?: IdentityProviderDetails; + resourceAccessIdentityDetails?: IdentityProviderDetails; providerVersionDetails?: VersionDetails; } @@ -5530,27 +5917,40 @@ export interface RecoveryServicesProviderProperties { * @member {array} [properties.healthErrorDetails] The recovery services * provider health error details. * @member {string} [properties.draIdentifier] The DRA Id. - * @member {object} [properties.identityDetails] The identity details. - * @member {string} [properties.identityDetails.identityProviderType] The - * identity provider type. Value is the ToString() of a IdentityProviderType - * value. Possible values include: 'RecoveryServicesActiveDirectory' - * @member {string} [properties.identityDetails.tenantId] The tenant Id for the - * service principal with which the on-premise management/data plane components - * would communicate with our Azure services. - * @member {string} [properties.identityDetails.applicationId] The - * application/client Id for the service principal with which the on-premise + * @member {object} [properties.authenticationIdentityDetails] The + * authentication identity details. + * @member {string} [properties.authenticationIdentityDetails.tenantId] The + * tenant Id for the service principal with which the on-premise * management/data plane components would communicate with our Azure services. - * @member {string} [properties.identityDetails.objectId] The object Id of the - * service principal with which the on-premise management/data plane components - * would communicate with our Azure services. - * @member {string} [properties.identityDetails.audience] The intended Audience - * of the service principal with which the on-premise management/data plane - * components would communicate with our Azure services. - * @member {string} [properties.identityDetails.aadAuthority] The base - * authority for Azure Active Directory authentication. - * @member {string} [properties.identityDetails.certificateThumbprint] The - * certificate thumbprint. Applicable only if IdentityProviderType is - * RecoveryServicesActiveDirectory. + * @member {string} [properties.authenticationIdentityDetails.applicationId] + * The application/client Id for the service principal with which the + * on-premise management/data plane components would communicate with our Azure + * services. + * @member {string} [properties.authenticationIdentityDetails.objectId] The + * object Id of the service principal with which the on-premise management/data + * plane components would communicate with our Azure services. + * @member {string} [properties.authenticationIdentityDetails.audience] The + * intended Audience of the service principal with which the on-premise + * management/data plane components would communicate with our Azure services. + * @member {string} [properties.authenticationIdentityDetails.aadAuthority] The + * base authority for Azure Active Directory authentication. + * @member {object} [properties.resourceAccessIdentityDetails] The resource + * access identity details. + * @member {string} [properties.resourceAccessIdentityDetails.tenantId] The + * tenant Id for the service principal with which the on-premise + * management/data plane components would communicate with our Azure services. + * @member {string} [properties.resourceAccessIdentityDetails.applicationId] + * The application/client Id for the service principal with which the + * on-premise management/data plane components would communicate with our Azure + * services. + * @member {string} [properties.resourceAccessIdentityDetails.objectId] The + * object Id of the service principal with which the on-premise management/data + * plane components would communicate with our Azure services. + * @member {string} [properties.resourceAccessIdentityDetails.audience] The + * intended Audience of the service principal with which the on-premise + * management/data plane components would communicate with our Azure services. + * @member {string} [properties.resourceAccessIdentityDetails.aadAuthority] The + * base authority for Azure Active Directory authentication. * @member {object} [properties.providerVersionDetails] The provider version * details. * @member {string} [properties.providerVersionDetails.version] The agent @@ -6201,6 +6601,73 @@ export interface TestFailoverJobDetails extends JobDetails { protectedItemDetails?: FailoverReplicationProtectedItemDetails[]; } +/** + * @class + * Initializes a new instance of the TestMigrateCleanupInputProperties class. + * @constructor + * Test migrate cleanup input properties. + * + * @member {string} [comments] Test migrate cleanup comments. + */ +export interface TestMigrateCleanupInputProperties { + comments?: string; +} + +/** + * @class + * Initializes a new instance of the TestMigrateCleanupInput class. + * @constructor + * Input for test migrate cleanup. + * + * @member {object} properties Test migrate cleanup input properties. + * @member {string} [properties.comments] Test migrate cleanup comments. + */ +export interface TestMigrateCleanupInput { + properties: TestMigrateCleanupInputProperties; +} + +/** + * @class + * Initializes a new instance of the TestMigrateProviderSpecificInput class. + * @constructor + * Test migrate provider specific input. + * + * @member {string} instanceType Polymorphic Discriminator + */ +export interface TestMigrateProviderSpecificInput { + instanceType: string; +} + +/** + * @class + * Initializes a new instance of the TestMigrateInputProperties class. + * @constructor + * Test migrate input properties. + * + * @member {object} providerSpecificDetails The provider specific details. + * @member {string} [providerSpecificDetails.instanceType] Polymorphic + * Discriminator + */ +export interface TestMigrateInputProperties { + providerSpecificDetails: TestMigrateProviderSpecificInput; +} + +/** + * @class + * Initializes a new instance of the TestMigrateInput class. + * @constructor + * Input for test migrate. + * + * @member {object} properties Test migrate input properties. + * @member {object} [properties.providerSpecificDetails] The provider specific + * details. + * @member {string} [properties.providerSpecificDetails.instanceType] + * Polymorphic Discriminator + */ +export interface TestMigrateInput { + properties: TestMigrateInputProperties; +} + /** * @class * Initializes a new instance of the UnplannedFailoverInputProperties class. @@ -6238,6 +6705,49 @@ export interface UnplannedFailoverInput { properties?: UnplannedFailoverInputProperties; } +/** + * @class + * Initializes a new instance of the UpdateMigrationItemProviderSpecificInput class. + * @constructor + * Update migration item provider specific input. + * + * @member {string} instanceType Polymorphic Discriminator + */ +export interface UpdateMigrationItemProviderSpecificInput { + instanceType: string; +} + +/** + * @class + * Initializes a new instance of the UpdateMigrationItemInputProperties class. + * @constructor + * Update migration item input properties. + * + * @member {object} providerSpecificDetails The provider specific input to + * update migration item. + * @member {string} [providerSpecificDetails.instanceType] Polymorphic + * Discriminator + */ +export interface UpdateMigrationItemInputProperties { + providerSpecificDetails: UpdateMigrationItemProviderSpecificInput; +} + +/** + * @class + * Initializes a new instance of the UpdateMigrationItemInput class. + * @constructor + * Update migration item input. + * + * @member {object} [properties] Update migration item input properties. + * @member {object} [properties.providerSpecificDetails] The provider specific + * input to update migration item. + * @member {string} [properties.providerSpecificDetails.instanceType] + * Polymorphic Discriminator + */ +export interface UpdateMigrationItemInput { + properties?: UpdateMigrationItemInputProperties; +} + /** * @class * Initializes a new instance of the UpdateMobilityServiceRequestProperties class. @@ -6795,21 +7305,262 @@ export interface VmNicUpdatesTaskDetails extends TaskTypeDetails { name?: string; } +/** + * @class + * Initializes a new instance of the VMwareCbtContainerCreationInput class. + * @constructor + * VMwareCbt container creation input. + * + */ +export interface VMwareCbtContainerCreationInput extends ReplicationProviderSpecificContainerCreationInput { +} + +/** + * @class + * Initializes a new instance of the VMwareCbtContainerMappingInput class. + * @constructor + * VMwareCbt container mapping input. + * + * @member {string} keyVaultId The target key vault ARM Id. + * @member {string} keyVaultUri The target key vault URL. + * @member {string} storageAccountId The storage account ARM Id. + * @member {string} storageAccountSasSecretName The secret name of the storage + * account. + * @member {string} serviceBusConnectionStringSecretName The secret name of the + * service bus connection string. + * @member {string} targetLocation The target location. + */ +export interface VMwareCbtContainerMappingInput extends ReplicationProviderSpecificContainerMappingInput { + keyVaultId: string; + keyVaultUri: string; + storageAccountId: string; + storageAccountSasSecretName: string; + serviceBusConnectionStringSecretName: string; + targetLocation: string; +} + +/** + * @class + * Initializes a new instance of the VMwareCbtDiskInput class. + * @constructor + * VMwareCbt disk input. + * + * @member {string} diskId The disk Id. + * @member {string} isOSDisk A value indicating whether the disk is the OS + * disk. + * @member {string} logStorageAccountId The log storage account ARM Id. + * @member {string} logStorageAccountSasSecretName The key vault secret name of + * the log storage account. + * @member {string} [diskType] The disk type. Possible values include: + * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS' + */ +export interface VMwareCbtDiskInput { + diskId: string; + isOSDisk: string; + logStorageAccountId: string; + logStorageAccountSasSecretName: string; + diskType?: string; +} + +/** + * @class + * Initializes a new instance of the VMwareCbtEnableMigrationInput class. + * @constructor + * VMwareCbt specific enable migration input. + * + * @member {string} vmwareMachineId The ARM Id of the VM discovered in VMware. + * @member {array} disksToInclude The disks to include list. + * @member {string} [licenseType] License type. Possible values include: + * 'NotSpecified', 'NoLicenseType', 'WindowsServer' + * @member {string} dataMoverRunAsAccountId The data mover runas account Id. + * @member {string} snapshotRunAsAccountId The snapshot runas account Id. + * @member {string} [targetVmName] The target VM name. + * @member {string} [targetVmSize] The target VM size. + * @member {string} targetResourceGroupId The target resource group ARM Id. + * @member {string} targetNetworkId The target network ARM Id. + * @member {string} [targetSubnetName] The target subnet name. + * @member {string} [targetAvailabilitySetId] The target availability set ARM + * Id. + * @member {string} [targetBootDiagnosticsStorageAccountId] The target boot + * diagnostics storage account ARM Id. + */ +export interface VMwareCbtEnableMigrationInput extends EnableMigrationProviderSpecificInput { + vmwareMachineId: string; + disksToInclude: VMwareCbtDiskInput[]; + licenseType?: string; + dataMoverRunAsAccountId: string; + snapshotRunAsAccountId: string; + targetVmName?: string; + targetVmSize?: string; + targetResourceGroupId: string; + targetNetworkId: string; + targetSubnetName?: string; + targetAvailabilitySetId?: string; + targetBootDiagnosticsStorageAccountId?: string; +} + +/** + * @class + * Initializes a new instance of the VMwareCbtMigrateInput class. + * @constructor + * VMwareCbt specific migrate input. + * + * @member {string} performShutdown A value indicating whether VM is to be + * shutdown. + */ +export interface VMwareCbtMigrateInput extends MigrateProviderSpecificInput { + performShutdown: string; +} + +/** + * @class + * Initializes a new instance of the VMwareCbtProtectedDiskDetails class. + * @constructor + * VMwareCbt protected disk details. + * + * @member {string} [diskId] The disk id. + * @member {string} [diskName] The disk name. + * @member {string} [diskPath] The disk path. + * @member {string} [isOSDisk] A value indicating whether the disk is the OS + * disk. + * @member {number} [capacityInBytes] The disk capacity in bytes. + * @member {string} [logStorageAccountId] The log storage account ARM Id. + * @member {string} [logStorageAccountSasSecretName] The key vault secret name + * of the log storage account. + * @member {string} [seedManagedDiskId] The ARM Id of the seed managed disk. + * @member {string} [targetManagedDiskId] The ARM Id of the target managed + * disk. + * @member {string} [diskType] The disk type. Possible values include: + * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS' + */ +export interface VMwareCbtProtectedDiskDetails { + readonly diskId?: string; + readonly diskName?: string; + readonly diskPath?: string; + readonly isOSDisk?: string; + readonly capacityInBytes?: number; + readonly logStorageAccountId?: string; + readonly logStorageAccountSasSecretName?: string; + readonly seedManagedDiskId?: string; + readonly targetManagedDiskId?: string; + diskType?: string; +} + +/** + * @class + * Initializes a new instance of the VMwareCbtNicDetails class. + * @constructor + * VMwareCbt NIC details. + * + * @member {string} [nicId] The NIC Id. + * @member {string} [isPrimaryNic] A value indicating whether this is the + * primary NIC. + * @member {string} [sourceIPAddress] The source IP address. + * @member {string} [sourceIPAddressType] The source IP address type. Possible + * values include: 'Dynamic', 'Static' + * @member {string} [sourceNetworkId] Source network Id. + * @member {string} [targetIPAddress] The target IP address. + * @member {string} [targetIPAddressType] The target IP address type. Possible + * values include: 'Dynamic', 'Static' + * @member {string} [targetSubnetName] Target subnet name. + * @member {string} [isSelectedForMigration] A value indicating whether this + * NIC is selected for migration. + */ +export interface VMwareCbtNicDetails { + readonly nicId?: string; + isPrimaryNic?: string; + readonly sourceIPAddress?: string; + readonly sourceIPAddressType?: string; + readonly sourceNetworkId?: string; + targetIPAddress?: string; + targetIPAddressType?: string; + targetSubnetName?: string; + isSelectedForMigration?: string; +} + +/** + * @class + * Initializes a new instance of the VMwareCbtMigrationDetails class. + * @constructor + * VMwareCbt provider specific settings + * + * @member {string} [vmwareMachineId] The ARM Id of the VM discovered in + * VMware. + * @member {string} [osType] The type of the OS on the VM. + * @member {string} [licenseType] License Type of the VM to be used. + * @member {string} [dataMoverRunAsAccountId] The data mover runas account Id. + * @member {string} [snapshotRunAsAccountId] The snapshot runas account Id. + * @member {string} [targetVmName] Target VM name. + * @member {string} [targetVmSize] The target VM size. + * @member {string} [targetLocation] The target location. + * @member {string} [targetResourceGroupId] The target resource group Id. + * @member {string} [targetAvailabilitySetId] The target availability set Id. + * @member {string} [targetBootDiagnosticsStorageAccountId] The target boot + * diagnostics storage account ARM Id. + * @member {array} [protectedDisks] The list of protected disks. + * @member {string} [targetNetworkId] The target network Id. + * @member {array} [vmNics] The network details. + * @member {string} [migrationRecoveryPointId] The recovery point Id to which + * the VM was migrated. + * @member {date} [lastRecoveryPointReceived] The last recovery point received + * time. + */ +export interface VMwareCbtMigrationDetails extends MigrationProviderSpecificSettings { + readonly vmwareMachineId?: string; + readonly osType?: string; + licenseType?: string; + readonly dataMoverRunAsAccountId?: string; + readonly snapshotRunAsAccountId?: string; + targetVmName?: string; + targetVmSize?: string; + readonly targetLocation?: string; + targetResourceGroupId?: string; + targetAvailabilitySetId?: string; + targetBootDiagnosticsStorageAccountId?: string; + protectedDisks?: VMwareCbtProtectedDiskDetails[]; + targetNetworkId?: string; + vmNics?: VMwareCbtNicDetails[]; + readonly migrationRecoveryPointId?: string; + readonly lastRecoveryPointReceived?: Date; +} + +/** + * @class + * Initializes a new instance of the VMwareCbtNicInput class. + * @constructor + * VMwareCbt NIC input. + * + * @member {string} nicId The NIC Id. + * @member {string} isPrimaryNic A value indicating whether this is the primary + * NIC. + * @member {string} [targetSubnetName] Target subnet name. + * @member {string} [targetStaticIPAddress] The static IP address. + * @member {string} [isSelectedForMigration] A value indicating whether this + * NIC is selected for migration. + */ +export interface VMwareCbtNicInput { + nicId: string; + isPrimaryNic: string; + targetSubnetName?: string; + targetStaticIPAddress?: string; + isSelectedForMigration?: string; +} + /** * @class * Initializes a new instance of the VMwareCbtPolicyCreationInput class. * @constructor - * VMware Cbt Policy creation input. + * VMware Cbt policy creation input. * - * @member {number} [recoveryPointHistory] The duration in minutes until which - * the recovery points need to be stored. + * @member {number} [recoveryPointHistoryInMinutes] The duration in minutes + * until which the recovery points need to be stored. * @member {number} [crashConsistentFrequencyInMinutes] The crash consistent * snapshot frequency (in minutes). * @member {number} [appConsistentFrequencyInMinutes] The app consistent * snapshot frequency (in minutes). */ export interface VMwareCbtPolicyCreationInput extends PolicyProviderSpecificInput { - recoveryPointHistory?: number; + recoveryPointHistoryInMinutes?: number; crashConsistentFrequencyInMinutes?: number; appConsistentFrequencyInMinutes?: number; } @@ -6820,22 +7571,86 @@ export interface VMwareCbtPolicyCreationInput extends PolicyProviderSpecificInpu * @constructor * VMware Cbt specific policy details. * - * @member {number} [recoveryPointThresholdInMinutes] The recovery point - * threshold in minutes. - * @member {number} [recoveryPointHistory] The duration in minutes until which - * the recovery points need to be stored. + * @member {number} [recoveryPointHistoryInMinutes] The duration in minutes + * until which the recovery points need to be stored. * @member {number} [appConsistentFrequencyInMinutes] The app consistent * snapshot frequency in minutes. * @member {number} [crashConsistentFrequencyInMinutes] The crash consistent * snapshot frequency in minutes. */ export interface VmwareCbtPolicyDetails extends PolicyProviderSpecificDetails { - recoveryPointThresholdInMinutes?: number; - recoveryPointHistory?: number; + recoveryPointHistoryInMinutes?: number; appConsistentFrequencyInMinutes?: number; crashConsistentFrequencyInMinutes?: number; } +/** + * @class + * Initializes a new instance of the VMwareCbtProtectionContainerMappingDetails class. + * @constructor + * VMwareCbt provider specific container mapping details. + * + * @member {string} [keyVaultId] The target key vault ARM Id. + * @member {string} [keyVaultUri] The target key vault URI. + * @member {string} [storageAccountId] The storage account ARM Id. + * @member {string} [storageAccountSasSecretName] The secret name of the + * storage account. + * @member {string} [serviceBusConnectionStringSecretName] The secret name of + * the service bus connection string. + * @member {string} [targetLocation] The target location. + */ +export interface VMwareCbtProtectionContainerMappingDetails extends ProtectionContainerMappingProviderSpecificDetails { + readonly keyVaultId?: string; + readonly keyVaultUri?: string; + readonly storageAccountId?: string; + readonly storageAccountSasSecretName?: string; + readonly serviceBusConnectionStringSecretName?: string; + readonly targetLocation?: string; +} + +/** + * @class + * Initializes a new instance of the VMwareCbtTestMigrateInput class. + * @constructor + * VMwareCbt specific test migrate input. + * + * @member {string} recoveryPointId The recovery point Id. + * @member {string} networkId The test network Id. + */ +export interface VMwareCbtTestMigrateInput extends TestMigrateProviderSpecificInput { + recoveryPointId: string; + networkId: string; +} + +/** + * @class + * Initializes a new instance of the VMwareCbtUpdateMigrationItemInput class. + * @constructor + * VMwareCbt specific update migration item input. + * + * @member {string} [targetVmName] The target VM name. + * @member {string} [targetVmSize] The target VM size. + * @member {string} [targetResourceGroupId] The target resource group ARM Id. + * @member {string} [targetAvailabilitySetId] The target availability set ARM + * Id. + * @member {string} [targetBootDiagnosticsStorageAccountId] The target boot + * diagnostics storage account ARM Id. + * @member {string} [targetNetworkId] The target network ARM Id. + * @member {array} [vmNics] The list of NIC details. + * @member {string} [licenseType] The license type. Possible values include: + * 'NotSpecified', 'NoLicenseType', 'WindowsServer' + */ +export interface VMwareCbtUpdateMigrationItemInput extends UpdateMigrationItemProviderSpecificInput { + targetVmName?: string; + targetVmSize?: string; + targetResourceGroupId?: string; + targetAvailabilitySetId?: string; + targetBootDiagnosticsStorageAccountId?: string; + targetNetworkId?: string; + vmNics?: VMwareCbtNicInput[]; + licenseType?: string; +} + /** * @class * Initializes a new instance of the VMwareDetails class. @@ -6924,34 +7739,30 @@ export interface VMwareDetails extends FabricSpecificDetails { * @class * Initializes a new instance of the VMwareV2FabricCreationInput class. * @constructor - * Fabric provider specific settings. + * VMwareV2 fabric provider specific settings. * - * @member {string} [keyVaultUrl] The Key Vault URL. - * @member {string} [keyVaultResourceArmId] The Key Vault ARM Id. + * @member {string} vmwareSiteId The ARM Id of the VMware site. + * @member {string} migrationSolutionId The ARM Id of the migration solution. */ export interface VMwareV2FabricCreationInput extends FabricSpecificCreationInput { - keyVaultUrl?: string; - keyVaultResourceArmId?: string; + vmwareSiteId: string; + migrationSolutionId: string; } /** * @class * Initializes a new instance of the VMwareV2FabricSpecificDetails class. * @constructor - * VMwareV2 fabric Specific Details. + * VMwareV2 fabric specific details. * - * @member {string} [srsServiceEndpoint] The endpoint for making requests to - * the SRS Service. - * @member {string} [rcmServiceEndpoint] The endpoint for making requests to - * the RCM Service. - * @member {string} [keyVaultUrl] The Key Vault URL. - * @member {string} [keyVaultResourceArmId] The Key Vault ARM Id. + * @member {string} [vmwareSiteId] The ARM Id of the VMware site. + * @member {string} [migrationSolutionId] The Migration solution ARM Id. + * @member {string} [serviceEndpoint] The service endpoint. */ export interface VMwareV2FabricSpecificDetails extends FabricSpecificDetails { - srsServiceEndpoint?: string; - rcmServiceEndpoint?: string; - keyVaultUrl?: string; - keyVaultResourceArmId?: string; + readonly vmwareSiteId?: string; + readonly migrationSolutionId?: string; + readonly serviceEndpoint?: string; } /** @@ -6970,7 +7781,7 @@ export interface VMwareV2FabricSpecificDetails extends FabricSpecificDetails { * @member {string} [ipAddress] The IP address. * @member {string} [poweredOn] The value indicating whether VM is powered on. * @member {string} [vCenterInfrastructureId] The VCenter infrastructure Id. - * @member {string} [discoveryType] A value inidicating the discovery type of + * @member {string} [discoveryType] A value indicating the discovery type of * the machine. Value can be vCenter or physical. * @member {array} [diskDetails] The disk details. * @member {array} [validationErrors] The validation errors. @@ -7089,6 +7900,30 @@ export interface ProtectionContainerCollection extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the MigrationRecoveryPointCollection class. + * @constructor + * Collection of migration recovery points. + * + * @member {string} [nextLink] The value of next link. + */ +export interface MigrationRecoveryPointCollection extends Array { + nextLink?: string; +} + /** * @class * Initializes a new instance of the ProtectableItemCollection class. diff --git a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/index.js b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/index.js index a016579d46..44befa64d7 100644 --- a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/index.js +++ b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/index.js @@ -60,6 +60,9 @@ exports.A2AUpdateContainerMappingInput = require('./a2AUpdateContainerMappingInp exports.A2AVmManagedDiskUpdateDetails = require('./a2AVmManagedDiskUpdateDetails'); exports.UpdateReplicationProtectedItemProviderInput = require('./updateReplicationProtectedItemProviderInput'); exports.A2AUpdateReplicationProtectedItemInput = require('./a2AUpdateReplicationProtectedItemInput'); +exports.IdentityProviderInput = require('./identityProviderInput'); +exports.AddRecoveryServicesProviderInputProperties = require('./addRecoveryServicesProviderInputProperties'); +exports.AddRecoveryServicesProviderInput = require('./addRecoveryServicesProviderInput'); exports.AddVCenterRequestProperties = require('./addVCenterRequestProperties'); exports.AddVCenterRequest = require('./addVCenterRequest'); exports.AlertProperties = require('./alertProperties'); @@ -107,6 +110,7 @@ exports.RecoveryPlanAction = require('./recoveryPlanAction'); exports.RecoveryPlanGroup = require('./recoveryPlanGroup'); exports.CreateRecoveryPlanInputProperties = require('./createRecoveryPlanInputProperties'); exports.CreateRecoveryPlanInput = require('./createRecoveryPlanInput'); +exports.CurrentJobDetails = require('./currentJobDetails'); exports.CurrentScenarioDetails = require('./currentScenarioDetails'); exports.DataStore = require('./dataStore'); exports.DisableProtectionProviderSpecificInput = require('./disableProtectionProviderSpecificInput'); @@ -117,6 +121,9 @@ exports.DiscoverProtectableItemRequest = require('./discoverProtectableItemReque exports.DiskDetails = require('./diskDetails'); exports.DiskVolumeDetails = require('./diskVolumeDetails'); exports.Display = require('./display'); +exports.EnableMigrationProviderSpecificInput = require('./enableMigrationProviderSpecificInput'); +exports.EnableMigrationInputProperties = require('./enableMigrationInputProperties'); +exports.EnableMigrationInput = require('./enableMigrationInput'); exports.EnableProtectionInputProperties = require('./enableProtectionInputProperties'); exports.EnableProtectionInput = require('./enableProtectionInput'); exports.EncryptionDetails = require('./encryptionDetails'); @@ -163,7 +170,7 @@ exports.HyperVReplicaPolicyInput = require('./hyperVReplicaPolicyInput'); exports.HyperVReplicaReplicationDetails = require('./hyperVReplicaReplicationDetails'); exports.HyperVSiteDetails = require('./hyperVSiteDetails'); exports.HyperVVirtualMachineDetails = require('./hyperVVirtualMachineDetails'); -exports.IdentityInformation = require('./identityInformation'); +exports.IdentityProviderDetails = require('./identityProviderDetails'); exports.InlineWorkflowTaskDetails = require('./inlineWorkflowTaskDetails'); exports.InMageAgentDetails = require('./inMageAgentDetails'); exports.InMageAgentVersionDetails = require('./inMageAgentVersionDetails'); @@ -203,6 +210,15 @@ exports.ManualActionTaskDetails = require('./manualActionTaskDetails'); exports.RetentionVolume = require('./retentionVolume'); exports.VersionDetails = require('./versionDetails'); exports.MasterTargetServer = require('./masterTargetServer'); +exports.MigrateProviderSpecificInput = require('./migrateProviderSpecificInput'); +exports.MigrateInputProperties = require('./migrateInputProperties'); +exports.MigrateInput = require('./migrateInput'); +exports.MigrationProviderSpecificSettings = require('./migrationProviderSpecificSettings'); +exports.MigrationItemProperties = require('./migrationItemProperties'); +exports.MigrationItem = require('./migrationItem'); +exports.MigrationItemsQueryParameter = require('./migrationItemsQueryParameter'); +exports.MigrationRecoveryPointProperties = require('./migrationRecoveryPointProperties'); +exports.MigrationRecoveryPoint = require('./migrationRecoveryPoint'); exports.MobilityServiceUpdate = require('./mobilityServiceUpdate'); exports.Subnet = require('./subnet'); exports.NetworkProperties = require('./networkProperties'); @@ -282,8 +298,16 @@ exports.TestFailoverCleanupInput = require('./testFailoverCleanupInput'); exports.TestFailoverInputProperties = require('./testFailoverInputProperties'); exports.TestFailoverInput = require('./testFailoverInput'); exports.TestFailoverJobDetails = require('./testFailoverJobDetails'); +exports.TestMigrateCleanupInputProperties = require('./testMigrateCleanupInputProperties'); +exports.TestMigrateCleanupInput = require('./testMigrateCleanupInput'); +exports.TestMigrateProviderSpecificInput = require('./testMigrateProviderSpecificInput'); +exports.TestMigrateInputProperties = require('./testMigrateInputProperties'); +exports.TestMigrateInput = require('./testMigrateInput'); exports.UnplannedFailoverInputProperties = require('./unplannedFailoverInputProperties'); exports.UnplannedFailoverInput = require('./unplannedFailoverInput'); +exports.UpdateMigrationItemProviderSpecificInput = require('./updateMigrationItemProviderSpecificInput'); +exports.UpdateMigrationItemInputProperties = require('./updateMigrationItemInputProperties'); +exports.UpdateMigrationItemInput = require('./updateMigrationItemInput'); exports.UpdateMobilityServiceRequestProperties = require('./updateMobilityServiceRequestProperties'); exports.UpdateMobilityServiceRequest = require('./updateMobilityServiceRequest'); exports.UpdateNetworkMappingInputProperties = require('./updateNetworkMappingInputProperties'); @@ -313,8 +337,20 @@ exports.VmmToVmmNetworkMappingSettings = require('./vmmToVmmNetworkMappingSettin exports.VmmToVmmUpdateNetworkMappingInput = require('./vmmToVmmUpdateNetworkMappingInput'); exports.VmmVirtualMachineDetails = require('./vmmVirtualMachineDetails'); exports.VmNicUpdatesTaskDetails = require('./vmNicUpdatesTaskDetails'); +exports.VMwareCbtContainerCreationInput = require('./vMwareCbtContainerCreationInput'); +exports.VMwareCbtContainerMappingInput = require('./vMwareCbtContainerMappingInput'); +exports.VMwareCbtDiskInput = require('./vMwareCbtDiskInput'); +exports.VMwareCbtEnableMigrationInput = require('./vMwareCbtEnableMigrationInput'); +exports.VMwareCbtMigrateInput = require('./vMwareCbtMigrateInput'); +exports.VMwareCbtProtectedDiskDetails = require('./vMwareCbtProtectedDiskDetails'); +exports.VMwareCbtNicDetails = require('./vMwareCbtNicDetails'); +exports.VMwareCbtMigrationDetails = require('./vMwareCbtMigrationDetails'); +exports.VMwareCbtNicInput = require('./vMwareCbtNicInput'); exports.VMwareCbtPolicyCreationInput = require('./vMwareCbtPolicyCreationInput'); exports.VmwareCbtPolicyDetails = require('./vmwareCbtPolicyDetails'); +exports.VMwareCbtProtectionContainerMappingDetails = require('./vMwareCbtProtectionContainerMappingDetails'); +exports.VMwareCbtTestMigrateInput = require('./vMwareCbtTestMigrateInput'); +exports.VMwareCbtUpdateMigrationItemInput = require('./vMwareCbtUpdateMigrationItemInput'); exports.VMwareDetails = require('./vMwareDetails'); exports.VMwareV2FabricCreationInput = require('./vMwareV2FabricCreationInput'); exports.VMwareV2FabricSpecificDetails = require('./vMwareV2FabricSpecificDetails'); @@ -327,6 +363,8 @@ exports.LogicalNetworkCollection = require('./logicalNetworkCollection'); exports.NetworkCollection = require('./networkCollection'); exports.NetworkMappingCollection = require('./networkMappingCollection'); exports.ProtectionContainerCollection = require('./protectionContainerCollection'); +exports.MigrationItemCollection = require('./migrationItemCollection'); +exports.MigrationRecoveryPointCollection = require('./migrationRecoveryPointCollection'); exports.ProtectableItemCollection = require('./protectableItemCollection'); exports.ReplicationProtectedItemCollection = require('./replicationProtectedItemCollection'); exports.RecoveryPointCollection = require('./recoveryPointCollection'); @@ -373,6 +411,7 @@ exports.discriminators = { 'ReplicationProviderSpecificContainerMappingInput' : exports.ReplicationProviderSpecificContainerMappingInput, 'RecoveryPlanActionDetails' : exports.RecoveryPlanActionDetails, 'DisableProtectionProviderSpecificInput' : exports.DisableProtectionProviderSpecificInput, + 'EnableMigrationProviderSpecificInput' : exports.EnableMigrationProviderSpecificInput, 'EnableProtectionProviderSpecificInput' : exports.EnableProtectionProviderSpecificInput, 'EventProviderSpecificDetails' : exports.EventProviderSpecificDetails, 'EventSpecificDetails' : exports.EventSpecificDetails, @@ -428,6 +467,8 @@ exports.discriminators = { 'EventSpecificDetails.JobStatus' : exports.JobStatusEventDetails, 'TaskTypeDetails.JobTaskDetails' : exports.JobTaskDetails, 'TaskTypeDetails.ManualActionTaskDetails' : exports.ManualActionTaskDetails, + 'MigrateProviderSpecificInput' : exports.MigrateProviderSpecificInput, + 'MigrationProviderSpecificSettings' : exports.MigrationProviderSpecificSettings, 'NetworkMappingFabricSpecificSettings' : exports.NetworkMappingFabricSpecificSettings, 'ProviderSpecificFailoverInput' : exports.ProviderSpecificFailoverInput, 'PolicyProviderSpecificDetails' : exports.PolicyProviderSpecificDetails, @@ -454,6 +495,8 @@ exports.discriminators = { 'SwitchProtectionProviderSpecificInput' : exports.SwitchProtectionProviderSpecificInput, 'JobDetails.SwitchProtectionJobDetails' : exports.SwitchProtectionJobDetails, 'JobDetails.TestFailoverJobDetails' : exports.TestFailoverJobDetails, + 'TestMigrateProviderSpecificInput' : exports.TestMigrateProviderSpecificInput, + 'UpdateMigrationItemProviderSpecificInput' : exports.UpdateMigrationItemProviderSpecificInput, 'UpdateReplicationProtectedItemProviderInput' : exports.UpdateReplicationProtectedItemProviderInput, 'TaskTypeDetails.VirtualMachineTaskDetails' : exports.VirtualMachineTaskDetails, 'FabricSpecificDetails.VMM' : exports.VmmDetails, @@ -465,8 +508,16 @@ exports.discriminators = { 'FabricSpecificUpdateNetworkMappingInput.VmmToVmm' : exports.VmmToVmmUpdateNetworkMappingInput, 'ConfigurationSettings.VmmVirtualMachine' : exports.VmmVirtualMachineDetails, 'TaskTypeDetails.VmNicUpdatesTaskDetails' : exports.VmNicUpdatesTaskDetails, + 'ReplicationProviderSpecificContainerCreationInput.6c7da455-506f-43ff-a16a-8eb101aebb70' : exports.VMwareCbtContainerCreationInput, + 'ReplicationProviderSpecificContainerMappingInput.VMwareCbt' : exports.VMwareCbtContainerMappingInput, + 'EnableMigrationProviderSpecificInput.VMwareCbt' : exports.VMwareCbtEnableMigrationInput, + 'MigrateProviderSpecificInput.VMwareCbt' : exports.VMwareCbtMigrateInput, + 'MigrationProviderSpecificSettings.VMwareCbt' : exports.VMwareCbtMigrationDetails, 'PolicyProviderSpecificInput.VMwareCbt' : exports.VMwareCbtPolicyCreationInput, 'PolicyProviderSpecificDetails.VMwareCbt' : exports.VmwareCbtPolicyDetails, + 'ProtectionContainerMappingProviderSpecificDetails.VMwareCbt' : exports.VMwareCbtProtectionContainerMappingDetails, + 'TestMigrateProviderSpecificInput.VMwareCbt' : exports.VMwareCbtTestMigrateInput, + 'UpdateMigrationItemProviderSpecificInput.VMwareCbt' : exports.VMwareCbtUpdateMigrationItemInput, 'FabricSpecificDetails.VMware' : exports.VMwareDetails, 'FabricSpecificCreationInput.VMwareV2' : exports.VMwareV2FabricCreationInput, 'FabricSpecificDetails.VMwareV2' : exports.VMwareV2FabricSpecificDetails, diff --git a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/keyEncryptionKeyInfo.js b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/keyEncryptionKeyInfo.js index e8db15aa8d..ef1b52aae7 100644 --- a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/keyEncryptionKeyInfo.js +++ b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/keyEncryptionKeyInfo.js @@ -17,8 +17,8 @@ class KeyEncryptionKeyInfo { /** * Create a KeyEncryptionKeyInfo. - * @member {string} [keyIdentifier] The key url / identifier. - * @member {string} [keyVaultResourceArmId] The KeyVault resource ARM id for + * @member {string} [keyIdentifier] The key url / identifier. + * @member {string} [keyVaultResourceArmId] The KeyVault resource ARM id for * key. */ constructor() { diff --git a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/migrateInput.js b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/migrateInput.js new file mode 100644 index 0000000000..e565fddcb3 --- /dev/null +++ b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/migrateInput.js @@ -0,0 +1,57 @@ +/* + * 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'; + +/** + * Input for migrate. + * + */ +class MigrateInput { + /** + * Create a MigrateInput. + * @member {object} properties Migrate input properties. + * @member {object} [properties.providerSpecificDetails] The provider + * specific details. + * @member {string} [properties.providerSpecificDetails.instanceType] + * Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of MigrateInput + * + * @returns {object} metadata of MigrateInput + * + */ + mapper() { + return { + required: false, + serializedName: 'MigrateInput', + type: { + name: 'Composite', + className: 'MigrateInput', + modelProperties: { + properties: { + required: true, + serializedName: 'properties', + type: { + name: 'Composite', + className: 'MigrateInputProperties' + } + } + } + } + }; + } +} + +module.exports = MigrateInput; diff --git a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/migrateInputProperties.js b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/migrateInputProperties.js new file mode 100644 index 0000000000..4a53478643 --- /dev/null +++ b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/migrateInputProperties.js @@ -0,0 +1,60 @@ +/* + * 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'; + +/** + * Migrate input properties. + * + */ +class MigrateInputProperties { + /** + * Create a MigrateInputProperties. + * @member {object} providerSpecificDetails The provider specific details. + * @member {string} [providerSpecificDetails.instanceType] Polymorphic + * Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of MigrateInputProperties + * + * @returns {object} metadata of MigrateInputProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'MigrateInputProperties', + type: { + name: 'Composite', + className: 'MigrateInputProperties', + modelProperties: { + providerSpecificDetails: { + required: true, + serializedName: 'providerSpecificDetails', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'instanceType', + clientName: 'instanceType' + }, + uberParent: 'MigrateProviderSpecificInput', + className: 'MigrateProviderSpecificInput' + } + } + } + } + }; + } +} + +module.exports = MigrateInputProperties; diff --git a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/migrateProviderSpecificInput.js b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/migrateProviderSpecificInput.js new file mode 100644 index 0000000000..322f64cd1e --- /dev/null +++ b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/migrateProviderSpecificInput.js @@ -0,0 +1,58 @@ +/* + * 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'; + +/** + * Migrate provider specific input. + * + */ +class MigrateProviderSpecificInput { + /** + * Create a MigrateProviderSpecificInput. + * @member {string} instanceType Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of MigrateProviderSpecificInput + * + * @returns {object} metadata of MigrateProviderSpecificInput + * + */ + mapper() { + return { + required: false, + serializedName: 'MigrateProviderSpecificInput', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'instanceType', + clientName: 'instanceType' + }, + uberParent: 'MigrateProviderSpecificInput', + className: 'MigrateProviderSpecificInput', + modelProperties: { + instanceType: { + required: true, + serializedName: 'instanceType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = MigrateProviderSpecificInput; diff --git a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/migrationItem.js b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/migrationItem.js new file mode 100644 index 0000000000..6fec829be1 --- /dev/null +++ b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/migrationItem.js @@ -0,0 +1,124 @@ +/* + * 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'; + +const models = require('./index'); + +/** + * Migration item. + * + * @extends models['Resource'] + */ +class MigrationItem extends models['Resource'] { + /** + * Create a MigrationItem. + * @member {object} [properties] The migration item properties. + * @member {string} [properties.machineName] The on-premise virtual machine + * name. + * @member {string} [properties.policyId] The ARM Id of policy governing this + * item. + * @member {string} [properties.policyFriendlyName] The name of policy + * governing this item. + * @member {string} [properties.recoveryServicesProviderId] The recovery + * services provider ARM Id. + * @member {string} [properties.migrationState] The migration status. + * Possible values include: 'None', 'EnableMigrationInProgress', + * 'EnableMigrationFailed', 'DisableMigrationInProgress', + * 'DisableMigrationFailed', 'InitialSeedingInProgress', + * 'InitialSeedingFailed', 'Replicating', 'MigrationInProgress', + * 'MigrationSucceeded', 'MigrationFailed' + * @member {string} [properties.migrationStateDescription] The migration + * state description. + * @member {string} [properties.testMigrateState] The test migrate state. + * Possible values include: 'None', 'TestMigrationInProgress', + * 'TestMigrationSucceeded', 'TestMigrationFailed', + * 'TestMigrationCleanupInProgress' + * @member {string} [properties.testMigrateStateDescription] The test migrate + * state description. + * @member {string} [properties.health] The consolidated health. + * @member {array} [properties.healthErrors] The list of health errors. + * @member {array} [properties.allowedOperations] The allowed operations on + * the migration item, based on the current migration state of the item. + * @member {object} [properties.currentJob] The current job details. + * @member {string} [properties.currentJob.jobName] The job name. + * @member {string} [properties.currentJob.jobId] The ARM Id of the job being + * executed. + * @member {date} [properties.currentJob.startTime] The start time of the + * job. + * @member {object} [properties.providerSpecificDetails] The migration + * provider custom settings. + * @member {string} [properties.providerSpecificDetails.instanceType] + * Polymorphic Discriminator + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MigrationItem + * + * @returns {object} metadata of MigrationItem + * + */ + mapper() { + return { + required: false, + serializedName: 'MigrationItem', + type: { + name: 'Composite', + className: 'MigrationItem', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + properties: { + required: false, + serializedName: 'properties', + type: { + name: 'Composite', + className: 'MigrationItemProperties' + } + } + } + } + }; + } +} + +module.exports = MigrationItem; diff --git a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/migrationItemCollection.js b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/migrationItemCollection.js new file mode 100644 index 0000000000..37238f543e --- /dev/null +++ b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/migrationItemCollection.js @@ -0,0 +1,67 @@ +/* + * 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'; + +/** + * Migration item collection. + */ +class MigrationItemCollection extends Array { + /** + * Create a MigrationItemCollection. + * @member {string} [nextLink] The value of next link. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MigrationItemCollection + * + * @returns {object} metadata of MigrationItemCollection + * + */ + mapper() { + return { + required: false, + serializedName: 'MigrationItemCollection', + type: { + name: 'Composite', + className: 'MigrationItemCollection', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'MigrationItemElementType', + type: { + name: 'Composite', + className: 'MigrationItem' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = MigrationItemCollection; diff --git a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/migrationItemProperties.js b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/migrationItemProperties.js new file mode 100644 index 0000000000..24d19e0047 --- /dev/null +++ b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/migrationItemProperties.js @@ -0,0 +1,200 @@ +/* + * 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'; + +/** + * Migration item properties. + * + */ +class MigrationItemProperties { + /** + * Create a MigrationItemProperties. + * @member {string} [machineName] The on-premise virtual machine name. + * @member {string} [policyId] The ARM Id of policy governing this item. + * @member {string} [policyFriendlyName] The name of policy governing this + * item. + * @member {string} [recoveryServicesProviderId] The recovery services + * provider ARM Id. + * @member {string} [migrationState] The migration status. Possible values + * include: 'None', 'EnableMigrationInProgress', 'EnableMigrationFailed', + * 'DisableMigrationInProgress', 'DisableMigrationFailed', + * 'InitialSeedingInProgress', 'InitialSeedingFailed', 'Replicating', + * 'MigrationInProgress', 'MigrationSucceeded', 'MigrationFailed' + * @member {string} [migrationStateDescription] The migration state + * description. + * @member {string} [testMigrateState] The test migrate state. Possible + * values include: 'None', 'TestMigrationInProgress', + * 'TestMigrationSucceeded', 'TestMigrationFailed', + * 'TestMigrationCleanupInProgress' + * @member {string} [testMigrateStateDescription] The test migrate state + * description. + * @member {string} [health] The consolidated health. + * @member {array} [healthErrors] The list of health errors. + * @member {array} [allowedOperations] The allowed operations on the + * migration item, based on the current migration state of the item. + * @member {object} [currentJob] The current job details. + * @member {string} [currentJob.jobName] The job name. + * @member {string} [currentJob.jobId] The ARM Id of the job being executed. + * @member {date} [currentJob.startTime] The start time of the job. + * @member {object} [providerSpecificDetails] The migration provider custom + * settings. + * @member {string} [providerSpecificDetails.instanceType] Polymorphic + * Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of MigrationItemProperties + * + * @returns {object} metadata of MigrationItemProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'MigrationItemProperties', + type: { + name: 'Composite', + className: 'MigrationItemProperties', + modelProperties: { + machineName: { + required: false, + readOnly: true, + serializedName: 'machineName', + type: { + name: 'String' + } + }, + policyId: { + required: false, + readOnly: true, + serializedName: 'policyId', + type: { + name: 'String' + } + }, + policyFriendlyName: { + required: false, + readOnly: true, + serializedName: 'policyFriendlyName', + type: { + name: 'String' + } + }, + recoveryServicesProviderId: { + required: false, + readOnly: true, + serializedName: 'recoveryServicesProviderId', + type: { + name: 'String' + } + }, + migrationState: { + required: false, + readOnly: true, + serializedName: 'migrationState', + type: { + name: 'String' + } + }, + migrationStateDescription: { + required: false, + readOnly: true, + serializedName: 'migrationStateDescription', + type: { + name: 'String' + } + }, + testMigrateState: { + required: false, + readOnly: true, + serializedName: 'testMigrateState', + type: { + name: 'String' + } + }, + testMigrateStateDescription: { + required: false, + readOnly: true, + serializedName: 'testMigrateStateDescription', + type: { + name: 'String' + } + }, + health: { + required: false, + readOnly: true, + serializedName: 'health', + type: { + name: 'String' + } + }, + healthErrors: { + required: false, + readOnly: true, + serializedName: 'healthErrors', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'HealthErrorElementType', + type: { + name: 'Composite', + className: 'HealthError' + } + } + } + }, + allowedOperations: { + required: false, + readOnly: true, + serializedName: 'allowedOperations', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'MigrationItemOperationElementType', + type: { + name: 'String' + } + } + } + }, + currentJob: { + required: false, + readOnly: true, + serializedName: 'currentJob', + type: { + name: 'Composite', + className: 'CurrentJobDetails' + } + }, + providerSpecificDetails: { + required: false, + serializedName: 'providerSpecificDetails', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'instanceType', + clientName: 'instanceType' + }, + uberParent: 'MigrationProviderSpecificSettings', + className: 'MigrationProviderSpecificSettings' + } + } + } + } + }; + } +} + +module.exports = MigrationItemProperties; diff --git a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/migrationItemsQueryParameter.js b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/migrationItemsQueryParameter.js new file mode 100644 index 0000000000..e75d1e9009 --- /dev/null +++ b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/migrationItemsQueryParameter.js @@ -0,0 +1,60 @@ +/* + * 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'; + +/** + * Query parameter to enumerate migration items. + * + */ +class MigrationItemsQueryParameter { + /** + * Create a MigrationItemsQueryParameter. + * @member {string} [sourceFabricName] The source fabric name filter. + * @member {string} [instanceType] The replication provider type. + */ + constructor() { + } + + /** + * Defines the metadata of MigrationItemsQueryParameter + * + * @returns {object} metadata of MigrationItemsQueryParameter + * + */ + mapper() { + return { + required: false, + serializedName: 'MigrationItemsQueryParameter', + type: { + name: 'Composite', + className: 'MigrationItemsQueryParameter', + modelProperties: { + sourceFabricName: { + required: false, + serializedName: 'sourceFabricName', + type: { + name: 'String' + } + }, + instanceType: { + required: false, + serializedName: 'instanceType', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = MigrationItemsQueryParameter; diff --git a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/migrationProviderSpecificSettings.js b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/migrationProviderSpecificSettings.js new file mode 100644 index 0000000000..5e334833a2 --- /dev/null +++ b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/migrationProviderSpecificSettings.js @@ -0,0 +1,58 @@ +/* + * 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'; + +/** + * Migration provider specific settings. + * + */ +class MigrationProviderSpecificSettings { + /** + * Create a MigrationProviderSpecificSettings. + * @member {string} instanceType Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of MigrationProviderSpecificSettings + * + * @returns {object} metadata of MigrationProviderSpecificSettings + * + */ + mapper() { + return { + required: false, + serializedName: 'MigrationProviderSpecificSettings', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'instanceType', + clientName: 'instanceType' + }, + uberParent: 'MigrationProviderSpecificSettings', + className: 'MigrationProviderSpecificSettings', + modelProperties: { + instanceType: { + required: true, + serializedName: 'instanceType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = MigrationProviderSpecificSettings; diff --git a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/migrationRecoveryPoint.js b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/migrationRecoveryPoint.js new file mode 100644 index 0000000000..17f80865b0 --- /dev/null +++ b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/migrationRecoveryPoint.js @@ -0,0 +1,92 @@ +/* + * 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'; + +const models = require('./index'); + +/** + * Recovery point for a migration item. + * + * @extends models['Resource'] + */ +class MigrationRecoveryPoint extends models['Resource'] { + /** + * Create a MigrationRecoveryPoint. + * @member {object} [properties] Recovery point properties. + * @member {date} [properties.recoveryPointTime] The recovery point time. + * @member {string} [properties.recoveryPointType] The recovery point type. + * Possible values include: 'NotSpecified', 'ApplicationConsistent', + * 'CrashConsistent' + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MigrationRecoveryPoint + * + * @returns {object} metadata of MigrationRecoveryPoint + * + */ + mapper() { + return { + required: false, + serializedName: 'MigrationRecoveryPoint', + type: { + name: 'Composite', + className: 'MigrationRecoveryPoint', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + properties: { + required: false, + serializedName: 'properties', + type: { + name: 'Composite', + className: 'MigrationRecoveryPointProperties' + } + } + } + } + }; + } +} + +module.exports = MigrationRecoveryPoint; diff --git a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/migrationRecoveryPointCollection.js b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/migrationRecoveryPointCollection.js new file mode 100644 index 0000000000..96396cdb86 --- /dev/null +++ b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/migrationRecoveryPointCollection.js @@ -0,0 +1,67 @@ +/* + * 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'; + +/** + * Collection of migration recovery points. + */ +class MigrationRecoveryPointCollection extends Array { + /** + * Create a MigrationRecoveryPointCollection. + * @member {string} [nextLink] The value of next link. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MigrationRecoveryPointCollection + * + * @returns {object} metadata of MigrationRecoveryPointCollection + * + */ + mapper() { + return { + required: false, + serializedName: 'MigrationRecoveryPointCollection', + type: { + name: 'Composite', + className: 'MigrationRecoveryPointCollection', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'MigrationRecoveryPointElementType', + type: { + name: 'Composite', + className: 'MigrationRecoveryPoint' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = MigrationRecoveryPointCollection; diff --git a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/migrationRecoveryPointProperties.js b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/migrationRecoveryPointProperties.js new file mode 100644 index 0000000000..ba9c04f5bd --- /dev/null +++ b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/migrationRecoveryPointProperties.js @@ -0,0 +1,63 @@ +/* + * 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'; + +/** + * Migration item recovery point properties. + * + */ +class MigrationRecoveryPointProperties { + /** + * Create a MigrationRecoveryPointProperties. + * @member {date} [recoveryPointTime] The recovery point time. + * @member {string} [recoveryPointType] The recovery point type. Possible + * values include: 'NotSpecified', 'ApplicationConsistent', 'CrashConsistent' + */ + constructor() { + } + + /** + * Defines the metadata of MigrationRecoveryPointProperties + * + * @returns {object} metadata of MigrationRecoveryPointProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'MigrationRecoveryPointProperties', + type: { + name: 'Composite', + className: 'MigrationRecoveryPointProperties', + modelProperties: { + recoveryPointTime: { + required: false, + readOnly: true, + serializedName: 'recoveryPointTime', + type: { + name: 'DateTime' + } + }, + recoveryPointType: { + required: false, + readOnly: true, + serializedName: 'recoveryPointType', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = MigrationRecoveryPointProperties; diff --git a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/recoveryServicesProvider.js b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/recoveryServicesProvider.js index 77b1feb23f..fe2847cbcc 100644 --- a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/recoveryServicesProvider.js +++ b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/recoveryServicesProvider.js @@ -40,29 +40,46 @@ class RecoveryServicesProvider extends models['Resource'] { * @member {array} [properties.healthErrorDetails] The recovery services * provider health error details. * @member {string} [properties.draIdentifier] The DRA Id. - * @member {object} [properties.identityDetails] The identity details. - * @member {string} [properties.identityDetails.identityProviderType] The - * identity provider type. Value is the ToString() of a IdentityProviderType - * value. Possible values include: 'RecoveryServicesActiveDirectory' - * @member {string} [properties.identityDetails.tenantId] The tenant Id for - * the service principal with which the on-premise management/data plane - * components would communicate with our Azure services. - * @member {string} [properties.identityDetails.applicationId] The - * application/client Id for the service principal with which the on-premise + * @member {object} [properties.authenticationIdentityDetails] The + * authentication identity details. + * @member {string} [properties.authenticationIdentityDetails.tenantId] The + * tenant Id for the service principal with which the on-premise * management/data plane components would communicate with our Azure * services. - * @member {string} [properties.identityDetails.objectId] The object Id of - * the service principal with which the on-premise management/data plane - * components would communicate with our Azure services. - * @member {string} [properties.identityDetails.audience] The intended - * Audience of the service principal with which the on-premise + * @member {string} [properties.authenticationIdentityDetails.applicationId] + * The application/client Id for the service principal with which the + * on-premise management/data plane components would communicate with our + * Azure services. + * @member {string} [properties.authenticationIdentityDetails.objectId] The + * object Id of the service principal with which the on-premise * management/data plane components would communicate with our Azure * services. - * @member {string} [properties.identityDetails.aadAuthority] The base - * authority for Azure Active Directory authentication. - * @member {string} [properties.identityDetails.certificateThumbprint] The - * certificate thumbprint. Applicable only if IdentityProviderType is - * RecoveryServicesActiveDirectory. + * @member {string} [properties.authenticationIdentityDetails.audience] The + * intended Audience of the service principal with which the on-premise + * management/data plane components would communicate with our Azure + * services. + * @member {string} [properties.authenticationIdentityDetails.aadAuthority] + * The base authority for Azure Active Directory authentication. + * @member {object} [properties.resourceAccessIdentityDetails] The resource + * access identity details. + * @member {string} [properties.resourceAccessIdentityDetails.tenantId] The + * tenant Id for the service principal with which the on-premise + * management/data plane components would communicate with our Azure + * services. + * @member {string} [properties.resourceAccessIdentityDetails.applicationId] + * The application/client Id for the service principal with which the + * on-premise management/data plane components would communicate with our + * Azure services. + * @member {string} [properties.resourceAccessIdentityDetails.objectId] The + * object Id of the service principal with which the on-premise + * management/data plane components would communicate with our Azure + * services. + * @member {string} [properties.resourceAccessIdentityDetails.audience] The + * intended Audience of the service principal with which the on-premise + * management/data plane components would communicate with our Azure + * services. + * @member {string} [properties.resourceAccessIdentityDetails.aadAuthority] + * The base authority for Azure Active Directory authentication. * @member {object} [properties.providerVersionDetails] The provider version * details. * @member {string} [properties.providerVersionDetails.version] The agent diff --git a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/recoveryServicesProviderProperties.js b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/recoveryServicesProviderProperties.js index 3add39cb8f..437ae8d8e0 100644 --- a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/recoveryServicesProviderProperties.js +++ b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/recoveryServicesProviderProperties.js @@ -34,27 +34,42 @@ class RecoveryServicesProviderProperties { * @member {array} [healthErrorDetails] The recovery services provider health * error details. * @member {string} [draIdentifier] The DRA Id. - * @member {object} [identityDetails] The identity details. - * @member {string} [identityDetails.identityProviderType] The identity - * provider type. Value is the ToString() of a IdentityProviderType value. - * Possible values include: 'RecoveryServicesActiveDirectory' - * @member {string} [identityDetails.tenantId] The tenant Id for the service - * principal with which the on-premise management/data plane components would - * communicate with our Azure services. - * @member {string} [identityDetails.applicationId] The application/client Id + * @member {object} [authenticationIdentityDetails] The authentication + * identity details. + * @member {string} [authenticationIdentityDetails.tenantId] The tenant Id * for the service principal with which the on-premise management/data plane * components would communicate with our Azure services. - * @member {string} [identityDetails.objectId] The object Id of the service - * principal with which the on-premise management/data plane components would - * communicate with our Azure services. - * @member {string} [identityDetails.audience] The intended Audience of the - * service principal with which the on-premise management/data plane + * @member {string} [authenticationIdentityDetails.applicationId] The + * application/client Id for the service principal with which the on-premise + * management/data plane components would communicate with our Azure + * services. + * @member {string} [authenticationIdentityDetails.objectId] The object Id of + * the service principal with which the on-premise management/data plane * components would communicate with our Azure services. - * @member {string} [identityDetails.aadAuthority] The base authority for - * Azure Active Directory authentication. - * @member {string} [identityDetails.certificateThumbprint] The certificate - * thumbprint. Applicable only if IdentityProviderType is - * RecoveryServicesActiveDirectory. + * @member {string} [authenticationIdentityDetails.audience] The intended + * Audience of the service principal with which the on-premise + * management/data plane components would communicate with our Azure + * services. + * @member {string} [authenticationIdentityDetails.aadAuthority] The base + * authority for Azure Active Directory authentication. + * @member {object} [resourceAccessIdentityDetails] The resource access + * identity details. + * @member {string} [resourceAccessIdentityDetails.tenantId] The tenant Id + * for the service principal with which the on-premise management/data plane + * components would communicate with our Azure services. + * @member {string} [resourceAccessIdentityDetails.applicationId] The + * application/client Id for the service principal with which the on-premise + * management/data plane components would communicate with our Azure + * services. + * @member {string} [resourceAccessIdentityDetails.objectId] The object Id of + * the service principal with which the on-premise management/data plane + * components would communicate with our Azure services. + * @member {string} [resourceAccessIdentityDetails.audience] The intended + * Audience of the service principal with which the on-premise + * management/data plane components would communicate with our Azure + * services. + * @member {string} [resourceAccessIdentityDetails.aadAuthority] The base + * authority for Azure Active Directory authentication. * @member {object} [providerVersionDetails] The provider version details. * @member {string} [providerVersionDetails.version] The agent version. * @member {date} [providerVersionDetails.expiryDate] Version expiry date. @@ -185,12 +200,20 @@ class RecoveryServicesProviderProperties { name: 'String' } }, - identityDetails: { + authenticationIdentityDetails: { + required: false, + serializedName: 'authenticationIdentityDetails', + type: { + name: 'Composite', + className: 'IdentityProviderDetails' + } + }, + resourceAccessIdentityDetails: { required: false, - serializedName: 'identityDetails', + serializedName: 'resourceAccessIdentityDetails', type: { name: 'Composite', - className: 'IdentityInformation' + className: 'IdentityProviderDetails' } }, providerVersionDetails: { diff --git a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/testMigrateCleanupInput.js b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/testMigrateCleanupInput.js new file mode 100644 index 0000000000..6ca92523cd --- /dev/null +++ b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/testMigrateCleanupInput.js @@ -0,0 +1,54 @@ +/* + * 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'; + +/** + * Input for test migrate cleanup. + * + */ +class TestMigrateCleanupInput { + /** + * Create a TestMigrateCleanupInput. + * @member {object} properties Test migrate cleanup input properties. + * @member {string} [properties.comments] Test migrate cleanup comments. + */ + constructor() { + } + + /** + * Defines the metadata of TestMigrateCleanupInput + * + * @returns {object} metadata of TestMigrateCleanupInput + * + */ + mapper() { + return { + required: false, + serializedName: 'TestMigrateCleanupInput', + type: { + name: 'Composite', + className: 'TestMigrateCleanupInput', + modelProperties: { + properties: { + required: true, + serializedName: 'properties', + type: { + name: 'Composite', + className: 'TestMigrateCleanupInputProperties' + } + } + } + } + }; + } +} + +module.exports = TestMigrateCleanupInput; diff --git a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/testMigrateCleanupInputProperties.js b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/testMigrateCleanupInputProperties.js new file mode 100644 index 0000000000..9faf3dd5f9 --- /dev/null +++ b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/testMigrateCleanupInputProperties.js @@ -0,0 +1,52 @@ +/* + * 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'; + +/** + * Test migrate cleanup input properties. + * + */ +class TestMigrateCleanupInputProperties { + /** + * Create a TestMigrateCleanupInputProperties. + * @member {string} [comments] Test migrate cleanup comments. + */ + constructor() { + } + + /** + * Defines the metadata of TestMigrateCleanupInputProperties + * + * @returns {object} metadata of TestMigrateCleanupInputProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'TestMigrateCleanupInputProperties', + type: { + name: 'Composite', + className: 'TestMigrateCleanupInputProperties', + modelProperties: { + comments: { + required: false, + serializedName: 'comments', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = TestMigrateCleanupInputProperties; diff --git a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/testMigrateInput.js b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/testMigrateInput.js new file mode 100644 index 0000000000..c4e3102849 --- /dev/null +++ b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/testMigrateInput.js @@ -0,0 +1,57 @@ +/* + * 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'; + +/** + * Input for test migrate. + * + */ +class TestMigrateInput { + /** + * Create a TestMigrateInput. + * @member {object} properties Test migrate input properties. + * @member {object} [properties.providerSpecificDetails] The provider + * specific details. + * @member {string} [properties.providerSpecificDetails.instanceType] + * Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of TestMigrateInput + * + * @returns {object} metadata of TestMigrateInput + * + */ + mapper() { + return { + required: false, + serializedName: 'TestMigrateInput', + type: { + name: 'Composite', + className: 'TestMigrateInput', + modelProperties: { + properties: { + required: true, + serializedName: 'properties', + type: { + name: 'Composite', + className: 'TestMigrateInputProperties' + } + } + } + } + }; + } +} + +module.exports = TestMigrateInput; diff --git a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/testMigrateInputProperties.js b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/testMigrateInputProperties.js new file mode 100644 index 0000000000..798dac5296 --- /dev/null +++ b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/testMigrateInputProperties.js @@ -0,0 +1,60 @@ +/* + * 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'; + +/** + * Test migrate input properties. + * + */ +class TestMigrateInputProperties { + /** + * Create a TestMigrateInputProperties. + * @member {object} providerSpecificDetails The provider specific details. + * @member {string} [providerSpecificDetails.instanceType] Polymorphic + * Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of TestMigrateInputProperties + * + * @returns {object} metadata of TestMigrateInputProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'TestMigrateInputProperties', + type: { + name: 'Composite', + className: 'TestMigrateInputProperties', + modelProperties: { + providerSpecificDetails: { + required: true, + serializedName: 'providerSpecificDetails', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'instanceType', + clientName: 'instanceType' + }, + uberParent: 'TestMigrateProviderSpecificInput', + className: 'TestMigrateProviderSpecificInput' + } + } + } + } + }; + } +} + +module.exports = TestMigrateInputProperties; diff --git a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/testMigrateProviderSpecificInput.js b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/testMigrateProviderSpecificInput.js new file mode 100644 index 0000000000..a9389e6bb5 --- /dev/null +++ b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/testMigrateProviderSpecificInput.js @@ -0,0 +1,58 @@ +/* + * 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'; + +/** + * Test migrate provider specific input. + * + */ +class TestMigrateProviderSpecificInput { + /** + * Create a TestMigrateProviderSpecificInput. + * @member {string} instanceType Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of TestMigrateProviderSpecificInput + * + * @returns {object} metadata of TestMigrateProviderSpecificInput + * + */ + mapper() { + return { + required: false, + serializedName: 'TestMigrateProviderSpecificInput', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'instanceType', + clientName: 'instanceType' + }, + uberParent: 'TestMigrateProviderSpecificInput', + className: 'TestMigrateProviderSpecificInput', + modelProperties: { + instanceType: { + required: true, + serializedName: 'instanceType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = TestMigrateProviderSpecificInput; diff --git a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/updateMigrationItemInput.js b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/updateMigrationItemInput.js new file mode 100644 index 0000000000..d6b2d009f4 --- /dev/null +++ b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/updateMigrationItemInput.js @@ -0,0 +1,57 @@ +/* + * 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'; + +/** + * Update migration item input. + * + */ +class UpdateMigrationItemInput { + /** + * Create a UpdateMigrationItemInput. + * @member {object} [properties] Update migration item input properties. + * @member {object} [properties.providerSpecificDetails] The provider + * specific input to update migration item. + * @member {string} [properties.providerSpecificDetails.instanceType] + * Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of UpdateMigrationItemInput + * + * @returns {object} metadata of UpdateMigrationItemInput + * + */ + mapper() { + return { + required: false, + serializedName: 'UpdateMigrationItemInput', + type: { + name: 'Composite', + className: 'UpdateMigrationItemInput', + modelProperties: { + properties: { + required: false, + serializedName: 'properties', + type: { + name: 'Composite', + className: 'UpdateMigrationItemInputProperties' + } + } + } + } + }; + } +} + +module.exports = UpdateMigrationItemInput; diff --git a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/updateMigrationItemInputProperties.js b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/updateMigrationItemInputProperties.js new file mode 100644 index 0000000000..55d6938318 --- /dev/null +++ b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/updateMigrationItemInputProperties.js @@ -0,0 +1,61 @@ +/* + * 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'; + +/** + * Update migration item input properties. + * + */ +class UpdateMigrationItemInputProperties { + /** + * Create a UpdateMigrationItemInputProperties. + * @member {object} providerSpecificDetails The provider specific input to + * update migration item. + * @member {string} [providerSpecificDetails.instanceType] Polymorphic + * Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of UpdateMigrationItemInputProperties + * + * @returns {object} metadata of UpdateMigrationItemInputProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'UpdateMigrationItemInputProperties', + type: { + name: 'Composite', + className: 'UpdateMigrationItemInputProperties', + modelProperties: { + providerSpecificDetails: { + required: true, + serializedName: 'providerSpecificDetails', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'instanceType', + clientName: 'instanceType' + }, + uberParent: 'UpdateMigrationItemProviderSpecificInput', + className: 'UpdateMigrationItemProviderSpecificInput' + } + } + } + } + }; + } +} + +module.exports = UpdateMigrationItemInputProperties; diff --git a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/updateMigrationItemProviderSpecificInput.js b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/updateMigrationItemProviderSpecificInput.js new file mode 100644 index 0000000000..4cff2459e8 --- /dev/null +++ b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/updateMigrationItemProviderSpecificInput.js @@ -0,0 +1,58 @@ +/* + * 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'; + +/** + * Update migration item provider specific input. + * + */ +class UpdateMigrationItemProviderSpecificInput { + /** + * Create a UpdateMigrationItemProviderSpecificInput. + * @member {string} instanceType Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of UpdateMigrationItemProviderSpecificInput + * + * @returns {object} metadata of UpdateMigrationItemProviderSpecificInput + * + */ + mapper() { + return { + required: false, + serializedName: 'UpdateMigrationItemProviderSpecificInput', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'instanceType', + clientName: 'instanceType' + }, + uberParent: 'UpdateMigrationItemProviderSpecificInput', + className: 'UpdateMigrationItemProviderSpecificInput', + modelProperties: { + instanceType: { + required: true, + serializedName: 'instanceType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = UpdateMigrationItemProviderSpecificInput; diff --git a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/vMwareCbtContainerCreationInput.js b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/vMwareCbtContainerCreationInput.js new file mode 100644 index 0000000000..b25ed44964 --- /dev/null +++ b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/vMwareCbtContainerCreationInput.js @@ -0,0 +1,61 @@ +/* + * 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'; + +const models = require('./index'); + +/** + * VMwareCbt container creation input. + * + * @extends models['ReplicationProviderSpecificContainerCreationInput'] + */ +class VMwareCbtContainerCreationInput extends models['ReplicationProviderSpecificContainerCreationInput'] { + /** + * Create a VMwareCbtContainerCreationInput. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VMwareCbtContainerCreationInput + * + * @returns {object} metadata of VMwareCbtContainerCreationInput + * + */ + mapper() { + return { + required: false, + serializedName: '6c7da455-506f-43ff-a16a-8eb101aebb70', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'instanceType', + clientName: 'instanceType' + }, + uberParent: 'ReplicationProviderSpecificContainerCreationInput', + className: 'VMwareCbtContainerCreationInput', + modelProperties: { + instanceType: { + required: true, + serializedName: 'instanceType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VMwareCbtContainerCreationInput; diff --git a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/vMwareCbtContainerMappingInput.js b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/vMwareCbtContainerMappingInput.js new file mode 100644 index 0000000000..84e96cab4a --- /dev/null +++ b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/vMwareCbtContainerMappingInput.js @@ -0,0 +1,111 @@ +/* + * 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'; + +const models = require('./index'); + +/** + * VMwareCbt container mapping input. + * + * @extends models['ReplicationProviderSpecificContainerMappingInput'] + */ +class VMwareCbtContainerMappingInput extends models['ReplicationProviderSpecificContainerMappingInput'] { + /** + * Create a VMwareCbtContainerMappingInput. + * @member {string} keyVaultId The target key vault ARM Id. + * @member {string} keyVaultUri The target key vault URL. + * @member {string} storageAccountId The storage account ARM Id. + * @member {string} storageAccountSasSecretName The secret name of the + * storage account. + * @member {string} serviceBusConnectionStringSecretName The secret name of + * the service bus connection string. + * @member {string} targetLocation The target location. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VMwareCbtContainerMappingInput + * + * @returns {object} metadata of VMwareCbtContainerMappingInput + * + */ + mapper() { + return { + required: false, + serializedName: 'VMwareCbt', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'instanceType', + clientName: 'instanceType' + }, + uberParent: 'ReplicationProviderSpecificContainerMappingInput', + className: 'VMwareCbtContainerMappingInput', + modelProperties: { + instanceType: { + required: true, + serializedName: 'instanceType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + keyVaultId: { + required: true, + serializedName: 'keyVaultId', + type: { + name: 'String' + } + }, + keyVaultUri: { + required: true, + serializedName: 'keyVaultUri', + type: { + name: 'String' + } + }, + storageAccountId: { + required: true, + serializedName: 'storageAccountId', + type: { + name: 'String' + } + }, + storageAccountSasSecretName: { + required: true, + serializedName: 'storageAccountSasSecretName', + type: { + name: 'String' + } + }, + serviceBusConnectionStringSecretName: { + required: true, + serializedName: 'serviceBusConnectionStringSecretName', + type: { + name: 'String' + } + }, + targetLocation: { + required: true, + serializedName: 'targetLocation', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VMwareCbtContainerMappingInput; diff --git a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/vMwareCbtDiskInput.js b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/vMwareCbtDiskInput.js new file mode 100644 index 0000000000..fe9991bb12 --- /dev/null +++ b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/vMwareCbtDiskInput.js @@ -0,0 +1,87 @@ +/* + * 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'; + +/** + * VMwareCbt disk input. + * + */ +class VMwareCbtDiskInput { + /** + * Create a VMwareCbtDiskInput. + * @member {string} diskId The disk Id. + * @member {string} isOSDisk A value indicating whether the disk is the OS + * disk. + * @member {string} logStorageAccountId The log storage account ARM Id. + * @member {string} logStorageAccountSasSecretName The key vault secret name + * of the log storage account. + * @member {string} [diskType] The disk type. Possible values include: + * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS' + */ + constructor() { + } + + /** + * Defines the metadata of VMwareCbtDiskInput + * + * @returns {object} metadata of VMwareCbtDiskInput + * + */ + mapper() { + return { + required: false, + serializedName: 'VMwareCbtDiskInput', + type: { + name: 'Composite', + className: 'VMwareCbtDiskInput', + modelProperties: { + diskId: { + required: true, + serializedName: 'diskId', + type: { + name: 'String' + } + }, + isOSDisk: { + required: true, + serializedName: 'isOSDisk', + type: { + name: 'String' + } + }, + logStorageAccountId: { + required: true, + serializedName: 'logStorageAccountId', + type: { + name: 'String' + } + }, + logStorageAccountSasSecretName: { + required: true, + serializedName: 'logStorageAccountSasSecretName', + type: { + name: 'String' + } + }, + diskType: { + required: false, + serializedName: 'diskType', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VMwareCbtDiskInput; diff --git a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/vMwareCbtEnableMigrationInput.js b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/vMwareCbtEnableMigrationInput.js new file mode 100644 index 0000000000..98b057fc5f --- /dev/null +++ b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/vMwareCbtEnableMigrationInput.js @@ -0,0 +1,169 @@ +/* + * 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'; + +const models = require('./index'); + +/** + * VMwareCbt specific enable migration input. + * + * @extends models['EnableMigrationProviderSpecificInput'] + */ +class VMwareCbtEnableMigrationInput extends models['EnableMigrationProviderSpecificInput'] { + /** + * Create a VMwareCbtEnableMigrationInput. + * @member {string} vmwareMachineId The ARM Id of the VM discovered in + * VMware. + * @member {array} disksToInclude The disks to include list. + * @member {string} [licenseType] License type. Possible values include: + * 'NotSpecified', 'NoLicenseType', 'WindowsServer' + * @member {string} dataMoverRunAsAccountId The data mover runas account Id. + * @member {string} snapshotRunAsAccountId The snapshot runas account Id. + * @member {string} [targetVmName] The target VM name. + * @member {string} [targetVmSize] The target VM size. + * @member {string} targetResourceGroupId The target resource group ARM Id. + * @member {string} targetNetworkId The target network ARM Id. + * @member {string} [targetSubnetName] The target subnet name. + * @member {string} [targetAvailabilitySetId] The target availability set ARM + * Id. + * @member {string} [targetBootDiagnosticsStorageAccountId] The target boot + * diagnostics storage account ARM Id. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VMwareCbtEnableMigrationInput + * + * @returns {object} metadata of VMwareCbtEnableMigrationInput + * + */ + mapper() { + return { + required: false, + serializedName: 'VMwareCbt', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'instanceType', + clientName: 'instanceType' + }, + uberParent: 'EnableMigrationProviderSpecificInput', + className: 'VMwareCbtEnableMigrationInput', + modelProperties: { + instanceType: { + required: true, + serializedName: 'instanceType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + vmwareMachineId: { + required: true, + serializedName: 'vmwareMachineId', + type: { + name: 'String' + } + }, + disksToInclude: { + required: true, + serializedName: 'disksToInclude', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VMwareCbtDiskInputElementType', + type: { + name: 'Composite', + className: 'VMwareCbtDiskInput' + } + } + } + }, + licenseType: { + required: false, + serializedName: 'licenseType', + type: { + name: 'String' + } + }, + dataMoverRunAsAccountId: { + required: true, + serializedName: 'dataMoverRunAsAccountId', + type: { + name: 'String' + } + }, + snapshotRunAsAccountId: { + required: true, + serializedName: 'snapshotRunAsAccountId', + type: { + name: 'String' + } + }, + targetVmName: { + required: false, + serializedName: 'targetVmName', + type: { + name: 'String' + } + }, + targetVmSize: { + required: false, + serializedName: 'targetVmSize', + type: { + name: 'String' + } + }, + targetResourceGroupId: { + required: true, + serializedName: 'targetResourceGroupId', + type: { + name: 'String' + } + }, + targetNetworkId: { + required: true, + serializedName: 'targetNetworkId', + type: { + name: 'String' + } + }, + targetSubnetName: { + required: false, + serializedName: 'targetSubnetName', + type: { + name: 'String' + } + }, + targetAvailabilitySetId: { + required: false, + serializedName: 'targetAvailabilitySetId', + type: { + name: 'String' + } + }, + targetBootDiagnosticsStorageAccountId: { + required: false, + serializedName: 'targetBootDiagnosticsStorageAccountId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VMwareCbtEnableMigrationInput; diff --git a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/vMwareCbtMigrateInput.js b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/vMwareCbtMigrateInput.js new file mode 100644 index 0000000000..d70f9e1a92 --- /dev/null +++ b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/vMwareCbtMigrateInput.js @@ -0,0 +1,70 @@ +/* + * 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'; + +const models = require('./index'); + +/** + * VMwareCbt specific migrate input. + * + * @extends models['MigrateProviderSpecificInput'] + */ +class VMwareCbtMigrateInput extends models['MigrateProviderSpecificInput'] { + /** + * Create a VMwareCbtMigrateInput. + * @member {string} performShutdown A value indicating whether VM is to be + * shutdown. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VMwareCbtMigrateInput + * + * @returns {object} metadata of VMwareCbtMigrateInput + * + */ + mapper() { + return { + required: false, + serializedName: 'VMwareCbt', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'instanceType', + clientName: 'instanceType' + }, + uberParent: 'MigrateProviderSpecificInput', + className: 'VMwareCbtMigrateInput', + modelProperties: { + instanceType: { + required: true, + serializedName: 'instanceType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + performShutdown: { + required: true, + serializedName: 'performShutdown', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VMwareCbtMigrateInput; diff --git a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/vMwareCbtMigrationDetails.js b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/vMwareCbtMigrationDetails.js new file mode 100644 index 0000000000..62c5d3c8d6 --- /dev/null +++ b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/vMwareCbtMigrationDetails.js @@ -0,0 +1,217 @@ +/* + * 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'; + +const models = require('./index'); + +/** + * VMwareCbt provider specific settings + * + * @extends models['MigrationProviderSpecificSettings'] + */ +class VMwareCbtMigrationDetails extends models['MigrationProviderSpecificSettings'] { + /** + * Create a VMwareCbtMigrationDetails. + * @member {string} [vmwareMachineId] The ARM Id of the VM discovered in + * VMware. + * @member {string} [osType] The type of the OS on the VM. + * @member {string} [licenseType] License Type of the VM to be used. + * @member {string} [dataMoverRunAsAccountId] The data mover runas account + * Id. + * @member {string} [snapshotRunAsAccountId] The snapshot runas account Id. + * @member {string} [targetVmName] Target VM name. + * @member {string} [targetVmSize] The target VM size. + * @member {string} [targetLocation] The target location. + * @member {string} [targetResourceGroupId] The target resource group Id. + * @member {string} [targetAvailabilitySetId] The target availability set Id. + * @member {string} [targetBootDiagnosticsStorageAccountId] The target boot + * diagnostics storage account ARM Id. + * @member {array} [protectedDisks] The list of protected disks. + * @member {string} [targetNetworkId] The target network Id. + * @member {array} [vmNics] The network details. + * @member {string} [migrationRecoveryPointId] The recovery point Id to which + * the VM was migrated. + * @member {date} [lastRecoveryPointReceived] The last recovery point + * received time. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VMwareCbtMigrationDetails + * + * @returns {object} metadata of VMwareCbtMigrationDetails + * + */ + mapper() { + return { + required: false, + serializedName: 'VMwareCbt', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'instanceType', + clientName: 'instanceType' + }, + uberParent: 'MigrationProviderSpecificSettings', + className: 'VMwareCbtMigrationDetails', + modelProperties: { + instanceType: { + required: true, + serializedName: 'instanceType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + vmwareMachineId: { + required: false, + readOnly: true, + serializedName: 'vmwareMachineId', + type: { + name: 'String' + } + }, + osType: { + required: false, + readOnly: true, + serializedName: 'osType', + type: { + name: 'String' + } + }, + licenseType: { + required: false, + serializedName: 'licenseType', + type: { + name: 'String' + } + }, + dataMoverRunAsAccountId: { + required: false, + readOnly: true, + serializedName: 'dataMoverRunAsAccountId', + type: { + name: 'String' + } + }, + snapshotRunAsAccountId: { + required: false, + readOnly: true, + serializedName: 'snapshotRunAsAccountId', + type: { + name: 'String' + } + }, + targetVmName: { + required: false, + serializedName: 'targetVmName', + type: { + name: 'String' + } + }, + targetVmSize: { + required: false, + serializedName: 'targetVmSize', + type: { + name: 'String' + } + }, + targetLocation: { + required: false, + readOnly: true, + serializedName: 'targetLocation', + type: { + name: 'String' + } + }, + targetResourceGroupId: { + required: false, + serializedName: 'targetResourceGroupId', + type: { + name: 'String' + } + }, + targetAvailabilitySetId: { + required: false, + serializedName: 'targetAvailabilitySetId', + type: { + name: 'String' + } + }, + targetBootDiagnosticsStorageAccountId: { + required: false, + serializedName: 'targetBootDiagnosticsStorageAccountId', + type: { + name: 'String' + } + }, + protectedDisks: { + required: false, + serializedName: 'protectedDisks', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VMwareCbtProtectedDiskDetailsElementType', + type: { + name: 'Composite', + className: 'VMwareCbtProtectedDiskDetails' + } + } + } + }, + targetNetworkId: { + required: false, + serializedName: 'targetNetworkId', + type: { + name: 'String' + } + }, + vmNics: { + required: false, + serializedName: 'vmNics', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VMwareCbtNicDetailsElementType', + type: { + name: 'Composite', + className: 'VMwareCbtNicDetails' + } + } + } + }, + migrationRecoveryPointId: { + required: false, + readOnly: true, + serializedName: 'migrationRecoveryPointId', + type: { + name: 'String' + } + }, + lastRecoveryPointReceived: { + required: false, + readOnly: true, + serializedName: 'lastRecoveryPointReceived', + type: { + name: 'DateTime' + } + } + } + } + }; + } +} + +module.exports = VMwareCbtMigrationDetails; diff --git a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/vMwareCbtNicDetails.js b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/vMwareCbtNicDetails.js new file mode 100644 index 0000000000..fd8ab768af --- /dev/null +++ b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/vMwareCbtNicDetails.js @@ -0,0 +1,124 @@ +/* + * 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'; + +/** + * VMwareCbt NIC details. + * + */ +class VMwareCbtNicDetails { + /** + * Create a VMwareCbtNicDetails. + * @member {string} [nicId] The NIC Id. + * @member {string} [isPrimaryNic] A value indicating whether this is the + * primary NIC. + * @member {string} [sourceIPAddress] The source IP address. + * @member {string} [sourceIPAddressType] The source IP address type. + * Possible values include: 'Dynamic', 'Static' + * @member {string} [sourceNetworkId] Source network Id. + * @member {string} [targetIPAddress] The target IP address. + * @member {string} [targetIPAddressType] The target IP address type. + * Possible values include: 'Dynamic', 'Static' + * @member {string} [targetSubnetName] Target subnet name. + * @member {string} [isSelectedForMigration] A value indicating whether this + * NIC is selected for migration. + */ + constructor() { + } + + /** + * Defines the metadata of VMwareCbtNicDetails + * + * @returns {object} metadata of VMwareCbtNicDetails + * + */ + mapper() { + return { + required: false, + serializedName: 'VMwareCbtNicDetails', + type: { + name: 'Composite', + className: 'VMwareCbtNicDetails', + modelProperties: { + nicId: { + required: false, + readOnly: true, + serializedName: 'nicId', + type: { + name: 'String' + } + }, + isPrimaryNic: { + required: false, + serializedName: 'isPrimaryNic', + type: { + name: 'String' + } + }, + sourceIPAddress: { + required: false, + readOnly: true, + serializedName: 'sourceIPAddress', + type: { + name: 'String' + } + }, + sourceIPAddressType: { + required: false, + readOnly: true, + serializedName: 'sourceIPAddressType', + type: { + name: 'String' + } + }, + sourceNetworkId: { + required: false, + readOnly: true, + serializedName: 'sourceNetworkId', + type: { + name: 'String' + } + }, + targetIPAddress: { + required: false, + serializedName: 'targetIPAddress', + type: { + name: 'String' + } + }, + targetIPAddressType: { + required: false, + serializedName: 'targetIPAddressType', + type: { + name: 'String' + } + }, + targetSubnetName: { + required: false, + serializedName: 'targetSubnetName', + type: { + name: 'String' + } + }, + isSelectedForMigration: { + required: false, + serializedName: 'isSelectedForMigration', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VMwareCbtNicDetails; diff --git a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/vMwareCbtNicInput.js b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/vMwareCbtNicInput.js new file mode 100644 index 0000000000..b2784ecd55 --- /dev/null +++ b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/vMwareCbtNicInput.js @@ -0,0 +1,86 @@ +/* + * 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'; + +/** + * VMwareCbt NIC input. + * + */ +class VMwareCbtNicInput { + /** + * Create a VMwareCbtNicInput. + * @member {string} nicId The NIC Id. + * @member {string} isPrimaryNic A value indicating whether this is the + * primary NIC. + * @member {string} [targetSubnetName] Target subnet name. + * @member {string} [targetStaticIPAddress] The static IP address. + * @member {string} [isSelectedForMigration] A value indicating whether this + * NIC is selected for migration. + */ + constructor() { + } + + /** + * Defines the metadata of VMwareCbtNicInput + * + * @returns {object} metadata of VMwareCbtNicInput + * + */ + mapper() { + return { + required: false, + serializedName: 'VMwareCbtNicInput', + type: { + name: 'Composite', + className: 'VMwareCbtNicInput', + modelProperties: { + nicId: { + required: true, + serializedName: 'nicId', + type: { + name: 'String' + } + }, + isPrimaryNic: { + required: true, + serializedName: 'isPrimaryNic', + type: { + name: 'String' + } + }, + targetSubnetName: { + required: false, + serializedName: 'targetSubnetName', + type: { + name: 'String' + } + }, + targetStaticIPAddress: { + required: false, + serializedName: 'targetStaticIPAddress', + type: { + name: 'String' + } + }, + isSelectedForMigration: { + required: false, + serializedName: 'isSelectedForMigration', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VMwareCbtNicInput; diff --git a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/vMwareCbtPolicyCreationInput.js b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/vMwareCbtPolicyCreationInput.js index 44c7cb21a5..c0e58386d4 100644 --- a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/vMwareCbtPolicyCreationInput.js +++ b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/vMwareCbtPolicyCreationInput.js @@ -13,15 +13,15 @@ const models = require('./index'); /** - * VMware Cbt Policy creation input. + * VMware Cbt policy creation input. * * @extends models['PolicyProviderSpecificInput'] */ class VMwareCbtPolicyCreationInput extends models['PolicyProviderSpecificInput'] { /** * Create a VMwareCbtPolicyCreationInput. - * @member {number} [recoveryPointHistory] The duration in minutes until - * which the recovery points need to be stored. + * @member {number} [recoveryPointHistoryInMinutes] The duration in minutes + * until which the recovery points need to be stored. * @member {number} [crashConsistentFrequencyInMinutes] The crash consistent * snapshot frequency (in minutes). * @member {number} [appConsistentFrequencyInMinutes] The app consistent @@ -58,9 +58,9 @@ class VMwareCbtPolicyCreationInput extends models['PolicyProviderSpecificInput'] name: 'String' } }, - recoveryPointHistory: { + recoveryPointHistoryInMinutes: { required: false, - serializedName: 'recoveryPointHistory', + serializedName: 'recoveryPointHistoryInMinutes', type: { name: 'Number' } diff --git a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/vMwareCbtProtectedDiskDetails.js b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/vMwareCbtProtectedDiskDetails.js new file mode 100644 index 0000000000..2acf167bf5 --- /dev/null +++ b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/vMwareCbtProtectedDiskDetails.js @@ -0,0 +1,137 @@ +/* + * 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'; + +/** + * VMwareCbt protected disk details. + * + */ +class VMwareCbtProtectedDiskDetails { + /** + * Create a VMwareCbtProtectedDiskDetails. + * @member {string} [diskId] The disk id. + * @member {string} [diskName] The disk name. + * @member {string} [diskPath] The disk path. + * @member {string} [isOSDisk] A value indicating whether the disk is the OS + * disk. + * @member {number} [capacityInBytes] The disk capacity in bytes. + * @member {string} [logStorageAccountId] The log storage account ARM Id. + * @member {string} [logStorageAccountSasSecretName] The key vault secret + * name of the log storage account. + * @member {string} [seedManagedDiskId] The ARM Id of the seed managed disk. + * @member {string} [targetManagedDiskId] The ARM Id of the target managed + * disk. + * @member {string} [diskType] The disk type. Possible values include: + * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS' + */ + constructor() { + } + + /** + * Defines the metadata of VMwareCbtProtectedDiskDetails + * + * @returns {object} metadata of VMwareCbtProtectedDiskDetails + * + */ + mapper() { + return { + required: false, + serializedName: 'VMwareCbtProtectedDiskDetails', + type: { + name: 'Composite', + className: 'VMwareCbtProtectedDiskDetails', + modelProperties: { + diskId: { + required: false, + readOnly: true, + serializedName: 'diskId', + type: { + name: 'String' + } + }, + diskName: { + required: false, + readOnly: true, + serializedName: 'diskName', + type: { + name: 'String' + } + }, + diskPath: { + required: false, + readOnly: true, + serializedName: 'diskPath', + type: { + name: 'String' + } + }, + isOSDisk: { + required: false, + readOnly: true, + serializedName: 'isOSDisk', + type: { + name: 'String' + } + }, + capacityInBytes: { + required: false, + readOnly: true, + serializedName: 'capacityInBytes', + type: { + name: 'Number' + } + }, + logStorageAccountId: { + required: false, + readOnly: true, + serializedName: 'logStorageAccountId', + type: { + name: 'String' + } + }, + logStorageAccountSasSecretName: { + required: false, + readOnly: true, + serializedName: 'logStorageAccountSasSecretName', + type: { + name: 'String' + } + }, + seedManagedDiskId: { + required: false, + readOnly: true, + serializedName: 'seedManagedDiskId', + type: { + name: 'String' + } + }, + targetManagedDiskId: { + required: false, + readOnly: true, + serializedName: 'targetManagedDiskId', + type: { + name: 'String' + } + }, + diskType: { + required: false, + serializedName: 'diskType', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VMwareCbtProtectedDiskDetails; diff --git a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/vMwareCbtProtectionContainerMappingDetails.js b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/vMwareCbtProtectionContainerMappingDetails.js new file mode 100644 index 0000000000..639d14aa9a --- /dev/null +++ b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/vMwareCbtProtectionContainerMappingDetails.js @@ -0,0 +1,117 @@ +/* + * 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'; + +const models = require('./index'); + +/** + * VMwareCbt provider specific container mapping details. + * + * @extends models['ProtectionContainerMappingProviderSpecificDetails'] + */ +class VMwareCbtProtectionContainerMappingDetails extends models['ProtectionContainerMappingProviderSpecificDetails'] { + /** + * Create a VMwareCbtProtectionContainerMappingDetails. + * @member {string} [keyVaultId] The target key vault ARM Id. + * @member {string} [keyVaultUri] The target key vault URI. + * @member {string} [storageAccountId] The storage account ARM Id. + * @member {string} [storageAccountSasSecretName] The secret name of the + * storage account. + * @member {string} [serviceBusConnectionStringSecretName] The secret name of + * the service bus connection string. + * @member {string} [targetLocation] The target location. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VMwareCbtProtectionContainerMappingDetails + * + * @returns {object} metadata of VMwareCbtProtectionContainerMappingDetails + * + */ + mapper() { + return { + required: false, + serializedName: 'VMwareCbt', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'instanceType', + clientName: 'instanceType' + }, + uberParent: 'ProtectionContainerMappingProviderSpecificDetails', + className: 'VMwareCbtProtectionContainerMappingDetails', + modelProperties: { + instanceType: { + required: true, + serializedName: 'instanceType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + keyVaultId: { + required: false, + readOnly: true, + serializedName: 'keyVaultId', + type: { + name: 'String' + } + }, + keyVaultUri: { + required: false, + readOnly: true, + serializedName: 'keyVaultUri', + type: { + name: 'String' + } + }, + storageAccountId: { + required: false, + readOnly: true, + serializedName: 'storageAccountId', + type: { + name: 'String' + } + }, + storageAccountSasSecretName: { + required: false, + readOnly: true, + serializedName: 'storageAccountSasSecretName', + type: { + name: 'String' + } + }, + serviceBusConnectionStringSecretName: { + required: false, + readOnly: true, + serializedName: 'serviceBusConnectionStringSecretName', + type: { + name: 'String' + } + }, + targetLocation: { + required: false, + readOnly: true, + serializedName: 'targetLocation', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VMwareCbtProtectionContainerMappingDetails; diff --git a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/vMwareCbtTestMigrateInput.js b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/vMwareCbtTestMigrateInput.js new file mode 100644 index 0000000000..5ff801155f --- /dev/null +++ b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/vMwareCbtTestMigrateInput.js @@ -0,0 +1,77 @@ +/* + * 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'; + +const models = require('./index'); + +/** + * VMwareCbt specific test migrate input. + * + * @extends models['TestMigrateProviderSpecificInput'] + */ +class VMwareCbtTestMigrateInput extends models['TestMigrateProviderSpecificInput'] { + /** + * Create a VMwareCbtTestMigrateInput. + * @member {string} recoveryPointId The recovery point Id. + * @member {string} networkId The test network Id. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VMwareCbtTestMigrateInput + * + * @returns {object} metadata of VMwareCbtTestMigrateInput + * + */ + mapper() { + return { + required: false, + serializedName: 'VMwareCbt', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'instanceType', + clientName: 'instanceType' + }, + uberParent: 'TestMigrateProviderSpecificInput', + className: 'VMwareCbtTestMigrateInput', + modelProperties: { + instanceType: { + required: true, + serializedName: 'instanceType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + recoveryPointId: { + required: true, + serializedName: 'recoveryPointId', + type: { + name: 'String' + } + }, + networkId: { + required: true, + serializedName: 'networkId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VMwareCbtTestMigrateInput; diff --git a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/vMwareCbtUpdateMigrationItemInput.js b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/vMwareCbtUpdateMigrationItemInput.js new file mode 100644 index 0000000000..2c6a71722e --- /dev/null +++ b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/vMwareCbtUpdateMigrationItemInput.js @@ -0,0 +1,136 @@ +/* + * 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'; + +const models = require('./index'); + +/** + * VMwareCbt specific update migration item input. + * + * @extends models['UpdateMigrationItemProviderSpecificInput'] + */ +class VMwareCbtUpdateMigrationItemInput extends models['UpdateMigrationItemProviderSpecificInput'] { + /** + * Create a VMwareCbtUpdateMigrationItemInput. + * @member {string} [targetVmName] The target VM name. + * @member {string} [targetVmSize] The target VM size. + * @member {string} [targetResourceGroupId] The target resource group ARM Id. + * @member {string} [targetAvailabilitySetId] The target availability set ARM + * Id. + * @member {string} [targetBootDiagnosticsStorageAccountId] The target boot + * diagnostics storage account ARM Id. + * @member {string} [targetNetworkId] The target network ARM Id. + * @member {array} [vmNics] The list of NIC details. + * @member {string} [licenseType] The license type. Possible values include: + * 'NotSpecified', 'NoLicenseType', 'WindowsServer' + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VMwareCbtUpdateMigrationItemInput + * + * @returns {object} metadata of VMwareCbtUpdateMigrationItemInput + * + */ + mapper() { + return { + required: false, + serializedName: 'VMwareCbt', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'instanceType', + clientName: 'instanceType' + }, + uberParent: 'UpdateMigrationItemProviderSpecificInput', + className: 'VMwareCbtUpdateMigrationItemInput', + modelProperties: { + instanceType: { + required: true, + serializedName: 'instanceType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + targetVmName: { + required: false, + serializedName: 'targetVmName', + type: { + name: 'String' + } + }, + targetVmSize: { + required: false, + serializedName: 'targetVmSize', + type: { + name: 'String' + } + }, + targetResourceGroupId: { + required: false, + serializedName: 'targetResourceGroupId', + type: { + name: 'String' + } + }, + targetAvailabilitySetId: { + required: false, + serializedName: 'targetAvailabilitySetId', + type: { + name: 'String' + } + }, + targetBootDiagnosticsStorageAccountId: { + required: false, + serializedName: 'targetBootDiagnosticsStorageAccountId', + type: { + name: 'String' + } + }, + targetNetworkId: { + required: false, + serializedName: 'targetNetworkId', + type: { + name: 'String' + } + }, + vmNics: { + required: false, + serializedName: 'vmNics', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VMwareCbtNicInputElementType', + type: { + name: 'Composite', + className: 'VMwareCbtNicInput' + } + } + } + }, + licenseType: { + required: false, + serializedName: 'licenseType', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VMwareCbtUpdateMigrationItemInput; diff --git a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/vMwareV2FabricCreationInput.js b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/vMwareV2FabricCreationInput.js index 0ad1b858e1..13f8b4e8d1 100644 --- a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/vMwareV2FabricCreationInput.js +++ b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/vMwareV2FabricCreationInput.js @@ -13,15 +13,15 @@ const models = require('./index'); /** - * Fabric provider specific settings. + * VMwareV2 fabric provider specific settings. * * @extends models['FabricSpecificCreationInput'] */ class VMwareV2FabricCreationInput extends models['FabricSpecificCreationInput'] { /** * Create a VMwareV2FabricCreationInput. - * @member {string} [keyVaultUrl] The Key Vault URL. - * @member {string} [keyVaultResourceArmId] The Key Vault ARM Id. + * @member {string} vmwareSiteId The ARM Id of the VMware site. + * @member {string} migrationSolutionId The ARM Id of the migration solution. */ constructor() { super(); @@ -54,16 +54,16 @@ class VMwareV2FabricCreationInput extends models['FabricSpecificCreationInput'] name: 'String' } }, - keyVaultUrl: { - required: false, - serializedName: 'keyVaultUrl', + vmwareSiteId: { + required: true, + serializedName: 'vmwareSiteId', type: { name: 'String' } }, - keyVaultResourceArmId: { - required: false, - serializedName: 'keyVaultResourceArmId', + migrationSolutionId: { + required: true, + serializedName: 'migrationSolutionId', type: { name: 'String' } diff --git a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/vMwareV2FabricSpecificDetails.js b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/vMwareV2FabricSpecificDetails.js index afd2f2a561..93812cecf0 100644 --- a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/vMwareV2FabricSpecificDetails.js +++ b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/vMwareV2FabricSpecificDetails.js @@ -13,19 +13,16 @@ const models = require('./index'); /** - * VMwareV2 fabric Specific Details. + * VMwareV2 fabric specific details. * * @extends models['FabricSpecificDetails'] */ class VMwareV2FabricSpecificDetails extends models['FabricSpecificDetails'] { /** * Create a VMwareV2FabricSpecificDetails. - * @member {string} [srsServiceEndpoint] The endpoint for making requests to - * the SRS Service. - * @member {string} [rcmServiceEndpoint] The endpoint for making requests to - * the RCM Service. - * @member {string} [keyVaultUrl] The Key Vault URL. - * @member {string} [keyVaultResourceArmId] The Key Vault ARM Id. + * @member {string} [vmwareSiteId] The ARM Id of the VMware site. + * @member {string} [migrationSolutionId] The Migration solution ARM Id. + * @member {string} [serviceEndpoint] The service endpoint. */ constructor() { super(); @@ -58,30 +55,26 @@ class VMwareV2FabricSpecificDetails extends models['FabricSpecificDetails'] { name: 'String' } }, - srsServiceEndpoint: { + vmwareSiteId: { required: false, - serializedName: 'srsServiceEndpoint', + readOnly: true, + serializedName: 'vmwareSiteId', type: { name: 'String' } }, - rcmServiceEndpoint: { + migrationSolutionId: { required: false, - serializedName: 'rcmServiceEndpoint', + readOnly: true, + serializedName: 'migrationSolutionId', type: { name: 'String' } }, - keyVaultUrl: { + serviceEndpoint: { required: false, - serializedName: 'keyVaultUrl', - type: { - name: 'String' - } - }, - keyVaultResourceArmId: { - required: false, - serializedName: 'keyVaultResourceArmId', + readOnly: true, + serializedName: 'serviceEndpoint', type: { name: 'String' } diff --git a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/vMwareVirtualMachineDetails.js b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/vMwareVirtualMachineDetails.js index b36c443ed8..d4e02e5540 100644 --- a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/vMwareVirtualMachineDetails.js +++ b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/vMwareVirtualMachineDetails.js @@ -31,7 +31,7 @@ class VMwareVirtualMachineDetails extends models['ConfigurationSettings'] { * @member {string} [poweredOn] The value indicating whether VM is powered * on. * @member {string} [vCenterInfrastructureId] The VCenter infrastructure Id. - * @member {string} [discoveryType] A value inidicating the discovery type of + * @member {string} [discoveryType] A value indicating the discovery type of * the machine. Value can be vCenter or physical. * @member {array} [diskDetails] The disk details. * @member {array} [validationErrors] The validation errors. diff --git a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/vmwareCbtPolicyDetails.js b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/vmwareCbtPolicyDetails.js index d36e6d2c93..812038a41e 100644 --- a/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/vmwareCbtPolicyDetails.js +++ b/lib/services/recoveryServicesSiteRecoveryManagement/lib/models/vmwareCbtPolicyDetails.js @@ -20,10 +20,8 @@ const models = require('./index'); class VmwareCbtPolicyDetails extends models['PolicyProviderSpecificDetails'] { /** * Create a VmwareCbtPolicyDetails. - * @member {number} [recoveryPointThresholdInMinutes] The recovery point - * threshold in minutes. - * @member {number} [recoveryPointHistory] The duration in minutes until - * which the recovery points need to be stored. + * @member {number} [recoveryPointHistoryInMinutes] The duration in minutes + * until which the recovery points need to be stored. * @member {number} [appConsistentFrequencyInMinutes] The app consistent * snapshot frequency in minutes. * @member {number} [crashConsistentFrequencyInMinutes] The crash consistent @@ -60,16 +58,9 @@ class VmwareCbtPolicyDetails extends models['PolicyProviderSpecificDetails'] { name: 'String' } }, - recoveryPointThresholdInMinutes: { + recoveryPointHistoryInMinutes: { required: false, - serializedName: 'recoveryPointThresholdInMinutes', - type: { - name: 'Number' - } - }, - recoveryPointHistory: { - required: false, - serializedName: 'recoveryPointHistory', + serializedName: 'recoveryPointHistoryInMinutes', type: { name: 'Number' } diff --git a/lib/services/recoveryServicesSiteRecoveryManagement/lib/operations/index.d.ts b/lib/services/recoveryServicesSiteRecoveryManagement/lib/operations/index.d.ts index 544c49d815..3fa2e3723d 100644 --- a/lib/services/recoveryServicesSiteRecoveryManagement/lib/operations/index.d.ts +++ b/lib/services/recoveryServicesSiteRecoveryManagement/lib/operations/index.d.ts @@ -4114,6 +4114,1537 @@ export interface ReplicationProtectionContainers { listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } +/** + * @class + * ReplicationMigrationItems + * __NOTE__: An instance of this class is automatically created for an + * instance of the SiteRecoveryManagementClient. + */ +export interface ReplicationMigrationItems { + + + /** + * @summary Gets the list of migration items in the protection container. + * + * Gets the list of ASR migration items in the protection container. + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container 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. + */ + listByReplicationProtectionContainersWithHttpOperationResponse(fabricName: string, protectionContainerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the list of migration items in the protection container. + * + * Gets the list of ASR migration items in the protection container. + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container 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 {MigrationItemCollection} - 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. + * + * {MigrationItemCollection} [result] - The deserialized result object if an error did not occur. + * See {@link MigrationItemCollection} 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. + */ + listByReplicationProtectionContainers(fabricName: string, protectionContainerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByReplicationProtectionContainers(fabricName: string, protectionContainerName: string, callback: ServiceCallback): void; + listByReplicationProtectionContainers(fabricName: string, protectionContainerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the details of a migration item. + * + * @param {string} fabricName Fabric unique name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item 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(fabricName: string, protectionContainerName: string, migrationItemName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the details of a migration item. + * + * @param {string} fabricName Fabric unique name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item 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 {MigrationItem} - 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. + * + * {MigrationItem} [result] - The deserialized result object if an error did not occur. + * See {@link MigrationItem} 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(fabricName: string, protectionContainerName: string, migrationItemName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(fabricName: string, protectionContainerName: string, migrationItemName: string, callback: ServiceCallback): void; + get(fabricName: string, protectionContainerName: string, migrationItemName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Enables migration. + * + * The operation to create an ASR migration item (enable migration). + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {object} input Enable migration input. + * + * @param {object} input.properties Enable migration input properties. + * + * @param {string} input.properties.policyId The policy Id. + * + * @param {object} input.properties.providerSpecificDetails The provider + * specific details. + * + * @param {string} input.properties.providerSpecificDetails.instanceType + * Polymorphic Discriminator + * + * @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. + */ + createWithHttpOperationResponse(fabricName: string, protectionContainerName: string, migrationItemName: string, input: models.EnableMigrationInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Enables migration. + * + * The operation to create an ASR migration item (enable migration). + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {object} input Enable migration input. + * + * @param {object} input.properties Enable migration input properties. + * + * @param {string} input.properties.policyId The policy Id. + * + * @param {object} input.properties.providerSpecificDetails The provider + * specific details. + * + * @param {string} input.properties.providerSpecificDetails.instanceType + * Polymorphic Discriminator + * + * @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 {MigrationItem} - 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. + * + * {MigrationItem} [result] - The deserialized result object if an error did not occur. + * See {@link MigrationItem} 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. + */ + create(fabricName: string, protectionContainerName: string, migrationItemName: string, input: models.EnableMigrationInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + create(fabricName: string, protectionContainerName: string, migrationItemName: string, input: models.EnableMigrationInput, callback: ServiceCallback): void; + create(fabricName: string, protectionContainerName: string, migrationItemName: string, input: models.EnableMigrationInput, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Delete the migration item. + * + * The operation to delete an ASR migration item. + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.deleteOption] The delete option. + * + * @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. + */ + deleteMethodWithHttpOperationResponse(fabricName: string, protectionContainerName: string, migrationItemName: string, options?: { deleteOption? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Delete the migration item. + * + * The operation to delete an ASR migration item. + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.deleteOption] The delete option. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(fabricName: string, protectionContainerName: string, migrationItemName: string, options?: { deleteOption? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(fabricName: string, protectionContainerName: string, migrationItemName: string, callback: ServiceCallback): void; + deleteMethod(fabricName: string, protectionContainerName: string, migrationItemName: string, options: { deleteOption? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Updates migration item. + * + * The operation to update the recovery settings of an ASR migration item. + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {object} input Update migration item input. + * + * @param {object} [input.properties] Update migration item input properties. + * + * @param {object} input.properties.providerSpecificDetails The provider + * specific input to update migration item. + * + * @param {string} input.properties.providerSpecificDetails.instanceType + * Polymorphic Discriminator + * + * @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. + */ + updateWithHttpOperationResponse(fabricName: string, protectionContainerName: string, migrationItemName: string, input: models.UpdateMigrationItemInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Updates migration item. + * + * The operation to update the recovery settings of an ASR migration item. + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {object} input Update migration item input. + * + * @param {object} [input.properties] Update migration item input properties. + * + * @param {object} input.properties.providerSpecificDetails The provider + * specific input to update migration item. + * + * @param {string} input.properties.providerSpecificDetails.instanceType + * Polymorphic Discriminator + * + * @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 {MigrationItem} - 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. + * + * {MigrationItem} [result] - The deserialized result object if an error did not occur. + * See {@link MigrationItem} 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. + */ + update(fabricName: string, protectionContainerName: string, migrationItemName: string, input: models.UpdateMigrationItemInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(fabricName: string, protectionContainerName: string, migrationItemName: string, input: models.UpdateMigrationItemInput, callback: ServiceCallback): void; + update(fabricName: string, protectionContainerName: string, migrationItemName: string, input: models.UpdateMigrationItemInput, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Migrate item. + * + * The operation to initiate migration of the item. + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {object} migrateInput Migrate input. + * + * @param {object} migrateInput.properties Migrate input properties. + * + * @param {object} migrateInput.properties.providerSpecificDetails The provider + * specific details. + * + * @param {string} migrateInput.properties.providerSpecificDetails.instanceType + * Polymorphic Discriminator + * + * @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. + */ + migrateWithHttpOperationResponse(fabricName: string, protectionContainerName: string, migrationItemName: string, migrateInput: models.MigrateInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Migrate item. + * + * The operation to initiate migration of the item. + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {object} migrateInput Migrate input. + * + * @param {object} migrateInput.properties Migrate input properties. + * + * @param {object} migrateInput.properties.providerSpecificDetails The provider + * specific details. + * + * @param {string} migrateInput.properties.providerSpecificDetails.instanceType + * Polymorphic Discriminator + * + * @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 {MigrationItem} - 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. + * + * {MigrationItem} [result] - The deserialized result object if an error did not occur. + * See {@link MigrationItem} 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. + */ + migrate(fabricName: string, protectionContainerName: string, migrationItemName: string, migrateInput: models.MigrateInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + migrate(fabricName: string, protectionContainerName: string, migrationItemName: string, migrateInput: models.MigrateInput, callback: ServiceCallback): void; + migrate(fabricName: string, protectionContainerName: string, migrationItemName: string, migrateInput: models.MigrateInput, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Test migrate item. + * + * The operation to initiate test migration of the item. + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {object} testMigrateInput Test migrate input. + * + * @param {object} testMigrateInput.properties Test migrate input properties. + * + * @param {object} testMigrateInput.properties.providerSpecificDetails The + * provider specific details. + * + * @param {string} + * testMigrateInput.properties.providerSpecificDetails.instanceType Polymorphic + * Discriminator + * + * @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. + */ + testMigrateWithHttpOperationResponse(fabricName: string, protectionContainerName: string, migrationItemName: string, testMigrateInput: models.TestMigrateInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Test migrate item. + * + * The operation to initiate test migration of the item. + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {object} testMigrateInput Test migrate input. + * + * @param {object} testMigrateInput.properties Test migrate input properties. + * + * @param {object} testMigrateInput.properties.providerSpecificDetails The + * provider specific details. + * + * @param {string} + * testMigrateInput.properties.providerSpecificDetails.instanceType Polymorphic + * Discriminator + * + * @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 {MigrationItem} - 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. + * + * {MigrationItem} [result] - The deserialized result object if an error did not occur. + * See {@link MigrationItem} 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. + */ + testMigrate(fabricName: string, protectionContainerName: string, migrationItemName: string, testMigrateInput: models.TestMigrateInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + testMigrate(fabricName: string, protectionContainerName: string, migrationItemName: string, testMigrateInput: models.TestMigrateInput, callback: ServiceCallback): void; + testMigrate(fabricName: string, protectionContainerName: string, migrationItemName: string, testMigrateInput: models.TestMigrateInput, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Test migrate cleanup. + * + * The operation to initiate test migrate cleanup. + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {object} testMigrateCleanupInput Test migrate cleanup input. + * + * @param {object} testMigrateCleanupInput.properties Test migrate cleanup + * input properties. + * + * @param {string} [testMigrateCleanupInput.properties.comments] Test migrate + * cleanup comments. + * + * @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. + */ + testMigrateCleanupWithHttpOperationResponse(fabricName: string, protectionContainerName: string, migrationItemName: string, testMigrateCleanupInput: models.TestMigrateCleanupInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Test migrate cleanup. + * + * The operation to initiate test migrate cleanup. + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {object} testMigrateCleanupInput Test migrate cleanup input. + * + * @param {object} testMigrateCleanupInput.properties Test migrate cleanup + * input properties. + * + * @param {string} [testMigrateCleanupInput.properties.comments] Test migrate + * cleanup comments. + * + * @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 {MigrationItem} - 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. + * + * {MigrationItem} [result] - The deserialized result object if an error did not occur. + * See {@link MigrationItem} 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. + */ + testMigrateCleanup(fabricName: string, protectionContainerName: string, migrationItemName: string, testMigrateCleanupInput: models.TestMigrateCleanupInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + testMigrateCleanup(fabricName: string, protectionContainerName: string, migrationItemName: string, testMigrateCleanupInput: models.TestMigrateCleanupInput, callback: ServiceCallback): void; + testMigrateCleanup(fabricName: string, protectionContainerName: string, migrationItemName: string, testMigrateCleanupInput: models.TestMigrateCleanupInput, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the list of migration items in the vault. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.skipToken] The pagination token. + * + * @param {string} [options.filter] OData filter options. + * + * @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. + */ + listWithHttpOperationResponse(options?: { skipToken? : string, filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the list of migration items in the vault. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.skipToken] The pagination token. + * + * @param {string} [options.filter] OData filter options. + * + * @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 {MigrationItemCollection} - 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. + * + * {MigrationItemCollection} [result] - The deserialized result object if an error did not occur. + * See {@link MigrationItemCollection} 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. + */ + list(options?: { skipToken? : string, filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { skipToken? : string, filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Enables migration. + * + * The operation to create an ASR migration item (enable migration). + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {object} input Enable migration input. + * + * @param {object} input.properties Enable migration input properties. + * + * @param {string} input.properties.policyId The policy Id. + * + * @param {object} input.properties.providerSpecificDetails The provider + * specific details. + * + * @param {string} input.properties.providerSpecificDetails.instanceType + * Polymorphic Discriminator + * + * @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. + */ + beginCreateWithHttpOperationResponse(fabricName: string, protectionContainerName: string, migrationItemName: string, input: models.EnableMigrationInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Enables migration. + * + * The operation to create an ASR migration item (enable migration). + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {object} input Enable migration input. + * + * @param {object} input.properties Enable migration input properties. + * + * @param {string} input.properties.policyId The policy Id. + * + * @param {object} input.properties.providerSpecificDetails The provider + * specific details. + * + * @param {string} input.properties.providerSpecificDetails.instanceType + * Polymorphic Discriminator + * + * @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 {MigrationItem} - 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. + * + * {MigrationItem} [result] - The deserialized result object if an error did not occur. + * See {@link MigrationItem} 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. + */ + beginCreate(fabricName: string, protectionContainerName: string, migrationItemName: string, input: models.EnableMigrationInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreate(fabricName: string, protectionContainerName: string, migrationItemName: string, input: models.EnableMigrationInput, callback: ServiceCallback): void; + beginCreate(fabricName: string, protectionContainerName: string, migrationItemName: string, input: models.EnableMigrationInput, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Delete the migration item. + * + * The operation to delete an ASR migration item. + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.deleteOption] The delete option. + * + * @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. + */ + beginDeleteMethodWithHttpOperationResponse(fabricName: string, protectionContainerName: string, migrationItemName: string, options?: { deleteOption? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Delete the migration item. + * + * The operation to delete an ASR migration item. + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.deleteOption] The delete option. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(fabricName: string, protectionContainerName: string, migrationItemName: string, options?: { deleteOption? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(fabricName: string, protectionContainerName: string, migrationItemName: string, callback: ServiceCallback): void; + beginDeleteMethod(fabricName: string, protectionContainerName: string, migrationItemName: string, options: { deleteOption? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Updates migration item. + * + * The operation to update the recovery settings of an ASR migration item. + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {object} input Update migration item input. + * + * @param {object} [input.properties] Update migration item input properties. + * + * @param {object} input.properties.providerSpecificDetails The provider + * specific input to update migration item. + * + * @param {string} input.properties.providerSpecificDetails.instanceType + * Polymorphic Discriminator + * + * @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. + */ + beginUpdateWithHttpOperationResponse(fabricName: string, protectionContainerName: string, migrationItemName: string, input: models.UpdateMigrationItemInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Updates migration item. + * + * The operation to update the recovery settings of an ASR migration item. + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {object} input Update migration item input. + * + * @param {object} [input.properties] Update migration item input properties. + * + * @param {object} input.properties.providerSpecificDetails The provider + * specific input to update migration item. + * + * @param {string} input.properties.providerSpecificDetails.instanceType + * Polymorphic Discriminator + * + * @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 {MigrationItem} - 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. + * + * {MigrationItem} [result] - The deserialized result object if an error did not occur. + * See {@link MigrationItem} 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. + */ + beginUpdate(fabricName: string, protectionContainerName: string, migrationItemName: string, input: models.UpdateMigrationItemInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdate(fabricName: string, protectionContainerName: string, migrationItemName: string, input: models.UpdateMigrationItemInput, callback: ServiceCallback): void; + beginUpdate(fabricName: string, protectionContainerName: string, migrationItemName: string, input: models.UpdateMigrationItemInput, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Migrate item. + * + * The operation to initiate migration of the item. + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {object} migrateInput Migrate input. + * + * @param {object} migrateInput.properties Migrate input properties. + * + * @param {object} migrateInput.properties.providerSpecificDetails The provider + * specific details. + * + * @param {string} migrateInput.properties.providerSpecificDetails.instanceType + * Polymorphic Discriminator + * + * @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. + */ + beginMigrateWithHttpOperationResponse(fabricName: string, protectionContainerName: string, migrationItemName: string, migrateInput: models.MigrateInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Migrate item. + * + * The operation to initiate migration of the item. + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {object} migrateInput Migrate input. + * + * @param {object} migrateInput.properties Migrate input properties. + * + * @param {object} migrateInput.properties.providerSpecificDetails The provider + * specific details. + * + * @param {string} migrateInput.properties.providerSpecificDetails.instanceType + * Polymorphic Discriminator + * + * @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 {MigrationItem} - 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. + * + * {MigrationItem} [result] - The deserialized result object if an error did not occur. + * See {@link MigrationItem} 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. + */ + beginMigrate(fabricName: string, protectionContainerName: string, migrationItemName: string, migrateInput: models.MigrateInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginMigrate(fabricName: string, protectionContainerName: string, migrationItemName: string, migrateInput: models.MigrateInput, callback: ServiceCallback): void; + beginMigrate(fabricName: string, protectionContainerName: string, migrationItemName: string, migrateInput: models.MigrateInput, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Test migrate item. + * + * The operation to initiate test migration of the item. + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {object} testMigrateInput Test migrate input. + * + * @param {object} testMigrateInput.properties Test migrate input properties. + * + * @param {object} testMigrateInput.properties.providerSpecificDetails The + * provider specific details. + * + * @param {string} + * testMigrateInput.properties.providerSpecificDetails.instanceType Polymorphic + * Discriminator + * + * @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. + */ + beginTestMigrateWithHttpOperationResponse(fabricName: string, protectionContainerName: string, migrationItemName: string, testMigrateInput: models.TestMigrateInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Test migrate item. + * + * The operation to initiate test migration of the item. + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {object} testMigrateInput Test migrate input. + * + * @param {object} testMigrateInput.properties Test migrate input properties. + * + * @param {object} testMigrateInput.properties.providerSpecificDetails The + * provider specific details. + * + * @param {string} + * testMigrateInput.properties.providerSpecificDetails.instanceType Polymorphic + * Discriminator + * + * @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 {MigrationItem} - 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. + * + * {MigrationItem} [result] - The deserialized result object if an error did not occur. + * See {@link MigrationItem} 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. + */ + beginTestMigrate(fabricName: string, protectionContainerName: string, migrationItemName: string, testMigrateInput: models.TestMigrateInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginTestMigrate(fabricName: string, protectionContainerName: string, migrationItemName: string, testMigrateInput: models.TestMigrateInput, callback: ServiceCallback): void; + beginTestMigrate(fabricName: string, protectionContainerName: string, migrationItemName: string, testMigrateInput: models.TestMigrateInput, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Test migrate cleanup. + * + * The operation to initiate test migrate cleanup. + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {object} testMigrateCleanupInput Test migrate cleanup input. + * + * @param {object} testMigrateCleanupInput.properties Test migrate cleanup + * input properties. + * + * @param {string} [testMigrateCleanupInput.properties.comments] Test migrate + * cleanup comments. + * + * @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. + */ + beginTestMigrateCleanupWithHttpOperationResponse(fabricName: string, protectionContainerName: string, migrationItemName: string, testMigrateCleanupInput: models.TestMigrateCleanupInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Test migrate cleanup. + * + * The operation to initiate test migrate cleanup. + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {object} testMigrateCleanupInput Test migrate cleanup input. + * + * @param {object} testMigrateCleanupInput.properties Test migrate cleanup + * input properties. + * + * @param {string} [testMigrateCleanupInput.properties.comments] Test migrate + * cleanup comments. + * + * @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 {MigrationItem} - 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. + * + * {MigrationItem} [result] - The deserialized result object if an error did not occur. + * See {@link MigrationItem} 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. + */ + beginTestMigrateCleanup(fabricName: string, protectionContainerName: string, migrationItemName: string, testMigrateCleanupInput: models.TestMigrateCleanupInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginTestMigrateCleanup(fabricName: string, protectionContainerName: string, migrationItemName: string, testMigrateCleanupInput: models.TestMigrateCleanupInput, callback: ServiceCallback): void; + beginTestMigrateCleanup(fabricName: string, protectionContainerName: string, migrationItemName: string, testMigrateCleanupInput: models.TestMigrateCleanupInput, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the list of migration items in the protection container. + * + * Gets the list of ASR migration items in the protection container. + * + * @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 + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByReplicationProtectionContainersNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the list of migration items in the protection container. + * + * Gets the list of ASR migration items in the protection container. + * + * @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} [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 {MigrationItemCollection} - 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. + * + * {MigrationItemCollection} [result] - The deserialized result object if an error did not occur. + * See {@link MigrationItemCollection} 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. + */ + listByReplicationProtectionContainersNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByReplicationProtectionContainersNext(nextPageLink: string, callback: ServiceCallback): void; + listByReplicationProtectionContainersNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the list of migration items in the vault. + * + * @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 + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the list of migration items in the vault. + * + * @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} [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 {MigrationItemCollection} - 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. + * + * {MigrationItemCollection} [result] - The deserialized result object if an error did not occur. + * See {@link MigrationItemCollection} 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. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * MigrationRecoveryPoints + * __NOTE__: An instance of this class is automatically created for an + * instance of the SiteRecoveryManagementClient. + */ +export interface MigrationRecoveryPoints { + + + /** + * @summary Gets the recovery points for a migration item. + * + * @param {string} fabricName Fabric unique name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item 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. + */ + listByReplicationMigrationItemsWithHttpOperationResponse(fabricName: string, protectionContainerName: string, migrationItemName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the recovery points for a migration item. + * + * @param {string} fabricName Fabric unique name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item 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 {MigrationRecoveryPointCollection} - 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. + * + * {MigrationRecoveryPointCollection} [result] - The deserialized result object if an error did not occur. + * See {@link MigrationRecoveryPointCollection} 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. + */ + listByReplicationMigrationItems(fabricName: string, protectionContainerName: string, migrationItemName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByReplicationMigrationItems(fabricName: string, protectionContainerName: string, migrationItemName: string, callback: ServiceCallback): void; + listByReplicationMigrationItems(fabricName: string, protectionContainerName: string, migrationItemName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets a recovery point for a migration item. + * + * @param {string} fabricName Fabric unique name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {string} migrationRecoveryPointName The migration recovery point + * 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(fabricName: string, protectionContainerName: string, migrationItemName: string, migrationRecoveryPointName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a recovery point for a migration item. + * + * @param {string} fabricName Fabric unique name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {string} migrationRecoveryPointName The migration recovery point + * 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 {MigrationRecoveryPoint} - 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. + * + * {MigrationRecoveryPoint} [result] - The deserialized result object if an error did not occur. + * See {@link MigrationRecoveryPoint} 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(fabricName: string, protectionContainerName: string, migrationItemName: string, migrationRecoveryPointName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(fabricName: string, protectionContainerName: string, migrationItemName: string, migrationRecoveryPointName: string, callback: ServiceCallback): void; + get(fabricName: string, protectionContainerName: string, migrationItemName: string, migrationRecoveryPointName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the recovery points for a migration item. + * + * @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 + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByReplicationMigrationItemsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the recovery points for a migration item. + * + * @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} [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 {MigrationRecoveryPointCollection} - 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. + * + * {MigrationRecoveryPointCollection} [result] - The deserialized result object if an error did not occur. + * See {@link MigrationRecoveryPointCollection} 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. + */ + listByReplicationMigrationItemsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByReplicationMigrationItemsNext(nextPageLink: string, callback: ServiceCallback): void; + listByReplicationMigrationItemsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + /** * @class * ReplicationProtectableItems @@ -8672,6 +10203,146 @@ export interface ReplicationRecoveryServicesProviders { get(fabricName: string, providerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** + * @summary Adds a recovery services provider. + * + * The operation to add a recovery services provider. + * + * @param {string} fabricName Fabric name. + * + * @param {string} providerName Recovery services provider name. + * + * @param {object} addProviderInput Add provider input. + * + * @param {object} addProviderInput.properties The properties of an add + * provider request. + * + * @param {string} addProviderInput.properties.machineName The name of the + * machine where the provider is getting added. + * + * @param {object} addProviderInput.properties.authenticationIdentityInput The + * identity provider input for DRA authentication. + * + * @param {object} addProviderInput.properties.resourceAccessIdentityInput The + * identity provider input for resource access. + * + * @param {string} + * addProviderInput.properties.resourceAccessIdentityInput.tenantId The tenant + * Id for the service principal with which the on-premise management/data plane + * components would communicate with our Azure services. + * + * @param {string} + * addProviderInput.properties.resourceAccessIdentityInput.applicationId The + * application/client Id for the service principal with which the on-premise + * management/data plane components would communicate with our Azure services. + * + * @param {string} + * addProviderInput.properties.resourceAccessIdentityInput.objectId The object + * Id of the service principal with which the on-premise management/data plane + * components would communicate with our Azure services. + * + * @param {string} + * addProviderInput.properties.resourceAccessIdentityInput.audience The + * intended Audience of the service principal with which the on-premise + * management/data plane components would communicate with our Azure services. + * + * @param {string} + * addProviderInput.properties.resourceAccessIdentityInput.aadAuthority The + * base authority for Azure Active Directory authentication. + * + * @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. + */ + createWithHttpOperationResponse(fabricName: string, providerName: string, addProviderInput: models.AddRecoveryServicesProviderInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Adds a recovery services provider. + * + * The operation to add a recovery services provider. + * + * @param {string} fabricName Fabric name. + * + * @param {string} providerName Recovery services provider name. + * + * @param {object} addProviderInput Add provider input. + * + * @param {object} addProviderInput.properties The properties of an add + * provider request. + * + * @param {string} addProviderInput.properties.machineName The name of the + * machine where the provider is getting added. + * + * @param {object} addProviderInput.properties.authenticationIdentityInput The + * identity provider input for DRA authentication. + * + * @param {object} addProviderInput.properties.resourceAccessIdentityInput The + * identity provider input for resource access. + * + * @param {string} + * addProviderInput.properties.resourceAccessIdentityInput.tenantId The tenant + * Id for the service principal with which the on-premise management/data plane + * components would communicate with our Azure services. + * + * @param {string} + * addProviderInput.properties.resourceAccessIdentityInput.applicationId The + * application/client Id for the service principal with which the on-premise + * management/data plane components would communicate with our Azure services. + * + * @param {string} + * addProviderInput.properties.resourceAccessIdentityInput.objectId The object + * Id of the service principal with which the on-premise management/data plane + * components would communicate with our Azure services. + * + * @param {string} + * addProviderInput.properties.resourceAccessIdentityInput.audience The + * intended Audience of the service principal with which the on-premise + * management/data plane components would communicate with our Azure services. + * + * @param {string} + * addProviderInput.properties.resourceAccessIdentityInput.aadAuthority The + * base authority for Azure Active Directory authentication. + * + * @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 {RecoveryServicesProvider} - 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. + * + * {RecoveryServicesProvider} [result] - The deserialized result object if an error did not occur. + * See {@link RecoveryServicesProvider} 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. + */ + create(fabricName: string, providerName: string, addProviderInput: models.AddRecoveryServicesProviderInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + create(fabricName: string, providerName: string, addProviderInput: models.AddRecoveryServicesProviderInput, callback: ServiceCallback): void; + create(fabricName: string, providerName: string, addProviderInput: models.AddRecoveryServicesProviderInput, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * @summary Purges recovery service provider from fabric * @@ -8932,6 +10603,146 @@ export interface ReplicationRecoveryServicesProviders { list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** + * @summary Adds a recovery services provider. + * + * The operation to add a recovery services provider. + * + * @param {string} fabricName Fabric name. + * + * @param {string} providerName Recovery services provider name. + * + * @param {object} addProviderInput Add provider input. + * + * @param {object} addProviderInput.properties The properties of an add + * provider request. + * + * @param {string} addProviderInput.properties.machineName The name of the + * machine where the provider is getting added. + * + * @param {object} addProviderInput.properties.authenticationIdentityInput The + * identity provider input for DRA authentication. + * + * @param {object} addProviderInput.properties.resourceAccessIdentityInput The + * identity provider input for resource access. + * + * @param {string} + * addProviderInput.properties.resourceAccessIdentityInput.tenantId The tenant + * Id for the service principal with which the on-premise management/data plane + * components would communicate with our Azure services. + * + * @param {string} + * addProviderInput.properties.resourceAccessIdentityInput.applicationId The + * application/client Id for the service principal with which the on-premise + * management/data plane components would communicate with our Azure services. + * + * @param {string} + * addProviderInput.properties.resourceAccessIdentityInput.objectId The object + * Id of the service principal with which the on-premise management/data plane + * components would communicate with our Azure services. + * + * @param {string} + * addProviderInput.properties.resourceAccessIdentityInput.audience The + * intended Audience of the service principal with which the on-premise + * management/data plane components would communicate with our Azure services. + * + * @param {string} + * addProviderInput.properties.resourceAccessIdentityInput.aadAuthority The + * base authority for Azure Active Directory authentication. + * + * @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. + */ + beginCreateWithHttpOperationResponse(fabricName: string, providerName: string, addProviderInput: models.AddRecoveryServicesProviderInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Adds a recovery services provider. + * + * The operation to add a recovery services provider. + * + * @param {string} fabricName Fabric name. + * + * @param {string} providerName Recovery services provider name. + * + * @param {object} addProviderInput Add provider input. + * + * @param {object} addProviderInput.properties The properties of an add + * provider request. + * + * @param {string} addProviderInput.properties.machineName The name of the + * machine where the provider is getting added. + * + * @param {object} addProviderInput.properties.authenticationIdentityInput The + * identity provider input for DRA authentication. + * + * @param {object} addProviderInput.properties.resourceAccessIdentityInput The + * identity provider input for resource access. + * + * @param {string} + * addProviderInput.properties.resourceAccessIdentityInput.tenantId The tenant + * Id for the service principal with which the on-premise management/data plane + * components would communicate with our Azure services. + * + * @param {string} + * addProviderInput.properties.resourceAccessIdentityInput.applicationId The + * application/client Id for the service principal with which the on-premise + * management/data plane components would communicate with our Azure services. + * + * @param {string} + * addProviderInput.properties.resourceAccessIdentityInput.objectId The object + * Id of the service principal with which the on-premise management/data plane + * components would communicate with our Azure services. + * + * @param {string} + * addProviderInput.properties.resourceAccessIdentityInput.audience The + * intended Audience of the service principal with which the on-premise + * management/data plane components would communicate with our Azure services. + * + * @param {string} + * addProviderInput.properties.resourceAccessIdentityInput.aadAuthority The + * base authority for Azure Active Directory authentication. + * + * @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 {RecoveryServicesProvider} - 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. + * + * {RecoveryServicesProvider} [result] - The deserialized result object if an error did not occur. + * See {@link RecoveryServicesProvider} 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. + */ + beginCreate(fabricName: string, providerName: string, addProviderInput: models.AddRecoveryServicesProviderInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreate(fabricName: string, providerName: string, addProviderInput: models.AddRecoveryServicesProviderInput, callback: ServiceCallback): void; + beginCreate(fabricName: string, providerName: string, addProviderInput: models.AddRecoveryServicesProviderInput, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * @summary Purges recovery service provider from fabric * diff --git a/lib/services/recoveryServicesSiteRecoveryManagement/lib/operations/index.js b/lib/services/recoveryServicesSiteRecoveryManagement/lib/operations/index.js index 146061f7e8..93880470cf 100644 --- a/lib/services/recoveryServicesSiteRecoveryManagement/lib/operations/index.js +++ b/lib/services/recoveryServicesSiteRecoveryManagement/lib/operations/index.js @@ -22,6 +22,8 @@ exports.ReplicationLogicalNetworks = require('./replicationLogicalNetworks'); exports.ReplicationNetworks = require('./replicationNetworks'); exports.ReplicationNetworkMappings = require('./replicationNetworkMappings'); exports.ReplicationProtectionContainers = require('./replicationProtectionContainers'); +exports.ReplicationMigrationItems = require('./replicationMigrationItems'); +exports.MigrationRecoveryPoints = require('./migrationRecoveryPoints'); exports.ReplicationProtectableItems = require('./replicationProtectableItems'); exports.ReplicationProtectedItems = require('./replicationProtectedItems'); exports.RecoveryPoints = require('./recoveryPoints'); diff --git a/lib/services/recoveryServicesSiteRecoveryManagement/lib/operations/migrationRecoveryPoints.js b/lib/services/recoveryServicesSiteRecoveryManagement/lib/operations/migrationRecoveryPoints.js new file mode 100644 index 0000000000..3c54cb7b9e --- /dev/null +++ b/lib/services/recoveryServicesSiteRecoveryManagement/lib/operations/migrationRecoveryPoints.js @@ -0,0 +1,760 @@ +/* + * 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'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * @summary Gets the recovery points for a migration item. + * + * @param {string} fabricName Fabric unique name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item 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 MigrationRecoveryPointCollection} 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 _listByReplicationMigrationItems(fabricName, protectionContainerName, migrationItemName, 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.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.resourceName === null || this.client.resourceName === undefined || typeof this.client.resourceName.valueOf() !== 'string') { + throw new Error('this.client.resourceName cannot be null or undefined and it must be of type string.'); + } + if (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName 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 (fabricName === null || fabricName === undefined || typeof fabricName.valueOf() !== 'string') { + throw new Error('fabricName cannot be null or undefined and it must be of type string.'); + } + if (protectionContainerName === null || protectionContainerName === undefined || typeof protectionContainerName.valueOf() !== 'string') { + throw new Error('protectionContainerName cannot be null or undefined and it must be of type string.'); + } + if (migrationItemName === null || migrationItemName === undefined || typeof migrationItemName.valueOf() !== 'string') { + throw new Error('migrationItemName 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.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/migrationRecoveryPoints'; + requestUrl = requestUrl.replace('{resourceName}', encodeURIComponent(this.client.resourceName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{fabricName}', encodeURIComponent(fabricName)); + requestUrl = requestUrl.replace('{protectionContainerName}', encodeURIComponent(protectionContainerName)); + requestUrl = requestUrl.replace('{migrationItemName}', encodeURIComponent(migrationItemName)); + 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['MigrationRecoveryPointCollection']().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); + }); +} + +/** + * @summary Gets a recovery point for a migration item. + * + * @param {string} fabricName Fabric unique name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {string} migrationRecoveryPointName The migration recovery point + * 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 MigrationRecoveryPoint} 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(fabricName, protectionContainerName, migrationItemName, migrationRecoveryPointName, 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.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.resourceName === null || this.client.resourceName === undefined || typeof this.client.resourceName.valueOf() !== 'string') { + throw new Error('this.client.resourceName cannot be null or undefined and it must be of type string.'); + } + if (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName 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 (fabricName === null || fabricName === undefined || typeof fabricName.valueOf() !== 'string') { + throw new Error('fabricName cannot be null or undefined and it must be of type string.'); + } + if (protectionContainerName === null || protectionContainerName === undefined || typeof protectionContainerName.valueOf() !== 'string') { + throw new Error('protectionContainerName cannot be null or undefined and it must be of type string.'); + } + if (migrationItemName === null || migrationItemName === undefined || typeof migrationItemName.valueOf() !== 'string') { + throw new Error('migrationItemName cannot be null or undefined and it must be of type string.'); + } + if (migrationRecoveryPointName === null || migrationRecoveryPointName === undefined || typeof migrationRecoveryPointName.valueOf() !== 'string') { + throw new Error('migrationRecoveryPointName 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.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/migrationRecoveryPoints/{migrationRecoveryPointName}'; + requestUrl = requestUrl.replace('{resourceName}', encodeURIComponent(this.client.resourceName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{fabricName}', encodeURIComponent(fabricName)); + requestUrl = requestUrl.replace('{protectionContainerName}', encodeURIComponent(protectionContainerName)); + requestUrl = requestUrl.replace('{migrationItemName}', encodeURIComponent(migrationItemName)); + requestUrl = requestUrl.replace('{migrationRecoveryPointName}', encodeURIComponent(migrationRecoveryPointName)); + 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['MigrationRecoveryPoint']().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); + }); +} + +/** + * @summary Gets the recovery points for a migration item. + * + * @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 - 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 MigrationRecoveryPointCollection} 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 _listByReplicationMigrationItemsNext(nextPageLink, 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 (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 + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // 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['MigrationRecoveryPointCollection']().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); + }); +} + +/** Class representing a MigrationRecoveryPoints. */ +class MigrationRecoveryPoints { + /** + * Create a MigrationRecoveryPoints. + * @param {SiteRecoveryManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._listByReplicationMigrationItems = _listByReplicationMigrationItems; + this._get = _get; + this._listByReplicationMigrationItemsNext = _listByReplicationMigrationItemsNext; + } + + /** + * @summary Gets the recovery points for a migration item. + * + * @param {string} fabricName Fabric unique name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item 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. + */ + listByReplicationMigrationItemsWithHttpOperationResponse(fabricName, protectionContainerName, migrationItemName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByReplicationMigrationItems(fabricName, protectionContainerName, migrationItemName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets the recovery points for a migration item. + * + * @param {string} fabricName Fabric unique name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item 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 {MigrationRecoveryPointCollection} - 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 MigrationRecoveryPointCollection} 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. + */ + listByReplicationMigrationItems(fabricName, protectionContainerName, migrationItemName, 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._listByReplicationMigrationItems(fabricName, protectionContainerName, migrationItemName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByReplicationMigrationItems(fabricName, protectionContainerName, migrationItemName, options, optionalCallback); + } + } + + /** + * @summary Gets a recovery point for a migration item. + * + * @param {string} fabricName Fabric unique name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {string} migrationRecoveryPointName The migration recovery point + * 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(fabricName, protectionContainerName, migrationItemName, migrationRecoveryPointName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(fabricName, protectionContainerName, migrationItemName, migrationRecoveryPointName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets a recovery point for a migration item. + * + * @param {string} fabricName Fabric unique name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {string} migrationRecoveryPointName The migration recovery point + * 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 {MigrationRecoveryPoint} - 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 MigrationRecoveryPoint} 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(fabricName, protectionContainerName, migrationItemName, migrationRecoveryPointName, 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(fabricName, protectionContainerName, migrationItemName, migrationRecoveryPointName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(fabricName, protectionContainerName, migrationItemName, migrationRecoveryPointName, options, optionalCallback); + } + } + + /** + * @summary Gets the recovery points for a migration item. + * + * @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 + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByReplicationMigrationItemsNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByReplicationMigrationItemsNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets the recovery points for a migration item. + * + * @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} [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 {MigrationRecoveryPointCollection} - 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 MigrationRecoveryPointCollection} 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. + */ + listByReplicationMigrationItemsNext(nextPageLink, 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._listByReplicationMigrationItemsNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByReplicationMigrationItemsNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = MigrationRecoveryPoints; diff --git a/lib/services/recoveryServicesSiteRecoveryManagement/lib/operations/replicationMigrationItems.js b/lib/services/recoveryServicesSiteRecoveryManagement/lib/operations/replicationMigrationItems.js new file mode 100644 index 0000000000..812cc818a2 --- /dev/null +++ b/lib/services/recoveryServicesSiteRecoveryManagement/lib/operations/replicationMigrationItems.js @@ -0,0 +1,4182 @@ +/* + * 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'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * @summary Gets the list of migration items in the protection container. + * + * Gets the list of ASR migration items in the protection container. + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container 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 MigrationItemCollection} 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 _listByReplicationProtectionContainers(fabricName, protectionContainerName, 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.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.resourceName === null || this.client.resourceName === undefined || typeof this.client.resourceName.valueOf() !== 'string') { + throw new Error('this.client.resourceName cannot be null or undefined and it must be of type string.'); + } + if (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName 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 (fabricName === null || fabricName === undefined || typeof fabricName.valueOf() !== 'string') { + throw new Error('fabricName cannot be null or undefined and it must be of type string.'); + } + if (protectionContainerName === null || protectionContainerName === undefined || typeof protectionContainerName.valueOf() !== 'string') { + throw new Error('protectionContainerName 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.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems'; + requestUrl = requestUrl.replace('{resourceName}', encodeURIComponent(this.client.resourceName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{fabricName}', encodeURIComponent(fabricName)); + requestUrl = requestUrl.replace('{protectionContainerName}', encodeURIComponent(protectionContainerName)); + 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['MigrationItemCollection']().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); + }); +} + +/** + * @summary Gets the details of a migration item. + * + * @param {string} fabricName Fabric unique name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item 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 MigrationItem} 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(fabricName, protectionContainerName, migrationItemName, 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.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.resourceName === null || this.client.resourceName === undefined || typeof this.client.resourceName.valueOf() !== 'string') { + throw new Error('this.client.resourceName cannot be null or undefined and it must be of type string.'); + } + if (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName 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 (fabricName === null || fabricName === undefined || typeof fabricName.valueOf() !== 'string') { + throw new Error('fabricName cannot be null or undefined and it must be of type string.'); + } + if (protectionContainerName === null || protectionContainerName === undefined || typeof protectionContainerName.valueOf() !== 'string') { + throw new Error('protectionContainerName cannot be null or undefined and it must be of type string.'); + } + if (migrationItemName === null || migrationItemName === undefined || typeof migrationItemName.valueOf() !== 'string') { + throw new Error('migrationItemName 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.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}'; + requestUrl = requestUrl.replace('{resourceName}', encodeURIComponent(this.client.resourceName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{fabricName}', encodeURIComponent(fabricName)); + requestUrl = requestUrl.replace('{protectionContainerName}', encodeURIComponent(protectionContainerName)); + requestUrl = requestUrl.replace('{migrationItemName}', encodeURIComponent(migrationItemName)); + 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['MigrationItem']().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); + }); +} + + +/** + * @summary Enables migration. + * + * The operation to create an ASR migration item (enable migration). + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {object} input Enable migration input. + * + * @param {object} input.properties Enable migration input properties. + * + * @param {string} input.properties.policyId The policy Id. + * + * @param {object} input.properties.providerSpecificDetails The provider + * specific details. + * + * @param {string} input.properties.providerSpecificDetails.instanceType + * Polymorphic Discriminator + * + * @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 MigrationItem} 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 _create(fabricName, protectionContainerName, migrationItemName, input, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginCreate(fabricName, protectionContainerName, migrationItemName, input, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['MigrationItem']().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); + }); + }); +} + + +/** + * @summary Delete the migration item. + * + * The operation to delete an ASR migration item. + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.deleteOption] The delete option. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteMethod(fabricName, protectionContainerName, migrationItemName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginDeleteMethod(fabricName, protectionContainerName, migrationItemName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * @summary Updates migration item. + * + * The operation to update the recovery settings of an ASR migration item. + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {object} input Update migration item input. + * + * @param {object} [input.properties] Update migration item input properties. + * + * @param {object} input.properties.providerSpecificDetails The provider + * specific input to update migration item. + * + * @param {string} input.properties.providerSpecificDetails.instanceType + * Polymorphic Discriminator + * + * @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 MigrationItem} 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 _update(fabricName, protectionContainerName, migrationItemName, input, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginUpdate(fabricName, protectionContainerName, migrationItemName, input, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['MigrationItem']().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); + }); + }); +} + + +/** + * @summary Migrate item. + * + * The operation to initiate migration of the item. + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {object} migrateInput Migrate input. + * + * @param {object} migrateInput.properties Migrate input properties. + * + * @param {object} migrateInput.properties.providerSpecificDetails The provider + * specific details. + * + * @param {string} migrateInput.properties.providerSpecificDetails.instanceType + * Polymorphic Discriminator + * + * @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 MigrationItem} 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 _migrate(fabricName, protectionContainerName, migrationItemName, migrateInput, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginMigrate(fabricName, protectionContainerName, migrationItemName, migrateInput, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['MigrationItem']().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); + }); + }); +} + + +/** + * @summary Test migrate item. + * + * The operation to initiate test migration of the item. + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {object} testMigrateInput Test migrate input. + * + * @param {object} testMigrateInput.properties Test migrate input properties. + * + * @param {object} testMigrateInput.properties.providerSpecificDetails The + * provider specific details. + * + * @param {string} + * testMigrateInput.properties.providerSpecificDetails.instanceType Polymorphic + * Discriminator + * + * @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 MigrationItem} 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 _testMigrate(fabricName, protectionContainerName, migrationItemName, testMigrateInput, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginTestMigrate(fabricName, protectionContainerName, migrationItemName, testMigrateInput, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['MigrationItem']().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); + }); + }); +} + + +/** + * @summary Test migrate cleanup. + * + * The operation to initiate test migrate cleanup. + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {object} testMigrateCleanupInput Test migrate cleanup input. + * + * @param {object} testMigrateCleanupInput.properties Test migrate cleanup + * input properties. + * + * @param {string} [testMigrateCleanupInput.properties.comments] Test migrate + * cleanup comments. + * + * @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 MigrationItem} 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 _testMigrateCleanup(fabricName, protectionContainerName, migrationItemName, testMigrateCleanupInput, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginTestMigrateCleanup(fabricName, protectionContainerName, migrationItemName, testMigrateCleanupInput, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['MigrationItem']().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); + }); + }); +} + +/** + * @summary Gets the list of migration items in the vault. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.skipToken] The pagination token. + * + * @param {string} [options.filter] OData filter options. + * + * @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 MigrationItemCollection} 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 _list(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.'); + } + let skipToken = (options && options.skipToken !== undefined) ? options.skipToken : undefined; + let filter = (options && options.filter !== undefined) ? options.filter : undefined; + // Validate + try { + 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.resourceName === null || this.client.resourceName === undefined || typeof this.client.resourceName.valueOf() !== 'string') { + throw new Error('this.client.resourceName cannot be null or undefined and it must be of type string.'); + } + if (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName 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 (skipToken !== null && skipToken !== undefined && typeof skipToken.valueOf() !== 'string') { + throw new Error('skipToken must be of type string.'); + } + if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { + throw new Error('filter 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.RecoveryServices/vaults/{resourceName}/replicationMigrationItems'; + requestUrl = requestUrl.replace('{resourceName}', encodeURIComponent(this.client.resourceName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (skipToken !== null && skipToken !== undefined) { + queryParameters.push('skipToken=' + encodeURIComponent(skipToken)); + } + if (filter !== null && filter !== undefined) { + queryParameters.push('$filter=' + encodeURIComponent(filter)); + } + 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['MigrationItemCollection']().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); + }); +} + +/** + * @summary Enables migration. + * + * The operation to create an ASR migration item (enable migration). + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {object} input Enable migration input. + * + * @param {object} input.properties Enable migration input properties. + * + * @param {string} input.properties.policyId The policy Id. + * + * @param {object} input.properties.providerSpecificDetails The provider + * specific details. + * + * @param {string} input.properties.providerSpecificDetails.instanceType + * Polymorphic Discriminator + * + * @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 MigrationItem} 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 _beginCreate(fabricName, protectionContainerName, migrationItemName, input, 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.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.resourceName === null || this.client.resourceName === undefined || typeof this.client.resourceName.valueOf() !== 'string') { + throw new Error('this.client.resourceName cannot be null or undefined and it must be of type string.'); + } + if (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName 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 (fabricName === null || fabricName === undefined || typeof fabricName.valueOf() !== 'string') { + throw new Error('fabricName cannot be null or undefined and it must be of type string.'); + } + if (protectionContainerName === null || protectionContainerName === undefined || typeof protectionContainerName.valueOf() !== 'string') { + throw new Error('protectionContainerName cannot be null or undefined and it must be of type string.'); + } + if (migrationItemName === null || migrationItemName === undefined || typeof migrationItemName.valueOf() !== 'string') { + throw new Error('migrationItemName cannot be null or undefined and it must be of type string.'); + } + if (input === null || input === undefined) { + throw new Error('input 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.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}'; + requestUrl = requestUrl.replace('{resourceName}', encodeURIComponent(this.client.resourceName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{fabricName}', encodeURIComponent(fabricName)); + requestUrl = requestUrl.replace('{protectionContainerName}', encodeURIComponent(protectionContainerName)); + requestUrl = requestUrl.replace('{migrationItemName}', encodeURIComponent(migrationItemName)); + 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 = 'PUT'; + 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 (input !== null && input !== undefined) { + let requestModelMapper = new client.models['EnableMigrationInput']().mapper(); + requestModel = client.serialize(requestModelMapper, input, 'input'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(input, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + 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['MigrationItem']().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); + }); +} + +/** + * @summary Delete the migration item. + * + * The operation to delete an ASR migration item. + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.deleteOption] The delete option. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginDeleteMethod(fabricName, protectionContainerName, migrationItemName, 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.'); + } + let deleteOption = (options && options.deleteOption !== undefined) ? options.deleteOption : undefined; + // Validate + try { + 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.resourceName === null || this.client.resourceName === undefined || typeof this.client.resourceName.valueOf() !== 'string') { + throw new Error('this.client.resourceName cannot be null or undefined and it must be of type string.'); + } + if (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName 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 (fabricName === null || fabricName === undefined || typeof fabricName.valueOf() !== 'string') { + throw new Error('fabricName cannot be null or undefined and it must be of type string.'); + } + if (protectionContainerName === null || protectionContainerName === undefined || typeof protectionContainerName.valueOf() !== 'string') { + throw new Error('protectionContainerName cannot be null or undefined and it must be of type string.'); + } + if (migrationItemName === null || migrationItemName === undefined || typeof migrationItemName.valueOf() !== 'string') { + throw new Error('migrationItemName cannot be null or undefined and it must be of type string.'); + } + if (deleteOption !== null && deleteOption !== undefined && typeof deleteOption.valueOf() !== 'string') { + throw new Error('deleteOption 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.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}'; + requestUrl = requestUrl.replace('{resourceName}', encodeURIComponent(this.client.resourceName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{fabricName}', encodeURIComponent(fabricName)); + requestUrl = requestUrl.replace('{protectionContainerName}', encodeURIComponent(protectionContainerName)); + requestUrl = requestUrl.replace('{migrationItemName}', encodeURIComponent(migrationItemName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (deleteOption !== null && deleteOption !== undefined) { + queryParameters.push('deleteOption=' + encodeURIComponent(deleteOption)); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + 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 !== 202 && statusCode !== 204) { + 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; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Updates migration item. + * + * The operation to update the recovery settings of an ASR migration item. + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {object} input Update migration item input. + * + * @param {object} [input.properties] Update migration item input properties. + * + * @param {object} input.properties.providerSpecificDetails The provider + * specific input to update migration item. + * + * @param {string} input.properties.providerSpecificDetails.instanceType + * Polymorphic Discriminator + * + * @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 MigrationItem} 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 _beginUpdate(fabricName, protectionContainerName, migrationItemName, input, 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.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.resourceName === null || this.client.resourceName === undefined || typeof this.client.resourceName.valueOf() !== 'string') { + throw new Error('this.client.resourceName cannot be null or undefined and it must be of type string.'); + } + if (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName 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 (fabricName === null || fabricName === undefined || typeof fabricName.valueOf() !== 'string') { + throw new Error('fabricName cannot be null or undefined and it must be of type string.'); + } + if (protectionContainerName === null || protectionContainerName === undefined || typeof protectionContainerName.valueOf() !== 'string') { + throw new Error('protectionContainerName cannot be null or undefined and it must be of type string.'); + } + if (migrationItemName === null || migrationItemName === undefined || typeof migrationItemName.valueOf() !== 'string') { + throw new Error('migrationItemName cannot be null or undefined and it must be of type string.'); + } + if (input === null || input === undefined) { + throw new Error('input 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.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}'; + requestUrl = requestUrl.replace('{resourceName}', encodeURIComponent(this.client.resourceName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{fabricName}', encodeURIComponent(fabricName)); + requestUrl = requestUrl.replace('{protectionContainerName}', encodeURIComponent(protectionContainerName)); + requestUrl = requestUrl.replace('{migrationItemName}', encodeURIComponent(migrationItemName)); + 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 = 'PATCH'; + 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 (input !== null && input !== undefined) { + let requestModelMapper = new client.models['UpdateMigrationItemInput']().mapper(); + requestModel = client.serialize(requestModelMapper, input, 'input'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(input, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + 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['MigrationItem']().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); + }); +} + +/** + * @summary Migrate item. + * + * The operation to initiate migration of the item. + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {object} migrateInput Migrate input. + * + * @param {object} migrateInput.properties Migrate input properties. + * + * @param {object} migrateInput.properties.providerSpecificDetails The provider + * specific details. + * + * @param {string} migrateInput.properties.providerSpecificDetails.instanceType + * Polymorphic Discriminator + * + * @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 MigrationItem} 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 _beginMigrate(fabricName, protectionContainerName, migrationItemName, migrateInput, 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.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.resourceName === null || this.client.resourceName === undefined || typeof this.client.resourceName.valueOf() !== 'string') { + throw new Error('this.client.resourceName cannot be null or undefined and it must be of type string.'); + } + if (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName 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 (fabricName === null || fabricName === undefined || typeof fabricName.valueOf() !== 'string') { + throw new Error('fabricName cannot be null or undefined and it must be of type string.'); + } + if (protectionContainerName === null || protectionContainerName === undefined || typeof protectionContainerName.valueOf() !== 'string') { + throw new Error('protectionContainerName cannot be null or undefined and it must be of type string.'); + } + if (migrationItemName === null || migrationItemName === undefined || typeof migrationItemName.valueOf() !== 'string') { + throw new Error('migrationItemName cannot be null or undefined and it must be of type string.'); + } + if (migrateInput === null || migrateInput === undefined) { + throw new Error('migrateInput 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.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/migrate'; + requestUrl = requestUrl.replace('{resourceName}', encodeURIComponent(this.client.resourceName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{fabricName}', encodeURIComponent(fabricName)); + requestUrl = requestUrl.replace('{protectionContainerName}', encodeURIComponent(protectionContainerName)); + requestUrl = requestUrl.replace('{migrationItemName}', encodeURIComponent(migrationItemName)); + 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 (migrateInput !== null && migrateInput !== undefined) { + let requestModelMapper = new client.models['MigrateInput']().mapper(); + requestModel = client.serialize(requestModelMapper, migrateInput, 'migrateInput'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(migrateInput, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + 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['MigrationItem']().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); + }); +} + +/** + * @summary Test migrate item. + * + * The operation to initiate test migration of the item. + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {object} testMigrateInput Test migrate input. + * + * @param {object} testMigrateInput.properties Test migrate input properties. + * + * @param {object} testMigrateInput.properties.providerSpecificDetails The + * provider specific details. + * + * @param {string} + * testMigrateInput.properties.providerSpecificDetails.instanceType Polymorphic + * Discriminator + * + * @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 MigrationItem} 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 _beginTestMigrate(fabricName, protectionContainerName, migrationItemName, testMigrateInput, 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.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.resourceName === null || this.client.resourceName === undefined || typeof this.client.resourceName.valueOf() !== 'string') { + throw new Error('this.client.resourceName cannot be null or undefined and it must be of type string.'); + } + if (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName 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 (fabricName === null || fabricName === undefined || typeof fabricName.valueOf() !== 'string') { + throw new Error('fabricName cannot be null or undefined and it must be of type string.'); + } + if (protectionContainerName === null || protectionContainerName === undefined || typeof protectionContainerName.valueOf() !== 'string') { + throw new Error('protectionContainerName cannot be null or undefined and it must be of type string.'); + } + if (migrationItemName === null || migrationItemName === undefined || typeof migrationItemName.valueOf() !== 'string') { + throw new Error('migrationItemName cannot be null or undefined and it must be of type string.'); + } + if (testMigrateInput === null || testMigrateInput === undefined) { + throw new Error('testMigrateInput 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.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/testMigrate'; + requestUrl = requestUrl.replace('{resourceName}', encodeURIComponent(this.client.resourceName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{fabricName}', encodeURIComponent(fabricName)); + requestUrl = requestUrl.replace('{protectionContainerName}', encodeURIComponent(protectionContainerName)); + requestUrl = requestUrl.replace('{migrationItemName}', encodeURIComponent(migrationItemName)); + 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 (testMigrateInput !== null && testMigrateInput !== undefined) { + let requestModelMapper = new client.models['TestMigrateInput']().mapper(); + requestModel = client.serialize(requestModelMapper, testMigrateInput, 'testMigrateInput'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(testMigrateInput, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + 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['MigrationItem']().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); + }); +} + +/** + * @summary Test migrate cleanup. + * + * The operation to initiate test migrate cleanup. + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {object} testMigrateCleanupInput Test migrate cleanup input. + * + * @param {object} testMigrateCleanupInput.properties Test migrate cleanup + * input properties. + * + * @param {string} [testMigrateCleanupInput.properties.comments] Test migrate + * cleanup comments. + * + * @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 MigrationItem} 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 _beginTestMigrateCleanup(fabricName, protectionContainerName, migrationItemName, testMigrateCleanupInput, 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.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.resourceName === null || this.client.resourceName === undefined || typeof this.client.resourceName.valueOf() !== 'string') { + throw new Error('this.client.resourceName cannot be null or undefined and it must be of type string.'); + } + if (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName 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 (fabricName === null || fabricName === undefined || typeof fabricName.valueOf() !== 'string') { + throw new Error('fabricName cannot be null or undefined and it must be of type string.'); + } + if (protectionContainerName === null || protectionContainerName === undefined || typeof protectionContainerName.valueOf() !== 'string') { + throw new Error('protectionContainerName cannot be null or undefined and it must be of type string.'); + } + if (migrationItemName === null || migrationItemName === undefined || typeof migrationItemName.valueOf() !== 'string') { + throw new Error('migrationItemName cannot be null or undefined and it must be of type string.'); + } + if (testMigrateCleanupInput === null || testMigrateCleanupInput === undefined) { + throw new Error('testMigrateCleanupInput 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.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/testMigrateCleanup'; + requestUrl = requestUrl.replace('{resourceName}', encodeURIComponent(this.client.resourceName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{fabricName}', encodeURIComponent(fabricName)); + requestUrl = requestUrl.replace('{protectionContainerName}', encodeURIComponent(protectionContainerName)); + requestUrl = requestUrl.replace('{migrationItemName}', encodeURIComponent(migrationItemName)); + 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 (testMigrateCleanupInput !== null && testMigrateCleanupInput !== undefined) { + let requestModelMapper = new client.models['TestMigrateCleanupInput']().mapper(); + requestModel = client.serialize(requestModelMapper, testMigrateCleanupInput, 'testMigrateCleanupInput'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(testMigrateCleanupInput, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + 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['MigrationItem']().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); + }); +} + +/** + * @summary Gets the list of migration items in the protection container. + * + * Gets the list of ASR migration items in the protection container. + * + * @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 - 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 MigrationItemCollection} 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 _listByReplicationProtectionContainersNext(nextPageLink, 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 (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 + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // 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['MigrationItemCollection']().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); + }); +} + +/** + * @summary Gets the list of migration items in the vault. + * + * @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 - 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 MigrationItemCollection} 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 _listNext(nextPageLink, 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 (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 + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // 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['MigrationItemCollection']().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); + }); +} + +/** Class representing a ReplicationMigrationItems. */ +class ReplicationMigrationItems { + /** + * Create a ReplicationMigrationItems. + * @param {SiteRecoveryManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._listByReplicationProtectionContainers = _listByReplicationProtectionContainers; + this._get = _get; + this._create = _create; + this._deleteMethod = _deleteMethod; + this._update = _update; + this._migrate = _migrate; + this._testMigrate = _testMigrate; + this._testMigrateCleanup = _testMigrateCleanup; + this._list = _list; + this._beginCreate = _beginCreate; + this._beginDeleteMethod = _beginDeleteMethod; + this._beginUpdate = _beginUpdate; + this._beginMigrate = _beginMigrate; + this._beginTestMigrate = _beginTestMigrate; + this._beginTestMigrateCleanup = _beginTestMigrateCleanup; + this._listByReplicationProtectionContainersNext = _listByReplicationProtectionContainersNext; + this._listNext = _listNext; + } + + /** + * @summary Gets the list of migration items in the protection container. + * + * Gets the list of ASR migration items in the protection container. + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container 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. + */ + listByReplicationProtectionContainersWithHttpOperationResponse(fabricName, protectionContainerName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByReplicationProtectionContainers(fabricName, protectionContainerName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets the list of migration items in the protection container. + * + * Gets the list of ASR migration items in the protection container. + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container 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 {MigrationItemCollection} - 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 MigrationItemCollection} 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. + */ + listByReplicationProtectionContainers(fabricName, protectionContainerName, 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._listByReplicationProtectionContainers(fabricName, protectionContainerName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByReplicationProtectionContainers(fabricName, protectionContainerName, options, optionalCallback); + } + } + + /** + * @summary Gets the details of a migration item. + * + * @param {string} fabricName Fabric unique name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item 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(fabricName, protectionContainerName, migrationItemName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(fabricName, protectionContainerName, migrationItemName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets the details of a migration item. + * + * @param {string} fabricName Fabric unique name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item 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 {MigrationItem} - 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 MigrationItem} 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(fabricName, protectionContainerName, migrationItemName, 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(fabricName, protectionContainerName, migrationItemName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(fabricName, protectionContainerName, migrationItemName, options, optionalCallback); + } + } + + /** + * @summary Enables migration. + * + * The operation to create an ASR migration item (enable migration). + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {object} input Enable migration input. + * + * @param {object} input.properties Enable migration input properties. + * + * @param {string} input.properties.policyId The policy Id. + * + * @param {object} input.properties.providerSpecificDetails The provider + * specific details. + * + * @param {string} input.properties.providerSpecificDetails.instanceType + * Polymorphic Discriminator + * + * @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. + */ + createWithHttpOperationResponse(fabricName, protectionContainerName, migrationItemName, input, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._create(fabricName, protectionContainerName, migrationItemName, input, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Enables migration. + * + * The operation to create an ASR migration item (enable migration). + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {object} input Enable migration input. + * + * @param {object} input.properties Enable migration input properties. + * + * @param {string} input.properties.policyId The policy Id. + * + * @param {object} input.properties.providerSpecificDetails The provider + * specific details. + * + * @param {string} input.properties.providerSpecificDetails.instanceType + * Polymorphic Discriminator + * + * @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 {MigrationItem} - 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 MigrationItem} 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. + */ + create(fabricName, protectionContainerName, migrationItemName, input, 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._create(fabricName, protectionContainerName, migrationItemName, input, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._create(fabricName, protectionContainerName, migrationItemName, input, options, optionalCallback); + } + } + + /** + * @summary Delete the migration item. + * + * The operation to delete an ASR migration item. + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.deleteOption] The delete option. + * + * @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. + */ + deleteMethodWithHttpOperationResponse(fabricName, protectionContainerName, migrationItemName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(fabricName, protectionContainerName, migrationItemName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Delete the migration item. + * + * The operation to delete an ASR migration item. + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.deleteOption] The delete option. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(fabricName, protectionContainerName, migrationItemName, 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._deleteMethod(fabricName, protectionContainerName, migrationItemName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(fabricName, protectionContainerName, migrationItemName, options, optionalCallback); + } + } + + /** + * @summary Updates migration item. + * + * The operation to update the recovery settings of an ASR migration item. + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {object} input Update migration item input. + * + * @param {object} [input.properties] Update migration item input properties. + * + * @param {object} input.properties.providerSpecificDetails The provider + * specific input to update migration item. + * + * @param {string} input.properties.providerSpecificDetails.instanceType + * Polymorphic Discriminator + * + * @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. + */ + updateWithHttpOperationResponse(fabricName, protectionContainerName, migrationItemName, input, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._update(fabricName, protectionContainerName, migrationItemName, input, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Updates migration item. + * + * The operation to update the recovery settings of an ASR migration item. + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {object} input Update migration item input. + * + * @param {object} [input.properties] Update migration item input properties. + * + * @param {object} input.properties.providerSpecificDetails The provider + * specific input to update migration item. + * + * @param {string} input.properties.providerSpecificDetails.instanceType + * Polymorphic Discriminator + * + * @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 {MigrationItem} - 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 MigrationItem} 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. + */ + update(fabricName, protectionContainerName, migrationItemName, input, 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._update(fabricName, protectionContainerName, migrationItemName, input, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._update(fabricName, protectionContainerName, migrationItemName, input, options, optionalCallback); + } + } + + /** + * @summary Migrate item. + * + * The operation to initiate migration of the item. + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {object} migrateInput Migrate input. + * + * @param {object} migrateInput.properties Migrate input properties. + * + * @param {object} migrateInput.properties.providerSpecificDetails The provider + * specific details. + * + * @param {string} migrateInput.properties.providerSpecificDetails.instanceType + * Polymorphic Discriminator + * + * @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. + */ + migrateWithHttpOperationResponse(fabricName, protectionContainerName, migrationItemName, migrateInput, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._migrate(fabricName, protectionContainerName, migrationItemName, migrateInput, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Migrate item. + * + * The operation to initiate migration of the item. + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {object} migrateInput Migrate input. + * + * @param {object} migrateInput.properties Migrate input properties. + * + * @param {object} migrateInput.properties.providerSpecificDetails The provider + * specific details. + * + * @param {string} migrateInput.properties.providerSpecificDetails.instanceType + * Polymorphic Discriminator + * + * @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 {MigrationItem} - 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 MigrationItem} 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. + */ + migrate(fabricName, protectionContainerName, migrationItemName, migrateInput, 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._migrate(fabricName, protectionContainerName, migrationItemName, migrateInput, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._migrate(fabricName, protectionContainerName, migrationItemName, migrateInput, options, optionalCallback); + } + } + + /** + * @summary Test migrate item. + * + * The operation to initiate test migration of the item. + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {object} testMigrateInput Test migrate input. + * + * @param {object} testMigrateInput.properties Test migrate input properties. + * + * @param {object} testMigrateInput.properties.providerSpecificDetails The + * provider specific details. + * + * @param {string} + * testMigrateInput.properties.providerSpecificDetails.instanceType Polymorphic + * Discriminator + * + * @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. + */ + testMigrateWithHttpOperationResponse(fabricName, protectionContainerName, migrationItemName, testMigrateInput, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._testMigrate(fabricName, protectionContainerName, migrationItemName, testMigrateInput, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Test migrate item. + * + * The operation to initiate test migration of the item. + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {object} testMigrateInput Test migrate input. + * + * @param {object} testMigrateInput.properties Test migrate input properties. + * + * @param {object} testMigrateInput.properties.providerSpecificDetails The + * provider specific details. + * + * @param {string} + * testMigrateInput.properties.providerSpecificDetails.instanceType Polymorphic + * Discriminator + * + * @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 {MigrationItem} - 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 MigrationItem} 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. + */ + testMigrate(fabricName, protectionContainerName, migrationItemName, testMigrateInput, 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._testMigrate(fabricName, protectionContainerName, migrationItemName, testMigrateInput, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._testMigrate(fabricName, protectionContainerName, migrationItemName, testMigrateInput, options, optionalCallback); + } + } + + /** + * @summary Test migrate cleanup. + * + * The operation to initiate test migrate cleanup. + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {object} testMigrateCleanupInput Test migrate cleanup input. + * + * @param {object} testMigrateCleanupInput.properties Test migrate cleanup + * input properties. + * + * @param {string} [testMigrateCleanupInput.properties.comments] Test migrate + * cleanup comments. + * + * @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. + */ + testMigrateCleanupWithHttpOperationResponse(fabricName, protectionContainerName, migrationItemName, testMigrateCleanupInput, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._testMigrateCleanup(fabricName, protectionContainerName, migrationItemName, testMigrateCleanupInput, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Test migrate cleanup. + * + * The operation to initiate test migrate cleanup. + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {object} testMigrateCleanupInput Test migrate cleanup input. + * + * @param {object} testMigrateCleanupInput.properties Test migrate cleanup + * input properties. + * + * @param {string} [testMigrateCleanupInput.properties.comments] Test migrate + * cleanup comments. + * + * @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 {MigrationItem} - 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 MigrationItem} 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. + */ + testMigrateCleanup(fabricName, protectionContainerName, migrationItemName, testMigrateCleanupInput, 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._testMigrateCleanup(fabricName, protectionContainerName, migrationItemName, testMigrateCleanupInput, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._testMigrateCleanup(fabricName, protectionContainerName, migrationItemName, testMigrateCleanupInput, options, optionalCallback); + } + } + + /** + * @summary Gets the list of migration items in the vault. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.skipToken] The pagination token. + * + * @param {string} [options.filter] OData filter options. + * + * @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. + */ + listWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets the list of migration items in the vault. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.skipToken] The pagination token. + * + * @param {string} [options.filter] OData filter options. + * + * @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 {MigrationItemCollection} - 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 MigrationItemCollection} 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. + */ + list(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._list(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(options, optionalCallback); + } + } + + /** + * @summary Enables migration. + * + * The operation to create an ASR migration item (enable migration). + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {object} input Enable migration input. + * + * @param {object} input.properties Enable migration input properties. + * + * @param {string} input.properties.policyId The policy Id. + * + * @param {object} input.properties.providerSpecificDetails The provider + * specific details. + * + * @param {string} input.properties.providerSpecificDetails.instanceType + * Polymorphic Discriminator + * + * @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. + */ + beginCreateWithHttpOperationResponse(fabricName, protectionContainerName, migrationItemName, input, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreate(fabricName, protectionContainerName, migrationItemName, input, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Enables migration. + * + * The operation to create an ASR migration item (enable migration). + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {object} input Enable migration input. + * + * @param {object} input.properties Enable migration input properties. + * + * @param {string} input.properties.policyId The policy Id. + * + * @param {object} input.properties.providerSpecificDetails The provider + * specific details. + * + * @param {string} input.properties.providerSpecificDetails.instanceType + * Polymorphic Discriminator + * + * @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 {MigrationItem} - 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 MigrationItem} 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. + */ + beginCreate(fabricName, protectionContainerName, migrationItemName, input, 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._beginCreate(fabricName, protectionContainerName, migrationItemName, input, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreate(fabricName, protectionContainerName, migrationItemName, input, options, optionalCallback); + } + } + + /** + * @summary Delete the migration item. + * + * The operation to delete an ASR migration item. + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.deleteOption] The delete option. + * + * @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. + */ + beginDeleteMethodWithHttpOperationResponse(fabricName, protectionContainerName, migrationItemName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(fabricName, protectionContainerName, migrationItemName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Delete the migration item. + * + * The operation to delete an ASR migration item. + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.deleteOption] The delete option. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(fabricName, protectionContainerName, migrationItemName, 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._beginDeleteMethod(fabricName, protectionContainerName, migrationItemName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(fabricName, protectionContainerName, migrationItemName, options, optionalCallback); + } + } + + /** + * @summary Updates migration item. + * + * The operation to update the recovery settings of an ASR migration item. + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {object} input Update migration item input. + * + * @param {object} [input.properties] Update migration item input properties. + * + * @param {object} input.properties.providerSpecificDetails The provider + * specific input to update migration item. + * + * @param {string} input.properties.providerSpecificDetails.instanceType + * Polymorphic Discriminator + * + * @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. + */ + beginUpdateWithHttpOperationResponse(fabricName, protectionContainerName, migrationItemName, input, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginUpdate(fabricName, protectionContainerName, migrationItemName, input, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Updates migration item. + * + * The operation to update the recovery settings of an ASR migration item. + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {object} input Update migration item input. + * + * @param {object} [input.properties] Update migration item input properties. + * + * @param {object} input.properties.providerSpecificDetails The provider + * specific input to update migration item. + * + * @param {string} input.properties.providerSpecificDetails.instanceType + * Polymorphic Discriminator + * + * @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 {MigrationItem} - 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 MigrationItem} 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. + */ + beginUpdate(fabricName, protectionContainerName, migrationItemName, input, 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._beginUpdate(fabricName, protectionContainerName, migrationItemName, input, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginUpdate(fabricName, protectionContainerName, migrationItemName, input, options, optionalCallback); + } + } + + /** + * @summary Migrate item. + * + * The operation to initiate migration of the item. + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {object} migrateInput Migrate input. + * + * @param {object} migrateInput.properties Migrate input properties. + * + * @param {object} migrateInput.properties.providerSpecificDetails The provider + * specific details. + * + * @param {string} migrateInput.properties.providerSpecificDetails.instanceType + * Polymorphic Discriminator + * + * @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. + */ + beginMigrateWithHttpOperationResponse(fabricName, protectionContainerName, migrationItemName, migrateInput, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginMigrate(fabricName, protectionContainerName, migrationItemName, migrateInput, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Migrate item. + * + * The operation to initiate migration of the item. + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {object} migrateInput Migrate input. + * + * @param {object} migrateInput.properties Migrate input properties. + * + * @param {object} migrateInput.properties.providerSpecificDetails The provider + * specific details. + * + * @param {string} migrateInput.properties.providerSpecificDetails.instanceType + * Polymorphic Discriminator + * + * @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 {MigrationItem} - 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 MigrationItem} 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. + */ + beginMigrate(fabricName, protectionContainerName, migrationItemName, migrateInput, 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._beginMigrate(fabricName, protectionContainerName, migrationItemName, migrateInput, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginMigrate(fabricName, protectionContainerName, migrationItemName, migrateInput, options, optionalCallback); + } + } + + /** + * @summary Test migrate item. + * + * The operation to initiate test migration of the item. + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {object} testMigrateInput Test migrate input. + * + * @param {object} testMigrateInput.properties Test migrate input properties. + * + * @param {object} testMigrateInput.properties.providerSpecificDetails The + * provider specific details. + * + * @param {string} + * testMigrateInput.properties.providerSpecificDetails.instanceType Polymorphic + * Discriminator + * + * @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. + */ + beginTestMigrateWithHttpOperationResponse(fabricName, protectionContainerName, migrationItemName, testMigrateInput, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginTestMigrate(fabricName, protectionContainerName, migrationItemName, testMigrateInput, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Test migrate item. + * + * The operation to initiate test migration of the item. + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {object} testMigrateInput Test migrate input. + * + * @param {object} testMigrateInput.properties Test migrate input properties. + * + * @param {object} testMigrateInput.properties.providerSpecificDetails The + * provider specific details. + * + * @param {string} + * testMigrateInput.properties.providerSpecificDetails.instanceType Polymorphic + * Discriminator + * + * @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 {MigrationItem} - 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 MigrationItem} 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. + */ + beginTestMigrate(fabricName, protectionContainerName, migrationItemName, testMigrateInput, 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._beginTestMigrate(fabricName, protectionContainerName, migrationItemName, testMigrateInput, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginTestMigrate(fabricName, protectionContainerName, migrationItemName, testMigrateInput, options, optionalCallback); + } + } + + /** + * @summary Test migrate cleanup. + * + * The operation to initiate test migrate cleanup. + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {object} testMigrateCleanupInput Test migrate cleanup input. + * + * @param {object} testMigrateCleanupInput.properties Test migrate cleanup + * input properties. + * + * @param {string} [testMigrateCleanupInput.properties.comments] Test migrate + * cleanup comments. + * + * @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. + */ + beginTestMigrateCleanupWithHttpOperationResponse(fabricName, protectionContainerName, migrationItemName, testMigrateCleanupInput, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginTestMigrateCleanup(fabricName, protectionContainerName, migrationItemName, testMigrateCleanupInput, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Test migrate cleanup. + * + * The operation to initiate test migrate cleanup. + * + * @param {string} fabricName Fabric name. + * + * @param {string} protectionContainerName Protection container name. + * + * @param {string} migrationItemName Migration item name. + * + * @param {object} testMigrateCleanupInput Test migrate cleanup input. + * + * @param {object} testMigrateCleanupInput.properties Test migrate cleanup + * input properties. + * + * @param {string} [testMigrateCleanupInput.properties.comments] Test migrate + * cleanup comments. + * + * @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 {MigrationItem} - 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 MigrationItem} 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. + */ + beginTestMigrateCleanup(fabricName, protectionContainerName, migrationItemName, testMigrateCleanupInput, 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._beginTestMigrateCleanup(fabricName, protectionContainerName, migrationItemName, testMigrateCleanupInput, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginTestMigrateCleanup(fabricName, protectionContainerName, migrationItemName, testMigrateCleanupInput, options, optionalCallback); + } + } + + /** + * @summary Gets the list of migration items in the protection container. + * + * Gets the list of ASR migration items in the protection container. + * + * @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 + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByReplicationProtectionContainersNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByReplicationProtectionContainersNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets the list of migration items in the protection container. + * + * Gets the list of ASR migration items in the protection container. + * + * @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} [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 {MigrationItemCollection} - 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 MigrationItemCollection} 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. + */ + listByReplicationProtectionContainersNext(nextPageLink, 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._listByReplicationProtectionContainersNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByReplicationProtectionContainersNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Gets the list of migration items in the vault. + * + * @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 + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets the list of migration items in the vault. + * + * @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} [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 {MigrationItemCollection} - 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 MigrationItemCollection} 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. + */ + listNext(nextPageLink, 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._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = ReplicationMigrationItems; diff --git a/lib/services/recoveryServicesSiteRecoveryManagement/lib/operations/replicationRecoveryServicesProviders.js b/lib/services/recoveryServicesSiteRecoveryManagement/lib/operations/replicationRecoveryServicesProviders.js index 07955bd37e..71f668298c 100644 --- a/lib/services/recoveryServicesSiteRecoveryManagement/lib/operations/replicationRecoveryServicesProviders.js +++ b/lib/services/recoveryServicesSiteRecoveryManagement/lib/operations/replicationRecoveryServicesProviders.js @@ -322,6 +322,125 @@ function _get(fabricName, providerName, options, callback) { } +/** + * @summary Adds a recovery services provider. + * + * The operation to add a recovery services provider. + * + * @param {string} fabricName Fabric name. + * + * @param {string} providerName Recovery services provider name. + * + * @param {object} addProviderInput Add provider input. + * + * @param {object} addProviderInput.properties The properties of an add + * provider request. + * + * @param {string} addProviderInput.properties.machineName The name of the + * machine where the provider is getting added. + * + * @param {object} addProviderInput.properties.authenticationIdentityInput The + * identity provider input for DRA authentication. + * + * @param {object} addProviderInput.properties.resourceAccessIdentityInput The + * identity provider input for resource access. + * + * @param {string} + * addProviderInput.properties.resourceAccessIdentityInput.tenantId The tenant + * Id for the service principal with which the on-premise management/data plane + * components would communicate with our Azure services. + * + * @param {string} + * addProviderInput.properties.resourceAccessIdentityInput.applicationId The + * application/client Id for the service principal with which the on-premise + * management/data plane components would communicate with our Azure services. + * + * @param {string} + * addProviderInput.properties.resourceAccessIdentityInput.objectId The object + * Id of the service principal with which the on-premise management/data plane + * components would communicate with our Azure services. + * + * @param {string} + * addProviderInput.properties.resourceAccessIdentityInput.audience The + * intended Audience of the service principal with which the on-premise + * management/data plane components would communicate with our Azure services. + * + * @param {string} + * addProviderInput.properties.resourceAccessIdentityInput.aadAuthority The + * base authority for Azure Active Directory authentication. + * + * @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 RecoveryServicesProvider} 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 _create(fabricName, providerName, addProviderInput, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginCreate(fabricName, providerName, addProviderInput, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['RecoveryServicesProvider']().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); + }); + }); +} + + /** * @summary Purges recovery service provider from fabric * @@ -684,6 +803,217 @@ function _list(options, callback) { }); } +/** + * @summary Adds a recovery services provider. + * + * The operation to add a recovery services provider. + * + * @param {string} fabricName Fabric name. + * + * @param {string} providerName Recovery services provider name. + * + * @param {object} addProviderInput Add provider input. + * + * @param {object} addProviderInput.properties The properties of an add + * provider request. + * + * @param {string} addProviderInput.properties.machineName The name of the + * machine where the provider is getting added. + * + * @param {object} addProviderInput.properties.authenticationIdentityInput The + * identity provider input for DRA authentication. + * + * @param {object} addProviderInput.properties.resourceAccessIdentityInput The + * identity provider input for resource access. + * + * @param {string} + * addProviderInput.properties.resourceAccessIdentityInput.tenantId The tenant + * Id for the service principal with which the on-premise management/data plane + * components would communicate with our Azure services. + * + * @param {string} + * addProviderInput.properties.resourceAccessIdentityInput.applicationId The + * application/client Id for the service principal with which the on-premise + * management/data plane components would communicate with our Azure services. + * + * @param {string} + * addProviderInput.properties.resourceAccessIdentityInput.objectId The object + * Id of the service principal with which the on-premise management/data plane + * components would communicate with our Azure services. + * + * @param {string} + * addProviderInput.properties.resourceAccessIdentityInput.audience The + * intended Audience of the service principal with which the on-premise + * management/data plane components would communicate with our Azure services. + * + * @param {string} + * addProviderInput.properties.resourceAccessIdentityInput.aadAuthority The + * base authority for Azure Active Directory authentication. + * + * @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 RecoveryServicesProvider} 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 _beginCreate(fabricName, providerName, addProviderInput, 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.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.resourceName === null || this.client.resourceName === undefined || typeof this.client.resourceName.valueOf() !== 'string') { + throw new Error('this.client.resourceName cannot be null or undefined and it must be of type string.'); + } + if (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName 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 (fabricName === null || fabricName === undefined || typeof fabricName.valueOf() !== 'string') { + throw new Error('fabricName cannot be null or undefined and it must be of type string.'); + } + if (providerName === null || providerName === undefined || typeof providerName.valueOf() !== 'string') { + throw new Error('providerName cannot be null or undefined and it must be of type string.'); + } + if (addProviderInput === null || addProviderInput === undefined) { + throw new Error('addProviderInput 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.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}'; + requestUrl = requestUrl.replace('{resourceName}', encodeURIComponent(this.client.resourceName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{fabricName}', encodeURIComponent(fabricName)); + requestUrl = requestUrl.replace('{providerName}', encodeURIComponent(providerName)); + 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 = 'PUT'; + 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 (addProviderInput !== null && addProviderInput !== undefined) { + let requestModelMapper = new client.models['AddRecoveryServicesProviderInput']().mapper(); + requestModel = client.serialize(requestModelMapper, addProviderInput, 'addProviderInput'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(addProviderInput, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + 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['RecoveryServicesProvider']().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); + }); +} + /** * @summary Purges recovery service provider from fabric * @@ -1393,10 +1723,12 @@ class ReplicationRecoveryServicesProviders { this.client = client; this._listByReplicationFabrics = _listByReplicationFabrics; this._get = _get; + this._create = _create; this._purge = _purge; this._refreshProvider = _refreshProvider; this._deleteMethod = _deleteMethod; this._list = _list; + this._beginCreate = _beginCreate; this._beginPurge = _beginPurge; this._beginRefreshProvider = _beginRefreshProvider; this._beginDeleteMethod = _beginDeleteMethod; @@ -1584,6 +1916,173 @@ class ReplicationRecoveryServicesProviders { } } + /** + * @summary Adds a recovery services provider. + * + * The operation to add a recovery services provider. + * + * @param {string} fabricName Fabric name. + * + * @param {string} providerName Recovery services provider name. + * + * @param {object} addProviderInput Add provider input. + * + * @param {object} addProviderInput.properties The properties of an add + * provider request. + * + * @param {string} addProviderInput.properties.machineName The name of the + * machine where the provider is getting added. + * + * @param {object} addProviderInput.properties.authenticationIdentityInput The + * identity provider input for DRA authentication. + * + * @param {object} addProviderInput.properties.resourceAccessIdentityInput The + * identity provider input for resource access. + * + * @param {string} + * addProviderInput.properties.resourceAccessIdentityInput.tenantId The tenant + * Id for the service principal with which the on-premise management/data plane + * components would communicate with our Azure services. + * + * @param {string} + * addProviderInput.properties.resourceAccessIdentityInput.applicationId The + * application/client Id for the service principal with which the on-premise + * management/data plane components would communicate with our Azure services. + * + * @param {string} + * addProviderInput.properties.resourceAccessIdentityInput.objectId The object + * Id of the service principal with which the on-premise management/data plane + * components would communicate with our Azure services. + * + * @param {string} + * addProviderInput.properties.resourceAccessIdentityInput.audience The + * intended Audience of the service principal with which the on-premise + * management/data plane components would communicate with our Azure services. + * + * @param {string} + * addProviderInput.properties.resourceAccessIdentityInput.aadAuthority The + * base authority for Azure Active Directory authentication. + * + * @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. + */ + createWithHttpOperationResponse(fabricName, providerName, addProviderInput, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._create(fabricName, providerName, addProviderInput, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Adds a recovery services provider. + * + * The operation to add a recovery services provider. + * + * @param {string} fabricName Fabric name. + * + * @param {string} providerName Recovery services provider name. + * + * @param {object} addProviderInput Add provider input. + * + * @param {object} addProviderInput.properties The properties of an add + * provider request. + * + * @param {string} addProviderInput.properties.machineName The name of the + * machine where the provider is getting added. + * + * @param {object} addProviderInput.properties.authenticationIdentityInput The + * identity provider input for DRA authentication. + * + * @param {object} addProviderInput.properties.resourceAccessIdentityInput The + * identity provider input for resource access. + * + * @param {string} + * addProviderInput.properties.resourceAccessIdentityInput.tenantId The tenant + * Id for the service principal with which the on-premise management/data plane + * components would communicate with our Azure services. + * + * @param {string} + * addProviderInput.properties.resourceAccessIdentityInput.applicationId The + * application/client Id for the service principal with which the on-premise + * management/data plane components would communicate with our Azure services. + * + * @param {string} + * addProviderInput.properties.resourceAccessIdentityInput.objectId The object + * Id of the service principal with which the on-premise management/data plane + * components would communicate with our Azure services. + * + * @param {string} + * addProviderInput.properties.resourceAccessIdentityInput.audience The + * intended Audience of the service principal with which the on-premise + * management/data plane components would communicate with our Azure services. + * + * @param {string} + * addProviderInput.properties.resourceAccessIdentityInput.aadAuthority The + * base authority for Azure Active Directory authentication. + * + * @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 {RecoveryServicesProvider} - 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 RecoveryServicesProvider} 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. + */ + create(fabricName, providerName, addProviderInput, 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._create(fabricName, providerName, addProviderInput, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._create(fabricName, providerName, addProviderInput, options, optionalCallback); + } + } + /** * @summary Purges recovery service provider from fabric * @@ -1952,6 +2451,173 @@ class ReplicationRecoveryServicesProviders { } } + /** + * @summary Adds a recovery services provider. + * + * The operation to add a recovery services provider. + * + * @param {string} fabricName Fabric name. + * + * @param {string} providerName Recovery services provider name. + * + * @param {object} addProviderInput Add provider input. + * + * @param {object} addProviderInput.properties The properties of an add + * provider request. + * + * @param {string} addProviderInput.properties.machineName The name of the + * machine where the provider is getting added. + * + * @param {object} addProviderInput.properties.authenticationIdentityInput The + * identity provider input for DRA authentication. + * + * @param {object} addProviderInput.properties.resourceAccessIdentityInput The + * identity provider input for resource access. + * + * @param {string} + * addProviderInput.properties.resourceAccessIdentityInput.tenantId The tenant + * Id for the service principal with which the on-premise management/data plane + * components would communicate with our Azure services. + * + * @param {string} + * addProviderInput.properties.resourceAccessIdentityInput.applicationId The + * application/client Id for the service principal with which the on-premise + * management/data plane components would communicate with our Azure services. + * + * @param {string} + * addProviderInput.properties.resourceAccessIdentityInput.objectId The object + * Id of the service principal with which the on-premise management/data plane + * components would communicate with our Azure services. + * + * @param {string} + * addProviderInput.properties.resourceAccessIdentityInput.audience The + * intended Audience of the service principal with which the on-premise + * management/data plane components would communicate with our Azure services. + * + * @param {string} + * addProviderInput.properties.resourceAccessIdentityInput.aadAuthority The + * base authority for Azure Active Directory authentication. + * + * @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. + */ + beginCreateWithHttpOperationResponse(fabricName, providerName, addProviderInput, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreate(fabricName, providerName, addProviderInput, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Adds a recovery services provider. + * + * The operation to add a recovery services provider. + * + * @param {string} fabricName Fabric name. + * + * @param {string} providerName Recovery services provider name. + * + * @param {object} addProviderInput Add provider input. + * + * @param {object} addProviderInput.properties The properties of an add + * provider request. + * + * @param {string} addProviderInput.properties.machineName The name of the + * machine where the provider is getting added. + * + * @param {object} addProviderInput.properties.authenticationIdentityInput The + * identity provider input for DRA authentication. + * + * @param {object} addProviderInput.properties.resourceAccessIdentityInput The + * identity provider input for resource access. + * + * @param {string} + * addProviderInput.properties.resourceAccessIdentityInput.tenantId The tenant + * Id for the service principal with which the on-premise management/data plane + * components would communicate with our Azure services. + * + * @param {string} + * addProviderInput.properties.resourceAccessIdentityInput.applicationId The + * application/client Id for the service principal with which the on-premise + * management/data plane components would communicate with our Azure services. + * + * @param {string} + * addProviderInput.properties.resourceAccessIdentityInput.objectId The object + * Id of the service principal with which the on-premise management/data plane + * components would communicate with our Azure services. + * + * @param {string} + * addProviderInput.properties.resourceAccessIdentityInput.audience The + * intended Audience of the service principal with which the on-premise + * management/data plane components would communicate with our Azure services. + * + * @param {string} + * addProviderInput.properties.resourceAccessIdentityInput.aadAuthority The + * base authority for Azure Active Directory authentication. + * + * @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 {RecoveryServicesProvider} - 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 RecoveryServicesProvider} 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. + */ + beginCreate(fabricName, providerName, addProviderInput, 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._beginCreate(fabricName, providerName, addProviderInput, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreate(fabricName, providerName, addProviderInput, options, optionalCallback); + } + } + /** * @summary Purges recovery service provider from fabric * diff --git a/lib/services/recoveryServicesSiteRecoveryManagement/lib/siteRecoveryManagementClient.d.ts b/lib/services/recoveryServicesSiteRecoveryManagement/lib/siteRecoveryManagementClient.d.ts index ae7a2347cd..85e0ccecbd 100644 --- a/lib/services/recoveryServicesSiteRecoveryManagement/lib/siteRecoveryManagementClient.d.ts +++ b/lib/services/recoveryServicesSiteRecoveryManagement/lib/siteRecoveryManagementClient.d.ts @@ -72,6 +72,8 @@ export default class SiteRecoveryManagementClient extends AzureServiceClient { replicationNetworks: operations.ReplicationNetworks; replicationNetworkMappings: operations.ReplicationNetworkMappings; replicationProtectionContainers: operations.ReplicationProtectionContainers; + replicationMigrationItems: operations.ReplicationMigrationItems; + migrationRecoveryPoints: operations.MigrationRecoveryPoints; replicationProtectableItems: operations.ReplicationProtectableItems; replicationProtectedItems: operations.ReplicationProtectedItems; recoveryPoints: operations.RecoveryPoints; diff --git a/lib/services/recoveryServicesSiteRecoveryManagement/lib/siteRecoveryManagementClient.js b/lib/services/recoveryServicesSiteRecoveryManagement/lib/siteRecoveryManagementClient.js index 7424119f7f..3bab6af590 100644 --- a/lib/services/recoveryServicesSiteRecoveryManagement/lib/siteRecoveryManagementClient.js +++ b/lib/services/recoveryServicesSiteRecoveryManagement/lib/siteRecoveryManagementClient.js @@ -90,6 +90,8 @@ class SiteRecoveryManagementClient extends ServiceClient { this.replicationNetworks = new operations.ReplicationNetworks(this); this.replicationNetworkMappings = new operations.ReplicationNetworkMappings(this); this.replicationProtectionContainers = new operations.ReplicationProtectionContainers(this); + this.replicationMigrationItems = new operations.ReplicationMigrationItems(this); + this.migrationRecoveryPoints = new operations.MigrationRecoveryPoints(this); this.replicationProtectableItems = new operations.ReplicationProtectableItems(this); this.replicationProtectedItems = new operations.ReplicationProtectedItems(this); this.recoveryPoints = new operations.RecoveryPoints(this); diff --git a/lib/services/recoveryServicesSiteRecoveryManagement/package.json b/lib/services/recoveryServicesSiteRecoveryManagement/package.json index 0408434f98..129991b2bc 100644 --- a/lib/services/recoveryServicesSiteRecoveryManagement/package.json +++ b/lib/services/recoveryServicesSiteRecoveryManagement/package.json @@ -22,4 +22,4 @@ "bugs": { "url": "https://github.com/azure/azure-sdk-for-node/issues" } -} \ No newline at end of file +}