diff --git a/lib/services/migrateManagement/LICENSE.txt b/lib/services/migrateManagement/LICENSE.txt index a70e8cf660..5431ba98b9 100644 --- a/lib/services/migrateManagement/LICENSE.txt +++ b/lib/services/migrateManagement/LICENSE.txt @@ -1,21 +1,21 @@ -The MIT License (MIT) - -Copyright (c) 2018 Microsoft - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +The MIT License (MIT) + +Copyright (c) 2018 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/lib/services/migrateManagement/README.md b/lib/services/migrateManagement/README.md index 164a6339ac..bc08e7705d 100644 --- a/lib/services/migrateManagement/README.md +++ b/lib/services/migrateManagement/README.md @@ -1,36 +1,42 @@ -# Microsoft Azure SDK for Node.js - AzureMigrate -This project provides a Node.js package for accessing Azure. Right now it supports: -- **Node.js version 6.x.x or higher** - -## Features - - -## How to Install - -```bash -npm install azure-arm-migrate -``` - -## How to use - -### Authentication, client creation and list projects as an example. - -```javascript -const msRestAzure = require("ms-rest-azure"); -const AzureMigrate = require("azure-arm-migrate"); -msRestAzure.interactiveLogin().then((creds) => { - const subscriptionId = ""; - const client = new AzureMigrate(creds, subscriptionId); - const resourceGroupName = "testresourceGroupName"; - return client.projects.list(resourceGroupName).then((result) => { - console.log("The result is:"); - console.log(result); - }); -}).catch((err) => { - console.log('An error ocurred:'); - console.dir(err, {depth: null, colors: true}); -}); - -## Related projects - -- [Microsoft Azure SDK for Node.js](https://github.com/Azure/azure-sdk-for-node) +--- +uid: azure-arm-migrate +summary: *content + +--- +**This SDK will be deprecated next year and will be replaced by a new TypeScript-based isomorphic SDK (found at https://github.com/Azure/azure-sdk-for-js) which works on Node.js and browsers.** +## Microsoft Azure SDK for Node.js - AzureMigrate +This project provides a Node.js package for accessing Azure. Right now it supports: +- **Node.js version 6.x.x or higher** + +### Features + + +### How to Install + +```bash +npm install azure-arm-migrate +``` + +### How to use + +#### Authentication, client creation and get assessmentOptions as an example. + +```javascript +const msRestAzure = require("ms-rest-azure"); +const AzureMigrate = require("azure-arm-migrate"); +msRestAzure.interactiveLogin().then((creds) => { + const subscriptionId = ""; + const client = new AzureMigrate(creds, subscriptionId); + const locationName = "testlocationName"; + return client.assessmentOptions.get(locationName).then((result) => { + console.log("The result is:"); + console.log(result); + }); +}).catch((err) => { + console.log('An error occurred:'); + console.dir(err, {depth: null, colors: true}); +}); + +### Related projects + +- [Microsoft Azure SDK for Node.js](https://github.com/Azure/azure-sdk-for-node) diff --git a/lib/services/migrateManagement/lib/azureMigrate.d.ts b/lib/services/migrateManagement/lib/azureMigrate.d.ts index 36f2fe500c..0eed92dc66 100644 --- a/lib/services/migrateManagement/lib/azureMigrate.d.ts +++ b/lib/services/migrateManagement/lib/azureMigrate.d.ts @@ -36,9 +36,9 @@ export default class AzureMigrate extends AzureServiceClient { * * @param {string} [options.acceptLanguage] - Standard request header. Used by service to respond to client in appropriate language. * - * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * @param {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30. * - * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. * */ constructor(credentials: ServiceClientCredentials, subscriptionId: string, baseUri?: string, options?: AzureServiceClientOptions); @@ -56,6 +56,8 @@ export default class AzureMigrate extends AzureServiceClient { generateClientRequestId: boolean; // Operation groups + location: operations.Location; + assessmentOptions: operations.AssessmentOptions; projects: operations.Projects; machines: operations.Machines; groups: operations.Groups; diff --git a/lib/services/migrateManagement/lib/azureMigrate.js b/lib/services/migrateManagement/lib/azureMigrate.js index ea44a7bb93..0556ee2aa0 100644 --- a/lib/services/migrateManagement/lib/azureMigrate.js +++ b/lib/services/migrateManagement/lib/azureMigrate.js @@ -35,8 +35,8 @@ class AzureMigrate extends ServiceClient { * {@link https://github.com/request/request#requestoptions-callback Options doc} * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy * @param {string} [options.acceptLanguage] - Standard request header. Used by service to respond to client in appropriate language. - * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. - * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * @param {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30. + * @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ constructor(credentials, subscriptionId, baseUri, options) { if (credentials === null || credentials === undefined) { @@ -71,6 +71,8 @@ class AzureMigrate extends ServiceClient { if(options.generateClientRequestId !== null && options.generateClientRequestId !== undefined) { this.generateClientRequestId = options.generateClientRequestId; } + this.location = new operations.Location(this); + this.assessmentOptions = new operations.AssessmentOptions(this); this.projects = new operations.Projects(this); this.machines = new operations.Machines(this); this.groups = new operations.Groups(this); diff --git a/lib/services/migrateManagement/lib/models/assessedDisk.js b/lib/services/migrateManagement/lib/models/assessedDisk.js index b11405f0b9..5b0fe7f8c3 100644 --- a/lib/services/migrateManagement/lib/models/assessedDisk.js +++ b/lib/services/migrateManagement/lib/models/assessedDisk.js @@ -17,51 +17,51 @@ class AssessedDisk { /** * Create a AssessedDisk. - * @member {string} [name] Name of the assessed disk. - * @member {number} [gigabytesProvisioned] Gigabytes of storage provisioned + * @property {string} [name] Name of the assessed disk. + * @property {number} [gigabytesProvisioned] Gigabytes of storage provisioned * for this disk. - * @member {number} [gigabytesConsumed] Gigabytes of storage consumed by this - * disk. - * @member {number} [megabytesPerSecondOfRead] Disk throughput in MegaBytes + * @property {number} [gigabytesConsumed] Gigabytes of storage consumed by + * this disk. + * @property {number} [megabytesPerSecondOfRead] Disk throughput in MegaBytes * per second. - * @member {number} [megabytesPerSecondOfReadDataPointsExpected] Expected + * @property {number} [megabytesPerSecondOfReadDataPointsExpected] Expected * data points for MegaBytes per second of read. - * @member {number} [megabytesPerSecondOfReadDataPointsReceived] Received + * @property {number} [megabytesPerSecondOfReadDataPointsReceived] Received * data points for MegaBytes per second of read. - * @member {number} [megabytesPerSecondOfWrite] Disk throughput in MegaBytes - * per second. - * @member {number} [megabytesPerSecondOfWriteDataPointsExpected] Expected + * @property {number} [megabytesPerSecondOfWrite] Disk throughput in + * MegaBytes per second. + * @property {number} [megabytesPerSecondOfWriteDataPointsExpected] Expected * data points for MegaBytes per second of write. - * @member {number} [megabytesPerSecondOfWriteDataPointsReceived] Received + * @property {number} [megabytesPerSecondOfWriteDataPointsReceived] Received * data points for MegaBytes per second of write. - * @member {number} [numberOfReadOperationsPerSecond] Number of read + * @property {number} [numberOfReadOperationsPerSecond] Number of read * operations per second for the disk. - * @member {number} [numberOfReadOperationsPerSecondDataPointsExpected] + * @property {number} [numberOfReadOperationsPerSecondDataPointsExpected] * Expected number of data points for read operations per second. - * @member {number} [numberOfReadOperationsPerSecondDataPointsReceived] + * @property {number} [numberOfReadOperationsPerSecondDataPointsReceived] * Received number of data points for read operations per second. - * @member {number} [numberOfWriteOperationsPerSecond] Number of read and + * @property {number} [numberOfWriteOperationsPerSecond] Number of read and * write operations per second for the disk. - * @member {number} [numberOfWriteOperationsPerSecondDataPointsExpected] + * @property {number} [numberOfWriteOperationsPerSecondDataPointsExpected] * Expected number of data points for write operations per second. - * @member {number} [numberOfWriteOperationsPerSecondDataPointsReceived] + * @property {number} [numberOfWriteOperationsPerSecondDataPointsReceived] * Received number of data points for write operations per second. - * @member {number} [monthlyStorageCost] Estimated aggregate storage cost for - * a 31-day month for this disk. - * @member {string} [recommendedDiskType] Storage type selected for this + * @property {number} [monthlyStorageCost] Estimated aggregate storage cost + * for a 31-day month for this disk. + * @property {string} [recommendedDiskType] Storage type selected for this * disk. Possible values include: 'Unknown', 'Standard', 'Premium' - * @member {string} [recommendedDiskSize] Recommended Azure size for the + * @property {string} [recommendedDiskSize] Recommended Azure size for the * disk, given utilization data and preferences set on Assessment. Possible * values include: 'Unknown', 'Standard_S4', 'Standard_S6', 'Standard_S10', * 'Standard_S20', 'Standard_S30', 'Standard_S40', 'Standard_S50', * 'Premium_P4', 'Premium_P6', 'Premium_P10', 'Premium_P20', 'Premium_P30', * 'Premium_P40', 'Premium_P50' - * @member {number} [gigabytesForRecommendedDiskSize] Gigabytes of storage + * @property {number} [gigabytesForRecommendedDiskSize] Gigabytes of storage * provided by the recommended Azure disk size. - * @member {string} [suitability] Whether this disk is suitable for Azure. + * @property {string} [suitability] Whether this disk is suitable for Azure. * Possible values include: 'Unknown', 'NotSuitable', 'Suitable', * 'ConditionallySuitable', 'ReadinessUnknown' - * @member {string} [suitabilityExplanation] If disk is suitable, this + * @property {string} [suitabilityExplanation] If disk is suitable, this * explains the reasons and mitigation steps. Possible values include: * 'Unknown', 'NotApplicable', 'DiskSizeGreaterThanSupported', * 'NoSuitableDiskSizeForIops', 'NoSuitableDiskSizeForThroughput', @@ -120,6 +120,7 @@ class AssessedDisk { }, megabytesPerSecondOfReadDataPointsExpected: { required: false, + nullable: true, readOnly: true, serializedName: 'megabytesPerSecondOfReadDataPointsExpected', type: { @@ -128,6 +129,7 @@ class AssessedDisk { }, megabytesPerSecondOfReadDataPointsReceived: { required: false, + nullable: true, readOnly: true, serializedName: 'megabytesPerSecondOfReadDataPointsReceived', type: { @@ -144,6 +146,7 @@ class AssessedDisk { }, megabytesPerSecondOfWriteDataPointsExpected: { required: false, + nullable: true, readOnly: true, serializedName: 'megabytesPerSecondOfWriteDataPointsExpected', type: { @@ -152,6 +155,7 @@ class AssessedDisk { }, megabytesPerSecondOfWriteDataPointsReceived: { required: false, + nullable: true, readOnly: true, serializedName: 'megabytesPerSecondOfWriteDataPointsReceived', type: { @@ -168,6 +172,7 @@ class AssessedDisk { }, numberOfReadOperationsPerSecondDataPointsExpected: { required: false, + nullable: true, readOnly: true, serializedName: 'numberOfReadOperationsPerSecondDataPointsExpected', type: { @@ -176,6 +181,7 @@ class AssessedDisk { }, numberOfReadOperationsPerSecondDataPointsReceived: { required: false, + nullable: true, readOnly: true, serializedName: 'numberOfReadOperationsPerSecondDataPointsReceived', type: { @@ -192,6 +198,7 @@ class AssessedDisk { }, numberOfWriteOperationsPerSecondDataPointsExpected: { required: false, + nullable: true, readOnly: true, serializedName: 'numberOfWriteOperationsPerSecondDataPointsExpected', type: { @@ -200,6 +207,7 @@ class AssessedDisk { }, numberOfWriteOperationsPerSecondDataPointsReceived: { required: false, + nullable: true, readOnly: true, serializedName: 'numberOfWriteOperationsPerSecondDataPointsReceived', type: { diff --git a/lib/services/migrateManagement/lib/models/assessedMachine.js b/lib/services/migrateManagement/lib/models/assessedMachine.js index 4e7be29df6..a88cdbab2f 100644 --- a/lib/services/migrateManagement/lib/models/assessedMachine.js +++ b/lib/services/migrateManagement/lib/models/assessedMachine.js @@ -20,44 +20,45 @@ const models = require('./index'); class AssessedMachine extends models['BaseResource'] { /** * Create a AssessedMachine. - * @member {string} [id] Path reference to this assessed machine. + * @property {string} [id] Path reference to this assessed machine. * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}/groups/{groupName}/assessments/{assessmentName}/assessedMachines/{assessedMachineName} - * @member {string} [name] Name of the machine. - * @member {string} [eTag] For optimistic concurrency control. - * @member {string} [type] Type of the object = + * @property {string} [name] Name of the machine. + * @property {string} [eTag] For optimistic concurrency control. + * @property {string} [type] Type of the object = * [Microsoft.Migrate/projects/groups/assessments/assessedMachines]. - * @member {array} [groups] List of references to the groups that the machine - * is member of. - * @member {date} [discoveredTimestamp] Time when this machine was discovered - * by Azure Migrate agent. Date-Time represented in ISO-8601 format. - * @member {string} [bootType] Boot type of the machine. Possible values + * @property {array} [groups] List of references to the groups that the + * machine is member of. + * @property {date} [discoveredTimestamp] Time when this machine was + * discovered by Azure Migrate agent. Date-Time represented in ISO-8601 + * format. + * @property {string} [bootType] Boot type of the machine. Possible values * include: 'Unknown', 'EFI', 'BIOS' - * @member {string} [datacenterContainer] Container defined in the management - * solution that this machine is part of in the datacenter. - * @member {string} [datacenterManagementServer] Name of the server hosting + * @property {string} [datacenterContainer] Container defined in the + * management solution that this machine is part of in the datacenter. + * @property {string} [datacenterManagementServer] Name of the server hosting * the datacenter management solution. - * @member {string} [datacenterMachineId] ID of the machine as tracked by the - * datacenter management solution. - * @member {string} [datacenterManagementServerId] ID of the server hosting + * @property {string} [datacenterMachineId] ID of the machine as tracked by * the datacenter management solution. - * @member {string} [description] Description of the machine - * @member {string} [displayName] User readable name of the machine as + * @property {string} [datacenterManagementServerId] ID of the server hosting + * the datacenter management solution. + * @property {string} [description] Description of the machine + * @property {string} [displayName] User readable name of the machine as * defined by the user in their private datacenter. - * @member {number} [megabytesOfMemory] Memory in Megabytes. - * @member {number} [numberOfCores] Processor count. - * @member {string} [operatingSystem] Operating System of the machine. - * @member {number} [monthlyBandwidthCost] Monthly network cost estimate for - * the network adapters that are attached to this machine as a group, for a - * 31-day month. - * @member {number} [monthlyStorageCost] Monthly storage cost estimate for + * @property {number} [megabytesOfMemory] Memory in Megabytes. + * @property {number} [numberOfCores] Processor count. + * @property {string} [operatingSystem] Operating System of the machine. + * @property {number} [monthlyBandwidthCost] Monthly network cost estimate + * for the network adapters that are attached to this machine as a group, for + * a 31-day month. + * @property {number} [monthlyStorageCost] Monthly storage cost estimate for * the disks that are attached to this machine as a group, for a 31-day * month. - * @member {object} [disks] Dictionary of disks attached to the machine. Key - * is ID of disk. Value is a disk object. - * @member {object} [networkAdapters] Dictionary of network adapters attached - * to the machine. Key is name of the adapter. Value is a network adapter - * object. - * @member {string} [recommendedSize] Recommended Azure size for this + * @property {object} [disks] Dictionary of disks attached to the machine. + * Key is ID of disk. Value is a disk object. + * @property {object} [networkAdapters] Dictionary of network adapters + * attached to the machine. Key is name of the adapter. Value is a network + * adapter object. + * @property {string} [recommendedSize] Recommended Azure size for this * machine. Possible values include: 'Unknown', 'Basic_A0', 'Basic_A1', * 'Basic_A2', 'Basic_A3', 'Basic_A4', 'Standard_A0', 'Standard_A1', * 'Standard_A2', 'Standard_A3', 'Standard_A4', 'Standard_A5', 'Standard_A6', @@ -81,33 +82,33 @@ class AssessedMachine extends models['BaseResource'] { * 'Standard_GS5', 'Standard_H8', 'Standard_H16', 'Standard_H8m', * 'Standard_H16m', 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', * 'Standard_L8s', 'Standard_L16s', 'Standard_L32s' - * @member {number} [numberOfCoresForRecommendedSize] Number of CPU cores in - * the Recommended Azure VM Size. - * @member {number} [megabytesOfMemoryForRecommendedSize] Megabytes of memory + * @property {number} [numberOfCoresForRecommendedSize] Number of CPU cores * in the Recommended Azure VM Size. - * @member {number} [monthlyComputeCostForRecommendedSize] Compute Cost for a - * 31-day month, if the machine is migrated to Azure with the Recommended + * @property {number} [megabytesOfMemoryForRecommendedSize] Megabytes of + * memory in the Recommended Azure VM Size. + * @property {number} [monthlyComputeCostForRecommendedSize] Compute Cost for + * a 31-day month, if the machine is migrated to Azure with the Recommended * Size. - * @member {number} [percentageCoresUtilization] Utilization percentage of + * @property {number} [percentageCoresUtilization] Utilization percentage of * the processor core as observed in the private data center, in the Time * Range selected on Assessment, reported as the Percentile value based on * the percentile number selected in assessment. - * @member {number} [percentageMemoryUtilization] Utilization percentage of + * @property {number} [percentageMemoryUtilization] Utilization percentage of * the memory as observed in the private data center, in the Time Range * selected on Assessment, reported as the Percentile value based on the * percentile number selected in assessment. - * @member {number} [percentageCoresUtilizationDataPointsExpected] Expected + * @property {number} [percentageCoresUtilizationDataPointsExpected] Expected * data points for percentage of cores utilization. - * @member {number} [percentageCoresUtilizationDataPointsReceived] Received + * @property {number} [percentageCoresUtilizationDataPointsReceived] Received * data points for percentage of cores utilization. - * @member {number} [percentageMemoryUtilizationDataPointsExpected] Expected - * data points for percentage of memory utilization. - * @member {number} [percentageMemoryUtilizationDataPointsReceived] Received - * data points for percentage of memory utilization. - * @member {string} [suitability] Whether machine is suitable for migration + * @property {number} [percentageMemoryUtilizationDataPointsExpected] + * Expected data points for percentage of memory utilization. + * @property {number} [percentageMemoryUtilizationDataPointsReceived] + * Received data points for percentage of memory utilization. + * @property {string} [suitability] Whether machine is suitable for migration * to Azure. Possible values include: 'Unknown', 'NotSuitable', 'Suitable', * 'ConditionallySuitable', 'ReadinessUnknown' - * @member {string} [suitabilityExplanation] If machine is not ready to be + * @property {string} [suitabilityExplanation] If machine is not ready to be * migrated, this explains the reasons and mitigation steps. Possible values * include: 'Unknown', 'NotApplicable', * 'GuestOperatingSystemArchitectureNotSupported', @@ -131,10 +132,10 @@ class AssessedMachine extends models['BaseResource'] { * 'EndorsedWithConditionsLinuxDistributions', * 'UnendorsedLinuxDistributions', 'NoVmSizeForStandardPricingTier', * 'NoVmSizeForBasicPricingTier' - * @member {date} [createdTimestamp] Time when this machine was created. - * Date-Time represented in ISO-8601 format. - * @member {date} [updatedTimestamp] Time when this machine was last updated. + * @property {date} [createdTimestamp] Time when this machine was created. * Date-Time represented in ISO-8601 format. + * @property {date} [updatedTimestamp] Time when this machine was last + * updated. Date-Time represented in ISO-8601 format. */ constructor() { super(); @@ -386,6 +387,7 @@ class AssessedMachine extends models['BaseResource'] { }, percentageCoresUtilizationDataPointsExpected: { required: false, + nullable: true, readOnly: true, serializedName: 'properties.percentageCoresUtilizationDataPointsExpected', type: { @@ -394,6 +396,7 @@ class AssessedMachine extends models['BaseResource'] { }, percentageCoresUtilizationDataPointsReceived: { required: false, + nullable: true, readOnly: true, serializedName: 'properties.percentageCoresUtilizationDataPointsReceived', type: { @@ -402,6 +405,7 @@ class AssessedMachine extends models['BaseResource'] { }, percentageMemoryUtilizationDataPointsExpected: { required: false, + nullable: true, readOnly: true, serializedName: 'properties.percentageMemoryUtilizationDataPointsExpected', type: { @@ -410,6 +414,7 @@ class AssessedMachine extends models['BaseResource'] { }, percentageMemoryUtilizationDataPointsReceived: { required: false, + nullable: true, readOnly: true, serializedName: 'properties.percentageMemoryUtilizationDataPointsReceived', type: { diff --git a/lib/services/migrateManagement/lib/models/assessedNetworkAdapter.js b/lib/services/migrateManagement/lib/models/assessedNetworkAdapter.js index e8a9e663d6..dc1ed20ae5 100644 --- a/lib/services/migrateManagement/lib/models/assessedNetworkAdapter.js +++ b/lib/services/migrateManagement/lib/models/assessedNetworkAdapter.js @@ -17,30 +17,31 @@ class AssessedNetworkAdapter { /** * Create a AssessedNetworkAdapter. - * @member {string} [macAddress] MAC Address of the network adapter. - * @member {array} [ipAddresses] List of IP Addresses on the network adapter. - * @member {number} [monthlyBandwidthCosts] Monthly cost estimate for network - * bandwidth used by this network adapter. - * @member {number} [megabytesPerSecondReceived] Adapter throughput for + * @property {string} [macAddress] MAC Address of the network adapter. + * @property {array} [ipAddresses] List of IP Addresses on the network + * adapter. + * @property {number} [monthlyBandwidthCosts] Monthly cost estimate for + * network bandwidth used by this network adapter. + * @property {number} [megabytesPerSecondReceived] Adapter throughput for * incoming traffic in MegaBytes per second. - * @member {number} [megabytesPerSecondReceivedDataPointsExpected] Expected + * @property {number} [megabytesPerSecondReceivedDataPointsExpected] Expected * data points for incoming traffic in MegaBytes per second. - * @member {number} [megabytesPerSecondOfReadDataPointsReceived] Received + * @property {number} [megabytesPerSecondOfReadDataPointsReceived] Received * data points for incoming traffic in MegaBytes per second. - * @member {number} [megabytesPerSecondTransmitted] Adapter throughput for + * @property {number} [megabytesPerSecondTransmitted] Adapter throughput for * outgoing traffic in MegaBytes per second. - * @member {number} [megabytesPerSecondTransmittedDataPointsExpected] + * @property {number} [megabytesPerSecondTransmittedDataPointsExpected] * Expected data points for outgoing traffic in MegaBytes per second. - * @member {number} [megabytesPerSecondTransmittedDataPointsReceived] + * @property {number} [megabytesPerSecondTransmittedDataPointsReceived] * Received data points for outgoing traffic in MegaBytes per second. - * @member {number} [netGigabytesTransmittedPerMonth] Gigabytes transmitted + * @property {number} [netGigabytesTransmittedPerMonth] Gigabytes transmitted * through this adapter each month. - * @member {string} [suitability] Whether this adapter is suitable for Azure. - * Possible values include: 'Unknown', 'NotSuitable', 'Suitable', + * @property {string} [suitability] Whether this adapter is suitable for + * Azure. Possible values include: 'Unknown', 'NotSuitable', 'Suitable', * 'ConditionallySuitable', 'ReadinessUnknown' - * @member {string} [suitabilityExplanation] If network adapter is suitable, - * this explains the reasons and mitigation steps. Possible values include: - * 'Unknown', 'NotApplicable', 'InternalErrorOccured' + * @property {string} [suitabilityExplanation] If network adapter is + * suitable, this explains the reasons and mitigation steps. Possible values + * include: 'Unknown', 'NotApplicable', 'InternalErrorOccured' */ constructor() { } @@ -100,6 +101,7 @@ class AssessedNetworkAdapter { }, megabytesPerSecondReceivedDataPointsExpected: { required: false, + nullable: true, readOnly: true, serializedName: 'megabytesPerSecondReceivedDataPointsExpected', type: { @@ -108,6 +110,7 @@ class AssessedNetworkAdapter { }, megabytesPerSecondOfReadDataPointsReceived: { required: false, + nullable: true, readOnly: true, serializedName: 'megabytesPerSecondOfReadDataPointsReceived', type: { @@ -124,6 +127,7 @@ class AssessedNetworkAdapter { }, megabytesPerSecondTransmittedDataPointsExpected: { required: false, + nullable: true, readOnly: true, serializedName: 'megabytesPerSecondTransmittedDataPointsExpected', type: { @@ -132,6 +136,7 @@ class AssessedNetworkAdapter { }, megabytesPerSecondTransmittedDataPointsReceived: { required: false, + nullable: true, readOnly: true, serializedName: 'megabytesPerSecondTransmittedDataPointsReceived', type: { diff --git a/lib/services/migrateManagement/lib/models/assessment.js b/lib/services/migrateManagement/lib/models/assessment.js index 0578ec73a2..2d876921c6 100644 --- a/lib/services/migrateManagement/lib/models/assessment.js +++ b/lib/services/migrateManagement/lib/models/assessment.js @@ -20,13 +20,13 @@ const models = require('./index'); class Assessment extends models['BaseResource'] { /** * Create a Assessment. - * @member {string} [id] Path reference to this assessment. + * @property {string} [id] Path reference to this assessment. * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}/groups/{groupName}/assessment/{assessmentName} - * @member {string} [name] Unique name of an assessment. - * @member {string} [eTag] For optimistic concurrency control. - * @member {string} [type] Type of the object = + * @property {string} [name] Unique name of an assessment. + * @property {string} [eTag] For optimistic concurrency control. + * @property {string} [type] Type of the object = * [Microsoft.Migrate/projects/groups/assessments]. - * @member {string} azureLocation Target Azure location for which the + * @property {string} azureLocation Target Azure location for which the * machines should be assessed. These enums are the same as used by Compute * API. Possible values include: 'Unknown', 'EastAsia', 'SoutheastAsia', * 'AustraliaEast', 'AustraliaSoutheast', 'BrazilSouth', 'CanadaCentral', @@ -35,7 +35,7 @@ class Assessment extends models['BaseResource'] { * 'UkWest', 'UkSouth', 'NorthCentralUs', 'EastUs', 'WestUs2', * 'SouthCentralUs', 'CentralUs', 'EastUs2', 'WestUs', 'WestCentralUs', * 'GermanyCentral', 'GermanyNortheast', 'ChinaNorth', 'ChinaEast' - * @member {string} azureOfferCode Offer code according to which cost + * @property {string} azureOfferCode Offer code according to which cost * estimation is done. Possible values include: 'Unknown', 'MSAZR0003P', * 'MSAZR0044P', 'MSAZR0059P', 'MSAZR0060P', 'MSAZR0062P', 'MSAZR0063P', * 'MSAZR0064P', 'MSAZR0029P', 'MSAZR0022P', 'MSAZR0023P', 'MSAZR0148P', @@ -45,53 +45,53 @@ class Assessment extends models['BaseResource'] { * 'MSAZR0149P', 'MSMCAZR0044P', 'MSMCAZR0059P', 'MSMCAZR0060P', * 'MSMCAZR0063P', 'MSMCAZR0120P', 'MSMCAZR0121P', 'MSMCAZR0125P', * 'MSMCAZR0128P', 'MSAZRDE0003P', 'MSAZRDE0044P' - * @member {string} azurePricingTier Pricing tier for Size evaluation. + * @property {string} azurePricingTier Pricing tier for Size evaluation. * Possible values include: 'Standard', 'Basic' - * @member {string} azureStorageRedundancy Storage Redundancy type offered by - * Azure. Possible values include: 'Unknown', 'LocallyRedundant', + * @property {string} azureStorageRedundancy Storage Redundancy type offered + * by Azure. Possible values include: 'Unknown', 'LocallyRedundant', * 'ZoneRedundant', 'GeoRedundant', 'ReadAccessGeoRedundant' - * @member {number} scalingFactor Scaling factor used over utilization data + * @property {number} scalingFactor Scaling factor used over utilization data * to add a performance buffer for new machines to be created in Azure. Min * Value = 1.0, Max value = 1.9, Default = 1.3. - * @member {string} percentile Percentile of performance data used to + * @property {string} percentile Percentile of performance data used to * recommend Azure size. Possible values include: 'Percentile50', * 'Percentile90', 'Percentile95', 'Percentile99' - * @member {string} timeRange Time range of performance data used to + * @property {string} timeRange Time range of performance data used to * recommend a size. Possible values include: 'Day', 'Week', 'Month' - * @member {string} stage User configurable setting that describes the status - * of the assessment. Possible values include: 'InProgress', 'UnderReview', - * 'Approved' - * @member {string} currency Currency to report prices in. Possible values + * @property {string} stage User configurable setting that describes the + * status of the assessment. Possible values include: 'InProgress', + * 'UnderReview', 'Approved' + * @property {string} currency Currency to report prices in. Possible values * include: 'Unknown', 'USD', 'DKK', 'CAD', 'IDR', 'JPY', 'KRW', 'NZD', * 'NOK', 'RUB', 'SAR', 'ZAR', 'SEK', 'TRY', 'GBP', 'MXN', 'MYR', 'INR', * 'HKD', 'BRL', 'TWD', 'EUR', 'CHF', 'ARS', 'AUD', 'CNY' - * @member {string} azureHybridUseBenefit AHUB discount on windows virtual + * @property {string} azureHybridUseBenefit AHUB discount on windows virtual * machines. Possible values include: 'Unknown', 'Yes', 'No' - * @member {number} discountPercentage Custom discount percentage to be + * @property {number} discountPercentage Custom discount percentage to be * applied on final costs. Can be in the range [0, 100]. - * @member {number} [confidenceRatingInPercentage] Confidence rating + * @property {number} [confidenceRatingInPercentage] Confidence rating * percentage for assessment. Can be in the range [0, 100]. - * @member {string} sizingCriterion Assessment sizing criterion. Possible + * @property {string} sizingCriterion Assessment sizing criterion. Possible * values include: 'PerformanceBased', 'AsOnPremises' - * @member {date} [pricesTimestamp] Time when the Azure Prices were queried. + * @property {date} [pricesTimestamp] Time when the Azure Prices were + * queried. Date-Time represented in ISO-8601 format. + * @property {date} [createdTimestamp] Time when this project was created. * Date-Time represented in ISO-8601 format. - * @member {date} [createdTimestamp] Time when this project was created. - * Date-Time represented in ISO-8601 format. - * @member {date} [updatedTimestamp] Time when this project was last updated. - * Date-Time represented in ISO-8601 format. - * @member {number} [monthlyComputeCost] Monthly compute cost estimate for + * @property {date} [updatedTimestamp] Time when this project was last + * updated. Date-Time represented in ISO-8601 format. + * @property {number} [monthlyComputeCost] Monthly compute cost estimate for * the machines that are part of this assessment as a group, for a 31-day * month. - * @member {number} [monthlyBandwidthCost] Monthly network cost estimate for - * the machines that are part of this assessment as a group, for a 31-day + * @property {number} [monthlyBandwidthCost] Monthly network cost estimate + * for the machines that are part of this assessment as a group, for a 31-day * month. - * @member {number} [monthlyStorageCost] Monthly storage cost estimate for + * @property {number} [monthlyStorageCost] Monthly storage cost estimate for * the machines that are part of this assessment as a group, for a 31-day * month. - * @member {string} [status] Wheter the assessment has been created and is + * @property {string} [status] Whether the assessment has been created and is * valid. Possible values include: 'Created', 'Updated', 'Running', * 'Completed', 'Invalid' - * @member {number} [numberOfMachines] Number of assessed machines part of + * @property {number} [numberOfMachines] Number of assessed machines part of * this assessment. */ constructor() { @@ -222,6 +222,7 @@ class Assessment extends models['BaseResource'] { }, confidenceRatingInPercentage: { required: false, + nullable: true, readOnly: true, serializedName: 'properties.confidenceRatingInPercentage', type: { diff --git a/lib/services/migrateManagement/lib/models/assessmentOptionsResultList.js b/lib/services/migrateManagement/lib/models/assessmentOptionsResultList.js new file mode 100644 index 0000000000..94ef9a2a19 --- /dev/null +++ b/lib/services/migrateManagement/lib/models/assessmentOptionsResultList.js @@ -0,0 +1,80 @@ +/* + * 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'; + +/** + * List of assessment options. + * + */ +class AssessmentOptionsResultList { + /** + * Create a AssessmentOptionsResultList. + * @property {array} [vmFamilies] Dictionary of VM families grouped by vm + * family name describing the targeted azure locations of VM family and the + * category of the family. + * @property {array} [reservedInstanceVmFamilies] List of supported VM + * Families. + */ + constructor() { + } + + /** + * Defines the metadata of AssessmentOptionsResultList + * + * @returns {object} metadata of AssessmentOptionsResultList + * + */ + mapper() { + return { + required: false, + serializedName: 'AssessmentOptionsResultList', + type: { + name: 'Composite', + className: 'AssessmentOptionsResultList', + modelProperties: { + vmFamilies: { + required: false, + readOnly: true, + serializedName: 'vmFamilies', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VmFamilyElementType', + type: { + name: 'Composite', + className: 'VmFamily' + } + } + } + }, + reservedInstanceVmFamilies: { + required: false, + readOnly: true, + serializedName: 'reservedInstanceVmFamilies', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = AssessmentOptionsResultList; diff --git a/lib/services/migrateManagement/lib/models/checkNameAvailabilityParameters.js b/lib/services/migrateManagement/lib/models/checkNameAvailabilityParameters.js new file mode 100644 index 0000000000..b28ac8ae04 --- /dev/null +++ b/lib/services/migrateManagement/lib/models/checkNameAvailabilityParameters.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'; + +/** + * Parameters for a check name availability request. + * + */ +class CheckNameAvailabilityParameters { + /** + * Create a CheckNameAvailabilityParameters. + * @property {string} name The name to check for availability + */ + constructor() { + } + + /** + * Defines the metadata of CheckNameAvailabilityParameters + * + * @returns {object} metadata of CheckNameAvailabilityParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'CheckNameAvailabilityParameters', + type: { + name: 'Composite', + className: 'CheckNameAvailabilityParameters', + modelProperties: { + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: true, + isConstant: true, + serializedName: 'type', + defaultValue: 'Microsoft.Migrate/projects', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = CheckNameAvailabilityParameters; diff --git a/lib/services/migrateManagement/lib/models/checkNameAvailabilityResult.js b/lib/services/migrateManagement/lib/models/checkNameAvailabilityResult.js new file mode 100644 index 0000000000..8708374512 --- /dev/null +++ b/lib/services/migrateManagement/lib/models/checkNameAvailabilityResult.js @@ -0,0 +1,78 @@ +/* + * 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 CheckNameAvailability operation response. + * + */ +class CheckNameAvailabilityResult { + /** + * Create a CheckNameAvailabilityResult. + * @property {boolean} [nameAvailable] Gets a boolean value that indicates + * whether the name is available for you to use. If true, the name is + * available. If false, the name has already been taken or invalid and cannot + * be used. + * @property {string} [reason] Gets the reason that a project name could not + * be used. The Reason element is only returned if NameAvailable is false. + * Possible values include: 'Available', 'Invalid', 'AlreadyExists' + * @property {string} [message] Gets an error message explaining the Reason + * value in more detail. + */ + constructor() { + } + + /** + * Defines the metadata of CheckNameAvailabilityResult + * + * @returns {object} metadata of CheckNameAvailabilityResult + * + */ + mapper() { + return { + required: false, + serializedName: 'CheckNameAvailabilityResult', + type: { + name: 'Composite', + className: 'CheckNameAvailabilityResult', + modelProperties: { + nameAvailable: { + required: false, + readOnly: true, + serializedName: 'nameAvailable', + type: { + name: 'Boolean' + } + }, + reason: { + required: false, + readOnly: true, + serializedName: 'reason', + type: { + name: 'Enum', + allowedValues: [ 'Available', 'Invalid', 'AlreadyExists' ] + } + }, + message: { + required: false, + readOnly: true, + serializedName: 'message', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = CheckNameAvailabilityResult; diff --git a/lib/services/migrateManagement/lib/models/disk.js b/lib/services/migrateManagement/lib/models/disk.js index 1536e34e30..4a8e6c97cc 100644 --- a/lib/services/migrateManagement/lib/models/disk.js +++ b/lib/services/migrateManagement/lib/models/disk.js @@ -17,10 +17,10 @@ class Disk { /** * Create a Disk. - * @member {number} [gigabytesAllocated] Gigabytes of storage provisioned for + * @property {number} [gigabytesAllocated] Gigabytes of storage provisioned + * for this disk. + * @property {number} [gigabytesConsumed] Gigabytes of storage consumed by * this disk. - * @member {number} [gigabytesConsumed] Gigabytes of storage consumed by this - * disk. */ constructor() { } diff --git a/lib/services/migrateManagement/lib/models/downloadUrl.js b/lib/services/migrateManagement/lib/models/downloadUrl.js index c7de9c8d52..934abd0285 100644 --- a/lib/services/migrateManagement/lib/models/downloadUrl.js +++ b/lib/services/migrateManagement/lib/models/downloadUrl.js @@ -17,8 +17,8 @@ class DownloadUrl { /** * Create a DownloadUrl. - * @member {string} [assessmentReportUrl] Hyperlink to download report. - * @member {date} [expirationTime] Expiry date of download url. + * @property {string} [assessmentReportUrl] Hyperlink to download report. + * @property {date} [expirationTime] Expiry date of download url. */ constructor() { } diff --git a/lib/services/migrateManagement/lib/models/group.js b/lib/services/migrateManagement/lib/models/group.js index 3e301ede4d..40cdc0a610 100644 --- a/lib/services/migrateManagement/lib/models/group.js +++ b/lib/services/migrateManagement/lib/models/group.js @@ -20,20 +20,20 @@ const models = require('./index'); class Group extends models['BaseResource'] { /** * Create a Group. - * @member {string} [id] Path reference to this group. + * @property {string} [id] Path reference to this group. * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}/groups/{groupName} - * @member {string} [name] Name of the group. - * @member {string} [eTag] For optimistic concurrency control. - * @member {string} [type] Type of the object = + * @property {string} [name] Name of the group. + * @property {string} [eTag] For optimistic concurrency control. + * @property {string} [type] Type of the object = * [Microsoft.Migrate/projects/groups]. - * @member {array} machines List of machine names that are part of this + * @property {array} machines List of machine names that are part of this * group. - * @member {array} [assessments] List of References to Assessments created on - * this group. - * @member {date} [createdTimestamp] Time when this project was created. - * Date-Time represented in ISO-8601 format. - * @member {date} [updatedTimestamp] Time when this project was last updated. + * @property {array} [assessments] List of References to Assessments created + * on this group. + * @property {date} [createdTimestamp] Time when this project was created. * Date-Time represented in ISO-8601 format. + * @property {date} [updatedTimestamp] Time when this project was last + * updated. Date-Time represented in ISO-8601 format. */ constructor() { super(); diff --git a/lib/services/migrateManagement/lib/models/index.d.ts b/lib/services/migrateManagement/lib/models/index.d.ts index 523d52abcb..2e9a77795d 100644 --- a/lib/services/migrateManagement/lib/models/index.d.ts +++ b/lib/services/migrateManagement/lib/models/index.d.ts @@ -1,720 +1,893 @@ /* * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { BaseResource } from 'ms-rest-azure'; -import { CloudError } from 'ms-rest-azure'; -import * as moment from 'moment'; +import { BaseResource, CloudError } from "ms-rest-azure"; +import * as moment from "moment"; -export { BaseResource } from 'ms-rest-azure'; -export { CloudError } from 'ms-rest-azure'; +export { + BaseResource, + CloudError +}; /** - * @class - * Initializes a new instance of the Project class. - * @constructor * Azure Migrate Project. - * - * @member {string} [id] Path reference to this project - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName} - * @member {string} [name] Name of the project. - * @member {string} [type] Type of the object = [Microsoft.Migrate/projects]. - * @member {string} [eTag] For optimistic concurrency control. - * @member {string} [location] Azure location in which project is created. - * @member {object} [tags] Tags provided by Azure Tagging service. - * @member {date} [createdTimestamp] Time when this project was created. - * Date-Time represented in ISO-8601 format. - * @member {date} [updatedTimestamp] Time when this project was last updated. - * Date-Time represented in ISO-8601 format. - * @member {string} [discoveryStatus] Reports whether project is under - * discovery. Possible values include: 'Unknown', 'NotStarted', 'InProgress', - * 'Completed' - * @member {string} [customerWorkspaceId] ARM ID of the Service Map workspace - * created by user. - * @member {string} [customerWorkspaceLocation] Location of the Service Map - * workspace created by user. - * @member {date} [lastDiscoveryTimestamp] Time when this project was created. - * Date-Time represented in ISO-8601 format. This value will be null until - * discovery is complete. - * @member {string} [lastDiscoverySessionId] Session id of the last discovery. - * @member {number} [numberOfGroups] Number of groups created in the project. - * @member {number} [numberOfMachines] Number of machines in the project. - * @member {number} [numberOfAssessments] Number of assessments created in the - * project. - * @member {date} [lastAssessmentTimestamp] Time when last assessment was - * created. Date-Time represented in ISO-8601 format. This value will be null - * until assessment is created. - * @member {string} [provisioningState] Provisioning state of the project. - * Possible values include: 'Accepted', 'Creating', 'Deleting', 'Failed', - * 'Moving', 'Succeeded' */ export interface Project extends BaseResource { + /** + * Path reference to this project + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName} + */ readonly id?: string; + /** + * Name of the project. + */ readonly name?: string; + /** + * Type of the object = [Microsoft.Migrate/projects]. + */ readonly type?: string; + /** + * For optimistic concurrency control. + */ eTag?: string; + /** + * Azure location in which project is created. + */ location?: string; + /** + * Tags provided by Azure Tagging service. + */ tags?: any; + /** + * Time when this project was created. Date-Time represented in ISO-8601 format. + */ readonly createdTimestamp?: Date; + /** + * Time when this project was last updated. Date-Time represented in ISO-8601 format. + */ readonly updatedTimestamp?: Date; + /** + * Reports whether project is under discovery. Possible values include: 'Unknown', 'NotStarted', + * 'InProgress', 'Completed' + */ readonly discoveryStatus?: string; + /** + * ARM ID of the Service Map workspace created by user. + */ customerWorkspaceId?: string; + /** + * Location of the Service Map workspace created by user. + */ customerWorkspaceLocation?: string; + /** + * Time when this project was created. Date-Time represented in ISO-8601 format. This value will + * be null until discovery is complete. + */ readonly lastDiscoveryTimestamp?: Date; + /** + * Session id of the last discovery. + */ readonly lastDiscoverySessionId?: string; + /** + * Number of groups created in the project. + */ readonly numberOfGroups?: number; + /** + * Number of machines in the project. + */ readonly numberOfMachines?: number; + /** + * Number of assessments created in the project. + */ readonly numberOfAssessments?: number; + /** + * Time when last assessment was created. Date-Time represented in ISO-8601 format. This value + * will be null until assessment is created. + */ readonly lastAssessmentTimestamp?: Date; + /** + * Provisioning state of the project. Possible values include: 'Accepted', 'Creating', + * 'Deleting', 'Failed', 'Moving', 'Succeeded' + */ provisioningState?: string; } /** - * @class - * Initializes a new instance of the Group class. - * @constructor * A group created in a Migration project. - * - * @member {string} [id] Path reference to this group. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}/groups/{groupName} - * @member {string} [name] Name of the group. - * @member {string} [eTag] For optimistic concurrency control. - * @member {string} [type] Type of the object = - * [Microsoft.Migrate/projects/groups]. - * @member {array} machines List of machine names that are part of this group. - * @member {array} [assessments] List of References to Assessments created on - * this group. - * @member {date} [createdTimestamp] Time when this project was created. - * Date-Time represented in ISO-8601 format. - * @member {date} [updatedTimestamp] Time when this project was last updated. - * Date-Time represented in ISO-8601 format. */ export interface Group extends BaseResource { + /** + * Path reference to this group. + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}/groups/{groupName} + */ readonly id?: string; + /** + * Name of the group. + */ readonly name?: string; + /** + * For optimistic concurrency control. + */ eTag?: string; + /** + * Type of the object = [Microsoft.Migrate/projects/groups]. + */ readonly type?: string; + /** + * List of machine names that are part of this group. + */ machines: string[]; + /** + * List of References to Assessments created on this group. + */ readonly assessments?: string[]; + /** + * Time when this project was created. Date-Time represented in ISO-8601 format. + */ readonly createdTimestamp?: Date; + /** + * Time when this project was last updated. Date-Time represented in ISO-8601 format. + */ readonly updatedTimestamp?: Date; } /** - * @class - * Initializes a new instance of the Assessment class. - * @constructor * An assessment created for a group in the Migration project. - * - * @member {string} [id] Path reference to this assessment. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}/groups/{groupName}/assessment/{assessmentName} - * @member {string} [name] Unique name of an assessment. - * @member {string} [eTag] For optimistic concurrency control. - * @member {string} [type] Type of the object = - * [Microsoft.Migrate/projects/groups/assessments]. - * @member {string} azureLocation Target Azure location for which the machines - * should be assessed. These enums are the same as used by Compute API. - * Possible values include: 'Unknown', 'EastAsia', 'SoutheastAsia', - * 'AustraliaEast', 'AustraliaSoutheast', 'BrazilSouth', 'CanadaCentral', - * 'CanadaEast', 'WestEurope', 'NorthEurope', 'CentralIndia', 'SouthIndia', - * 'WestIndia', 'JapanEast', 'JapanWest', 'KoreaCentral', 'KoreaSouth', - * 'UkWest', 'UkSouth', 'NorthCentralUs', 'EastUs', 'WestUs2', - * 'SouthCentralUs', 'CentralUs', 'EastUs2', 'WestUs', 'WestCentralUs', - * 'GermanyCentral', 'GermanyNortheast', 'ChinaNorth', 'ChinaEast' - * @member {string} azureOfferCode Offer code according to which cost - * estimation is done. Possible values include: 'Unknown', 'MSAZR0003P', - * 'MSAZR0044P', 'MSAZR0059P', 'MSAZR0060P', 'MSAZR0062P', 'MSAZR0063P', - * 'MSAZR0064P', 'MSAZR0029P', 'MSAZR0022P', 'MSAZR0023P', 'MSAZR0148P', - * 'MSAZR0025P', 'MSAZR0036P', 'MSAZR0120P', 'MSAZR0121P', 'MSAZR0122P', - * 'MSAZR0123P', 'MSAZR0124P', 'MSAZR0125P', 'MSAZR0126P', 'MSAZR0127P', - * 'MSAZR0128P', 'MSAZR0129P', 'MSAZR0130P', 'MSAZR0111P', 'MSAZR0144P', - * 'MSAZR0149P', 'MSMCAZR0044P', 'MSMCAZR0059P', 'MSMCAZR0060P', - * 'MSMCAZR0063P', 'MSMCAZR0120P', 'MSMCAZR0121P', 'MSMCAZR0125P', - * 'MSMCAZR0128P', 'MSAZRDE0003P', 'MSAZRDE0044P' - * @member {string} azurePricingTier Pricing tier for Size evaluation. Possible - * values include: 'Standard', 'Basic' - * @member {string} azureStorageRedundancy Storage Redundancy type offered by - * Azure. Possible values include: 'Unknown', 'LocallyRedundant', - * 'ZoneRedundant', 'GeoRedundant', 'ReadAccessGeoRedundant' - * @member {number} scalingFactor Scaling factor used over utilization data to - * add a performance buffer for new machines to be created in Azure. Min Value - * = 1.0, Max value = 1.9, Default = 1.3. - * @member {string} percentile Percentile of performance data used to recommend - * Azure size. Possible values include: 'Percentile50', 'Percentile90', - * 'Percentile95', 'Percentile99' - * @member {string} timeRange Time range of performance data used to recommend - * a size. Possible values include: 'Day', 'Week', 'Month' - * @member {string} stage User configurable setting that describes the status - * of the assessment. Possible values include: 'InProgress', 'UnderReview', - * 'Approved' - * @member {string} currency Currency to report prices in. Possible values - * include: 'Unknown', 'USD', 'DKK', 'CAD', 'IDR', 'JPY', 'KRW', 'NZD', 'NOK', - * 'RUB', 'SAR', 'ZAR', 'SEK', 'TRY', 'GBP', 'MXN', 'MYR', 'INR', 'HKD', 'BRL', - * 'TWD', 'EUR', 'CHF', 'ARS', 'AUD', 'CNY' - * @member {string} azureHybridUseBenefit AHUB discount on windows virtual - * machines. Possible values include: 'Unknown', 'Yes', 'No' - * @member {number} discountPercentage Custom discount percentage to be applied - * on final costs. Can be in the range [0, 100]. - * @member {number} [confidenceRatingInPercentage] Confidence rating percentage - * for assessment. Can be in the range [0, 100]. - * @member {string} sizingCriterion Assessment sizing criterion. Possible - * values include: 'PerformanceBased', 'AsOnPremises' - * @member {date} [pricesTimestamp] Time when the Azure Prices were queried. - * Date-Time represented in ISO-8601 format. - * @member {date} [createdTimestamp] Time when this project was created. - * Date-Time represented in ISO-8601 format. - * @member {date} [updatedTimestamp] Time when this project was last updated. - * Date-Time represented in ISO-8601 format. - * @member {number} [monthlyComputeCost] Monthly compute cost estimate for the - * machines that are part of this assessment as a group, for a 31-day month. - * @member {number} [monthlyBandwidthCost] Monthly network cost estimate for - * the machines that are part of this assessment as a group, for a 31-day - * month. - * @member {number} [monthlyStorageCost] Monthly storage cost estimate for the - * machines that are part of this assessment as a group, for a 31-day month. - * @member {string} [status] Wheter the assessment has been created and is - * valid. Possible values include: 'Created', 'Updated', 'Running', - * 'Completed', 'Invalid' - * @member {number} [numberOfMachines] Number of assessed machines part of this - * assessment. */ export interface Assessment extends BaseResource { + /** + * Path reference to this assessment. + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}/groups/{groupName}/assessment/{assessmentName} + */ readonly id?: string; + /** + * Unique name of an assessment. + */ readonly name?: string; + /** + * For optimistic concurrency control. + */ eTag?: string; + /** + * Type of the object = [Microsoft.Migrate/projects/groups/assessments]. + */ readonly type?: string; + /** + * Target Azure location for which the machines should be assessed. These enums are the same as + * used by Compute API. Possible values include: 'Unknown', 'EastAsia', 'SoutheastAsia', + * 'AustraliaEast', 'AustraliaSoutheast', 'BrazilSouth', 'CanadaCentral', 'CanadaEast', + * 'WestEurope', 'NorthEurope', 'CentralIndia', 'SouthIndia', 'WestIndia', 'JapanEast', + * 'JapanWest', 'KoreaCentral', 'KoreaSouth', 'UkWest', 'UkSouth', 'NorthCentralUs', 'EastUs', + * 'WestUs2', 'SouthCentralUs', 'CentralUs', 'EastUs2', 'WestUs', 'WestCentralUs', + * 'GermanyCentral', 'GermanyNortheast', 'ChinaNorth', 'ChinaEast' + */ azureLocation: string; + /** + * Offer code according to which cost estimation is done. Possible values include: 'Unknown', + * 'MSAZR0003P', 'MSAZR0044P', 'MSAZR0059P', 'MSAZR0060P', 'MSAZR0062P', 'MSAZR0063P', + * 'MSAZR0064P', 'MSAZR0029P', 'MSAZR0022P', 'MSAZR0023P', 'MSAZR0148P', 'MSAZR0025P', + * 'MSAZR0036P', 'MSAZR0120P', 'MSAZR0121P', 'MSAZR0122P', 'MSAZR0123P', 'MSAZR0124P', + * 'MSAZR0125P', 'MSAZR0126P', 'MSAZR0127P', 'MSAZR0128P', 'MSAZR0129P', 'MSAZR0130P', + * 'MSAZR0111P', 'MSAZR0144P', 'MSAZR0149P', 'MSMCAZR0044P', 'MSMCAZR0059P', 'MSMCAZR0060P', + * 'MSMCAZR0063P', 'MSMCAZR0120P', 'MSMCAZR0121P', 'MSMCAZR0125P', 'MSMCAZR0128P', + * 'MSAZRDE0003P', 'MSAZRDE0044P' + */ azureOfferCode: string; + /** + * Pricing tier for Size evaluation. Possible values include: 'Standard', 'Basic' + */ azurePricingTier: string; + /** + * Storage Redundancy type offered by Azure. Possible values include: 'Unknown', + * 'LocallyRedundant', 'ZoneRedundant', 'GeoRedundant', 'ReadAccessGeoRedundant' + */ azureStorageRedundancy: string; + /** + * Scaling factor used over utilization data to add a performance buffer for new machines to be + * created in Azure. Min Value = 1.0, Max value = 1.9, Default = 1.3. + */ scalingFactor: number; + /** + * Percentile of performance data used to recommend Azure size. Possible values include: + * 'Percentile50', 'Percentile90', 'Percentile95', 'Percentile99' + */ percentile: string; + /** + * Time range of performance data used to recommend a size. Possible values include: 'Day', + * 'Week', 'Month' + */ timeRange: string; + /** + * User configurable setting that describes the status of the assessment. Possible values + * include: 'InProgress', 'UnderReview', 'Approved' + */ stage: string; + /** + * Currency to report prices in. Possible values include: 'Unknown', 'USD', 'DKK', 'CAD', 'IDR', + * 'JPY', 'KRW', 'NZD', 'NOK', 'RUB', 'SAR', 'ZAR', 'SEK', 'TRY', 'GBP', 'MXN', 'MYR', 'INR', + * 'HKD', 'BRL', 'TWD', 'EUR', 'CHF', 'ARS', 'AUD', 'CNY' + */ currency: string; + /** + * AHUB discount on windows virtual machines. Possible values include: 'Unknown', 'Yes', 'No' + */ azureHybridUseBenefit: string; + /** + * Custom discount percentage to be applied on final costs. Can be in the range [0, 100]. + */ discountPercentage: number; + /** + * Confidence rating percentage for assessment. Can be in the range [0, 100]. + */ readonly confidenceRatingInPercentage?: number; + /** + * Assessment sizing criterion. Possible values include: 'PerformanceBased', 'AsOnPremises' + */ sizingCriterion: string; + /** + * Time when the Azure Prices were queried. Date-Time represented in ISO-8601 format. + */ readonly pricesTimestamp?: Date; + /** + * Time when this project was created. Date-Time represented in ISO-8601 format. + */ readonly createdTimestamp?: Date; + /** + * Time when this project was last updated. Date-Time represented in ISO-8601 format. + */ readonly updatedTimestamp?: Date; + /** + * Monthly compute cost estimate for the machines that are part of this assessment as a group, + * for a 31-day month. + */ readonly monthlyComputeCost?: number; + /** + * Monthly network cost estimate for the machines that are part of this assessment as a group, + * for a 31-day month. + */ readonly monthlyBandwidthCost?: number; + /** + * Monthly storage cost estimate for the machines that are part of this assessment as a group, + * for a 31-day month. + */ readonly monthlyStorageCost?: number; + /** + * Whether the assessment has been created and is valid. Possible values include: 'Created', + * 'Updated', 'Running', 'Completed', 'Invalid' + */ readonly status?: string; + /** + * Number of assessed machines part of this assessment. + */ readonly numberOfMachines?: number; } /** - * @class - * Initializes a new instance of the Disk class. - * @constructor * A disk discovered on a machine. - * - * @member {number} [gigabytesAllocated] Gigabytes of storage provisioned for - * this disk. - * @member {number} [gigabytesConsumed] Gigabytes of storage consumed by this - * disk. */ export interface Disk { + /** + * Gigabytes of storage provisioned for this disk. + */ readonly gigabytesAllocated?: number; + /** + * Gigabytes of storage consumed by this disk. + */ readonly gigabytesConsumed?: number; } /** - * @class - * Initializes a new instance of the NetworkAdapter class. - * @constructor * A network adapter discovered on a machine. - * - * @member {string} [macAddress] MAC Address of the network adapter. - * @member {array} [ipAddresses] List of IP Addresses on the network adapter. */ export interface NetworkAdapter { + /** + * MAC Address of the network adapter. + */ readonly macAddress?: string; + /** + * List of IP Addresses on the network adapter. + */ readonly ipAddresses?: string[]; } /** - * @class - * Initializes a new instance of the Machine class. - * @constructor * A machine in a migration project. - * - * @member {string} [id] Path reference to this machine. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}/machines/{machineName} - * @member {string} [name] Name of the machine. It is a GUID which is unique - * identifier of machine in private data center. For user-readable name, we - * have a displayName property on this machine. - * @member {string} [eTag] For optimistic concurrency control. - * @member {string} [type] Type of the object = - * [Microsoft.Migrate/projects/machines]. - * @member {string} [bootType] Boot type of the machine. Possible values - * include: 'Unknown', 'EFI', 'BIOS' - * @member {string} [datacenterContainer] Container defined in the management - * solution that this machine is part of in the datacenter. - * @member {string} [datacenterManagementServer] Name of the server hosting the - * datacenter management solution. - * @member {string} [datacenterMachineId] ID of the machine as tracked by the - * datacenter management solution. - * @member {string} [datacenterManagementServerId] ID of the server hosting the - * datacenter management solution. - * @member {string} [description] Description of the machine - * @member {string} [displayName] User readable name of the machine as defined - * by the user in their private datacenter. - * @member {number} [megabytesOfMemory] Memory in Megabytes. - * @member {number} [numberOfCores] Processor count. - * @member {string} [operatingSystem] Operating System of the machine. - * @member {array} [groups] List of references to the groups that the machine - * is member of. - * @member {date} [createdTimestamp] Time when this machine was created. - * Date-Time represented in ISO-8601 format. - * @member {date} [updatedTimestamp] Time when this machine was last updated. - * Date-Time represented in ISO-8601 format. - * @member {date} [discoveredTimestamp] Time when this machine was discovered - * by Azure Migrate agent. Date-Time represented in ISO-8601 format. - * @member {object} [disks] Dictionary of disks attached to the machine. Key is - * ID of disk. Value is a disk object - * @member {object} [networkAdapters] Dictionary of network adapters attached - * to the machine. Key is ID of network adapter. Value is a network adapter - * object */ export interface Machine extends BaseResource { + /** + * Path reference to this machine. + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}/machines/{machineName} + */ readonly id?: string; + /** + * Name of the machine. It is a GUID which is unique identifier of machine in private data + * center. For user-readable name, we have a displayName property on this machine. + */ readonly name?: string; + /** + * For optimistic concurrency control. + */ eTag?: string; + /** + * Type of the object = [Microsoft.Migrate/projects/machines]. + */ readonly type?: string; + /** + * Boot type of the machine. Possible values include: 'Unknown', 'EFI', 'BIOS' + */ readonly bootType?: string; + /** + * Container defined in the management solution that this machine is part of in the datacenter. + */ readonly datacenterContainer?: string; + /** + * Name of the server hosting the datacenter management solution. + */ readonly datacenterManagementServer?: string; + /** + * ID of the machine as tracked by the datacenter management solution. + */ readonly datacenterMachineId?: string; + /** + * ID of the server hosting the datacenter management solution. + */ readonly datacenterManagementServerId?: string; + /** + * Description of the machine + */ readonly description?: string; + /** + * User readable name of the machine as defined by the user in their private datacenter. + */ readonly displayName?: string; + /** + * Memory in Megabytes. + */ readonly megabytesOfMemory?: number; + /** + * Processor count. + */ readonly numberOfCores?: number; + /** + * Operating System of the machine. + */ readonly operatingSystem?: string; + /** + * List of references to the groups that the machine is member of. + */ readonly groups?: string[]; + /** + * Time when this machine was created. Date-Time represented in ISO-8601 format. + */ readonly createdTimestamp?: Date; + /** + * Time when this machine was last updated. Date-Time represented in ISO-8601 format. + */ readonly updatedTimestamp?: Date; + /** + * Time when this machine was discovered by Azure Migrate agent. Date-Time represented in + * ISO-8601 format. + */ readonly discoveredTimestamp?: Date; + /** + * Dictionary of disks attached to the machine. Key is ID of disk. Value is a disk object + */ readonly disks?: { [propertyName: string]: Disk }; + /** + * Dictionary of network adapters attached to the machine. Key is ID of network adapter. Value is + * a network adapter object + */ readonly networkAdapters?: { [propertyName: string]: NetworkAdapter }; } /** - * @class - * Initializes a new instance of the AssessedDisk class. - * @constructor * A disk assessed for an assessment. - * - * @member {string} [name] Name of the assessed disk. - * @member {number} [gigabytesProvisioned] Gigabytes of storage provisioned for - * this disk. - * @member {number} [gigabytesConsumed] Gigabytes of storage consumed by this - * disk. - * @member {number} [megabytesPerSecondOfRead] Disk throughput in MegaBytes per - * second. - * @member {number} [megabytesPerSecondOfReadDataPointsExpected] Expected data - * points for MegaBytes per second of read. - * @member {number} [megabytesPerSecondOfReadDataPointsReceived] Received data - * points for MegaBytes per second of read. - * @member {number} [megabytesPerSecondOfWrite] Disk throughput in MegaBytes - * per second. - * @member {number} [megabytesPerSecondOfWriteDataPointsExpected] Expected data - * points for MegaBytes per second of write. - * @member {number} [megabytesPerSecondOfWriteDataPointsReceived] Received data - * points for MegaBytes per second of write. - * @member {number} [numberOfReadOperationsPerSecond] Number of read operations - * per second for the disk. - * @member {number} [numberOfReadOperationsPerSecondDataPointsExpected] - * Expected number of data points for read operations per second. - * @member {number} [numberOfReadOperationsPerSecondDataPointsReceived] - * Received number of data points for read operations per second. - * @member {number} [numberOfWriteOperationsPerSecond] Number of read and write - * operations per second for the disk. - * @member {number} [numberOfWriteOperationsPerSecondDataPointsExpected] - * Expected number of data points for write operations per second. - * @member {number} [numberOfWriteOperationsPerSecondDataPointsReceived] - * Received number of data points for write operations per second. - * @member {number} [monthlyStorageCost] Estimated aggregate storage cost for a - * 31-day month for this disk. - * @member {string} [recommendedDiskType] Storage type selected for this disk. - * Possible values include: 'Unknown', 'Standard', 'Premium' - * @member {string} [recommendedDiskSize] Recommended Azure size for the disk, - * given utilization data and preferences set on Assessment. Possible values - * include: 'Unknown', 'Standard_S4', 'Standard_S6', 'Standard_S10', - * 'Standard_S20', 'Standard_S30', 'Standard_S40', 'Standard_S50', - * 'Premium_P4', 'Premium_P6', 'Premium_P10', 'Premium_P20', 'Premium_P30', - * 'Premium_P40', 'Premium_P50' - * @member {number} [gigabytesForRecommendedDiskSize] Gigabytes of storage - * provided by the recommended Azure disk size. - * @member {string} [suitability] Whether this disk is suitable for Azure. - * Possible values include: 'Unknown', 'NotSuitable', 'Suitable', - * 'ConditionallySuitable', 'ReadinessUnknown' - * @member {string} [suitabilityExplanation] If disk is suitable, this explains - * the reasons and mitigation steps. Possible values include: 'Unknown', - * 'NotApplicable', 'DiskSizeGreaterThanSupported', - * 'NoSuitableDiskSizeForIops', 'NoSuitableDiskSizeForThroughput', - * 'NoDiskSizeFoundInSelectedLocation', 'NoDiskSizeFoundForSelectedRedundancy', - * 'InternalErrorOccurredForDiskEvaluation' */ export interface AssessedDisk { + /** + * Name of the assessed disk. + */ readonly name?: string; + /** + * Gigabytes of storage provisioned for this disk. + */ readonly gigabytesProvisioned?: number; + /** + * Gigabytes of storage consumed by this disk. + */ readonly gigabytesConsumed?: number; + /** + * Disk throughput in MegaBytes per second. + */ readonly megabytesPerSecondOfRead?: number; + /** + * Expected data points for MegaBytes per second of read. + */ readonly megabytesPerSecondOfReadDataPointsExpected?: number; + /** + * Received data points for MegaBytes per second of read. + */ readonly megabytesPerSecondOfReadDataPointsReceived?: number; + /** + * Disk throughput in MegaBytes per second. + */ readonly megabytesPerSecondOfWrite?: number; + /** + * Expected data points for MegaBytes per second of write. + */ readonly megabytesPerSecondOfWriteDataPointsExpected?: number; + /** + * Received data points for MegaBytes per second of write. + */ readonly megabytesPerSecondOfWriteDataPointsReceived?: number; + /** + * Number of read operations per second for the disk. + */ readonly numberOfReadOperationsPerSecond?: number; + /** + * Expected number of data points for read operations per second. + */ readonly numberOfReadOperationsPerSecondDataPointsExpected?: number; + /** + * Received number of data points for read operations per second. + */ readonly numberOfReadOperationsPerSecondDataPointsReceived?: number; + /** + * Number of read and write operations per second for the disk. + */ readonly numberOfWriteOperationsPerSecond?: number; + /** + * Expected number of data points for write operations per second. + */ readonly numberOfWriteOperationsPerSecondDataPointsExpected?: number; + /** + * Received number of data points for write operations per second. + */ readonly numberOfWriteOperationsPerSecondDataPointsReceived?: number; + /** + * Estimated aggregate storage cost for a 31-day month for this disk. + */ readonly monthlyStorageCost?: number; + /** + * Storage type selected for this disk. Possible values include: 'Unknown', 'Standard', 'Premium' + */ readonly recommendedDiskType?: string; + /** + * Recommended Azure size for the disk, given utilization data and preferences set on Assessment. + * Possible values include: 'Unknown', 'Standard_S4', 'Standard_S6', 'Standard_S10', + * 'Standard_S20', 'Standard_S30', 'Standard_S40', 'Standard_S50', 'Premium_P4', 'Premium_P6', + * 'Premium_P10', 'Premium_P20', 'Premium_P30', 'Premium_P40', 'Premium_P50' + */ readonly recommendedDiskSize?: string; + /** + * Gigabytes of storage provided by the recommended Azure disk size. + */ readonly gigabytesForRecommendedDiskSize?: number; + /** + * Whether this disk is suitable for Azure. Possible values include: 'Unknown', 'NotSuitable', + * 'Suitable', 'ConditionallySuitable', 'ReadinessUnknown' + */ readonly suitability?: string; + /** + * If disk is suitable, this explains the reasons and mitigation steps. Possible values include: + * 'Unknown', 'NotApplicable', 'DiskSizeGreaterThanSupported', 'NoSuitableDiskSizeForIops', + * 'NoSuitableDiskSizeForThroughput', 'NoDiskSizeFoundInSelectedLocation', + * 'NoDiskSizeFoundForSelectedRedundancy', 'InternalErrorOccurredForDiskEvaluation' + */ readonly suitabilityExplanation?: string; } /** - * @class - * Initializes a new instance of the AssessedNetworkAdapter class. - * @constructor * A network adapter assessed for an assessment. - * - * @member {string} [macAddress] MAC Address of the network adapter. - * @member {array} [ipAddresses] List of IP Addresses on the network adapter. - * @member {number} [monthlyBandwidthCosts] Monthly cost estimate for network - * bandwidth used by this network adapter. - * @member {number} [megabytesPerSecondReceived] Adapter throughput for - * incoming traffic in MegaBytes per second. - * @member {number} [megabytesPerSecondReceivedDataPointsExpected] Expected - * data points for incoming traffic in MegaBytes per second. - * @member {number} [megabytesPerSecondOfReadDataPointsReceived] Received data - * points for incoming traffic in MegaBytes per second. - * @member {number} [megabytesPerSecondTransmitted] Adapter throughput for - * outgoing traffic in MegaBytes per second. - * @member {number} [megabytesPerSecondTransmittedDataPointsExpected] Expected - * data points for outgoing traffic in MegaBytes per second. - * @member {number} [megabytesPerSecondTransmittedDataPointsReceived] Received - * data points for outgoing traffic in MegaBytes per second. - * @member {number} [netGigabytesTransmittedPerMonth] Gigabytes transmitted - * through this adapter each month. - * @member {string} [suitability] Whether this adapter is suitable for Azure. - * Possible values include: 'Unknown', 'NotSuitable', 'Suitable', - * 'ConditionallySuitable', 'ReadinessUnknown' - * @member {string} [suitabilityExplanation] If network adapter is suitable, - * this explains the reasons and mitigation steps. Possible values include: - * 'Unknown', 'NotApplicable', 'InternalErrorOccured' */ export interface AssessedNetworkAdapter { + /** + * MAC Address of the network adapter. + */ readonly macAddress?: string; + /** + * List of IP Addresses on the network adapter. + */ readonly ipAddresses?: string[]; + /** + * Monthly cost estimate for network bandwidth used by this network adapter. + */ readonly monthlyBandwidthCosts?: number; + /** + * Adapter throughput for incoming traffic in MegaBytes per second. + */ readonly megabytesPerSecondReceived?: number; + /** + * Expected data points for incoming traffic in MegaBytes per second. + */ readonly megabytesPerSecondReceivedDataPointsExpected?: number; + /** + * Received data points for incoming traffic in MegaBytes per second. + */ readonly megabytesPerSecondOfReadDataPointsReceived?: number; + /** + * Adapter throughput for outgoing traffic in MegaBytes per second. + */ readonly megabytesPerSecondTransmitted?: number; + /** + * Expected data points for outgoing traffic in MegaBytes per second. + */ readonly megabytesPerSecondTransmittedDataPointsExpected?: number; + /** + * Received data points for outgoing traffic in MegaBytes per second. + */ readonly megabytesPerSecondTransmittedDataPointsReceived?: number; + /** + * Gigabytes transmitted through this adapter each month. + */ netGigabytesTransmittedPerMonth?: number; + /** + * Whether this adapter is suitable for Azure. Possible values include: 'Unknown', 'NotSuitable', + * 'Suitable', 'ConditionallySuitable', 'ReadinessUnknown' + */ readonly suitability?: string; + /** + * If network adapter is suitable, this explains the reasons and mitigation steps. Possible + * values include: 'Unknown', 'NotApplicable', 'InternalErrorOccured' + */ readonly suitabilityExplanation?: string; } /** - * @class - * Initializes a new instance of the AssessedMachine class. - * @constructor * A machine evaluated as part of an assessment. - * - * @member {string} [id] Path reference to this assessed machine. - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}/groups/{groupName}/assessments/{assessmentName}/assessedMachines/{assessedMachineName} - * @member {string} [name] Name of the machine. - * @member {string} [eTag] For optimistic concurrency control. - * @member {string} [type] Type of the object = - * [Microsoft.Migrate/projects/groups/assessments/assessedMachines]. - * @member {array} [groups] List of references to the groups that the machine - * is member of. - * @member {date} [discoveredTimestamp] Time when this machine was discovered - * by Azure Migrate agent. Date-Time represented in ISO-8601 format. - * @member {string} [bootType] Boot type of the machine. Possible values - * include: 'Unknown', 'EFI', 'BIOS' - * @member {string} [datacenterContainer] Container defined in the management - * solution that this machine is part of in the datacenter. - * @member {string} [datacenterManagementServer] Name of the server hosting the - * datacenter management solution. - * @member {string} [datacenterMachineId] ID of the machine as tracked by the - * datacenter management solution. - * @member {string} [datacenterManagementServerId] ID of the server hosting the - * datacenter management solution. - * @member {string} [description] Description of the machine - * @member {string} [displayName] User readable name of the machine as defined - * by the user in their private datacenter. - * @member {number} [megabytesOfMemory] Memory in Megabytes. - * @member {number} [numberOfCores] Processor count. - * @member {string} [operatingSystem] Operating System of the machine. - * @member {number} [monthlyBandwidthCost] Monthly network cost estimate for - * the network adapters that are attached to this machine as a group, for a - * 31-day month. - * @member {number} [monthlyStorageCost] Monthly storage cost estimate for the - * disks that are attached to this machine as a group, for a 31-day month. - * @member {object} [disks] Dictionary of disks attached to the machine. Key is - * ID of disk. Value is a disk object. - * @member {object} [networkAdapters] Dictionary of network adapters attached - * to the machine. Key is name of the adapter. Value is a network adapter - * object. - * @member {string} [recommendedSize] Recommended Azure size for this machine. - * Possible values include: 'Unknown', 'Basic_A0', 'Basic_A1', 'Basic_A2', - * 'Basic_A3', 'Basic_A4', 'Standard_A0', 'Standard_A1', 'Standard_A2', - * 'Standard_A3', 'Standard_A4', 'Standard_A5', 'Standard_A6', 'Standard_A7', - * 'Standard_A8', 'Standard_A9', 'Standard_A10', 'Standard_A11', - * 'Standard_A1_v2', 'Standard_A2_v2', 'Standard_A4_v2', 'Standard_A8_v2', - * 'Standard_A2m_v2', 'Standard_A4m_v2', 'Standard_A8m_v2', 'Standard_D1', - * 'Standard_D2', 'Standard_D3', 'Standard_D4', 'Standard_D11', 'Standard_D12', - * 'Standard_D13', 'Standard_D14', 'Standard_D1_v2', 'Standard_D2_v2', - * 'Standard_D3_v2', 'Standard_D4_v2', 'Standard_D5_v2', 'Standard_D11_v2', - * 'Standard_D12_v2', 'Standard_D13_v2', 'Standard_D14_v2', 'Standard_D15_v2', - * 'Standard_DS1', 'Standard_DS2', 'Standard_DS3', 'Standard_DS4', - * 'Standard_DS11', 'Standard_DS12', 'Standard_DS13', 'Standard_DS14', - * 'Standard_DS1_v2', 'Standard_DS2_v2', 'Standard_DS3_v2', 'Standard_DS4_v2', - * 'Standard_DS5_v2', 'Standard_DS11_v2', 'Standard_DS12_v2', - * 'Standard_DS13_v2', 'Standard_DS14_v2', 'Standard_DS15_v2', 'Standard_F1', - * 'Standard_F2', 'Standard_F4', 'Standard_F8', 'Standard_F16', 'Standard_F1s', - * 'Standard_F2s', 'Standard_F4s', 'Standard_F8s', 'Standard_F16s', - * 'Standard_G1', 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', - * 'Standard_GS1', 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', - * 'Standard_GS5', 'Standard_H8', 'Standard_H16', 'Standard_H8m', - * 'Standard_H16m', 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', - * 'Standard_L8s', 'Standard_L16s', 'Standard_L32s' - * @member {number} [numberOfCoresForRecommendedSize] Number of CPU cores in - * the Recommended Azure VM Size. - * @member {number} [megabytesOfMemoryForRecommendedSize] Megabytes of memory - * in the Recommended Azure VM Size. - * @member {number} [monthlyComputeCostForRecommendedSize] Compute Cost for a - * 31-day month, if the machine is migrated to Azure with the Recommended Size. - * @member {number} [percentageCoresUtilization] Utilization percentage of the - * processor core as observed in the private data center, in the Time Range - * selected on Assessment, reported as the Percentile value based on the - * percentile number selected in assessment. - * @member {number} [percentageMemoryUtilization] Utilization percentage of the - * memory as observed in the private data center, in the Time Range selected on - * Assessment, reported as the Percentile value based on the percentile number - * selected in assessment. - * @member {number} [percentageCoresUtilizationDataPointsExpected] Expected - * data points for percentage of cores utilization. - * @member {number} [percentageCoresUtilizationDataPointsReceived] Received - * data points for percentage of cores utilization. - * @member {number} [percentageMemoryUtilizationDataPointsExpected] Expected - * data points for percentage of memory utilization. - * @member {number} [percentageMemoryUtilizationDataPointsReceived] Received - * data points for percentage of memory utilization. - * @member {string} [suitability] Whether machine is suitable for migration to - * Azure. Possible values include: 'Unknown', 'NotSuitable', 'Suitable', - * 'ConditionallySuitable', 'ReadinessUnknown' - * @member {string} [suitabilityExplanation] If machine is not ready to be - * migrated, this explains the reasons and mitigation steps. Possible values - * include: 'Unknown', 'NotApplicable', - * 'GuestOperatingSystemArchitectureNotSupported', - * 'GuestOperatingSystemNotSupported', 'BootTypeNotSupported', - * 'MoreDisksThanSupported', 'NoSuitableVmSizeFound', - * 'OneOrMoreDisksNotSuitable', 'OneOrMoreAdaptersNotSuitable', - * 'InternalErrorOccuredDuringComputeEvaluation', - * 'InternalErrorOccuredDuringStorageEvaluation', - * 'InternalErrorOccuredDuringNetworkEvaluation', - * 'NoVmSizeSupportsStoragePerformance', 'NoVmSizeSupportsNetworkPerformance', - * 'NoVmSizeForSelectedPricingTier', 'NoVmSizeForSelectedAzureLocation', - * 'CheckRedHatLinuxVersion', 'CheckOpenSuseLinuxVersion', - * 'CheckWindowsServer2008R2Version', 'CheckCentOsVersion', - * 'CheckDebianLinuxVersion', 'CheckSuseLinuxVersion', - * 'CheckOracleLinuxVersion', 'CheckUbuntuLinuxVersion', - * 'CheckCoreOsLinuxVersion', 'WindowsServerVersionConditionallySupported', - * 'NoGuestOperatingSystemConditionallySupported', - * 'WindowsClientVersionsConditionallySupported', 'BootTypeUnknown', - * 'GuestOperatingSystemUnknown', 'WindowsServerVersionsSupportedWithCaveat', - * 'WindowsOSNoLongerUnderMSSupport', - * 'EndorsedWithConditionsLinuxDistributions', 'UnendorsedLinuxDistributions', - * 'NoVmSizeForStandardPricingTier', 'NoVmSizeForBasicPricingTier' - * @member {date} [createdTimestamp] Time when this machine was created. - * Date-Time represented in ISO-8601 format. - * @member {date} [updatedTimestamp] Time when this machine was last updated. - * Date-Time represented in ISO-8601 format. */ export interface AssessedMachine extends BaseResource { + /** + * Path reference to this assessed machine. + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}/groups/{groupName}/assessments/{assessmentName}/assessedMachines/{assessedMachineName} + */ readonly id?: string; + /** + * Name of the machine. + */ readonly name?: string; + /** + * For optimistic concurrency control. + */ eTag?: string; + /** + * Type of the object = [Microsoft.Migrate/projects/groups/assessments/assessedMachines]. + */ readonly type?: string; + /** + * List of references to the groups that the machine is member of. + */ readonly groups?: string[]; + /** + * Time when this machine was discovered by Azure Migrate agent. Date-Time represented in + * ISO-8601 format. + */ readonly discoveredTimestamp?: Date; + /** + * Boot type of the machine. Possible values include: 'Unknown', 'EFI', 'BIOS' + */ readonly bootType?: string; + /** + * Container defined in the management solution that this machine is part of in the datacenter. + */ readonly datacenterContainer?: string; + /** + * Name of the server hosting the datacenter management solution. + */ readonly datacenterManagementServer?: string; + /** + * ID of the machine as tracked by the datacenter management solution. + */ readonly datacenterMachineId?: string; + /** + * ID of the server hosting the datacenter management solution. + */ readonly datacenterManagementServerId?: string; + /** + * Description of the machine + */ readonly description?: string; + /** + * User readable name of the machine as defined by the user in their private datacenter. + */ readonly displayName?: string; + /** + * Memory in Megabytes. + */ readonly megabytesOfMemory?: number; + /** + * Processor count. + */ readonly numberOfCores?: number; + /** + * Operating System of the machine. + */ readonly operatingSystem?: string; + /** + * Monthly network cost estimate for the network adapters that are attached to this machine as a + * group, for a 31-day month. + */ readonly monthlyBandwidthCost?: number; + /** + * Monthly storage cost estimate for the disks that are attached to this machine as a group, for + * a 31-day month. + */ readonly monthlyStorageCost?: number; + /** + * Dictionary of disks attached to the machine. Key is ID of disk. Value is a disk object. + */ readonly disks?: { [propertyName: string]: AssessedDisk }; + /** + * Dictionary of network adapters attached to the machine. Key is name of the adapter. Value is a + * network adapter object. + */ readonly networkAdapters?: { [propertyName: string]: AssessedNetworkAdapter }; + /** + * Recommended Azure size for this machine. Possible values include: 'Unknown', 'Basic_A0', + * 'Basic_A1', 'Basic_A2', 'Basic_A3', 'Basic_A4', 'Standard_A0', 'Standard_A1', 'Standard_A2', + * 'Standard_A3', 'Standard_A4', 'Standard_A5', 'Standard_A6', 'Standard_A7', 'Standard_A8', + * 'Standard_A9', 'Standard_A10', 'Standard_A11', 'Standard_A1_v2', 'Standard_A2_v2', + * 'Standard_A4_v2', 'Standard_A8_v2', 'Standard_A2m_v2', 'Standard_A4m_v2', 'Standard_A8m_v2', + * 'Standard_D1', 'Standard_D2', 'Standard_D3', 'Standard_D4', 'Standard_D11', 'Standard_D12', + * 'Standard_D13', 'Standard_D14', 'Standard_D1_v2', 'Standard_D2_v2', 'Standard_D3_v2', + * 'Standard_D4_v2', 'Standard_D5_v2', 'Standard_D11_v2', 'Standard_D12_v2', 'Standard_D13_v2', + * 'Standard_D14_v2', 'Standard_D15_v2', 'Standard_DS1', 'Standard_DS2', 'Standard_DS3', + * 'Standard_DS4', 'Standard_DS11', 'Standard_DS12', 'Standard_DS13', 'Standard_DS14', + * 'Standard_DS1_v2', 'Standard_DS2_v2', 'Standard_DS3_v2', 'Standard_DS4_v2', 'Standard_DS5_v2', + * 'Standard_DS11_v2', 'Standard_DS12_v2', 'Standard_DS13_v2', 'Standard_DS14_v2', + * 'Standard_DS15_v2', 'Standard_F1', 'Standard_F2', 'Standard_F4', 'Standard_F8', + * 'Standard_F16', 'Standard_F1s', 'Standard_F2s', 'Standard_F4s', 'Standard_F8s', + * 'Standard_F16s', 'Standard_G1', 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', + * 'Standard_GS1', 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', 'Standard_H8', + * 'Standard_H16', 'Standard_H8m', 'Standard_H16m', 'Standard_H16r', 'Standard_H16mr', + * 'Standard_L4s', 'Standard_L8s', 'Standard_L16s', 'Standard_L32s' + */ readonly recommendedSize?: string; + /** + * Number of CPU cores in the Recommended Azure VM Size. + */ readonly numberOfCoresForRecommendedSize?: number; + /** + * Megabytes of memory in the Recommended Azure VM Size. + */ readonly megabytesOfMemoryForRecommendedSize?: number; + /** + * Compute Cost for a 31-day month, if the machine is migrated to Azure with the Recommended + * Size. + */ readonly monthlyComputeCostForRecommendedSize?: number; + /** + * Utilization percentage of the processor core as observed in the private data center, in the + * Time Range selected on Assessment, reported as the Percentile value based on the percentile + * number selected in assessment. + */ readonly percentageCoresUtilization?: number; + /** + * Utilization percentage of the memory as observed in the private data center, in the Time Range + * selected on Assessment, reported as the Percentile value based on the percentile number + * selected in assessment. + */ readonly percentageMemoryUtilization?: number; + /** + * Expected data points for percentage of cores utilization. + */ readonly percentageCoresUtilizationDataPointsExpected?: number; + /** + * Received data points for percentage of cores utilization. + */ readonly percentageCoresUtilizationDataPointsReceived?: number; + /** + * Expected data points for percentage of memory utilization. + */ readonly percentageMemoryUtilizationDataPointsExpected?: number; + /** + * Received data points for percentage of memory utilization. + */ readonly percentageMemoryUtilizationDataPointsReceived?: number; + /** + * Whether machine is suitable for migration to Azure. Possible values include: 'Unknown', + * 'NotSuitable', 'Suitable', 'ConditionallySuitable', 'ReadinessUnknown' + */ readonly suitability?: string; + /** + * If machine is not ready to be migrated, this explains the reasons and mitigation steps. + * Possible values include: 'Unknown', 'NotApplicable', + * 'GuestOperatingSystemArchitectureNotSupported', 'GuestOperatingSystemNotSupported', + * 'BootTypeNotSupported', 'MoreDisksThanSupported', 'NoSuitableVmSizeFound', + * 'OneOrMoreDisksNotSuitable', 'OneOrMoreAdaptersNotSuitable', + * 'InternalErrorOccuredDuringComputeEvaluation', 'InternalErrorOccuredDuringStorageEvaluation', + * 'InternalErrorOccuredDuringNetworkEvaluation', 'NoVmSizeSupportsStoragePerformance', + * 'NoVmSizeSupportsNetworkPerformance', 'NoVmSizeForSelectedPricingTier', + * 'NoVmSizeForSelectedAzureLocation', 'CheckRedHatLinuxVersion', 'CheckOpenSuseLinuxVersion', + * 'CheckWindowsServer2008R2Version', 'CheckCentOsVersion', 'CheckDebianLinuxVersion', + * 'CheckSuseLinuxVersion', 'CheckOracleLinuxVersion', 'CheckUbuntuLinuxVersion', + * 'CheckCoreOsLinuxVersion', 'WindowsServerVersionConditionallySupported', + * 'NoGuestOperatingSystemConditionallySupported', 'WindowsClientVersionsConditionallySupported', + * 'BootTypeUnknown', 'GuestOperatingSystemUnknown', 'WindowsServerVersionsSupportedWithCaveat', + * 'WindowsOSNoLongerUnderMSSupport', 'EndorsedWithConditionsLinuxDistributions', + * 'UnendorsedLinuxDistributions', 'NoVmSizeForStandardPricingTier', + * 'NoVmSizeForBasicPricingTier' + */ readonly suitabilityExplanation?: string; + /** + * Time when this machine was created. Date-Time represented in ISO-8601 format. + */ readonly createdTimestamp?: Date; + /** + * Time when this machine was last updated. Date-Time represented in ISO-8601 format. + */ readonly updatedTimestamp?: Date; } /** - * @class - * Initializes a new instance of the ProjectKey class. - * @constructor * ID and Key for Migration Project. - * - * @member {string} [workspaceId] ID of Migration Project. - * @member {string} [workspaceKey] Key of Migration Project. */ export interface ProjectKey extends BaseResource { + /** + * ID of Migration Project. + */ readonly workspaceId?: string; + /** + * Key of Migration Project. + */ readonly workspaceKey?: string; } /** - * @class - * Initializes a new instance of the OperationDisplay class. - * @constructor * Displayable properties of the operation. - * - * @member {string} [provider] Provider of the operation. - * @member {string} [resource] Resource operated on by the operation. - * @member {string} [operation] Operation Type. - * @member {string} [description] Description of the operation. */ export interface OperationDisplay { + /** + * Provider of the operation. + */ readonly provider?: string; + /** + * Resource operated on by the operation. + */ readonly resource?: string; + /** + * Operation Type. + */ readonly operation?: string; + /** + * Description of the operation. + */ readonly description?: string; } /** - * @class - * Initializes a new instance of the Operation class. - * @constructor * A REST API operation supported by the provider. - * - * @member {string} [name] Name of the operation. - * @member {object} [display] Displayable properties of the operation. - * @member {string} [display.provider] Provider of the operation. - * @member {string} [display.resource] Resource operated on by the operation. - * @member {string} [display.operation] Operation Type. - * @member {string} [display.description] Description of the operation. - * @member {string} [origin] Origin of the operation. */ export interface Operation { + /** + * Name of the operation. + */ readonly name?: string; + /** + * Displayable properties of the operation. + */ display?: OperationDisplay; + /** + * Origin of the operation. + */ readonly origin?: string; } /** - * @class - * Initializes a new instance of the DownloadUrl class. - * @constructor * Download URL for assessment report. - * - * @member {string} [assessmentReportUrl] Hyperlink to download report. - * @member {date} [expirationTime] Expiry date of download url. */ export interface DownloadUrl { + /** + * Hyperlink to download report. + */ readonly assessmentReportUrl?: string; + /** + * Expiry date of download url. + */ readonly expirationTime?: Date; } +/** + * VM family name, the list of targeted azure locations and the category of the family. + */ +export interface VmFamily { + /** + * Name of the VM family. + */ + readonly familyName?: string; + /** + * List of Azure regions. + */ + readonly targetLocations?: string[]; + /** + * Category of the VM family. + */ + readonly category?: string[]; +} + +/** + * List of assessment options. + */ +export interface AssessmentOptionsResultList { + /** + * Dictionary of VM families grouped by vm family name describing the targeted azure locations of + * VM family and the category of the family. + */ + readonly vmFamilies?: VmFamily[]; + /** + * List of supported VM Families. + */ + readonly reservedInstanceVmFamilies?: string[]; +} + +/** + * Parameters for a check name availability request. + */ +export interface CheckNameAvailabilityParameters { + /** + * The name to check for availability + */ + name: string; +} + +/** + * The CheckNameAvailability operation response. + */ +export interface CheckNameAvailabilityResult { + /** + * Gets a boolean value that indicates whether the name is available for you to use. If true, the + * name is available. If false, the name has already been taken or invalid and cannot be used. + */ + readonly nameAvailable?: boolean; + /** + * Gets the reason that a project name could not be used. The Reason element is only returned if + * NameAvailable is false. Possible values include: 'Available', 'Invalid', 'AlreadyExists' + */ + readonly reason?: string; + /** + * Gets an error message explaining the Reason value in more detail. + */ + readonly message?: string; +} /** - * @class - * Initializes a new instance of the ProjectResultList class. - * @constructor * List of projects. - * */ export interface ProjectResultList extends Array { } /** - * @class - * Initializes a new instance of the MachineResultList class. - * @constructor * List of machines. - * */ export interface MachineResultList extends Array { } /** - * @class - * Initializes a new instance of the GroupResultList class. - * @constructor * List of groups. - * */ export interface GroupResultList extends Array { } /** - * @class - * Initializes a new instance of the AssessmentResultList class. - * @constructor * List of assessments. - * */ export interface AssessmentResultList extends Array { } /** - * @class - * Initializes a new instance of the AssessedMachineResultList class. - * @constructor * List of assessed machines. - * */ export interface AssessedMachineResultList extends Array { } /** - * @class - * Initializes a new instance of the OperationResultList class. - * @constructor * List of API operations. - * */ export interface OperationResultList extends Array { } diff --git a/lib/services/migrateManagement/lib/models/index.js b/lib/services/migrateManagement/lib/models/index.js index 3558b4c054..4ebdc434df 100644 --- a/lib/services/migrateManagement/lib/models/index.js +++ b/lib/services/migrateManagement/lib/models/index.js @@ -31,6 +31,10 @@ exports.ProjectKey = require('./projectKey'); exports.OperationDisplay = require('./operationDisplay'); exports.Operation = require('./operation'); exports.DownloadUrl = require('./downloadUrl'); +exports.VmFamily = require('./vmFamily'); +exports.AssessmentOptionsResultList = require('./assessmentOptionsResultList'); +exports.CheckNameAvailabilityParameters = require('./checkNameAvailabilityParameters'); +exports.CheckNameAvailabilityResult = require('./checkNameAvailabilityResult'); exports.ProjectResultList = require('./projectResultList'); exports.MachineResultList = require('./machineResultList'); exports.GroupResultList = require('./groupResultList'); diff --git a/lib/services/migrateManagement/lib/models/machine.js b/lib/services/migrateManagement/lib/models/machine.js index 1c3c347859..342b8a4045 100644 --- a/lib/services/migrateManagement/lib/models/machine.js +++ b/lib/services/migrateManagement/lib/models/machine.js @@ -20,43 +20,44 @@ const models = require('./index'); class Machine extends models['BaseResource'] { /** * Create a Machine. - * @member {string} [id] Path reference to this machine. + * @property {string} [id] Path reference to this machine. * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}/machines/{machineName} - * @member {string} [name] Name of the machine. It is a GUID which is unique - * identifier of machine in private data center. For user-readable name, we - * have a displayName property on this machine. - * @member {string} [eTag] For optimistic concurrency control. - * @member {string} [type] Type of the object = + * @property {string} [name] Name of the machine. It is a GUID which is + * unique identifier of machine in private data center. For user-readable + * name, we have a displayName property on this machine. + * @property {string} [eTag] For optimistic concurrency control. + * @property {string} [type] Type of the object = * [Microsoft.Migrate/projects/machines]. - * @member {string} [bootType] Boot type of the machine. Possible values + * @property {string} [bootType] Boot type of the machine. Possible values * include: 'Unknown', 'EFI', 'BIOS' - * @member {string} [datacenterContainer] Container defined in the management - * solution that this machine is part of in the datacenter. - * @member {string} [datacenterManagementServer] Name of the server hosting + * @property {string} [datacenterContainer] Container defined in the + * management solution that this machine is part of in the datacenter. + * @property {string} [datacenterManagementServer] Name of the server hosting * the datacenter management solution. - * @member {string} [datacenterMachineId] ID of the machine as tracked by the - * datacenter management solution. - * @member {string} [datacenterManagementServerId] ID of the server hosting + * @property {string} [datacenterMachineId] ID of the machine as tracked by * the datacenter management solution. - * @member {string} [description] Description of the machine - * @member {string} [displayName] User readable name of the machine as + * @property {string} [datacenterManagementServerId] ID of the server hosting + * the datacenter management solution. + * @property {string} [description] Description of the machine + * @property {string} [displayName] User readable name of the machine as * defined by the user in their private datacenter. - * @member {number} [megabytesOfMemory] Memory in Megabytes. - * @member {number} [numberOfCores] Processor count. - * @member {string} [operatingSystem] Operating System of the machine. - * @member {array} [groups] List of references to the groups that the machine - * is member of. - * @member {date} [createdTimestamp] Time when this machine was created. - * Date-Time represented in ISO-8601 format. - * @member {date} [updatedTimestamp] Time when this machine was last updated. + * @property {number} [megabytesOfMemory] Memory in Megabytes. + * @property {number} [numberOfCores] Processor count. + * @property {string} [operatingSystem] Operating System of the machine. + * @property {array} [groups] List of references to the groups that the + * machine is member of. + * @property {date} [createdTimestamp] Time when this machine was created. * Date-Time represented in ISO-8601 format. - * @member {date} [discoveredTimestamp] Time when this machine was discovered - * by Azure Migrate agent. Date-Time represented in ISO-8601 format. - * @member {object} [disks] Dictionary of disks attached to the machine. Key - * is ID of disk. Value is a disk object - * @member {object} [networkAdapters] Dictionary of network adapters attached - * to the machine. Key is ID of network adapter. Value is a network adapter - * object + * @property {date} [updatedTimestamp] Time when this machine was last + * updated. Date-Time represented in ISO-8601 format. + * @property {date} [discoveredTimestamp] Time when this machine was + * discovered by Azure Migrate agent. Date-Time represented in ISO-8601 + * format. + * @property {object} [disks] Dictionary of disks attached to the machine. + * Key is ID of disk. Value is a disk object + * @property {object} [networkAdapters] Dictionary of network adapters + * attached to the machine. Key is ID of network adapter. Value is a network + * adapter object */ constructor() { super(); diff --git a/lib/services/migrateManagement/lib/models/networkAdapter.js b/lib/services/migrateManagement/lib/models/networkAdapter.js index d2ebaf4a8e..61898e2be2 100644 --- a/lib/services/migrateManagement/lib/models/networkAdapter.js +++ b/lib/services/migrateManagement/lib/models/networkAdapter.js @@ -17,8 +17,9 @@ class NetworkAdapter { /** * Create a NetworkAdapter. - * @member {string} [macAddress] MAC Address of the network adapter. - * @member {array} [ipAddresses] List of IP Addresses on the network adapter. + * @property {string} [macAddress] MAC Address of the network adapter. + * @property {array} [ipAddresses] List of IP Addresses on the network + * adapter. */ constructor() { } diff --git a/lib/services/migrateManagement/lib/models/operation.js b/lib/services/migrateManagement/lib/models/operation.js index d4ac7fd556..57e029df3c 100644 --- a/lib/services/migrateManagement/lib/models/operation.js +++ b/lib/services/migrateManagement/lib/models/operation.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * A REST API operation supported by the provider. * @@ -19,13 +17,14 @@ const models = require('./index'); class Operation { /** * Create a Operation. - * @member {string} [name] Name of the operation. - * @member {object} [display] Displayable properties of the operation. - * @member {string} [display.provider] Provider of the operation. - * @member {string} [display.resource] Resource operated on by the operation. - * @member {string} [display.operation] Operation Type. - * @member {string} [display.description] Description of the operation. - * @member {string} [origin] Origin of the operation. + * @property {string} [name] Name of the operation. + * @property {object} [display] Displayable properties of the operation. + * @property {string} [display.provider] Provider of the operation. + * @property {string} [display.resource] Resource operated on by the + * operation. + * @property {string} [display.operation] Operation Type. + * @property {string} [display.description] Description of the operation. + * @property {string} [origin] Origin of the operation. */ constructor() { } diff --git a/lib/services/migrateManagement/lib/models/operationDisplay.js b/lib/services/migrateManagement/lib/models/operationDisplay.js index 86e28fa513..f0c25c8d21 100644 --- a/lib/services/migrateManagement/lib/models/operationDisplay.js +++ b/lib/services/migrateManagement/lib/models/operationDisplay.js @@ -17,10 +17,10 @@ class OperationDisplay { /** * Create a OperationDisplay. - * @member {string} [provider] Provider of the operation. - * @member {string} [resource] Resource operated on by the operation. - * @member {string} [operation] Operation Type. - * @member {string} [description] Description of the operation. + * @property {string} [provider] Provider of the operation. + * @property {string} [resource] Resource operated on by the operation. + * @property {string} [operation] Operation Type. + * @property {string} [description] Description of the operation. */ constructor() { } diff --git a/lib/services/migrateManagement/lib/models/project.js b/lib/services/migrateManagement/lib/models/project.js index bbb4463e0b..94420e414c 100644 --- a/lib/services/migrateManagement/lib/models/project.js +++ b/lib/services/migrateManagement/lib/models/project.js @@ -20,37 +20,39 @@ const models = require('./index'); class Project extends models['BaseResource'] { /** * Create a Project. - * @member {string} [id] Path reference to this project + * @property {string} [id] Path reference to this project * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName} - * @member {string} [name] Name of the project. - * @member {string} [type] Type of the object = [Microsoft.Migrate/projects]. - * @member {string} [eTag] For optimistic concurrency control. - * @member {string} [location] Azure location in which project is created. - * @member {object} [tags] Tags provided by Azure Tagging service. - * @member {date} [createdTimestamp] Time when this project was created. + * @property {string} [name] Name of the project. + * @property {string} [type] Type of the object = + * [Microsoft.Migrate/projects]. + * @property {string} [eTag] For optimistic concurrency control. + * @property {string} [location] Azure location in which project is created. + * @property {object} [tags] Tags provided by Azure Tagging service. + * @property {date} [createdTimestamp] Time when this project was created. * Date-Time represented in ISO-8601 format. - * @member {date} [updatedTimestamp] Time when this project was last updated. - * Date-Time represented in ISO-8601 format. - * @member {string} [discoveryStatus] Reports whether project is under + * @property {date} [updatedTimestamp] Time when this project was last + * updated. Date-Time represented in ISO-8601 format. + * @property {string} [discoveryStatus] Reports whether project is under * discovery. Possible values include: 'Unknown', 'NotStarted', 'InProgress', * 'Completed' - * @member {string} [customerWorkspaceId] ARM ID of the Service Map workspace - * created by user. - * @member {string} [customerWorkspaceLocation] Location of the Service Map + * @property {string} [customerWorkspaceId] ARM ID of the Service Map + * workspace created by user. + * @property {string} [customerWorkspaceLocation] Location of the Service Map * workspace created by user. - * @member {date} [lastDiscoveryTimestamp] Time when this project was + * @property {date} [lastDiscoveryTimestamp] Time when this project was * created. Date-Time represented in ISO-8601 format. This value will be null * until discovery is complete. - * @member {string} [lastDiscoverySessionId] Session id of the last + * @property {string} [lastDiscoverySessionId] Session id of the last * discovery. - * @member {number} [numberOfGroups] Number of groups created in the project. - * @member {number} [numberOfMachines] Number of machines in the project. - * @member {number} [numberOfAssessments] Number of assessments created in + * @property {number} [numberOfGroups] Number of groups created in the + * project. + * @property {number} [numberOfMachines] Number of machines in the project. + * @property {number} [numberOfAssessments] Number of assessments created in * the project. - * @member {date} [lastAssessmentTimestamp] Time when last assessment was + * @property {date} [lastAssessmentTimestamp] Time when last assessment was * created. Date-Time represented in ISO-8601 format. This value will be null * until assessment is created. - * @member {string} [provisioningState] Provisioning state of the project. + * @property {string} [provisioningState] Provisioning state of the project. * Possible values include: 'Accepted', 'Creating', 'Deleting', 'Failed', * 'Moving', 'Succeeded' */ @@ -157,6 +159,7 @@ class Project extends models['BaseResource'] { }, lastDiscoveryTimestamp: { required: false, + nullable: true, readOnly: true, serializedName: 'properties.lastDiscoveryTimestamp', type: { @@ -197,6 +200,7 @@ class Project extends models['BaseResource'] { }, lastAssessmentTimestamp: { required: false, + nullable: true, readOnly: true, serializedName: 'properties.lastAssessmentTimestamp', type: { diff --git a/lib/services/migrateManagement/lib/models/projectKey.js b/lib/services/migrateManagement/lib/models/projectKey.js index 50d442c186..358e746a27 100644 --- a/lib/services/migrateManagement/lib/models/projectKey.js +++ b/lib/services/migrateManagement/lib/models/projectKey.js @@ -20,8 +20,8 @@ const models = require('./index'); class ProjectKey extends models['BaseResource'] { /** * Create a ProjectKey. - * @member {string} [workspaceId] ID of Migration Project. - * @member {string} [workspaceKey] Key of Migration Project. + * @property {string} [workspaceId] ID of Migration Project. + * @property {string} [workspaceKey] Key of Migration Project. */ constructor() { super(); diff --git a/lib/services/migrateManagement/lib/models/vmFamily.js b/lib/services/migrateManagement/lib/models/vmFamily.js new file mode 100644 index 0000000000..08b6da3b68 --- /dev/null +++ b/lib/services/migrateManagement/lib/models/vmFamily.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'; + +/** + * VM family name, the list of targeted azure locations and the category of the + * family. + * + */ +class VmFamily { + /** + * Create a VmFamily. + * @property {string} [familyName] Name of the VM family. + * @property {array} [targetLocations] List of Azure regions. + * @property {array} [category] Category of the VM family. + */ + constructor() { + } + + /** + * Defines the metadata of VmFamily + * + * @returns {object} metadata of VmFamily + * + */ + mapper() { + return { + required: false, + serializedName: 'VmFamily', + type: { + name: 'Composite', + className: 'VmFamily', + modelProperties: { + familyName: { + required: false, + readOnly: true, + serializedName: 'familyName', + type: { + name: 'String' + } + }, + targetLocations: { + required: false, + readOnly: true, + serializedName: 'targetLocations', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + category: { + required: false, + readOnly: true, + serializedName: 'category', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = VmFamily; diff --git a/lib/services/migrateManagement/lib/operations/assessedMachines.js b/lib/services/migrateManagement/lib/operations/assessedMachines.js index 1d17053957..7b8037508d 100644 --- a/lib/services/migrateManagement/lib/operations/assessedMachines.js +++ b/lib/services/migrateManagement/lib/operations/assessedMachines.js @@ -133,7 +133,7 @@ function _listByAssessment(resourceGroupName, projectName, groupName, assessment return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 401 && statusCode !== 404 && statusCode !== 500 && statusCode !== 503) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -186,7 +186,7 @@ function _listByAssessment(resourceGroupName, projectName, groupName, assessment /** * @summary Get an assessed machine. * - * Get an assessed machine with its size & cost estimnate that was evaluated in + * Get an assessed machine with its size & cost estimate that was evaluated in * the specified assessment. * * @param {string} resourceGroupName Name of the Azure Resource Group that @@ -299,7 +299,7 @@ function _get(resourceGroupName, projectName, groupName, assessmentName, assesse return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 401 && statusCode !== 404 && statusCode !== 500 && statusCode !== 503) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -487,7 +487,7 @@ class AssessedMachines { /** * @summary Get an assessed machine. * - * Get an assessed machine with its size & cost estimnate that was evaluated in + * Get an assessed machine with its size & cost estimate that was evaluated in * the specified assessment. * * @param {string} resourceGroupName Name of the Azure Resource Group that @@ -531,7 +531,7 @@ class AssessedMachines { /** * @summary Get an assessed machine. * - * Get an assessed machine with its size & cost estimnate that was evaluated in + * Get an assessed machine with its size & cost estimate that was evaluated in * the specified assessment. * * @param {string} resourceGroupName Name of the Azure Resource Group that diff --git a/lib/services/migrateManagement/lib/operations/assessmentOptions.js b/lib/services/migrateManagement/lib/operations/assessmentOptions.js new file mode 100644 index 0000000000..ebf1566e44 --- /dev/null +++ b/lib/services/migrateManagement/lib/operations/assessmentOptions.js @@ -0,0 +1,256 @@ +/* + * 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 Get the assessment options. + * + * Get the available options for the properties of an assessment. + * + * @param {string} locationName Azure region in which the project is created. + * + * @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 AssessmentOptionsResultList} 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(locationName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (locationName === null || locationName === undefined || typeof locationName.valueOf() !== 'string') { + throw new Error('locationName 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}/providers/Microsoft.Migrate/locations/{locationName}/assessmentOptions'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{locationName}', encodeURIComponent(locationName)); + 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['AssessmentOptionsResultList']().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 AssessmentOptions. */ +class AssessmentOptions { + /** + * Create a AssessmentOptions. + * @param {AzureMigrate} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._get = _get; + } + + /** + * @summary Get the assessment options. + * + * Get the available options for the properties of an assessment. + * + * @param {string} locationName Azure region in which the project is created. + * + * @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(locationName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(locationName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get the assessment options. + * + * Get the available options for the properties of an assessment. + * + * @param {string} locationName Azure region in which the project is created. + * + * @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 {AssessmentOptionsResultList} - 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 AssessmentOptionsResultList} 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(locationName, 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(locationName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(locationName, options, optionalCallback); + } + } + +} + +module.exports = AssessmentOptions; diff --git a/lib/services/migrateManagement/lib/operations/assessments.js b/lib/services/migrateManagement/lib/operations/assessments.js index f39247606f..84084b9567 100644 --- a/lib/services/migrateManagement/lib/operations/assessments.js +++ b/lib/services/migrateManagement/lib/operations/assessments.js @@ -119,7 +119,7 @@ function _listByGroup(resourceGroupName, projectName, groupName, options, callba return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 401 && statusCode !== 404 && statusCode !== 500 && statusCode !== 503) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -268,7 +268,7 @@ function _listByProject(resourceGroupName, projectName, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 401 && statusCode !== 404 && statusCode !== 500 && statusCode !== 503) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -427,7 +427,7 @@ function _get(resourceGroupName, projectName, groupName, assessmentName, options return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 401 && statusCode !== 404 && statusCode !== 500 && statusCode !== 503) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -481,7 +481,7 @@ function _get(resourceGroupName, projectName, groupName, assessmentName, options * @summary Create or Update assessment. * * Create a new assessment with the given name and the specified settings. - * Since name of an assessment in a project is a unique identiefier, if an + * Since name of an assessment in a project is a unique identifier, if an * assessment with the name provided already exists, then the existing * assessment is updated. * @@ -678,7 +678,7 @@ function _create(resourceGroupName, projectName, groupName, assessmentName, opti return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201 && statusCode !== 400 && statusCode !== 401 && statusCode !== 500 && statusCode !== 503) { + if (statusCode !== 200 && statusCode !== 201) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -858,7 +858,7 @@ function _deleteMethod(resourceGroupName, projectName, groupName, assessmentName return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 204 && statusCode !== 400 && statusCode !== 401 && statusCode !== 500 && statusCode !== 503) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -999,7 +999,7 @@ function _getReportDownloadUrl(resourceGroupName, projectName, groupName, assess return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 401 && statusCode !== 404 && statusCode !== 500 && statusCode !== 503) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -1377,7 +1377,7 @@ class Assessments { * @summary Create or Update assessment. * * Create a new assessment with the given name and the specified settings. - * Since name of an assessment in a project is a unique identiefier, if an + * Since name of an assessment in a project is a unique identifier, if an * assessment with the name provided already exists, then the existing * assessment is updated. * @@ -1495,7 +1495,7 @@ class Assessments { * @summary Create or Update assessment. * * Create a new assessment with the given name and the specified settings. - * Since name of an assessment in a project is a unique identiefier, if an + * Since name of an assessment in a project is a unique identifier, if an * assessment with the name provided already exists, then the existing * assessment is updated. * diff --git a/lib/services/migrateManagement/lib/operations/groups.js b/lib/services/migrateManagement/lib/operations/groups.js index 08a8fc0236..54bd044229 100644 --- a/lib/services/migrateManagement/lib/operations/groups.js +++ b/lib/services/migrateManagement/lib/operations/groups.js @@ -110,7 +110,7 @@ function _listByProject(resourceGroupName, projectName, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 401 && statusCode !== 404 && statusCode !== 500 && statusCode !== 503) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -262,7 +262,7 @@ function _get(resourceGroupName, projectName, groupName, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 401 && statusCode !== 404 && statusCode !== 500 && statusCode !== 503) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -444,7 +444,7 @@ function _create(resourceGroupName, projectName, groupName, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201 && statusCode !== 400 && statusCode !== 401 && statusCode !== 500 && statusCode !== 503) { + if (statusCode !== 200 && statusCode !== 201) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -616,7 +616,7 @@ function _deleteMethod(resourceGroupName, projectName, groupName, options, callb return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 204 && statusCode !== 401 && statusCode !== 404 && statusCode !== 500 && statusCode !== 503) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); diff --git a/lib/services/migrateManagement/lib/operations/index.d.ts b/lib/services/migrateManagement/lib/operations/index.d.ts index 5866829d90..6d2ecd71b3 100644 --- a/lib/services/migrateManagement/lib/operations/index.d.ts +++ b/lib/services/migrateManagement/lib/operations/index.d.ts @@ -12,6 +12,150 @@ import { ServiceClientOptions, RequestOptions, ServiceCallback, HttpOperationRes import * as models from '../models'; +/** + * @class + * Location + * __NOTE__: An instance of this class is automatically created for an + * instance of the AzureMigrate. + */ +export interface Location { + + + /** + * Checks whether the project name is available in the specified region. + * + * @param {string} locationName The desired region for the name check. + * + * @param {object} parameters Properties needed to check the availability of a + * name. + * + * @param {string} parameters.name The name to check for availability + * + * @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. + */ + checkNameAvailabilityWithHttpOperationResponse(locationName: string, parameters: models.CheckNameAvailabilityParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Checks whether the project name is available in the specified region. + * + * @param {string} locationName The desired region for the name check. + * + * @param {object} parameters Properties needed to check the availability of a + * name. + * + * @param {string} parameters.name The name to check for availability + * + * @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 {CheckNameAvailabilityResult} - 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. + * + * {CheckNameAvailabilityResult} [result] - The deserialized result object if an error did not occur. + * See {@link CheckNameAvailabilityResult} 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. + */ + checkNameAvailability(locationName: string, parameters: models.CheckNameAvailabilityParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + checkNameAvailability(locationName: string, parameters: models.CheckNameAvailabilityParameters, callback: ServiceCallback): void; + checkNameAvailability(locationName: string, parameters: models.CheckNameAvailabilityParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * AssessmentOptions + * __NOTE__: An instance of this class is automatically created for an + * instance of the AzureMigrate. + */ +export interface AssessmentOptions { + + + /** + * @summary Get the assessment options. + * + * Get the available options for the properties of an assessment. + * + * @param {string} locationName Azure region in which the project is created. + * + * @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(locationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get the assessment options. + * + * Get the available options for the properties of an assessment. + * + * @param {string} locationName Azure region in which the project is created. + * + * @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 {AssessmentOptionsResultList} - 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. + * + * {AssessmentOptionsResultList} [result] - The deserialized result object if an error did not occur. + * See {@link AssessmentOptionsResultList} 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(locationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(locationName: string, callback: ServiceCallback): void; + get(locationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + /** * @class * Projects @@ -21,6 +165,61 @@ import * as models from '../models'; export interface Projects { + /** + * @summary Get all projects. + * + * Get all the projects in the subscription. + * + * @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. + */ + listBySubscriptionWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get all projects. + * + * Get all the projects in the subscription. + * + * @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 {ProjectResultList} - 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. + * + * {ProjectResultList} [result] - The deserialized result object if an error did not occur. + * See {@link ProjectResultList} 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. + */ + listBySubscription(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listBySubscription(callback: ServiceCallback): void; + listBySubscription(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * @summary Get all projects. * @@ -40,7 +239,7 @@ export interface Projects { * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Get all projects. @@ -77,9 +276,9 @@ export interface Projects { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - list(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -1205,7 +1404,7 @@ export interface Assessments { * @summary Create or Update assessment. * * Create a new assessment with the given name and the specified settings. - * Since name of an assessment in a project is a unique identiefier, if an + * Since name of an assessment in a project is a unique identifier, if an * assessment with the name provided already exists, then the existing * assessment is updated. * @@ -1311,7 +1510,7 @@ export interface Assessments { * @summary Create or Update assessment. * * Create a new assessment with the given name and the specified settings. - * Since name of an assessment in a project is a unique identiefier, if an + * Since name of an assessment in a project is a unique identifier, if an * assessment with the name provided already exists, then the existing * assessment is updated. * @@ -1701,7 +1900,7 @@ export interface AssessedMachines { /** * @summary Get an assessed machine. * - * Get an assessed machine with its size & cost estimnate that was evaluated in + * Get an assessed machine with its size & cost estimate that was evaluated in * the specified assessment. * * @param {string} resourceGroupName Name of the Azure Resource Group that @@ -1733,7 +1932,7 @@ export interface AssessedMachines { /** * @summary Get an assessed machine. * - * Get an assessed machine with its size & cost estimnate that was evaluated in + * Get an assessed machine with its size & cost estimate that was evaluated in * the specified assessment. * * @param {string} resourceGroupName Name of the Azure Resource Group that diff --git a/lib/services/migrateManagement/lib/operations/index.js b/lib/services/migrateManagement/lib/operations/index.js index 1c34042864..e657276c8f 100644 --- a/lib/services/migrateManagement/lib/operations/index.js +++ b/lib/services/migrateManagement/lib/operations/index.js @@ -14,6 +14,8 @@ 'use strict'; +exports.Location = require('./location'); +exports.AssessmentOptions = require('./assessmentOptions'); exports.Projects = require('./projects'); exports.Machines = require('./machines'); exports.Groups = require('./groups'); diff --git a/lib/services/migrateManagement/lib/operations/location.js b/lib/services/migrateManagement/lib/operations/location.js new file mode 100644 index 0000000000..d58f097c49 --- /dev/null +++ b/lib/services/migrateManagement/lib/operations/location.js @@ -0,0 +1,286 @@ +/* + * 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; + +/** + * Checks whether the project name is available in the specified region. + * + * @param {string} locationName The desired region for the name check. + * + * @param {object} parameters Properties needed to check the availability of a + * name. + * + * @param {string} parameters.name The name to check for availability + * + * @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 CheckNameAvailabilityResult} 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 _checkNameAvailability(locationName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + if (parameters === null || parameters === undefined) + { + parameters = {}; + } + // Validate + try { + if (locationName === null || locationName === undefined || typeof locationName.valueOf() !== 'string') { + throw new Error('locationName 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 (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Migrate/locations/{locationName}/checkNameAvailability'; + requestUrl = requestUrl.replace('{locationName}', encodeURIComponent(locationName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['Accept-Language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['CheckNameAvailabilityParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + 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['CheckNameAvailabilityResult']().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 Location. */ +class Location { + /** + * Create a Location. + * @param {AzureMigrate} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._checkNameAvailability = _checkNameAvailability; + } + + /** + * Checks whether the project name is available in the specified region. + * + * @param {string} locationName The desired region for the name check. + * + * @param {object} parameters Properties needed to check the availability of a + * name. + * + * @param {string} parameters.name The name to check for availability + * + * @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. + */ + checkNameAvailabilityWithHttpOperationResponse(locationName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._checkNameAvailability(locationName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Checks whether the project name is available in the specified region. + * + * @param {string} locationName The desired region for the name check. + * + * @param {object} parameters Properties needed to check the availability of a + * name. + * + * @param {string} parameters.name The name to check for availability + * + * @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 {CheckNameAvailabilityResult} - 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 CheckNameAvailabilityResult} 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. + */ + checkNameAvailability(locationName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._checkNameAvailability(locationName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._checkNameAvailability(locationName, parameters, options, optionalCallback); + } + } + +} + +module.exports = Location; diff --git a/lib/services/migrateManagement/lib/operations/machines.js b/lib/services/migrateManagement/lib/operations/machines.js index eadb1b0c83..8383ceeefd 100644 --- a/lib/services/migrateManagement/lib/operations/machines.js +++ b/lib/services/migrateManagement/lib/operations/machines.js @@ -110,7 +110,7 @@ function _listByProject(resourceGroupName, projectName, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 401 && statusCode !== 404 && statusCode !== 500 && statusCode !== 503) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -262,7 +262,7 @@ function _get(resourceGroupName, projectName, machineName, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 401 && statusCode !== 404 && statusCode !== 500 && statusCode !== 503) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); diff --git a/lib/services/migrateManagement/lib/operations/projects.js b/lib/services/migrateManagement/lib/operations/projects.js index 2d24b04606..e84d88b342 100644 --- a/lib/services/migrateManagement/lib/operations/projects.js +++ b/lib/services/migrateManagement/lib/operations/projects.js @@ -14,6 +14,138 @@ const msRest = require('ms-rest'); const msRestAzure = require('ms-rest-azure'); const WebResource = msRest.WebResource; +/** + * @summary Get all projects. + * + * Get all the projects in the subscription. + * + * @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 ProjectResultList} 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 _listBySubscription(options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (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}/providers/Microsoft.Migrate/projects'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + 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['ProjectResultList']().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 Get all projects. * @@ -40,7 +172,7 @@ const WebResource = msRest.WebResource; * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _list(resourceGroupName, options, callback) { +function _listByResourceGroup(resourceGroupName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -103,7 +235,7 @@ function _list(resourceGroupName, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 401 && statusCode !== 404 && statusCode !== 500 && statusCode !== 503) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -248,7 +380,7 @@ function _get(resourceGroupName, projectName, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 401 && statusCode !== 404 && statusCode !== 500 && statusCode !== 503) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -429,7 +561,7 @@ function _create(resourceGroupName, projectName, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201 && statusCode !== 400 && statusCode !== 401 && statusCode !== 500 && statusCode !== 503) { + if (statusCode !== 200 && statusCode !== 201) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -627,7 +759,7 @@ function _update(resourceGroupName, projectName, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 400 && statusCode !== 401 && statusCode !== 404 && statusCode !== 500 && statusCode !== 503) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -771,7 +903,7 @@ function _deleteMethod(resourceGroupName, projectName, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 204 && statusCode !== 400 && statusCode !== 401 && statusCode !== 500 && statusCode !== 503) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -900,7 +1032,7 @@ function _getKeys(resourceGroupName, projectName, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 401 && statusCode !== 404 && statusCode !== 500 && statusCode !== 503) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -958,7 +1090,8 @@ class Projects { */ constructor(client) { this.client = client; - this._list = _list; + this._listBySubscription = _listBySubscription; + this._listByResourceGroup = _listByResourceGroup; this._get = _get; this._create = _create; this._update = _update; @@ -966,6 +1099,88 @@ class Projects { this._getKeys = _getKeys; } + /** + * @summary Get all projects. + * + * Get all the projects in the subscription. + * + * @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. + */ + listBySubscriptionWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listBySubscription(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get all projects. + * + * Get all the projects in the subscription. + * + * @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 {ProjectResultList} - 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 ProjectResultList} 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. + */ + listBySubscription(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._listBySubscription(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listBySubscription(options, optionalCallback); + } + } + /** * @summary Get all projects. * @@ -985,11 +1200,11 @@ class Projects { * * @reject {Error} - The error object. */ - listWithHttpOperationResponse(resourceGroupName, options) { + listByResourceGroupWithHttpOperationResponse(resourceGroupName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._list(resourceGroupName, options, (err, result, request, response) => { + self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1034,7 +1249,7 @@ class Projects { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - list(resourceGroupName, options, optionalCallback) { + listByResourceGroup(resourceGroupName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1043,14 +1258,14 @@ class Projects { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._list(resourceGroupName, options, (err, result, request, response) => { + self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._list(resourceGroupName, options, optionalCallback); + return self._listByResourceGroup(resourceGroupName, options, optionalCallback); } } diff --git a/lib/services/migrateManagement/package.json b/lib/services/migrateManagement/package.json index 219a8c2626..a5aadca4bb 100644 --- a/lib/services/migrateManagement/package.json +++ b/lib/services/migrateManagement/package.json @@ -14,12 +14,12 @@ "license": "MIT", "main": "./lib/azureMigrate.js", "types": "./lib/azureMigrate.d.ts", - "homepage": "http://github.com/azure/azure-sdk-for-node", + "homepage": "https://github.com/azure/azure-sdk-for-node/tree/master/lib/services/migrateManagement", "repository": { "type": "git", "url": "https://github.com/azure/azure-sdk-for-node.git" }, "bugs": { - "url": "http://github.com/Azure/azure-sdk-for-node/issues" + "url": "https://github.com/azure/azure-sdk-for-node/issues" } -} \ No newline at end of file +}