diff --git a/lib/services/computeManagement2/LICENSE.txt b/lib/services/computeManagement2/LICENSE.txt index 0313a903d7..5431ba98b9 100644 --- a/lib/services/computeManagement2/LICENSE.txt +++ b/lib/services/computeManagement2/LICENSE.txt @@ -1,21 +1,21 @@ -The MIT License (MIT) - -Copyright (c) 2017 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. \ No newline at end of file +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/computeManagement2/lib/LICENSE.txt b/lib/services/computeManagement2/lib/LICENSE.txt new file mode 100644 index 0000000000..5431ba98b9 --- /dev/null +++ b/lib/services/computeManagement2/lib/LICENSE.txt @@ -0,0 +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. diff --git a/lib/services/computeManagement2/lib/computeManagementClient.d.ts b/lib/services/computeManagement2/lib/computeManagementClient.d.ts index d924b38665..4894e75f99 100644 --- a/lib/services/computeManagement2/lib/computeManagementClient.d.ts +++ b/lib/services/computeManagement2/lib/computeManagementClient.d.ts @@ -58,11 +58,11 @@ export default class ComputeManagementClient extends AzureServiceClient { availabilitySets: operations.AvailabilitySets; virtualMachineExtensionImages: operations.VirtualMachineExtensionImages; virtualMachineExtensions: operations.VirtualMachineExtensions; + virtualMachines: operations.VirtualMachines; virtualMachineImages: operations.VirtualMachineImages; usageOperations: operations.UsageOperations; virtualMachineSizes: operations.VirtualMachineSizes; images: operations.Images; - virtualMachines: operations.VirtualMachines; virtualMachineScaleSets: operations.VirtualMachineScaleSets; virtualMachineScaleSetExtensions: operations.VirtualMachineScaleSetExtensions; virtualMachineScaleSetRollingUpgrades: operations.VirtualMachineScaleSetRollingUpgrades; diff --git a/lib/services/computeManagement2/lib/computeManagementClient.js b/lib/services/computeManagement2/lib/computeManagementClient.js index 84327ce764..15a0e2a7d3 100644 --- a/lib/services/computeManagement2/lib/computeManagementClient.js +++ b/lib/services/computeManagement2/lib/computeManagementClient.js @@ -75,11 +75,11 @@ class ComputeManagementClient extends ServiceClient { this.availabilitySets = new operations.AvailabilitySets(this); this.virtualMachineExtensionImages = new operations.VirtualMachineExtensionImages(this); this.virtualMachineExtensions = new operations.VirtualMachineExtensions(this); + this.virtualMachines = new operations.VirtualMachines(this); this.virtualMachineImages = new operations.VirtualMachineImages(this); this.usageOperations = new operations.UsageOperations(this); this.virtualMachineSizes = new operations.VirtualMachineSizes(this); this.images = new operations.Images(this); - this.virtualMachines = new operations.VirtualMachines(this); this.virtualMachineScaleSets = new operations.VirtualMachineScaleSets(this); this.virtualMachineScaleSetExtensions = new operations.VirtualMachineScaleSetExtensions(this); this.virtualMachineScaleSetRollingUpgrades = new operations.VirtualMachineScaleSetRollingUpgrades(this); diff --git a/lib/services/computeManagement2/lib/lib/computeManagementClient.d.ts b/lib/services/computeManagement2/lib/lib/computeManagementClient.d.ts new file mode 100644 index 0000000000..d924b38665 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/computeManagementClient.d.ts @@ -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. + */ + +import { ServiceClientCredentials } from 'ms-rest'; +import { AzureServiceClient, AzureServiceClientOptions } from 'ms-rest-azure'; +import * as models from "./models"; +import * as operations from "./operations"; + +export default class ComputeManagementClient extends AzureServiceClient { + /** + * Initializes a new instance of the ComputeManagementClient class. + * @constructor + * + * @class + * @param {credentials} credentials - Credentials needed for the client to connect to Azure. + * + * @param {string} subscriptionId - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @param {string} [baseUri] - The base URI of the service. + * + * @param {object} [options] - The parameter options + * + * @param {Array} [options.filters] - Filters to be added to the request pipeline + * + * @param {object} [options.requestOptions] - Options for the underlying request object + * {@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] - Gets or sets the preferred language for the response. + * + * @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. + * + */ + constructor(credentials: ServiceClientCredentials, subscriptionId: string, baseUri?: string, options?: AzureServiceClientOptions); + + credentials: ServiceClientCredentials; + + subscriptionId: string; + + acceptLanguage: string; + + longRunningOperationRetryTimeout: number; + + generateClientRequestId: boolean; + + // Operation groups + operations: operations.Operations; + availabilitySets: operations.AvailabilitySets; + virtualMachineExtensionImages: operations.VirtualMachineExtensionImages; + virtualMachineExtensions: operations.VirtualMachineExtensions; + virtualMachineImages: operations.VirtualMachineImages; + usageOperations: operations.UsageOperations; + virtualMachineSizes: operations.VirtualMachineSizes; + images: operations.Images; + virtualMachines: operations.VirtualMachines; + virtualMachineScaleSets: operations.VirtualMachineScaleSets; + virtualMachineScaleSetExtensions: operations.VirtualMachineScaleSetExtensions; + virtualMachineScaleSetRollingUpgrades: operations.VirtualMachineScaleSetRollingUpgrades; + virtualMachineScaleSetVMs: operations.VirtualMachineScaleSetVMs; + logAnalytics: operations.LogAnalytics; + virtualMachineRunCommands: operations.VirtualMachineRunCommands; + resourceSkus: operations.ResourceSkus; + disks: operations.Disks; + snapshots: operations.Snapshots; + containerServices: operations.ContainerServices; +} + +export { ComputeManagementClient, models as ComputeManagementModels }; diff --git a/lib/services/computeManagement2/lib/lib/computeManagementClient.js b/lib/services/computeManagement2/lib/lib/computeManagementClient.js new file mode 100644 index 0000000000..84327ce764 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/computeManagementClient.js @@ -0,0 +1,102 @@ +/* + * 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. + */ + +/* jshint latedef:false */ +/* jshint forin:false */ +/* jshint noempty:false */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const ServiceClient = msRestAzure.AzureServiceClient; + +const models = require('./models'); +const operations = require('./operations'); + + +/** Class representing a ComputeManagementClient. */ +class ComputeManagementClient extends ServiceClient { + /** + * Create a ComputeManagementClient. + * @param {credentials} credentials - Credentials needed for the client to connect to Azure. + * @param {string} subscriptionId - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * @param {string} [baseUri] - The base URI of the service. + * @param {object} [options] - The parameter options + * @param {Array} [options.filters] - Filters to be added to the request pipeline + * @param {object} [options.requestOptions] - Options for the underlying request object + * {@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] - Gets or sets the preferred language for the response. + * @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. + */ + constructor(credentials, subscriptionId, baseUri, options) { + if (credentials === null || credentials === undefined) { + throw new Error('\'credentials\' cannot be null.'); + } + if (subscriptionId === null || subscriptionId === undefined) { + throw new Error('\'subscriptionId\' cannot be null.'); + } + + if (!options) options = {}; + + super(credentials, options); + + this.acceptLanguage = 'en-US'; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.baseUri = baseUri; + if (!this.baseUri) { + this.baseUri = 'https://management.azure.com'; + } + this.credentials = credentials; + this.subscriptionId = subscriptionId; + + let packageInfo = this.getPackageJsonInfo(__dirname); + this.addUserAgentInfo(`${packageInfo.name}/${packageInfo.version}`); + if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { + this.acceptLanguage = options.acceptLanguage; + } + if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { + this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; + } + if(options.generateClientRequestId !== null && options.generateClientRequestId !== undefined) { + this.generateClientRequestId = options.generateClientRequestId; + } + this.operations = new operations.Operations(this); + this.availabilitySets = new operations.AvailabilitySets(this); + this.virtualMachineExtensionImages = new operations.VirtualMachineExtensionImages(this); + this.virtualMachineExtensions = new operations.VirtualMachineExtensions(this); + this.virtualMachineImages = new operations.VirtualMachineImages(this); + this.usageOperations = new operations.UsageOperations(this); + this.virtualMachineSizes = new operations.VirtualMachineSizes(this); + this.images = new operations.Images(this); + this.virtualMachines = new operations.VirtualMachines(this); + this.virtualMachineScaleSets = new operations.VirtualMachineScaleSets(this); + this.virtualMachineScaleSetExtensions = new operations.VirtualMachineScaleSetExtensions(this); + this.virtualMachineScaleSetRollingUpgrades = new operations.VirtualMachineScaleSetRollingUpgrades(this); + this.virtualMachineScaleSetVMs = new operations.VirtualMachineScaleSetVMs(this); + this.logAnalytics = new operations.LogAnalytics(this); + this.virtualMachineRunCommands = new operations.VirtualMachineRunCommands(this); + this.resourceSkus = new operations.ResourceSkus(this); + this.disks = new operations.Disks(this); + this.snapshots = new operations.Snapshots(this); + this.containerServices = new operations.ContainerServices(this); + this.models = models; + msRest.addSerializationMixin(this); + } + +} + +module.exports = ComputeManagementClient; +module.exports['default'] = ComputeManagementClient; +module.exports.ComputeManagementClient = ComputeManagementClient; +module.exports.ComputeManagementModels = models; diff --git a/lib/services/computeManagement2/lib/lib/models/accessUri.js b/lib/services/computeManagement2/lib/lib/models/accessUri.js new file mode 100644 index 0000000000..2f3d401a97 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/accessUri.js @@ -0,0 +1,53 @@ +/* + * 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'; + +/** + * A disk access SAS uri. + * + */ +class AccessUri { + /** + * Create a AccessUri. + * @member {string} [accessSAS] A SAS uri for accessing a disk. + */ + constructor() { + } + + /** + * Defines the metadata of AccessUri + * + * @returns {object} metadata of AccessUri + * + */ + mapper() { + return { + required: false, + serializedName: 'AccessUri', + type: { + name: 'Composite', + className: 'AccessUri', + modelProperties: { + accessSAS: { + required: false, + readOnly: true, + serializedName: 'properties.output.accessSAS', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = AccessUri; diff --git a/lib/services/computeManagement2/lib/lib/models/additionalUnattendContent.js b/lib/services/computeManagement2/lib/lib/models/additionalUnattendContent.js new file mode 100644 index 0000000000..d28f97b17d --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/additionalUnattendContent.js @@ -0,0 +1,89 @@ +/* + * 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'; + +/** + * Specifies additional XML formatted information that can be included in the + * Unattend.xml file, which is used by Windows Setup. Contents are defined by + * setting name, component name, and the pass in which the content is applied. + * + */ +class AdditionalUnattendContent { + /** + * Create a AdditionalUnattendContent. + * @member {string} [passName] The pass name. Currently, the only allowable + * value is OobeSystem. Possible values include: 'OobeSystem' + * @member {string} [componentName] The component name. Currently, the only + * allowable value is Microsoft-Windows-Shell-Setup. Possible values include: + * 'Microsoft-Windows-Shell-Setup' + * @member {string} [settingName] Specifies the name of the setting to which + * the content applies. Possible values are: FirstLogonCommands and + * AutoLogon. Possible values include: 'AutoLogon', 'FirstLogonCommands' + * @member {string} [content] Specifies the XML formatted content that is + * added to the unattend.xml file for the specified path and component. The + * XML must be less than 4KB and must include the root element for the + * setting or feature that is being inserted. + */ + constructor() { + } + + /** + * Defines the metadata of AdditionalUnattendContent + * + * @returns {object} metadata of AdditionalUnattendContent + * + */ + mapper() { + return { + required: false, + serializedName: 'AdditionalUnattendContent', + type: { + name: 'Composite', + className: 'AdditionalUnattendContent', + modelProperties: { + passName: { + required: false, + serializedName: 'passName', + type: { + name: 'Enum', + allowedValues: [ 'OobeSystem' ] + } + }, + componentName: { + required: false, + serializedName: 'componentName', + type: { + name: 'Enum', + allowedValues: [ 'Microsoft-Windows-Shell-Setup' ] + } + }, + settingName: { + required: false, + serializedName: 'settingName', + type: { + name: 'Enum', + allowedValues: [ 'AutoLogon', 'FirstLogonCommands' ] + } + }, + content: { + required: false, + serializedName: 'content', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = AdditionalUnattendContent; diff --git a/lib/services/computeManagement2/lib/lib/models/apiEntityReference.js b/lib/services/computeManagement2/lib/lib/models/apiEntityReference.js new file mode 100644 index 0000000000..c2886a79e4 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/apiEntityReference.js @@ -0,0 +1,53 @@ +/* + * 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 API entity reference. + * + */ +class ApiEntityReference { + /** + * Create a ApiEntityReference. + * @member {string} [id] The ARM resource id in the form of + * /subscriptions/{SubcriptionId}/resourceGroups/{ResourceGroupName}/... + */ + constructor() { + } + + /** + * Defines the metadata of ApiEntityReference + * + * @returns {object} metadata of ApiEntityReference + * + */ + mapper() { + return { + required: false, + serializedName: 'ApiEntityReference', + type: { + name: 'Composite', + className: 'ApiEntityReference', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ApiEntityReference; diff --git a/lib/services/computeManagement2/lib/lib/models/apiError.js b/lib/services/computeManagement2/lib/lib/models/apiError.js new file mode 100644 index 0000000000..858ddc2ea9 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/apiError.js @@ -0,0 +1,98 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Api error. + * + */ +class ApiError { + /** + * Create a ApiError. + * @member {array} [details] The Api error details + * @member {object} [innererror] The Api inner error + * @member {string} [innererror.exceptiontype] The exception type. + * @member {string} [innererror.errordetail] The internal error message or + * exception dump. + * @member {string} [code] The error code. + * @member {string} [target] The target of the particular error. + * @member {string} [message] The error message. + */ + constructor() { + } + + /** + * Defines the metadata of ApiError + * + * @returns {object} metadata of ApiError + * + */ + mapper() { + return { + required: false, + serializedName: 'ApiError', + type: { + name: 'Composite', + className: 'ApiError', + modelProperties: { + details: { + required: false, + serializedName: 'details', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ApiErrorBaseElementType', + type: { + name: 'Composite', + className: 'ApiErrorBase' + } + } + } + }, + innererror: { + required: false, + serializedName: 'innererror', + type: { + name: 'Composite', + className: 'InnerError' + } + }, + code: { + required: false, + serializedName: 'code', + type: { + name: 'String' + } + }, + target: { + required: false, + serializedName: 'target', + type: { + name: 'String' + } + }, + message: { + required: false, + serializedName: 'message', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ApiError; diff --git a/lib/services/computeManagement2/lib/lib/models/apiErrorBase.js b/lib/services/computeManagement2/lib/lib/models/apiErrorBase.js new file mode 100644 index 0000000000..f66f82ef56 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/apiErrorBase.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Api error base. + * + */ +class ApiErrorBase { + /** + * Create a ApiErrorBase. + * @member {string} [code] The error code. + * @member {string} [target] The target of the particular error. + * @member {string} [message] The error message. + */ + constructor() { + } + + /** + * Defines the metadata of ApiErrorBase + * + * @returns {object} metadata of ApiErrorBase + * + */ + mapper() { + return { + required: false, + serializedName: 'ApiErrorBase', + type: { + name: 'Composite', + className: 'ApiErrorBase', + modelProperties: { + code: { + required: false, + serializedName: 'code', + type: { + name: 'String' + } + }, + target: { + required: false, + serializedName: 'target', + type: { + name: 'String' + } + }, + message: { + required: false, + serializedName: 'message', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ApiErrorBase; diff --git a/lib/services/computeManagement2/lib/lib/models/availabilitySet.js b/lib/services/computeManagement2/lib/lib/models/availabilitySet.js new file mode 100644 index 0000000000..c7cd6dd84e --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/availabilitySet.js @@ -0,0 +1,167 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Specifies information about the availability set that the virtual machine + * should be assigned to. Virtual machines specified in the same availability + * set are allocated to different nodes to maximize availability. For more + * information about availability sets, see [Manage the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

For more information on Azure planned maintainance, see [Planned + * maintenance for virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

Currently, a VM can only be added to availability set at creation + * time. An existing VM cannot be added to an availability set. + * + * @extends models['Resource'] + */ +class AvailabilitySet extends models['Resource'] { + /** + * Create a AvailabilitySet. + * @member {number} [platformUpdateDomainCount] Update Domain count. + * @member {number} [platformFaultDomainCount] Fault Domain count. + * @member {array} [virtualMachines] A list of references to all virtual + * machines in the availability set. + * @member {array} [statuses] The resource status information. + * @member {object} [sku] Sku of the availability set + * @member {string} [sku.name] The sku name. + * @member {string} [sku.tier] Specifies the tier of virtual machines in a + * scale set.

Possible Values:

**Standard**

**Basic** + * @member {number} [sku.capacity] Specifies the number of virtual machines + * in the scale set. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of AvailabilitySet + * + * @returns {object} metadata of AvailabilitySet + * + */ + mapper() { + return { + required: false, + serializedName: 'AvailabilitySet', + type: { + name: 'Composite', + className: 'AvailabilitySet', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: true, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + platformUpdateDomainCount: { + required: false, + serializedName: 'properties.platformUpdateDomainCount', + type: { + name: 'Number' + } + }, + platformFaultDomainCount: { + required: false, + serializedName: 'properties.platformFaultDomainCount', + type: { + name: 'Number' + } + }, + virtualMachines: { + required: false, + serializedName: 'properties.virtualMachines', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SubResourceElementType', + type: { + name: 'Composite', + className: 'SubResource' + } + } + } + }, + statuses: { + required: false, + readOnly: true, + serializedName: 'properties.statuses', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'InstanceViewStatusElementType', + type: { + name: 'Composite', + className: 'InstanceViewStatus' + } + } + } + }, + sku: { + required: false, + serializedName: 'sku', + type: { + name: 'Composite', + className: 'Sku' + } + } + } + } + }; + } +} + +module.exports = AvailabilitySet; diff --git a/lib/services/computeManagement2/lib/lib/models/availabilitySetListResult.js b/lib/services/computeManagement2/lib/lib/models/availabilitySetListResult.js new file mode 100644 index 0000000000..62c74689b8 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/availabilitySetListResult.js @@ -0,0 +1,59 @@ +/* + * 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 List Availability Set operation response. + */ +class AvailabilitySetListResult extends Array { + /** + * Create a AvailabilitySetListResult. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of AvailabilitySetListResult + * + * @returns {object} metadata of AvailabilitySetListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'AvailabilitySetListResult', + type: { + name: 'Composite', + className: 'AvailabilitySetListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'AvailabilitySetElementType', + type: { + name: 'Composite', + className: 'AvailabilitySet' + } + } + } + } + } + } + }; + } +} + +module.exports = AvailabilitySetListResult; diff --git a/lib/services/computeManagement2/lib/lib/models/availabilitySetUpdate.js b/lib/services/computeManagement2/lib/lib/models/availabilitySetUpdate.js new file mode 100644 index 0000000000..b87f466cd2 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/availabilitySetUpdate.js @@ -0,0 +1,136 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Specifies information about the availability set that the virtual machine + * should be assigned to. Virtual machines specified in the same availability + * set are allocated to different nodes to maximize availability. For more + * information about availability sets, see [Manage the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

For more information on Azure planned maintainance, see [Planned + * maintenance for virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

Currently, a VM can only be added to availability set at creation + * time. An existing VM cannot be added to an availability set. + * + * @extends models['UpdateResource'] + */ +class AvailabilitySetUpdate extends models['UpdateResource'] { + /** + * Create a AvailabilitySetUpdate. + * @member {number} [platformUpdateDomainCount] Update Domain count. + * @member {number} [platformFaultDomainCount] Fault Domain count. + * @member {array} [virtualMachines] A list of references to all virtual + * machines in the availability set. + * @member {array} [statuses] The resource status information. + * @member {object} [sku] Sku of the availability set + * @member {string} [sku.name] The sku name. + * @member {string} [sku.tier] Specifies the tier of virtual machines in a + * scale set.

Possible Values:

**Standard**

**Basic** + * @member {number} [sku.capacity] Specifies the number of virtual machines + * in the scale set. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of AvailabilitySetUpdate + * + * @returns {object} metadata of AvailabilitySetUpdate + * + */ + mapper() { + return { + required: false, + serializedName: 'AvailabilitySetUpdate', + type: { + name: 'Composite', + className: 'AvailabilitySetUpdate', + modelProperties: { + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + platformUpdateDomainCount: { + required: false, + serializedName: 'properties.platformUpdateDomainCount', + type: { + name: 'Number' + } + }, + platformFaultDomainCount: { + required: false, + serializedName: 'properties.platformFaultDomainCount', + type: { + name: 'Number' + } + }, + virtualMachines: { + required: false, + serializedName: 'properties.virtualMachines', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SubResourceElementType', + type: { + name: 'Composite', + className: 'SubResource' + } + } + } + }, + statuses: { + required: false, + readOnly: true, + serializedName: 'properties.statuses', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'InstanceViewStatusElementType', + type: { + name: 'Composite', + className: 'InstanceViewStatus' + } + } + } + }, + sku: { + required: false, + serializedName: 'sku', + type: { + name: 'Composite', + className: 'Sku' + } + } + } + } + }; + } +} + +module.exports = AvailabilitySetUpdate; diff --git a/lib/services/computeManagement2/lib/lib/models/bootDiagnostics.js b/lib/services/computeManagement2/lib/lib/models/bootDiagnostics.js new file mode 100644 index 0000000000..840741d822 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/bootDiagnostics.js @@ -0,0 +1,66 @@ +/* + * 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'; + +/** + * Boot Diagnostics is a debugging feature which allows you to view Console + * Output and Screenshot to diagnose VM status.

For Linux Virtual + * Machines, you can easily view the output of your console log.

For + * both Windows and Linux virtual machines, Azure also enables you to see a + * screenshot of the VM from the hypervisor. + * + */ +class BootDiagnostics { + /** + * Create a BootDiagnostics. + * @member {boolean} [enabled] Whether boot diagnostics should be enabled on + * the Virtual Machine. + * @member {string} [storageUri] Uri of the storage account to use for + * placing the console output and screenshot. + */ + constructor() { + } + + /** + * Defines the metadata of BootDiagnostics + * + * @returns {object} metadata of BootDiagnostics + * + */ + mapper() { + return { + required: false, + serializedName: 'BootDiagnostics', + type: { + name: 'Composite', + className: 'BootDiagnostics', + modelProperties: { + enabled: { + required: false, + serializedName: 'enabled', + type: { + name: 'Boolean' + } + }, + storageUri: { + required: false, + serializedName: 'storageUri', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = BootDiagnostics; diff --git a/lib/services/computeManagement2/lib/lib/models/bootDiagnosticsInstanceView.js b/lib/services/computeManagement2/lib/lib/models/bootDiagnosticsInstanceView.js new file mode 100644 index 0000000000..e577b799be --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/bootDiagnosticsInstanceView.js @@ -0,0 +1,62 @@ +/* + * 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 instance view of a virtual machine boot diagnostics. + * + */ +class BootDiagnosticsInstanceView { + /** + * Create a BootDiagnosticsInstanceView. + * @member {string} [consoleScreenshotBlobUri] The console screenshot blob + * URI. + * @member {string} [serialConsoleLogBlobUri] The Linux serial console log + * blob Uri. + */ + constructor() { + } + + /** + * Defines the metadata of BootDiagnosticsInstanceView + * + * @returns {object} metadata of BootDiagnosticsInstanceView + * + */ + mapper() { + return { + required: false, + serializedName: 'BootDiagnosticsInstanceView', + type: { + name: 'Composite', + className: 'BootDiagnosticsInstanceView', + modelProperties: { + consoleScreenshotBlobUri: { + required: false, + serializedName: 'consoleScreenshotBlobUri', + type: { + name: 'String' + } + }, + serialConsoleLogBlobUri: { + required: false, + serializedName: 'serialConsoleLogBlobUri', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = BootDiagnosticsInstanceView; diff --git a/lib/services/computeManagement2/lib/lib/models/computeLongRunningOperationProperties.js b/lib/services/computeManagement2/lib/lib/models/computeLongRunningOperationProperties.js new file mode 100644 index 0000000000..c16291cfad --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/computeLongRunningOperationProperties.js @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Compute-specific operation properties, including output + * + */ +class ComputeLongRunningOperationProperties { + /** + * Create a ComputeLongRunningOperationProperties. + * @member {object} [output] Operation output data (raw JSON) + */ + constructor() { + } + + /** + * Defines the metadata of ComputeLongRunningOperationProperties + * + * @returns {object} metadata of ComputeLongRunningOperationProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'ComputeLongRunningOperationProperties', + type: { + name: 'Composite', + className: 'ComputeLongRunningOperationProperties', + modelProperties: { + output: { + required: false, + serializedName: 'output', + type: { + name: 'Object' + } + } + } + } + }; + } +} + +module.exports = ComputeLongRunningOperationProperties; diff --git a/lib/services/computeManagement2/lib/lib/models/computeOperationListResult.js b/lib/services/computeManagement2/lib/lib/models/computeOperationListResult.js new file mode 100644 index 0000000000..fcbd0421cb --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/computeOperationListResult.js @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The List Compute Operation operation response. + */ +class ComputeOperationListResult extends Array { + /** + * Create a ComputeOperationListResult. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ComputeOperationListResult + * + * @returns {object} metadata of ComputeOperationListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'ComputeOperationListResult', + type: { + name: 'Composite', + className: 'ComputeOperationListResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ComputeOperationValueElementType', + type: { + name: 'Composite', + className: 'ComputeOperationValue' + } + } + } + } + } + } + }; + } +} + +module.exports = ComputeOperationListResult; diff --git a/lib/services/computeManagement2/lib/lib/models/computeOperationValue.js b/lib/services/computeManagement2/lib/lib/models/computeOperationValue.js new file mode 100644 index 0000000000..bb1f964dad --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/computeOperationValue.js @@ -0,0 +1,99 @@ +/* + * 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'; + +/** + * Describes the properties of a Compute Operation value. + * + */ +class ComputeOperationValue { + /** + * Create a ComputeOperationValue. + * @member {string} [origin] The origin of the compute operation. + * @member {string} [name] The name of the compute operation. + * @member {string} [operation] The display name of the compute operation. + * @member {string} [resource] The display name of the resource the operation + * applies to. + * @member {string} [description] The description of the operation. + * @member {string} [provider] The resource provider for the operation. + */ + constructor() { + } + + /** + * Defines the metadata of ComputeOperationValue + * + * @returns {object} metadata of ComputeOperationValue + * + */ + mapper() { + return { + required: false, + serializedName: 'ComputeOperationValue', + type: { + name: 'Composite', + className: 'ComputeOperationValue', + modelProperties: { + origin: { + required: false, + readOnly: true, + serializedName: 'origin', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + operation: { + required: false, + readOnly: true, + serializedName: 'display.operation', + type: { + name: 'String' + } + }, + resource: { + required: false, + readOnly: true, + serializedName: 'display.resource', + type: { + name: 'String' + } + }, + description: { + required: false, + readOnly: true, + serializedName: 'display.description', + type: { + name: 'String' + } + }, + provider: { + required: false, + readOnly: true, + serializedName: 'display.provider', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ComputeOperationValue; diff --git a/lib/services/computeManagement2/lib/lib/models/containerService.js b/lib/services/computeManagement2/lib/lib/models/containerService.js new file mode 100644 index 0000000000..e033d40316 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/containerService.js @@ -0,0 +1,215 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Container service. + * + * @extends models['Resource'] + */ +class ContainerService extends models['Resource'] { + /** + * Create a ContainerService. + * @member {string} [provisioningState] the current deployment or + * provisioning state, which only appears in the response. + * @member {object} [orchestratorProfile] Properties of the orchestrator. + * @member {string} [orchestratorProfile.orchestratorType] The orchestrator + * to use to manage container service cluster resources. Valid values are + * Swarm, DCOS, and Custom. Possible values include: 'Swarm', 'DCOS', + * 'Custom', 'Kubernetes' + * @member {object} [customProfile] Properties for custom clusters. + * @member {string} [customProfile.orchestrator] The name of the custom + * orchestrator to use. + * @member {object} [servicePrincipalProfile] Properties for cluster service + * principals. + * @member {string} [servicePrincipalProfile.clientId] The ID for the service + * principal. + * @member {string} [servicePrincipalProfile.secret] The secret password + * associated with the service principal. + * @member {object} masterProfile Properties of master agents. + * @member {number} [masterProfile.count] Number of masters (VMs) in the + * container service cluster. Allowed values are 1, 3, and 5. The default + * value is 1. + * @member {string} [masterProfile.dnsPrefix] DNS prefix to be used to create + * the FQDN for master. + * @member {string} [masterProfile.fqdn] FDQN for the master. + * @member {array} agentPoolProfiles Properties of the agent pool. + * @member {object} [windowsProfile] Properties of Windows VMs. + * @member {string} [windowsProfile.adminUsername] The administrator username + * to use for Windows VMs. + * @member {string} [windowsProfile.adminPassword] The administrator password + * to use for Windows VMs. + * @member {object} linuxProfile Properties of Linux VMs. + * @member {string} [linuxProfile.adminUsername] The administrator username + * to use for Linux VMs. + * @member {object} [linuxProfile.ssh] The ssh key configuration for Linux + * VMs. + * @member {array} [linuxProfile.ssh.publicKeys] the list of SSH public keys + * used to authenticate with Linux-based VMs. + * @member {object} [diagnosticsProfile] Properties of the diagnostic agent. + * @member {object} [diagnosticsProfile.vmDiagnostics] Profile for the + * container service VM diagnostic agent. + * @member {boolean} [diagnosticsProfile.vmDiagnostics.enabled] Whether the + * VM diagnostic agent is provisioned on the VM. + * @member {string} [diagnosticsProfile.vmDiagnostics.storageUri] The URI of + * the storage account where diagnostics are stored. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ContainerService + * + * @returns {object} metadata of ContainerService + * + */ + mapper() { + return { + required: false, + serializedName: 'ContainerService', + type: { + name: 'Composite', + className: 'ContainerService', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: true, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + orchestratorProfile: { + required: false, + serializedName: 'properties.orchestratorProfile', + type: { + name: 'Composite', + className: 'ContainerServiceOrchestratorProfile' + } + }, + customProfile: { + required: false, + serializedName: 'properties.customProfile', + type: { + name: 'Composite', + className: 'ContainerServiceCustomProfile' + } + }, + servicePrincipalProfile: { + required: false, + serializedName: 'properties.servicePrincipalProfile', + type: { + name: 'Composite', + className: 'ContainerServiceServicePrincipalProfile' + } + }, + masterProfile: { + required: true, + serializedName: 'properties.masterProfile', + type: { + name: 'Composite', + className: 'ContainerServiceMasterProfile' + } + }, + agentPoolProfiles: { + required: true, + serializedName: 'properties.agentPoolProfiles', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ContainerServiceAgentPoolProfileElementType', + type: { + name: 'Composite', + className: 'ContainerServiceAgentPoolProfile' + } + } + } + }, + windowsProfile: { + required: false, + serializedName: 'properties.windowsProfile', + type: { + name: 'Composite', + className: 'ContainerServiceWindowsProfile' + } + }, + linuxProfile: { + required: true, + serializedName: 'properties.linuxProfile', + type: { + name: 'Composite', + className: 'ContainerServiceLinuxProfile' + } + }, + diagnosticsProfile: { + required: false, + serializedName: 'properties.diagnosticsProfile', + type: { + name: 'Composite', + className: 'ContainerServiceDiagnosticsProfile' + } + } + } + } + }; + } +} + +module.exports = ContainerService; diff --git a/lib/services/computeManagement2/lib/lib/models/containerServiceAgentPoolProfile.js b/lib/services/computeManagement2/lib/lib/models/containerServiceAgentPoolProfile.js new file mode 100644 index 0000000000..89c1404dc9 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/containerServiceAgentPoolProfile.js @@ -0,0 +1,106 @@ +/* + * 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'; + +/** + * Profile for the container service agent pool. + * + */ +class ContainerServiceAgentPoolProfile { + /** + * Create a ContainerServiceAgentPoolProfile. + * @member {string} name Unique name of the agent pool profile in the context + * of the subscription and resource group. + * @member {number} count Number of agents (VMs) to host docker containers. + * Allowed values must be in the range of 1 to 100 (inclusive). The default + * value is 1. . Default value: 1 . + * @member {string} vmSize Size of agent VMs. Possible values include: + * '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_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_G1', + * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', + * 'Standard_DS1', 'Standard_DS2', 'Standard_DS3', 'Standard_DS4', + * 'Standard_DS11', 'Standard_DS12', 'Standard_DS13', 'Standard_DS14', + * 'Standard_GS1', 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', + * 'Standard_GS5' + * @member {string} dnsPrefix DNS prefix to be used to create the FQDN for + * the agent pool. + * @member {string} [fqdn] FDQN for the agent pool. + */ + constructor() { + } + + /** + * Defines the metadata of ContainerServiceAgentPoolProfile + * + * @returns {object} metadata of ContainerServiceAgentPoolProfile + * + */ + mapper() { + return { + required: false, + serializedName: 'ContainerServiceAgentPoolProfile', + type: { + name: 'Composite', + className: 'ContainerServiceAgentPoolProfile', + modelProperties: { + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + count: { + required: true, + serializedName: 'count', + defaultValue: 1, + constraints: { + InclusiveMaximum: 100, + InclusiveMinimum: 1 + }, + type: { + name: 'Number' + } + }, + vmSize: { + required: true, + serializedName: 'vmSize', + type: { + name: 'String' + } + }, + dnsPrefix: { + required: true, + serializedName: 'dnsPrefix', + type: { + name: 'String' + } + }, + fqdn: { + required: false, + readOnly: true, + serializedName: 'fqdn', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ContainerServiceAgentPoolProfile; diff --git a/lib/services/computeManagement2/lib/lib/models/containerServiceCustomProfile.js b/lib/services/computeManagement2/lib/lib/models/containerServiceCustomProfile.js new file mode 100644 index 0000000000..ddf1584f4c --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/containerServiceCustomProfile.js @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Properties to configure a custom container service cluster. + * + */ +class ContainerServiceCustomProfile { + /** + * Create a ContainerServiceCustomProfile. + * @member {string} orchestrator The name of the custom orchestrator to use. + */ + constructor() { + } + + /** + * Defines the metadata of ContainerServiceCustomProfile + * + * @returns {object} metadata of ContainerServiceCustomProfile + * + */ + mapper() { + return { + required: false, + serializedName: 'ContainerServiceCustomProfile', + type: { + name: 'Composite', + className: 'ContainerServiceCustomProfile', + modelProperties: { + orchestrator: { + required: true, + serializedName: 'orchestrator', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ContainerServiceCustomProfile; diff --git a/lib/services/computeManagement2/lib/lib/models/containerServiceDiagnosticsProfile.js b/lib/services/computeManagement2/lib/lib/models/containerServiceDiagnosticsProfile.js new file mode 100644 index 0000000000..97ca03d8ab --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/containerServiceDiagnosticsProfile.js @@ -0,0 +1,59 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Class representing a ContainerServiceDiagnosticsProfile. + */ +class ContainerServiceDiagnosticsProfile { + /** + * Create a ContainerServiceDiagnosticsProfile. + * @member {object} vmDiagnostics Profile for the container service VM + * diagnostic agent. + * @member {boolean} [vmDiagnostics.enabled] Whether the VM diagnostic agent + * is provisioned on the VM. + * @member {string} [vmDiagnostics.storageUri] The URI of the storage account + * where diagnostics are stored. + */ + constructor() { + } + + /** + * Defines the metadata of ContainerServiceDiagnosticsProfile + * + * @returns {object} metadata of ContainerServiceDiagnosticsProfile + * + */ + mapper() { + return { + required: false, + serializedName: 'ContainerServiceDiagnosticsProfile', + type: { + name: 'Composite', + className: 'ContainerServiceDiagnosticsProfile', + modelProperties: { + vmDiagnostics: { + required: true, + serializedName: 'vmDiagnostics', + type: { + name: 'Composite', + className: 'ContainerServiceVMDiagnostics' + } + } + } + } + }; + } +} + +module.exports = ContainerServiceDiagnosticsProfile; diff --git a/lib/services/computeManagement2/lib/lib/models/containerServiceLinuxProfile.js b/lib/services/computeManagement2/lib/lib/models/containerServiceLinuxProfile.js new file mode 100644 index 0000000000..f651f9ec06 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/containerServiceLinuxProfile.js @@ -0,0 +1,69 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Profile for Linux VMs in the container service cluster. + * + */ +class ContainerServiceLinuxProfile { + /** + * Create a ContainerServiceLinuxProfile. + * @member {string} adminUsername The administrator username to use for Linux + * VMs. + * @member {object} ssh The ssh key configuration for Linux VMs. + * @member {array} [ssh.publicKeys] the list of SSH public keys used to + * authenticate with Linux-based VMs. + */ + constructor() { + } + + /** + * Defines the metadata of ContainerServiceLinuxProfile + * + * @returns {object} metadata of ContainerServiceLinuxProfile + * + */ + mapper() { + return { + required: false, + serializedName: 'ContainerServiceLinuxProfile', + type: { + name: 'Composite', + className: 'ContainerServiceLinuxProfile', + modelProperties: { + adminUsername: { + required: true, + serializedName: 'adminUsername', + constraints: { + Pattern: '^[a-z][a-z0-9_-]*$' + }, + type: { + name: 'String' + } + }, + ssh: { + required: true, + serializedName: 'ssh', + type: { + name: 'Composite', + className: 'ContainerServiceSshConfiguration' + } + } + } + } + }; + } +} + +module.exports = ContainerServiceLinuxProfile; diff --git a/lib/services/computeManagement2/lib/lib/models/containerServiceListResult.js b/lib/services/computeManagement2/lib/lib/models/containerServiceListResult.js new file mode 100644 index 0000000000..48a64b5f13 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/containerServiceListResult.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The response from the List Container Services operation. + */ +class ContainerServiceListResult extends Array { + /** + * Create a ContainerServiceListResult. + * @member {string} [nextLink] The URL to get the next set of container + * service results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ContainerServiceListResult + * + * @returns {object} metadata of ContainerServiceListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'ContainerServiceListResult', + type: { + name: 'Composite', + className: 'ContainerServiceListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ContainerServiceElementType', + type: { + name: 'Composite', + className: 'ContainerService' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ContainerServiceListResult; diff --git a/lib/services/computeManagement2/lib/lib/models/containerServiceMasterProfile.js b/lib/services/computeManagement2/lib/lib/models/containerServiceMasterProfile.js new file mode 100644 index 0000000000..5816e6dbb6 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/containerServiceMasterProfile.js @@ -0,0 +1,73 @@ +/* + * 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'; + +/** + * Profile for the container service master. + * + */ +class ContainerServiceMasterProfile { + /** + * Create a ContainerServiceMasterProfile. + * @member {number} [count] Number of masters (VMs) in the container service + * cluster. Allowed values are 1, 3, and 5. The default value is 1. Default + * value: 1 . + * @member {string} dnsPrefix DNS prefix to be used to create the FQDN for + * master. + * @member {string} [fqdn] FDQN for the master. + */ + constructor() { + } + + /** + * Defines the metadata of ContainerServiceMasterProfile + * + * @returns {object} metadata of ContainerServiceMasterProfile + * + */ + mapper() { + return { + required: false, + serializedName: 'ContainerServiceMasterProfile', + type: { + name: 'Composite', + className: 'ContainerServiceMasterProfile', + modelProperties: { + count: { + required: false, + serializedName: 'count', + defaultValue: 1, + type: { + name: 'Number' + } + }, + dnsPrefix: { + required: true, + serializedName: 'dnsPrefix', + type: { + name: 'String' + } + }, + fqdn: { + required: false, + readOnly: true, + serializedName: 'fqdn', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ContainerServiceMasterProfile; diff --git a/lib/services/computeManagement2/lib/lib/models/containerServiceOrchestratorProfile.js b/lib/services/computeManagement2/lib/lib/models/containerServiceOrchestratorProfile.js new file mode 100644 index 0000000000..e95b6de3d4 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/containerServiceOrchestratorProfile.js @@ -0,0 +1,55 @@ +/* + * 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'; + +/** + * Profile for the container service orchestrator. + * + */ +class ContainerServiceOrchestratorProfile { + /** + * Create a ContainerServiceOrchestratorProfile. + * @member {string} orchestratorType The orchestrator to use to manage + * container service cluster resources. Valid values are Swarm, DCOS, and + * Custom. Possible values include: 'Swarm', 'DCOS', 'Custom', 'Kubernetes' + */ + constructor() { + } + + /** + * Defines the metadata of ContainerServiceOrchestratorProfile + * + * @returns {object} metadata of ContainerServiceOrchestratorProfile + * + */ + mapper() { + return { + required: false, + serializedName: 'ContainerServiceOrchestratorProfile', + type: { + name: 'Composite', + className: 'ContainerServiceOrchestratorProfile', + modelProperties: { + orchestratorType: { + required: true, + serializedName: 'orchestratorType', + type: { + name: 'Enum', + allowedValues: [ 'Swarm', 'DCOS', 'Custom', 'Kubernetes' ] + } + } + } + } + }; + } +} + +module.exports = ContainerServiceOrchestratorProfile; diff --git a/lib/services/computeManagement2/lib/lib/models/containerServiceServicePrincipalProfile.js b/lib/services/computeManagement2/lib/lib/models/containerServiceServicePrincipalProfile.js new file mode 100644 index 0000000000..37d421ac51 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/containerServiceServicePrincipalProfile.js @@ -0,0 +1,62 @@ +/* + * 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'; + +/** + * Information about a service principal identity for the cluster to use for + * manipulating Azure APIs. + * + */ +class ContainerServiceServicePrincipalProfile { + /** + * Create a ContainerServiceServicePrincipalProfile. + * @member {string} clientId The ID for the service principal. + * @member {string} secret The secret password associated with the service + * principal. + */ + constructor() { + } + + /** + * Defines the metadata of ContainerServiceServicePrincipalProfile + * + * @returns {object} metadata of ContainerServiceServicePrincipalProfile + * + */ + mapper() { + return { + required: false, + serializedName: 'ContainerServiceServicePrincipalProfile', + type: { + name: 'Composite', + className: 'ContainerServiceServicePrincipalProfile', + modelProperties: { + clientId: { + required: true, + serializedName: 'clientId', + type: { + name: 'String' + } + }, + secret: { + required: true, + serializedName: 'secret', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ContainerServiceServicePrincipalProfile; diff --git a/lib/services/computeManagement2/lib/lib/models/containerServiceSshConfiguration.js b/lib/services/computeManagement2/lib/lib/models/containerServiceSshConfiguration.js new file mode 100644 index 0000000000..49c1c1cb97 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/containerServiceSshConfiguration.js @@ -0,0 +1,63 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * SSH configuration for Linux-based VMs running on Azure. + * + */ +class ContainerServiceSshConfiguration { + /** + * Create a ContainerServiceSshConfiguration. + * @member {array} publicKeys the list of SSH public keys used to + * authenticate with Linux-based VMs. + */ + constructor() { + } + + /** + * Defines the metadata of ContainerServiceSshConfiguration + * + * @returns {object} metadata of ContainerServiceSshConfiguration + * + */ + mapper() { + return { + required: false, + serializedName: 'ContainerServiceSshConfiguration', + type: { + name: 'Composite', + className: 'ContainerServiceSshConfiguration', + modelProperties: { + publicKeys: { + required: true, + serializedName: 'publicKeys', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ContainerServiceSshPublicKeyElementType', + type: { + name: 'Composite', + className: 'ContainerServiceSshPublicKey' + } + } + } + } + } + } + }; + } +} + +module.exports = ContainerServiceSshConfiguration; diff --git a/lib/services/computeManagement2/lib/lib/models/containerServiceSshPublicKey.js b/lib/services/computeManagement2/lib/lib/models/containerServiceSshPublicKey.js new file mode 100644 index 0000000000..e6246dc5b4 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/containerServiceSshPublicKey.js @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Contains information about SSH certificate public key data. + * + */ +class ContainerServiceSshPublicKey { + /** + * Create a ContainerServiceSshPublicKey. + * @member {string} keyData Certificate public key used to authenticate with + * VMs through SSH. The certificate must be in PEM format with or without + * headers. + */ + constructor() { + } + + /** + * Defines the metadata of ContainerServiceSshPublicKey + * + * @returns {object} metadata of ContainerServiceSshPublicKey + * + */ + mapper() { + return { + required: false, + serializedName: 'ContainerServiceSshPublicKey', + type: { + name: 'Composite', + className: 'ContainerServiceSshPublicKey', + modelProperties: { + keyData: { + required: true, + serializedName: 'keyData', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ContainerServiceSshPublicKey; diff --git a/lib/services/computeManagement2/lib/lib/models/containerServiceVMDiagnostics.js b/lib/services/computeManagement2/lib/lib/models/containerServiceVMDiagnostics.js new file mode 100644 index 0000000000..9c10887571 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/containerServiceVMDiagnostics.js @@ -0,0 +1,63 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Profile for diagnostics on the container service VMs. + * + */ +class ContainerServiceVMDiagnostics { + /** + * Create a ContainerServiceVMDiagnostics. + * @member {boolean} enabled Whether the VM diagnostic agent is provisioned + * on the VM. + * @member {string} [storageUri] The URI of the storage account where + * diagnostics are stored. + */ + constructor() { + } + + /** + * Defines the metadata of ContainerServiceVMDiagnostics + * + * @returns {object} metadata of ContainerServiceVMDiagnostics + * + */ + mapper() { + return { + required: false, + serializedName: 'ContainerServiceVMDiagnostics', + type: { + name: 'Composite', + className: 'ContainerServiceVMDiagnostics', + modelProperties: { + enabled: { + required: true, + serializedName: 'enabled', + type: { + name: 'Boolean' + } + }, + storageUri: { + required: false, + readOnly: true, + serializedName: 'storageUri', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ContainerServiceVMDiagnostics; diff --git a/lib/services/computeManagement2/lib/lib/models/containerServiceWindowsProfile.js b/lib/services/computeManagement2/lib/lib/models/containerServiceWindowsProfile.js new file mode 100644 index 0000000000..3bb3b802ca --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/containerServiceWindowsProfile.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Profile for Windows VMs in the container service cluster. + * + */ +class ContainerServiceWindowsProfile { + /** + * Create a ContainerServiceWindowsProfile. + * @member {string} adminUsername The administrator username to use for + * Windows VMs. + * @member {string} adminPassword The administrator password to use for + * Windows VMs. + */ + constructor() { + } + + /** + * Defines the metadata of ContainerServiceWindowsProfile + * + * @returns {object} metadata of ContainerServiceWindowsProfile + * + */ + mapper() { + return { + required: false, + serializedName: 'ContainerServiceWindowsProfile', + type: { + name: 'Composite', + className: 'ContainerServiceWindowsProfile', + modelProperties: { + adminUsername: { + required: true, + serializedName: 'adminUsername', + constraints: { + Pattern: '^[a-zA-Z0-9]+([._]?[a-zA-Z0-9]+)*$' + }, + type: { + name: 'String' + } + }, + adminPassword: { + required: true, + serializedName: 'adminPassword', + constraints: { + Pattern: '^(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%\^&\*\(\)])[a-zA-Z\d!@#$%\^&\*\(\)]{12,123}$' + }, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ContainerServiceWindowsProfile; diff --git a/lib/services/computeManagement2/lib/lib/models/creationData.js b/lib/services/computeManagement2/lib/lib/models/creationData.js new file mode 100644 index 0000000000..0bd210c44a --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/creationData.js @@ -0,0 +1,98 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Data used when creating a disk. + * + */ +class CreationData { + /** + * Create a CreationData. + * @member {string} createOption This enumerates the possible sources of a + * disk's creation. Possible values include: 'Empty', 'Attach', 'FromImage', + * 'Import', 'Copy', 'Restore' + * @member {string} [storageAccountId] If createOption is Import, the Azure + * Resource Manager identifier of the storage account containing the blob to + * import as a disk. Required only if the blob is in a different subscription + * @member {object} [imageReference] Disk source information. + * @member {string} [imageReference.id] A relative uri containing either a + * Platform Imgage Repository or user image reference. + * @member {number} [imageReference.lun] If the disk is created from an + * image's data disk, this is an index that indicates which of the data disks + * in the image to use. For OS disks, this field is null. + * @member {string} [sourceUri] If createOption is Import, this is the URI of + * a blob to be imported into a managed disk. + * @member {string} [sourceResourceId] If createOption is Copy, this is the + * ARM id of the source snapshot or disk. + */ + constructor() { + } + + /** + * Defines the metadata of CreationData + * + * @returns {object} metadata of CreationData + * + */ + mapper() { + return { + required: false, + serializedName: 'CreationData', + type: { + name: 'Composite', + className: 'CreationData', + modelProperties: { + createOption: { + required: true, + serializedName: 'createOption', + type: { + name: 'String' + } + }, + storageAccountId: { + required: false, + serializedName: 'storageAccountId', + type: { + name: 'String' + } + }, + imageReference: { + required: false, + serializedName: 'imageReference', + type: { + name: 'Composite', + className: 'ImageDiskReference' + } + }, + sourceUri: { + required: false, + serializedName: 'sourceUri', + type: { + name: 'String' + } + }, + sourceResourceId: { + required: false, + serializedName: 'sourceResourceId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = CreationData; diff --git a/lib/services/computeManagement2/lib/lib/models/dataDisk.js b/lib/services/computeManagement2/lib/lib/models/dataDisk.js new file mode 100644 index 0000000000..5a4e36bacb --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/dataDisk.js @@ -0,0 +1,146 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Describes a data disk. + * + */ +class DataDisk { + /** + * Create a DataDisk. + * @member {number} lun Specifies the logical unit number of the data disk. + * This value is used to identify data disks within the VM and therefore must + * be unique for each data disk attached to a VM. + * @member {string} [name] The disk name. + * @member {object} [vhd] The virtual hard disk. + * @member {string} [vhd.uri] Specifies the virtual hard disk's uri. + * @member {object} [image] The source user image virtual hard disk. The + * virtual hard disk will be copied before being attached to the virtual + * machine. If SourceImage is provided, the destination virtual hard drive + * must not exist. + * @member {string} [image.uri] Specifies the virtual hard disk's uri. + * @member {string} [caching] Specifies the caching requirements.

+ * Possible values are:

**None**

**ReadOnly**

+ * **ReadWrite**

Default: **None for Standard storage. ReadOnly for + * Premium storage**. Possible values include: 'None', 'ReadOnly', + * 'ReadWrite' + * @member {boolean} [writeAcceleratorEnabled] Specifies whether + * writeAccelerator should be enabled or disabled on the disk. + * @member {string} createOption Specifies how the virtual machine should be + * created.

Possible values are:

**Attach** \u2013 This value + * is used when you are using a specialized disk to create the virtual + * machine.

**FromImage** \u2013 This value is used when you are + * using an image to create the virtual machine. If you are using a platform + * image, you also use the imageReference element described above. If you are + * using a marketplace image, you also use the plan element previously + * described. Possible values include: 'FromImage', 'Empty', 'Attach' + * @member {number} [diskSizeGB] Specifies the size of an empty data disk in + * gigabytes. This element can be used to overwrite the name of the disk in a + * virtual machine image.

This value cannot be larger than 1023 GB + * @member {object} [managedDisk] The managed disk parameters. + * @member {string} [managedDisk.storageAccountType] Specifies the storage + * account type for the managed disk. Possible values are: Standard_LRS or + * Premium_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS' + */ + constructor() { + } + + /** + * Defines the metadata of DataDisk + * + * @returns {object} metadata of DataDisk + * + */ + mapper() { + return { + required: false, + serializedName: 'DataDisk', + type: { + name: 'Composite', + className: 'DataDisk', + modelProperties: { + lun: { + required: true, + serializedName: 'lun', + type: { + name: 'Number' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + vhd: { + required: false, + serializedName: 'vhd', + type: { + name: 'Composite', + className: 'VirtualHardDisk' + } + }, + image: { + required: false, + serializedName: 'image', + type: { + name: 'Composite', + className: 'VirtualHardDisk' + } + }, + caching: { + required: false, + serializedName: 'caching', + type: { + name: 'Enum', + allowedValues: [ 'None', 'ReadOnly', 'ReadWrite' ] + } + }, + writeAcceleratorEnabled: { + required: false, + serializedName: 'writeAcceleratorEnabled', + type: { + name: 'Boolean' + } + }, + createOption: { + required: true, + serializedName: 'createOption', + type: { + name: 'String' + } + }, + diskSizeGB: { + required: false, + serializedName: 'diskSizeGB', + type: { + name: 'Number' + } + }, + managedDisk: { + required: false, + serializedName: 'managedDisk', + type: { + name: 'Composite', + className: 'ManagedDiskParameters' + } + } + } + } + }; + } +} + +module.exports = DataDisk; diff --git a/lib/services/computeManagement2/lib/lib/models/dataDiskImage.js b/lib/services/computeManagement2/lib/lib/models/dataDiskImage.js new file mode 100644 index 0000000000..b426c31fab --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/dataDiskImage.js @@ -0,0 +1,55 @@ +/* + * 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'; + +/** + * Contains the data disk images information. + * + */ +class DataDiskImage { + /** + * Create a DataDiskImage. + * @member {number} [lun] Specifies the logical unit number of the data disk. + * This value is used to identify data disks within the VM and therefore must + * be unique for each data disk attached to a VM. + */ + constructor() { + } + + /** + * Defines the metadata of DataDiskImage + * + * @returns {object} metadata of DataDiskImage + * + */ + mapper() { + return { + required: false, + serializedName: 'DataDiskImage', + type: { + name: 'Composite', + className: 'DataDiskImage', + modelProperties: { + lun: { + required: false, + readOnly: true, + serializedName: 'lun', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = DataDiskImage; diff --git a/lib/services/computeManagement2/lib/lib/models/diagnosticsProfile.js b/lib/services/computeManagement2/lib/lib/models/diagnosticsProfile.js new file mode 100644 index 0000000000..3abafdb77e --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/diagnosticsProfile.js @@ -0,0 +1,65 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Specifies the boot diagnostic settings state.

Minimum api-version: + * 2015-06-15. + * + */ +class DiagnosticsProfile { + /** + * Create a DiagnosticsProfile. + * @member {object} [bootDiagnostics] Boot Diagnostics is a debugging feature + * which allows you to view Console Output and Screenshot to diagnose VM + * status.

For Linux Virtual Machines, you can easily view the + * output of your console log.

For both Windows and Linux virtual + * machines, Azure also enables you to see a screenshot of the VM from the + * hypervisor. + * @member {boolean} [bootDiagnostics.enabled] Whether boot diagnostics + * should be enabled on the Virtual Machine. + * @member {string} [bootDiagnostics.storageUri] Uri of the storage account + * to use for placing the console output and screenshot. + */ + constructor() { + } + + /** + * Defines the metadata of DiagnosticsProfile + * + * @returns {object} metadata of DiagnosticsProfile + * + */ + mapper() { + return { + required: false, + serializedName: 'DiagnosticsProfile', + type: { + name: 'Composite', + className: 'DiagnosticsProfile', + modelProperties: { + bootDiagnostics: { + required: false, + serializedName: 'bootDiagnostics', + type: { + name: 'Composite', + className: 'BootDiagnostics' + } + } + } + } + }; + } +} + +module.exports = DiagnosticsProfile; diff --git a/lib/services/computeManagement2/lib/lib/models/disk.js b/lib/services/computeManagement2/lib/lib/models/disk.js new file mode 100644 index 0000000000..470ae2c184 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/disk.js @@ -0,0 +1,228 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Disk resource. + * + * @extends models['Resource'] + */ +class Disk extends models['Resource'] { + /** + * Create a Disk. + * @member {string} [managedBy] A relative URI containing the ID of the VM + * that has the disk attached. + * @member {object} [sku] + * @member {string} [sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS' + * @member {string} [sku.tier] The sku tier. + * @member {array} [zones] The Logical zone list for Disk. + * @member {date} [timeCreated] The time when the disk was created. + * @member {string} [osType] The Operating System type. Possible values + * include: 'Windows', 'Linux' + * @member {object} creationData Disk source information. CreationData + * information cannot be changed after the disk has been created. + * @member {string} [creationData.createOption] This enumerates the possible + * sources of a disk's creation. Possible values include: 'Empty', 'Attach', + * 'FromImage', 'Import', 'Copy', 'Restore' + * @member {string} [creationData.storageAccountId] If createOption is + * Import, the Azure Resource Manager identifier of the storage account + * containing the blob to import as a disk. Required only if the blob is in a + * different subscription + * @member {object} [creationData.imageReference] Disk source information. + * @member {string} [creationData.imageReference.id] A relative uri + * containing either a Platform Imgage Repository or user image reference. + * @member {number} [creationData.imageReference.lun] If the disk is created + * from an image's data disk, this is an index that indicates which of the + * data disks in the image to use. For OS disks, this field is null. + * @member {string} [creationData.sourceUri] If createOption is Import, this + * is the URI of a blob to be imported into a managed disk. + * @member {string} [creationData.sourceResourceId] If createOption is Copy, + * this is the ARM id of the source snapshot or disk. + * @member {number} [diskSizeGB] If creationData.createOption is Empty, this + * field is mandatory and it indicates the size of the VHD to create. If this + * field is present for updates or creation with other options, it indicates + * a resize. Resizes are only allowed if the disk is not attached to a + * running VM, and can only increase the disk's size. + * @member {object} [encryptionSettings] Encryption settings for disk or + * snapshot + * @member {boolean} [encryptionSettings.enabled] Set this flag to true and + * provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * encryption. Set this flag to false and remove DiskEncryptionKey and + * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in + * the request object, the existing settings remain unchanged. + * @member {object} [encryptionSettings.diskEncryptionKey] Key Vault Secret + * Url and vault id of the disk encryption key + * @member {object} [encryptionSettings.diskEncryptionKey.sourceVault] + * Resource id of the KeyVault containing the key or secret + * @member {string} [encryptionSettings.diskEncryptionKey.sourceVault.id] + * Resource Id + * @member {string} [encryptionSettings.diskEncryptionKey.secretUrl] Url + * pointing to a key or secret in KeyVault + * @member {object} [encryptionSettings.keyEncryptionKey] Key Vault Key Url + * and vault id of the key encryption key + * @member {object} [encryptionSettings.keyEncryptionKey.sourceVault] + * Resource id of the KeyVault containing the key or secret + * @member {string} [encryptionSettings.keyEncryptionKey.sourceVault.id] + * Resource Id + * @member {string} [encryptionSettings.keyEncryptionKey.keyUrl] Url pointing + * to a key or secret in KeyVault + * @member {string} [provisioningState] The disk provisioning state. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of Disk + * + * @returns {object} metadata of Disk + * + */ + mapper() { + return { + required: false, + serializedName: 'Disk', + type: { + name: 'Composite', + className: 'Disk', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: true, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + managedBy: { + required: false, + readOnly: true, + serializedName: 'managedBy', + type: { + name: 'String' + } + }, + sku: { + required: false, + serializedName: 'sku', + type: { + name: 'Composite', + className: 'DiskSku' + } + }, + zones: { + required: false, + serializedName: 'zones', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + timeCreated: { + required: false, + readOnly: true, + serializedName: 'properties.timeCreated', + type: { + name: 'DateTime' + } + }, + osType: { + required: false, + serializedName: 'properties.osType', + type: { + name: 'Enum', + allowedValues: [ 'Windows', 'Linux' ] + } + }, + creationData: { + required: true, + serializedName: 'properties.creationData', + type: { + name: 'Composite', + className: 'CreationData' + } + }, + diskSizeGB: { + required: false, + serializedName: 'properties.diskSizeGB', + type: { + name: 'Number' + } + }, + encryptionSettings: { + required: false, + serializedName: 'properties.encryptionSettings', + type: { + name: 'Composite', + className: 'EncryptionSettings' + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = Disk; diff --git a/lib/services/computeManagement2/lib/lib/models/diskEncryptionSettings.js b/lib/services/computeManagement2/lib/lib/models/diskEncryptionSettings.js new file mode 100644 index 0000000000..a90094cd64 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/diskEncryptionSettings.js @@ -0,0 +1,85 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Describes a Encryption Settings for a Disk + * + */ +class DiskEncryptionSettings { + /** + * Create a DiskEncryptionSettings. + * @member {object} [diskEncryptionKey] Specifies the location of the disk + * encryption key, which is a Key Vault Secret. + * @member {string} [diskEncryptionKey.secretUrl] The URL referencing a + * secret in a Key Vault. + * @member {object} [diskEncryptionKey.sourceVault] The relative URL of the + * Key Vault containing the secret. + * @member {string} [diskEncryptionKey.sourceVault.id] Resource Id + * @member {object} [keyEncryptionKey] Specifies the location of the key + * encryption key in Key Vault. + * @member {string} [keyEncryptionKey.keyUrl] The URL referencing a key + * encryption key in Key Vault. + * @member {object} [keyEncryptionKey.sourceVault] The relative URL of the + * Key Vault containing the key. + * @member {string} [keyEncryptionKey.sourceVault.id] Resource Id + * @member {boolean} [enabled] Specifies whether disk encryption should be + * enabled on the virtual machine. + */ + constructor() { + } + + /** + * Defines the metadata of DiskEncryptionSettings + * + * @returns {object} metadata of DiskEncryptionSettings + * + */ + mapper() { + return { + required: false, + serializedName: 'DiskEncryptionSettings', + type: { + name: 'Composite', + className: 'DiskEncryptionSettings', + modelProperties: { + diskEncryptionKey: { + required: false, + serializedName: 'diskEncryptionKey', + type: { + name: 'Composite', + className: 'KeyVaultSecretReference' + } + }, + keyEncryptionKey: { + required: false, + serializedName: 'keyEncryptionKey', + type: { + name: 'Composite', + className: 'KeyVaultKeyReference' + } + }, + enabled: { + required: false, + serializedName: 'enabled', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = DiskEncryptionSettings; diff --git a/lib/services/computeManagement2/lib/lib/models/diskInstanceView.js b/lib/services/computeManagement2/lib/lib/models/diskInstanceView.js new file mode 100644 index 0000000000..5350cc26c3 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/diskInstanceView.js @@ -0,0 +1,87 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The instance view of the disk. + * + */ +class DiskInstanceView { + /** + * Create a DiskInstanceView. + * @member {string} [name] The disk name. + * @member {array} [encryptionSettings] Specifies the encryption settings for + * the OS Disk.

Minimum api-version: 2015-06-15 + * @member {array} [statuses] The resource status information. + */ + constructor() { + } + + /** + * Defines the metadata of DiskInstanceView + * + * @returns {object} metadata of DiskInstanceView + * + */ + mapper() { + return { + required: false, + serializedName: 'DiskInstanceView', + type: { + name: 'Composite', + className: 'DiskInstanceView', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + encryptionSettings: { + required: false, + serializedName: 'encryptionSettings', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DiskEncryptionSettingsElementType', + type: { + name: 'Composite', + className: 'DiskEncryptionSettings' + } + } + } + }, + statuses: { + required: false, + serializedName: 'statuses', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'InstanceViewStatusElementType', + type: { + name: 'Composite', + className: 'InstanceViewStatus' + } + } + } + } + } + } + }; + } +} + +module.exports = DiskInstanceView; diff --git a/lib/services/computeManagement2/lib/lib/models/diskList.js b/lib/services/computeManagement2/lib/lib/models/diskList.js new file mode 100644 index 0000000000..67a22a3f6e --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/diskList.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The List Disks operation response. + */ +class DiskList extends Array { + /** + * Create a DiskList. + * @member {string} [nextLink] The uri to fetch the next page of disks. Call + * ListNext() with this to fetch the next page of disks. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DiskList + * + * @returns {object} metadata of DiskList + * + */ + mapper() { + return { + required: false, + serializedName: 'DiskList', + type: { + name: 'Composite', + className: 'DiskList', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DiskElementType', + type: { + name: 'Composite', + className: 'Disk' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DiskList; diff --git a/lib/services/computeManagement2/lib/lib/models/diskSku.js b/lib/services/computeManagement2/lib/lib/models/diskSku.js new file mode 100644 index 0000000000..f06042e1b9 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/diskSku.js @@ -0,0 +1,63 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The disks sku name. Can be Standard_LRS or Premium_LRS. + * + */ +class DiskSku { + /** + * Create a DiskSku. + * @member {string} [name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS' + * @member {string} [tier] The sku tier. Default value: 'Standard' . + */ + constructor() { + } + + /** + * Defines the metadata of DiskSku + * + * @returns {object} metadata of DiskSku + * + */ + mapper() { + return { + required: false, + serializedName: 'DiskSku', + type: { + name: 'Composite', + className: 'DiskSku', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + tier: { + required: false, + readOnly: true, + serializedName: 'tier', + defaultValue: 'Standard', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DiskSku; diff --git a/lib/services/computeManagement2/lib/lib/models/diskUpdate.js b/lib/services/computeManagement2/lib/lib/models/diskUpdate.js new file mode 100644 index 0000000000..a9899f37c5 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/diskUpdate.js @@ -0,0 +1,123 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Disk update resource. + * + * @extends models['ResourceUpdate'] + */ +class DiskUpdate extends models['ResourceUpdate'] { + /** + * Create a DiskUpdate. + * @member {string} [osType] the Operating System type. Possible values + * include: 'Windows', 'Linux' + * @member {number} [diskSizeGB] If creationData.createOption is Empty, this + * field is mandatory and it indicates the size of the VHD to create. If this + * field is present for updates or creation with other options, it indicates + * a resize. Resizes are only allowed if the disk is not attached to a + * running VM, and can only increase the disk's size. + * @member {object} [encryptionSettings] Encryption settings for disk or + * snapshot + * @member {boolean} [encryptionSettings.enabled] Set this flag to true and + * provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * encryption. Set this flag to false and remove DiskEncryptionKey and + * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in + * the request object, the existing settings remain unchanged. + * @member {object} [encryptionSettings.diskEncryptionKey] Key Vault Secret + * Url and vault id of the disk encryption key + * @member {object} [encryptionSettings.diskEncryptionKey.sourceVault] + * Resource id of the KeyVault containing the key or secret + * @member {string} [encryptionSettings.diskEncryptionKey.sourceVault.id] + * Resource Id + * @member {string} [encryptionSettings.diskEncryptionKey.secretUrl] Url + * pointing to a key or secret in KeyVault + * @member {object} [encryptionSettings.keyEncryptionKey] Key Vault Key Url + * and vault id of the key encryption key + * @member {object} [encryptionSettings.keyEncryptionKey.sourceVault] + * Resource id of the KeyVault containing the key or secret + * @member {string} [encryptionSettings.keyEncryptionKey.sourceVault.id] + * Resource Id + * @member {string} [encryptionSettings.keyEncryptionKey.keyUrl] Url pointing + * to a key or secret in KeyVault + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DiskUpdate + * + * @returns {object} metadata of DiskUpdate + * + */ + mapper() { + return { + required: false, + serializedName: 'DiskUpdate', + type: { + name: 'Composite', + className: 'DiskUpdate', + modelProperties: { + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + sku: { + required: false, + serializedName: 'sku', + type: { + name: 'Composite', + className: 'DiskSku' + } + }, + osType: { + required: false, + serializedName: 'properties.osType', + type: { + name: 'Enum', + allowedValues: [ 'Windows', 'Linux' ] + } + }, + diskSizeGB: { + required: false, + serializedName: 'properties.diskSizeGB', + type: { + name: 'Number' + } + }, + encryptionSettings: { + required: false, + serializedName: 'properties.encryptionSettings', + type: { + name: 'Composite', + className: 'EncryptionSettings' + } + } + } + } + }; + } +} + +module.exports = DiskUpdate; diff --git a/lib/services/computeManagement2/lib/lib/models/encryptionSettings.js b/lib/services/computeManagement2/lib/lib/models/encryptionSettings.js new file mode 100644 index 0000000000..61dd97452c --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/encryptionSettings.js @@ -0,0 +1,88 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Encryption settings for disk or snapshot + * + */ +class EncryptionSettings { + /** + * Create a EncryptionSettings. + * @member {boolean} [enabled] Set this flag to true and provide + * DiskEncryptionKey and optional KeyEncryptionKey to enable encryption. Set + * this flag to false and remove DiskEncryptionKey and KeyEncryptionKey to + * disable encryption. If EncryptionSettings is null in the request object, + * the existing settings remain unchanged. + * @member {object} [diskEncryptionKey] Key Vault Secret Url and vault id of + * the disk encryption key + * @member {object} [diskEncryptionKey.sourceVault] Resource id of the + * KeyVault containing the key or secret + * @member {string} [diskEncryptionKey.sourceVault.id] Resource Id + * @member {string} [diskEncryptionKey.secretUrl] Url pointing to a key or + * secret in KeyVault + * @member {object} [keyEncryptionKey] Key Vault Key Url and vault id of the + * key encryption key + * @member {object} [keyEncryptionKey.sourceVault] Resource id of the + * KeyVault containing the key or secret + * @member {string} [keyEncryptionKey.sourceVault.id] Resource Id + * @member {string} [keyEncryptionKey.keyUrl] Url pointing to a key or secret + * in KeyVault + */ + constructor() { + } + + /** + * Defines the metadata of EncryptionSettings + * + * @returns {object} metadata of EncryptionSettings + * + */ + mapper() { + return { + required: false, + serializedName: 'EncryptionSettings', + type: { + name: 'Composite', + className: 'EncryptionSettings', + modelProperties: { + enabled: { + required: false, + serializedName: 'enabled', + type: { + name: 'Boolean' + } + }, + diskEncryptionKey: { + required: false, + serializedName: 'diskEncryptionKey', + type: { + name: 'Composite', + className: 'KeyVaultAndSecretReference' + } + }, + keyEncryptionKey: { + required: false, + serializedName: 'keyEncryptionKey', + type: { + name: 'Composite', + className: 'KeyVaultAndKeyReference' + } + } + } + } + }; + } +} + +module.exports = EncryptionSettings; diff --git a/lib/services/computeManagement2/lib/lib/models/grantAccessData.js b/lib/services/computeManagement2/lib/lib/models/grantAccessData.js new file mode 100644 index 0000000000..efd49ef389 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/grantAccessData.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'; + +/** + * Data used for requesting a SAS. + * + */ +class GrantAccessData { + /** + * Create a GrantAccessData. + * @member {string} access Possible values include: 'None', 'Read' + * @member {number} durationInSeconds Time duration in seconds until the SAS + * access expires. + */ + constructor() { + } + + /** + * Defines the metadata of GrantAccessData + * + * @returns {object} metadata of GrantAccessData + * + */ + mapper() { + return { + required: false, + serializedName: 'GrantAccessData', + type: { + name: 'Composite', + className: 'GrantAccessData', + modelProperties: { + access: { + required: true, + serializedName: 'access', + type: { + name: 'String' + } + }, + durationInSeconds: { + required: true, + serializedName: 'durationInSeconds', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = GrantAccessData; diff --git a/lib/services/computeManagement2/lib/lib/models/hardwareProfile.js b/lib/services/computeManagement2/lib/lib/models/hardwareProfile.js new file mode 100644 index 0000000000..2204f011da --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/hardwareProfile.js @@ -0,0 +1,108 @@ +/* + * 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'; + +/** + * Specifies the hardware settings for the virtual machine. + * + */ +class HardwareProfile { + /** + * Create a HardwareProfile. + * @member {string} [vmSize] Specifies the size of the virtual machine. For + * more information about virtual machine sizes, see [Sizes for virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

The available VM sizes depend on region and availability set. For + * a list of available sizes use these APIs:

[List all available + * virtual machine sizes in an availability + * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) + *

[List all available virtual machine sizes in a + * region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) + *

[List all available virtual machine sizes for + * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). + * Possible values include: '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_B1s', 'Standard_B1ms', + * 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', + * '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_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', + * 'Standard_D16_v3', 'Standard_D32_v3', 'Standard_D64_v3', + * 'Standard_D2s_v3', 'Standard_D4s_v3', 'Standard_D8s_v3', + * 'Standard_D16s_v3', 'Standard_D32s_v3', 'Standard_D64s_v3', + * '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_DS13-4_v2', + * 'Standard_DS13-2_v2', 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', + * 'Standard_E2_v3', 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', + * 'Standard_E32_v3', 'Standard_E64_v3', 'Standard_E2s_v3', + * 'Standard_E4s_v3', 'Standard_E8s_v3', 'Standard_E16s_v3', + * 'Standard_E32s_v3', 'Standard_E64s_v3', 'Standard_E32-16_v3', + * 'Standard_E32-8s_v3', 'Standard_E64-32s_v3', 'Standard_E64-16s_v3', + * 'Standard_F1', 'Standard_F2', 'Standard_F4', 'Standard_F8', + * 'Standard_F16', 'Standard_F1s', 'Standard_F2s', 'Standard_F4s', + * 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2', 'Standard_F4s_v2', + * 'Standard_F8s_v2', 'Standard_F16s_v2', 'Standard_F32s_v2', + * 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1', 'Standard_G2', + * 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', + * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', + * 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8', + * 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m', + * 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', + * 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms', + * 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms', + * 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms', + * 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', + * 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2', + * 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3', + * 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s', + * 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6', + * 'Standard_NV12', 'Standard_NV24' + */ + constructor() { + } + + /** + * Defines the metadata of HardwareProfile + * + * @returns {object} metadata of HardwareProfile + * + */ + mapper() { + return { + required: false, + serializedName: 'HardwareProfile', + type: { + name: 'Composite', + className: 'HardwareProfile', + modelProperties: { + vmSize: { + required: false, + serializedName: 'vmSize', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = HardwareProfile; diff --git a/lib/services/computeManagement2/lib/lib/models/image.js b/lib/services/computeManagement2/lib/lib/models/image.js new file mode 100644 index 0000000000..50e1764899 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/image.js @@ -0,0 +1,160 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The source user image virtual hard disk. The virtual hard disk will be + * copied before being attached to the virtual machine. If SourceImage is + * provided, the destination virtual hard drive must not exist. + * + * @extends models['Resource'] + */ +class Image extends models['Resource'] { + /** + * Create a Image. + * @member {object} [sourceVirtualMachine] The source virtual machine from + * which Image is created. + * @member {string} [sourceVirtualMachine.id] Resource Id + * @member {object} [storageProfile] Specifies the storage settings for the + * virtual machine disks. + * @member {object} [storageProfile.osDisk] Specifies information about the + * operating system disk used by the virtual machine.

For more + * information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @member {string} [storageProfile.osDisk.osType] This property allows you + * to specify the type of the OS that is included in the disk if creating a + * VM from a custom image.

Possible values are:

**Windows** + *

**Linux**. Possible values include: 'Windows', 'Linux' + * @member {string} [storageProfile.osDisk.osState] The OS State. Possible + * values include: 'Generalized', 'Specialized' + * @member {object} [storageProfile.osDisk.snapshot] The snapshot. + * @member {string} [storageProfile.osDisk.snapshot.id] Resource Id + * @member {object} [storageProfile.osDisk.managedDisk] The managedDisk. + * @member {string} [storageProfile.osDisk.managedDisk.id] Resource Id + * @member {string} [storageProfile.osDisk.blobUri] The Virtual Hard Disk. + * @member {string} [storageProfile.osDisk.caching] Specifies the caching + * requirements.

Possible values are:

**None**

+ * **ReadOnly**

**ReadWrite**

Default: **None for Standard + * storage. ReadOnly for Premium storage**. Possible values include: 'None', + * 'ReadOnly', 'ReadWrite' + * @member {number} [storageProfile.osDisk.diskSizeGB] Specifies the size of + * empty data disks in gigabytes. This element can be used to overwrite the + * name of the disk in a virtual machine image.

This value cannot be + * larger than 1023 GB + * @member {string} [storageProfile.osDisk.storageAccountType] Specifies the + * storage account type for the managed disk. Possible values are: + * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * @member {array} [storageProfile.dataDisks] Specifies the parameters that + * are used to add a data disk to a virtual machine.

For more + * information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @member {boolean} [storageProfile.zoneResilient] Specifies whether an + * image is zone resilient or not. Default is false. Zone resilient images + * can be created only in regions that provide Zone Redundant Storage (ZRS). + * @member {string} [provisioningState] The provisioning state. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of Image + * + * @returns {object} metadata of Image + * + */ + mapper() { + return { + required: false, + serializedName: 'Image', + type: { + name: 'Composite', + className: 'Image', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: true, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + sourceVirtualMachine: { + required: false, + serializedName: 'properties.sourceVirtualMachine', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + storageProfile: { + required: false, + serializedName: 'properties.storageProfile', + type: { + name: 'Composite', + className: 'ImageStorageProfile' + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = Image; diff --git a/lib/services/computeManagement2/lib/lib/models/imageDataDisk.js b/lib/services/computeManagement2/lib/lib/models/imageDataDisk.js new file mode 100644 index 0000000000..1c4c5e7d30 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/imageDataDisk.js @@ -0,0 +1,117 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Describes a data disk. + * + */ +class ImageDataDisk { + /** + * Create a ImageDataDisk. + * @member {number} lun Specifies the logical unit number of the data disk. + * This value is used to identify data disks within the VM and therefore must + * be unique for each data disk attached to a VM. + * @member {object} [snapshot] The snapshot. + * @member {string} [snapshot.id] Resource Id + * @member {object} [managedDisk] The managedDisk. + * @member {string} [managedDisk.id] Resource Id + * @member {string} [blobUri] The Virtual Hard Disk. + * @member {string} [caching] Specifies the caching requirements.

+ * Possible values are:

**None**

**ReadOnly**

+ * **ReadWrite**

Default: **None for Standard storage. ReadOnly for + * Premium storage**. Possible values include: 'None', 'ReadOnly', + * 'ReadWrite' + * @member {number} [diskSizeGB] Specifies the size of empty data disks in + * gigabytes. This element can be used to overwrite the name of the disk in a + * virtual machine image.

This value cannot be larger than 1023 GB + * @member {string} [storageAccountType] Specifies the storage account type + * for the managed disk. Possible values are: Standard_LRS or Premium_LRS. + * Possible values include: 'Standard_LRS', 'Premium_LRS' + */ + constructor() { + } + + /** + * Defines the metadata of ImageDataDisk + * + * @returns {object} metadata of ImageDataDisk + * + */ + mapper() { + return { + required: false, + serializedName: 'ImageDataDisk', + type: { + name: 'Composite', + className: 'ImageDataDisk', + modelProperties: { + lun: { + required: true, + serializedName: 'lun', + type: { + name: 'Number' + } + }, + snapshot: { + required: false, + serializedName: 'snapshot', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + managedDisk: { + required: false, + serializedName: 'managedDisk', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + blobUri: { + required: false, + serializedName: 'blobUri', + type: { + name: 'String' + } + }, + caching: { + required: false, + serializedName: 'caching', + type: { + name: 'Enum', + allowedValues: [ 'None', 'ReadOnly', 'ReadWrite' ] + } + }, + diskSizeGB: { + required: false, + serializedName: 'diskSizeGB', + type: { + name: 'Number' + } + }, + storageAccountType: { + required: false, + serializedName: 'storageAccountType', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ImageDataDisk; diff --git a/lib/services/computeManagement2/lib/lib/models/imageDiskReference.js b/lib/services/computeManagement2/lib/lib/models/imageDiskReference.js new file mode 100644 index 0000000000..18d5045692 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/imageDiskReference.js @@ -0,0 +1,63 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The source image used for creating the disk. + * + */ +class ImageDiskReference { + /** + * Create a ImageDiskReference. + * @member {string} id A relative uri containing either a Platform Imgage + * Repository or user image reference. + * @member {number} [lun] If the disk is created from an image's data disk, + * this is an index that indicates which of the data disks in the image to + * use. For OS disks, this field is null. + */ + constructor() { + } + + /** + * Defines the metadata of ImageDiskReference + * + * @returns {object} metadata of ImageDiskReference + * + */ + mapper() { + return { + required: false, + serializedName: 'ImageDiskReference', + type: { + name: 'Composite', + className: 'ImageDiskReference', + modelProperties: { + id: { + required: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + lun: { + required: false, + serializedName: 'lun', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = ImageDiskReference; diff --git a/lib/services/computeManagement2/lib/lib/models/imageListResult.js b/lib/services/computeManagement2/lib/lib/models/imageListResult.js new file mode 100644 index 0000000000..a3a6e0bce0 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/imageListResult.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The List Image operation response. + */ +class ImageListResult extends Array { + /** + * Create a ImageListResult. + * @member {string} [nextLink] The uri to fetch the next page of Images. Call + * ListNext() with this to fetch the next page of Images. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ImageListResult + * + * @returns {object} metadata of ImageListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'ImageListResult', + type: { + name: 'Composite', + className: 'ImageListResult', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ImageElementType', + type: { + name: 'Composite', + className: 'Image' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ImageListResult; diff --git a/lib/services/computeManagement2/lib/lib/models/imageOSDisk.js b/lib/services/computeManagement2/lib/lib/models/imageOSDisk.js new file mode 100644 index 0000000000..2e3abc90ec --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/imageOSDisk.js @@ -0,0 +1,129 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Describes an Operating System disk. + * + */ +class ImageOSDisk { + /** + * Create a ImageOSDisk. + * @member {string} osType This property allows you to specify the type of + * the OS that is included in the disk if creating a VM from a custom image. + *

Possible values are:

**Windows**

**Linux**. + * Possible values include: 'Windows', 'Linux' + * @member {string} osState The OS State. Possible values include: + * 'Generalized', 'Specialized' + * @member {object} [snapshot] The snapshot. + * @member {string} [snapshot.id] Resource Id + * @member {object} [managedDisk] The managedDisk. + * @member {string} [managedDisk.id] Resource Id + * @member {string} [blobUri] The Virtual Hard Disk. + * @member {string} [caching] Specifies the caching requirements.

+ * Possible values are:

**None**

**ReadOnly**

+ * **ReadWrite**

Default: **None for Standard storage. ReadOnly for + * Premium storage**. Possible values include: 'None', 'ReadOnly', + * 'ReadWrite' + * @member {number} [diskSizeGB] Specifies the size of empty data disks in + * gigabytes. This element can be used to overwrite the name of the disk in a + * virtual machine image.

This value cannot be larger than 1023 GB + * @member {string} [storageAccountType] Specifies the storage account type + * for the managed disk. Possible values are: Standard_LRS or Premium_LRS. + * Possible values include: 'Standard_LRS', 'Premium_LRS' + */ + constructor() { + } + + /** + * Defines the metadata of ImageOSDisk + * + * @returns {object} metadata of ImageOSDisk + * + */ + mapper() { + return { + required: false, + serializedName: 'ImageOSDisk', + type: { + name: 'Composite', + className: 'ImageOSDisk', + modelProperties: { + osType: { + required: true, + serializedName: 'osType', + type: { + name: 'Enum', + allowedValues: [ 'Windows', 'Linux' ] + } + }, + osState: { + required: true, + serializedName: 'osState', + type: { + name: 'Enum', + allowedValues: [ 'Generalized', 'Specialized' ] + } + }, + snapshot: { + required: false, + serializedName: 'snapshot', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + managedDisk: { + required: false, + serializedName: 'managedDisk', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + blobUri: { + required: false, + serializedName: 'blobUri', + type: { + name: 'String' + } + }, + caching: { + required: false, + serializedName: 'caching', + type: { + name: 'Enum', + allowedValues: [ 'None', 'ReadOnly', 'ReadWrite' ] + } + }, + diskSizeGB: { + required: false, + serializedName: 'diskSizeGB', + type: { + name: 'Number' + } + }, + storageAccountType: { + required: false, + serializedName: 'storageAccountType', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ImageOSDisk; diff --git a/lib/services/computeManagement2/lib/lib/models/imageReference.js b/lib/services/computeManagement2/lib/lib/models/imageReference.js new file mode 100644 index 0000000000..8cca252687 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/imageReference.js @@ -0,0 +1,98 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Specifies information about the image to use. You can specify information + * about platform images, marketplace images, or virtual machine images. This + * element is required when you want to use a platform image, marketplace + * image, or virtual machine image, but is not used in other creation + * operations. + * + * @extends models['SubResource'] + */ +class ImageReference extends models['SubResource'] { + /** + * Create a ImageReference. + * @member {string} [publisher] The image publisher. + * @member {string} [offer] Specifies the offer of the platform image or + * marketplace image used to create the virtual machine. + * @member {string} [sku] The image SKU. + * @member {string} [version] Specifies the version of the platform image or + * marketplace image used to create the virtual machine. The allowed formats + * are Major.Minor.Build or 'latest'. Major, Minor, and Build are decimal + * numbers. Specify 'latest' to use the latest version of an image available + * at deploy time. Even if you use 'latest', the VM image will not + * automatically update after deploy time even if a new version becomes + * available. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ImageReference + * + * @returns {object} metadata of ImageReference + * + */ + mapper() { + return { + required: false, + serializedName: 'ImageReference', + type: { + name: 'Composite', + className: 'ImageReference', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + publisher: { + required: false, + serializedName: 'publisher', + type: { + name: 'String' + } + }, + offer: { + required: false, + serializedName: 'offer', + type: { + name: 'String' + } + }, + sku: { + required: false, + serializedName: 'sku', + type: { + name: 'String' + } + }, + version: { + required: false, + serializedName: 'version', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ImageReference; diff --git a/lib/services/computeManagement2/lib/lib/models/imageStorageProfile.js b/lib/services/computeManagement2/lib/lib/models/imageStorageProfile.js new file mode 100644 index 0000000000..1d36d1e724 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/imageStorageProfile.js @@ -0,0 +1,110 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Describes a storage profile. + * + */ +class ImageStorageProfile { + /** + * Create a ImageStorageProfile. + * @member {object} [osDisk] Specifies information about the operating system + * disk used by the virtual machine.

For more information about + * disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @member {string} [osDisk.osType] This property allows you to specify the + * type of the OS that is included in the disk if creating a VM from a custom + * image.

Possible values are:

**Windows**

+ * **Linux**. Possible values include: 'Windows', 'Linux' + * @member {string} [osDisk.osState] The OS State. Possible values include: + * 'Generalized', 'Specialized' + * @member {object} [osDisk.snapshot] The snapshot. + * @member {string} [osDisk.snapshot.id] Resource Id + * @member {object} [osDisk.managedDisk] The managedDisk. + * @member {string} [osDisk.managedDisk.id] Resource Id + * @member {string} [osDisk.blobUri] The Virtual Hard Disk. + * @member {string} [osDisk.caching] Specifies the caching requirements. + *

Possible values are:

**None**

**ReadOnly** + *

**ReadWrite**

Default: **None for Standard storage. + * ReadOnly for Premium storage**. Possible values include: 'None', + * 'ReadOnly', 'ReadWrite' + * @member {number} [osDisk.diskSizeGB] Specifies the size of empty data + * disks in gigabytes. This element can be used to overwrite the name of the + * disk in a virtual machine image.

This value cannot be larger than + * 1023 GB + * @member {string} [osDisk.storageAccountType] Specifies the storage account + * type for the managed disk. Possible values are: Standard_LRS or + * Premium_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS' + * @member {array} [dataDisks] Specifies the parameters that are used to add + * a data disk to a virtual machine.

For more information about + * disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @member {boolean} [zoneResilient] Specifies whether an image is zone + * resilient or not. Default is false. Zone resilient images can be created + * only in regions that provide Zone Redundant Storage (ZRS). + */ + constructor() { + } + + /** + * Defines the metadata of ImageStorageProfile + * + * @returns {object} metadata of ImageStorageProfile + * + */ + mapper() { + return { + required: false, + serializedName: 'ImageStorageProfile', + type: { + name: 'Composite', + className: 'ImageStorageProfile', + modelProperties: { + osDisk: { + required: false, + serializedName: 'osDisk', + type: { + name: 'Composite', + className: 'ImageOSDisk' + } + }, + dataDisks: { + required: false, + serializedName: 'dataDisks', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ImageDataDiskElementType', + type: { + name: 'Composite', + className: 'ImageDataDisk' + } + } + } + }, + zoneResilient: { + required: false, + serializedName: 'zoneResilient', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = ImageStorageProfile; diff --git a/lib/services/computeManagement2/lib/lib/models/imageUpdate.js b/lib/services/computeManagement2/lib/lib/models/imageUpdate.js new file mode 100644 index 0000000000..16ea2a9ac7 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/imageUpdate.js @@ -0,0 +1,129 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The source user image virtual hard disk. The virtual hard disk will be + * copied before being attached to the virtual machine. If SourceImage is + * provided, the destination virtual hard drive must not exist. + * + * @extends models['UpdateResource'] + */ +class ImageUpdate extends models['UpdateResource'] { + /** + * Create a ImageUpdate. + * @member {object} [sourceVirtualMachine] The source virtual machine from + * which Image is created. + * @member {string} [sourceVirtualMachine.id] Resource Id + * @member {object} [storageProfile] Specifies the storage settings for the + * virtual machine disks. + * @member {object} [storageProfile.osDisk] Specifies information about the + * operating system disk used by the virtual machine.

For more + * information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @member {string} [storageProfile.osDisk.osType] This property allows you + * to specify the type of the OS that is included in the disk if creating a + * VM from a custom image.

Possible values are:

**Windows** + *

**Linux**. Possible values include: 'Windows', 'Linux' + * @member {string} [storageProfile.osDisk.osState] The OS State. Possible + * values include: 'Generalized', 'Specialized' + * @member {object} [storageProfile.osDisk.snapshot] The snapshot. + * @member {string} [storageProfile.osDisk.snapshot.id] Resource Id + * @member {object} [storageProfile.osDisk.managedDisk] The managedDisk. + * @member {string} [storageProfile.osDisk.managedDisk.id] Resource Id + * @member {string} [storageProfile.osDisk.blobUri] The Virtual Hard Disk. + * @member {string} [storageProfile.osDisk.caching] Specifies the caching + * requirements.

Possible values are:

**None**

+ * **ReadOnly**

**ReadWrite**

Default: **None for Standard + * storage. ReadOnly for Premium storage**. Possible values include: 'None', + * 'ReadOnly', 'ReadWrite' + * @member {number} [storageProfile.osDisk.diskSizeGB] Specifies the size of + * empty data disks in gigabytes. This element can be used to overwrite the + * name of the disk in a virtual machine image.

This value cannot be + * larger than 1023 GB + * @member {string} [storageProfile.osDisk.storageAccountType] Specifies the + * storage account type for the managed disk. Possible values are: + * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * @member {array} [storageProfile.dataDisks] Specifies the parameters that + * are used to add a data disk to a virtual machine.

For more + * information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @member {boolean} [storageProfile.zoneResilient] Specifies whether an + * image is zone resilient or not. Default is false. Zone resilient images + * can be created only in regions that provide Zone Redundant Storage (ZRS). + * @member {string} [provisioningState] The provisioning state. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ImageUpdate + * + * @returns {object} metadata of ImageUpdate + * + */ + mapper() { + return { + required: false, + serializedName: 'ImageUpdate', + type: { + name: 'Composite', + className: 'ImageUpdate', + modelProperties: { + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + sourceVirtualMachine: { + required: false, + serializedName: 'properties.sourceVirtualMachine', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + storageProfile: { + required: false, + serializedName: 'properties.storageProfile', + type: { + name: 'Composite', + className: 'ImageStorageProfile' + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ImageUpdate; diff --git a/lib/services/computeManagement2/lib/lib/models/index.d.ts b/lib/services/computeManagement2/lib/lib/models/index.d.ts new file mode 100644 index 0000000000..a32a1e6dd0 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/index.d.ts @@ -0,0 +1,6264 @@ +/* + * 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. + */ + +import { BaseResource } from 'ms-rest-azure'; +import { CloudError } from 'ms-rest-azure'; +import * as moment from 'moment'; + +export { BaseResource } from 'ms-rest-azure'; +export { CloudError } from 'ms-rest-azure'; + + +/** + * @class + * Initializes a new instance of the ComputeOperationValue class. + * @constructor + * Describes the properties of a Compute Operation value. + * + * @member {string} [origin] The origin of the compute operation. + * @member {string} [name] The name of the compute operation. + * @member {string} [operation] The display name of the compute operation. + * @member {string} [resource] The display name of the resource the operation + * applies to. + * @member {string} [description] The description of the operation. + * @member {string} [provider] The resource provider for the operation. + */ +export interface ComputeOperationValue { + readonly origin?: string; + readonly name?: string; + readonly operation?: string; + readonly resource?: string; + readonly description?: string; + readonly provider?: string; +} + +/** + * @class + * Initializes a new instance of the InstanceViewStatus class. + * @constructor + * Instance view status. + * + * @member {string} [code] The status code. + * @member {string} [level] The level code. Possible values include: 'Info', + * 'Warning', 'Error' + * @member {string} [displayStatus] The short localizable label for the status. + * @member {string} [message] The detailed status message, including for alerts + * and error messages. + * @member {date} [time] The time of the status. + */ +export interface InstanceViewStatus { + code?: string; + level?: string; + displayStatus?: string; + message?: string; + time?: Date; +} + +/** + * @class + * Initializes a new instance of the SubResource class. + * @constructor + * @member {string} [id] Resource Id + */ +export interface SubResource extends BaseResource { + id?: string; +} + +/** + * @class + * Initializes a new instance of the Sku class. + * @constructor + * Describes a virtual machine scale set sku. + * + * @member {string} [name] The sku name. + * @member {string} [tier] Specifies the tier of virtual machines in a scale + * set.

Possible Values:

**Standard**

+ * **Basic** + * @member {number} [capacity] Specifies the number of virtual machines in the + * scale set. + */ +export interface Sku { + name?: string; + tier?: string; + capacity?: number; +} + +/** + * @class + * Initializes a new instance of the Resource class. + * @constructor + * The Resource model definition. + * + * @member {string} [id] Resource Id + * @member {string} [name] Resource name + * @member {string} [type] Resource type + * @member {string} location Resource location + * @member {object} [tags] Resource tags + */ +export interface Resource extends BaseResource { + readonly id?: string; + readonly name?: string; + readonly type?: string; + location: string; + tags?: { [propertyName: string]: string }; +} + +/** + * @class + * Initializes a new instance of the AvailabilitySet class. + * @constructor + * Specifies information about the availability set that the virtual machine + * should be assigned to. Virtual machines specified in the same availability + * set are allocated to different nodes to maximize availability. For more + * information about availability sets, see [Manage the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

For more information on Azure planned maintainance, see [Planned + * maintenance for virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

Currently, a VM can only be added to availability set at creation + * time. An existing VM cannot be added to an availability set. + * + * @member {number} [platformUpdateDomainCount] Update Domain count. + * @member {number} [platformFaultDomainCount] Fault Domain count. + * @member {array} [virtualMachines] A list of references to all virtual + * machines in the availability set. + * @member {array} [statuses] The resource status information. + * @member {object} [sku] Sku of the availability set + * @member {string} [sku.name] The sku name. + * @member {string} [sku.tier] Specifies the tier of virtual machines in a + * scale set.

Possible Values:

**Standard**

+ * **Basic** + * @member {number} [sku.capacity] Specifies the number of virtual machines in + * the scale set. + */ +export interface AvailabilitySet extends Resource { + platformUpdateDomainCount?: number; + platformFaultDomainCount?: number; + virtualMachines?: SubResource[]; + readonly statuses?: InstanceViewStatus[]; + sku?: Sku; +} + +/** + * @class + * Initializes a new instance of the UpdateResource class. + * @constructor + * The Update Resource model definition. + * + * @member {object} [tags] Resource tags + */ +export interface UpdateResource extends BaseResource { + tags?: { [propertyName: string]: string }; +} + +/** + * @class + * Initializes a new instance of the AvailabilitySetUpdate class. + * @constructor + * Specifies information about the availability set that the virtual machine + * should be assigned to. Virtual machines specified in the same availability + * set are allocated to different nodes to maximize availability. For more + * information about availability sets, see [Manage the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

For more information on Azure planned maintainance, see [Planned + * maintenance for virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

Currently, a VM can only be added to availability set at creation + * time. An existing VM cannot be added to an availability set. + * + * @member {number} [platformUpdateDomainCount] Update Domain count. + * @member {number} [platformFaultDomainCount] Fault Domain count. + * @member {array} [virtualMachines] A list of references to all virtual + * machines in the availability set. + * @member {array} [statuses] The resource status information. + * @member {object} [sku] Sku of the availability set + * @member {string} [sku.name] The sku name. + * @member {string} [sku.tier] Specifies the tier of virtual machines in a + * scale set.

Possible Values:

**Standard**

+ * **Basic** + * @member {number} [sku.capacity] Specifies the number of virtual machines in + * the scale set. + */ +export interface AvailabilitySetUpdate extends UpdateResource { + platformUpdateDomainCount?: number; + platformFaultDomainCount?: number; + virtualMachines?: SubResource[]; + readonly statuses?: InstanceViewStatus[]; + sku?: Sku; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineSize class. + * @constructor + * Describes the properties of a VM size. + * + * @member {string} [name] The name of the virtual machine size. + * @member {number} [numberOfCores] The number of cores supported by the + * virtual machine size. + * @member {number} [osDiskSizeInMB] The OS disk size, in MB, allowed by the + * virtual machine size. + * @member {number} [resourceDiskSizeInMB] The resource disk size, in MB, + * allowed by the virtual machine size. + * @member {number} [memoryInMB] The amount of memory, in MB, supported by the + * virtual machine size. + * @member {number} [maxDataDiskCount] The maximum number of data disks that + * can be attached to the virtual machine size. + */ +export interface VirtualMachineSize { + name?: string; + numberOfCores?: number; + osDiskSizeInMB?: number; + resourceDiskSizeInMB?: number; + memoryInMB?: number; + maxDataDiskCount?: number; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineExtensionImage class. + * @constructor + * Describes a Virtual Machine Extension Image. + * + * @member {string} operatingSystem The operating system this extension + * supports. + * @member {string} computeRole The type of role (IaaS or PaaS) this extension + * supports. + * @member {string} handlerSchema The schema defined by publisher, where + * extension consumers should provide settings in a matching schema. + * @member {boolean} [vmScaleSetEnabled] Whether the extension can be used on + * xRP VMScaleSets. By default existing extensions are usable on scalesets, but + * there might be cases where a publisher wants to explicitly indicate the + * extension is only enabled for CRP VMs but not VMSS. + * @member {boolean} [supportsMultipleExtensions] Whether the handler can + * support multiple extensions. + */ +export interface VirtualMachineExtensionImage extends Resource { + operatingSystem: string; + computeRole: string; + handlerSchema: string; + vmScaleSetEnabled?: boolean; + supportsMultipleExtensions?: boolean; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineImageResource class. + * @constructor + * Virtual machine image resource information. + * + * @member {string} name The name of the resource. + * @member {string} location The supported Azure location of the resource. + * @member {object} [tags] Specifies the tags that are assigned to the virtual + * machine. For more information about using tags, see [Using tags to organize + * your Azure + * resources](https://docs.microsoft.com/azure/azure-resource-manager/resource-group-using-tags.md). + */ +export interface VirtualMachineImageResource extends SubResource { + name: string; + location: string; + tags?: { [propertyName: string]: string }; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineExtensionInstanceView class. + * @constructor + * The instance view of a virtual machine extension. + * + * @member {string} [name] The virtual machine extension name. + * @member {string} [type] Specifies the type of the extension; an example is + * "CustomScriptExtension". + * @member {string} [typeHandlerVersion] Specifies the version of the script + * handler. + * @member {array} [substatuses] The resource status information. + * @member {array} [statuses] The resource status information. + */ +export interface VirtualMachineExtensionInstanceView { + name?: string; + type?: string; + typeHandlerVersion?: string; + substatuses?: InstanceViewStatus[]; + statuses?: InstanceViewStatus[]; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineExtension class. + * @constructor + * Describes a Virtual Machine Extension. + * + * @member {string} [forceUpdateTag] How the extension handler should be forced + * to update even if the extension configuration has not changed. + * @member {string} [publisher] The name of the extension handler publisher. + * @member {string} [virtualMachineExtensionType] Specifies the type of the + * extension; an example is "CustomScriptExtension". + * @member {string} [typeHandlerVersion] Specifies the version of the script + * handler. + * @member {boolean} [autoUpgradeMinorVersion] Indicates whether the extension + * should use a newer minor version if one is available at deployment time. + * Once deployed, however, the extension will not upgrade minor versions unless + * redeployed, even with this property set to true. + * @member {object} [settings] Json formatted public settings for the + * extension. + * @member {object} [protectedSettings] The extension can contain either + * protectedSettings or protectedSettingsFromKeyVault or no protected settings + * at all. + * @member {string} [provisioningState] The provisioning state, which only + * appears in the response. + * @member {object} [instanceView] The virtual machine extension instance view. + * @member {string} [instanceView.name] The virtual machine extension name. + * @member {string} [instanceView.type] Specifies the type of the extension; an + * example is "CustomScriptExtension". + * @member {string} [instanceView.typeHandlerVersion] Specifies the version of + * the script handler. + * @member {array} [instanceView.substatuses] The resource status information. + * @member {array} [instanceView.statuses] The resource status information. + */ +export interface VirtualMachineExtension extends Resource { + forceUpdateTag?: string; + publisher?: string; + virtualMachineExtensionType?: string; + typeHandlerVersion?: string; + autoUpgradeMinorVersion?: boolean; + settings?: any; + protectedSettings?: any; + readonly provisioningState?: string; + instanceView?: VirtualMachineExtensionInstanceView; +} + +/** + * @class + * Initializes a new instance of the PurchasePlan class. + * @constructor + * Used for establishing the purchase context of any 3rd Party artifact through + * MarketPlace. + * + * @member {string} publisher The publisher ID. + * @member {string} name The plan ID. + * @member {string} product Specifies the product of the image from the + * marketplace. This is the same value as Offer under the imageReference + * element. + */ +export interface PurchasePlan { + publisher: string; + name: string; + product: string; +} + +/** + * @class + * Initializes a new instance of the OSDiskImage class. + * @constructor + * Contains the os disk image information. + * + * @member {string} operatingSystem The operating system of the osDiskImage. + * Possible values include: 'Windows', 'Linux' + */ +export interface OSDiskImage { + operatingSystem: string; +} + +/** + * @class + * Initializes a new instance of the DataDiskImage class. + * @constructor + * Contains the data disk images information. + * + * @member {number} [lun] Specifies the logical unit number of the data disk. + * This value is used to identify data disks within the VM and therefore must + * be unique for each data disk attached to a VM. + */ +export interface DataDiskImage { + readonly lun?: number; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineImage class. + * @constructor + * Describes a Virtual Machine Image. + * + * @member {object} [plan] + * @member {string} [plan.publisher] The publisher ID. + * @member {string} [plan.name] The plan ID. + * @member {string} [plan.product] Specifies the product of the image from the + * marketplace. This is the same value as Offer under the imageReference + * element. + * @member {object} [osDiskImage] + * @member {string} [osDiskImage.operatingSystem] The operating system of the + * osDiskImage. Possible values include: 'Windows', 'Linux' + * @member {array} [dataDiskImages] + */ +export interface VirtualMachineImage extends VirtualMachineImageResource { + plan?: PurchasePlan; + osDiskImage?: OSDiskImage; + dataDiskImages?: DataDiskImage[]; +} + +/** + * @class + * Initializes a new instance of the UsageName class. + * @constructor + * The Usage Names. + * + * @member {string} [value] The name of the resource. + * @member {string} [localizedValue] The localized name of the resource. + */ +export interface UsageName { + value?: string; + localizedValue?: string; +} + +/** + * @class + * Initializes a new instance of the Usage class. + * @constructor + * Describes Compute Resource Usage. + * + * @member {number} currentValue The current usage of the resource. + * @member {number} limit The maximum permitted usage of the resource. + * @member {object} name The name of the type of usage. + * @member {string} [name.value] The name of the resource. + * @member {string} [name.localizedValue] The localized name of the resource. + */ +export interface Usage { + currentValue: number; + limit: number; + name: UsageName; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineCaptureParameters class. + * @constructor + * Capture Virtual Machine parameters. + * + * @member {string} vhdPrefix The captured virtual hard disk's name prefix. + * @member {string} destinationContainerName The destination container name. + * @member {boolean} overwriteVhds Specifies whether to overwrite the + * destination virtual hard disk, in case of conflict. + */ +export interface VirtualMachineCaptureParameters { + vhdPrefix: string; + destinationContainerName: string; + overwriteVhds: boolean; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineCaptureResult class. + * @constructor + * Resource Id. + * + * @member {object} [output] Operation output data (raw JSON) + */ +export interface VirtualMachineCaptureResult extends SubResource { + output?: any; +} + +/** + * @class + * Initializes a new instance of the Plan class. + * @constructor + * Specifies information about the marketplace image used to create the virtual + * machine. This element is only used for marketplace images. Before you can + * use a marketplace image from an API, you must enable the image for + * programmatic use. In the Azure portal, find the marketplace image that you + * want to use and then click **Want to deploy programmatically, Get Started + * ->**. Enter any required information and then click **Save**. + * + * @member {string} [name] The plan ID. + * @member {string} [publisher] The publisher ID. + * @member {string} [product] Specifies the product of the image from the + * marketplace. This is the same value as Offer under the imageReference + * element. + * @member {string} [promotionCode] The promotion code. + */ +export interface Plan { + name?: string; + publisher?: string; + product?: string; + promotionCode?: string; +} + +/** + * @class + * Initializes a new instance of the HardwareProfile class. + * @constructor + * Specifies the hardware settings for the virtual machine. + * + * @member {string} [vmSize] Specifies the size of the virtual machine. For + * more information about virtual machine sizes, see [Sizes for virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

The available VM sizes depend on region and availability set. For a + * list of available sizes use these APIs:

[List all available + * virtual machine sizes in an availability + * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) + *

[List all available virtual machine sizes in a + * region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) + *

[List all available virtual machine sizes for + * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). + * Possible values include: '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_B1s', 'Standard_B1ms', + * 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', + * '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_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', + * 'Standard_D32_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', + * 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', + * 'Standard_D64s_v3', '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_DS13-4_v2', 'Standard_DS13-2_v2', + * 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', 'Standard_E2_v3', + * 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', 'Standard_E32_v3', + * 'Standard_E64_v3', 'Standard_E2s_v3', 'Standard_E4s_v3', 'Standard_E8s_v3', + * 'Standard_E16s_v3', 'Standard_E32s_v3', 'Standard_E64s_v3', + * 'Standard_E32-16_v3', 'Standard_E32-8s_v3', 'Standard_E64-32s_v3', + * 'Standard_E64-16s_v3', 'Standard_F1', 'Standard_F2', 'Standard_F4', + * 'Standard_F8', 'Standard_F16', 'Standard_F1s', 'Standard_F2s', + * 'Standard_F4s', 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2', + * 'Standard_F4s_v2', 'Standard_F8s_v2', 'Standard_F16s_v2', + * 'Standard_F32s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1', + * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', + * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', + * 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8', + * 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m', + * 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', + * 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms', + * 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms', + * 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms', + * 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', + * 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2', + * 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3', + * 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s', + * 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6', + * 'Standard_NV12', 'Standard_NV24' + */ +export interface HardwareProfile { + vmSize?: string; +} + +/** + * @class + * Initializes a new instance of the ImageReference class. + * @constructor + * Specifies information about the image to use. You can specify information + * about platform images, marketplace images, or virtual machine images. This + * element is required when you want to use a platform image, marketplace + * image, or virtual machine image, but is not used in other creation + * operations. + * + * @member {string} [publisher] The image publisher. + * @member {string} [offer] Specifies the offer of the platform image or + * marketplace image used to create the virtual machine. + * @member {string} [sku] The image SKU. + * @member {string} [version] Specifies the version of the platform image or + * marketplace image used to create the virtual machine. The allowed formats + * are Major.Minor.Build or 'latest'. Major, Minor, and Build are decimal + * numbers. Specify 'latest' to use the latest version of an image available at + * deploy time. Even if you use 'latest', the VM image will not automatically + * update after deploy time even if a new version becomes available. + */ +export interface ImageReference extends SubResource { + publisher?: string; + offer?: string; + sku?: string; + version?: string; +} + +/** + * @class + * Initializes a new instance of the KeyVaultSecretReference class. + * @constructor + * Describes a reference to Key Vault Secret + * + * @member {string} secretUrl The URL referencing a secret in a Key Vault. + * @member {object} sourceVault The relative URL of the Key Vault containing + * the secret. + * @member {string} [sourceVault.id] Resource Id + */ +export interface KeyVaultSecretReference { + secretUrl: string; + sourceVault: SubResource; +} + +/** + * @class + * Initializes a new instance of the KeyVaultKeyReference class. + * @constructor + * Describes a reference to Key Vault Key + * + * @member {string} keyUrl The URL referencing a key encryption key in Key + * Vault. + * @member {object} sourceVault The relative URL of the Key Vault containing + * the key. + * @member {string} [sourceVault.id] Resource Id + */ +export interface KeyVaultKeyReference { + keyUrl: string; + sourceVault: SubResource; +} + +/** + * @class + * Initializes a new instance of the DiskEncryptionSettings class. + * @constructor + * Describes a Encryption Settings for a Disk + * + * @member {object} [diskEncryptionKey] Specifies the location of the disk + * encryption key, which is a Key Vault Secret. + * @member {string} [diskEncryptionKey.secretUrl] The URL referencing a secret + * in a Key Vault. + * @member {object} [diskEncryptionKey.sourceVault] The relative URL of the Key + * Vault containing the secret. + * @member {string} [diskEncryptionKey.sourceVault.id] Resource Id + * @member {object} [keyEncryptionKey] Specifies the location of the key + * encryption key in Key Vault. + * @member {string} [keyEncryptionKey.keyUrl] The URL referencing a key + * encryption key in Key Vault. + * @member {object} [keyEncryptionKey.sourceVault] The relative URL of the Key + * Vault containing the key. + * @member {string} [keyEncryptionKey.sourceVault.id] Resource Id + * @member {boolean} [enabled] Specifies whether disk encryption should be + * enabled on the virtual machine. + */ +export interface DiskEncryptionSettings { + diskEncryptionKey?: KeyVaultSecretReference; + keyEncryptionKey?: KeyVaultKeyReference; + enabled?: boolean; +} + +/** + * @class + * Initializes a new instance of the VirtualHardDisk class. + * @constructor + * Describes the uri of a disk. + * + * @member {string} [uri] Specifies the virtual hard disk's uri. + */ +export interface VirtualHardDisk { + uri?: string; +} + +/** + * @class + * Initializes a new instance of the ManagedDiskParameters class. + * @constructor + * The parameters of a managed disk. + * + * @member {string} [storageAccountType] Specifies the storage account type for + * the managed disk. Possible values are: Standard_LRS or Premium_LRS. Possible + * values include: 'Standard_LRS', 'Premium_LRS' + */ +export interface ManagedDiskParameters extends SubResource { + storageAccountType?: string; +} + +/** + * @class + * Initializes a new instance of the OSDisk class. + * @constructor + * Specifies information about the operating system disk used by the virtual + * machine.

For more information about disks, see [About disks and + * VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @member {string} [osType] This property allows you to specify the type of + * the OS that is included in the disk if creating a VM from user-image or a + * specialized VHD.

Possible values are:

**Windows**

+ * **Linux**. Possible values include: 'Windows', 'Linux' + * @member {object} [encryptionSettings] Specifies the encryption settings for + * the OS Disk.

Minimum api-version: 2015-06-15 + * @member {object} [encryptionSettings.diskEncryptionKey] Specifies the + * location of the disk encryption key, which is a Key Vault Secret. + * @member {string} [encryptionSettings.diskEncryptionKey.secretUrl] The URL + * referencing a secret in a Key Vault. + * @member {object} [encryptionSettings.diskEncryptionKey.sourceVault] The + * relative URL of the Key Vault containing the secret. + * @member {string} [encryptionSettings.diskEncryptionKey.sourceVault.id] + * Resource Id + * @member {object} [encryptionSettings.keyEncryptionKey] Specifies the + * location of the key encryption key in Key Vault. + * @member {string} [encryptionSettings.keyEncryptionKey.keyUrl] The URL + * referencing a key encryption key in Key Vault. + * @member {object} [encryptionSettings.keyEncryptionKey.sourceVault] The + * relative URL of the Key Vault containing the key. + * @member {string} [encryptionSettings.keyEncryptionKey.sourceVault.id] + * Resource Id + * @member {boolean} [encryptionSettings.enabled] Specifies whether disk + * encryption should be enabled on the virtual machine. + * @member {string} [name] The disk name. + * @member {object} [vhd] The virtual hard disk. + * @member {string} [vhd.uri] Specifies the virtual hard disk's uri. + * @member {object} [image] The source user image virtual hard disk. The + * virtual hard disk will be copied before being attached to the virtual + * machine. If SourceImage is provided, the destination virtual hard drive must + * not exist. + * @member {string} [image.uri] Specifies the virtual hard disk's uri. + * @member {string} [caching] Specifies the caching requirements.

+ * Possible values are:

**None**

**ReadOnly**

+ * **ReadWrite**

Default: **None for Standard storage. ReadOnly for + * Premium storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite' + * @member {boolean} [writeAcceleratorEnabled] Specifies whether + * writeAccelerator should be enabled or disabled on the disk. + * @member {string} createOption Specifies how the virtual machine should be + * created.

Possible values are:

**Attach** \u2013 This value + * is used when you are using a specialized disk to create the virtual + * machine.

**FromImage** \u2013 This value is used when you are using + * an image to create the virtual machine. If you are using a platform image, + * you also use the imageReference element described above. If you are using a + * marketplace image, you also use the plan element previously described. + * Possible values include: 'FromImage', 'Empty', 'Attach' + * @member {number} [diskSizeGB] Specifies the size of an empty data disk in + * gigabytes. This element can be used to overwrite the name of the disk in a + * virtual machine image.

This value cannot be larger than 1023 GB + * @member {object} [managedDisk] The managed disk parameters. + * @member {string} [managedDisk.storageAccountType] Specifies the storage + * account type for the managed disk. Possible values are: Standard_LRS or + * Premium_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS' + */ +export interface OSDisk { + osType?: string; + encryptionSettings?: DiskEncryptionSettings; + name?: string; + vhd?: VirtualHardDisk; + image?: VirtualHardDisk; + caching?: string; + writeAcceleratorEnabled?: boolean; + createOption: string; + diskSizeGB?: number; + managedDisk?: ManagedDiskParameters; +} + +/** + * @class + * Initializes a new instance of the DataDisk class. + * @constructor + * Describes a data disk. + * + * @member {number} lun Specifies the logical unit number of the data disk. + * This value is used to identify data disks within the VM and therefore must + * be unique for each data disk attached to a VM. + * @member {string} [name] The disk name. + * @member {object} [vhd] The virtual hard disk. + * @member {string} [vhd.uri] Specifies the virtual hard disk's uri. + * @member {object} [image] The source user image virtual hard disk. The + * virtual hard disk will be copied before being attached to the virtual + * machine. If SourceImage is provided, the destination virtual hard drive must + * not exist. + * @member {string} [image.uri] Specifies the virtual hard disk's uri. + * @member {string} [caching] Specifies the caching requirements.

+ * Possible values are:

**None**

**ReadOnly**

+ * **ReadWrite**

Default: **None for Standard storage. ReadOnly for + * Premium storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite' + * @member {boolean} [writeAcceleratorEnabled] Specifies whether + * writeAccelerator should be enabled or disabled on the disk. + * @member {string} createOption Specifies how the virtual machine should be + * created.

Possible values are:

**Attach** \u2013 This value + * is used when you are using a specialized disk to create the virtual + * machine.

**FromImage** \u2013 This value is used when you are using + * an image to create the virtual machine. If you are using a platform image, + * you also use the imageReference element described above. If you are using a + * marketplace image, you also use the plan element previously described. + * Possible values include: 'FromImage', 'Empty', 'Attach' + * @member {number} [diskSizeGB] Specifies the size of an empty data disk in + * gigabytes. This element can be used to overwrite the name of the disk in a + * virtual machine image.

This value cannot be larger than 1023 GB + * @member {object} [managedDisk] The managed disk parameters. + * @member {string} [managedDisk.storageAccountType] Specifies the storage + * account type for the managed disk. Possible values are: Standard_LRS or + * Premium_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS' + */ +export interface DataDisk { + lun: number; + name?: string; + vhd?: VirtualHardDisk; + image?: VirtualHardDisk; + caching?: string; + writeAcceleratorEnabled?: boolean; + createOption: string; + diskSizeGB?: number; + managedDisk?: ManagedDiskParameters; +} + +/** + * @class + * Initializes a new instance of the StorageProfile class. + * @constructor + * Specifies the storage settings for the virtual machine disks. + * + * @member {object} [imageReference] Specifies information about the image to + * use. You can specify information about platform images, marketplace images, + * or virtual machine images. This element is required when you want to use a + * platform image, marketplace image, or virtual machine image, but is not used + * in other creation operations. + * @member {string} [imageReference.publisher] The image publisher. + * @member {string} [imageReference.offer] Specifies the offer of the platform + * image or marketplace image used to create the virtual machine. + * @member {string} [imageReference.sku] The image SKU. + * @member {string} [imageReference.version] Specifies the version of the + * platform image or marketplace image used to create the virtual machine. The + * allowed formats are Major.Minor.Build or 'latest'. Major, Minor, and Build + * are decimal numbers. Specify 'latest' to use the latest version of an image + * available at deploy time. Even if you use 'latest', the VM image will not + * automatically update after deploy time even if a new version becomes + * available. + * @member {object} [osDisk] Specifies information about the operating system + * disk used by the virtual machine.

For more information about disks, + * see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @member {string} [osDisk.osType] This property allows you to specify the + * type of the OS that is included in the disk if creating a VM from user-image + * or a specialized VHD.

Possible values are:

**Windows** + *

**Linux**. Possible values include: 'Windows', 'Linux' + * @member {object} [osDisk.encryptionSettings] Specifies the encryption + * settings for the OS Disk.

Minimum api-version: 2015-06-15 + * @member {object} [osDisk.encryptionSettings.diskEncryptionKey] Specifies the + * location of the disk encryption key, which is a Key Vault Secret. + * @member {string} [osDisk.encryptionSettings.diskEncryptionKey.secretUrl] The + * URL referencing a secret in a Key Vault. + * @member {object} [osDisk.encryptionSettings.diskEncryptionKey.sourceVault] + * The relative URL of the Key Vault containing the secret. + * @member {string} + * [osDisk.encryptionSettings.diskEncryptionKey.sourceVault.id] Resource Id + * @member {object} [osDisk.encryptionSettings.keyEncryptionKey] Specifies the + * location of the key encryption key in Key Vault. + * @member {string} [osDisk.encryptionSettings.keyEncryptionKey.keyUrl] The URL + * referencing a key encryption key in Key Vault. + * @member {object} [osDisk.encryptionSettings.keyEncryptionKey.sourceVault] + * The relative URL of the Key Vault containing the key. + * @member {string} [osDisk.encryptionSettings.keyEncryptionKey.sourceVault.id] + * Resource Id + * @member {boolean} [osDisk.encryptionSettings.enabled] Specifies whether disk + * encryption should be enabled on the virtual machine. + * @member {string} [osDisk.name] The disk name. + * @member {object} [osDisk.vhd] The virtual hard disk. + * @member {string} [osDisk.vhd.uri] Specifies the virtual hard disk's uri. + * @member {object} [osDisk.image] The source user image virtual hard disk. The + * virtual hard disk will be copied before being attached to the virtual + * machine. If SourceImage is provided, the destination virtual hard drive must + * not exist. + * @member {string} [osDisk.image.uri] Specifies the virtual hard disk's uri. + * @member {string} [osDisk.caching] Specifies the caching requirements. + *

Possible values are:

**None**

**ReadOnly** + *

**ReadWrite**

Default: **None for Standard storage. + * ReadOnly for Premium storage**. Possible values include: 'None', 'ReadOnly', + * 'ReadWrite' + * @member {boolean} [osDisk.writeAcceleratorEnabled] Specifies whether + * writeAccelerator should be enabled or disabled on the disk. + * @member {string} [osDisk.createOption] Specifies how the virtual machine + * should be created.

Possible values are:

**Attach** \u2013 + * This value is used when you are using a specialized disk to create the + * virtual machine.

**FromImage** \u2013 This value is used when you + * are using an image to create the virtual machine. If you are using a + * platform image, you also use the imageReference element described above. If + * you are using a marketplace image, you also use the plan element previously + * described. Possible values include: 'FromImage', 'Empty', 'Attach' + * @member {number} [osDisk.diskSizeGB] Specifies the size of an empty data + * disk in gigabytes. This element can be used to overwrite the name of the + * disk in a virtual machine image.

This value cannot be larger than + * 1023 GB + * @member {object} [osDisk.managedDisk] The managed disk parameters. + * @member {string} [osDisk.managedDisk.storageAccountType] Specifies the + * storage account type for the managed disk. Possible values are: Standard_LRS + * or Premium_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS' + * @member {array} [dataDisks] Specifies the parameters that are used to add a + * data disk to a virtual machine.

For more information about disks, + * see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + */ +export interface StorageProfile { + imageReference?: ImageReference; + osDisk?: OSDisk; + dataDisks?: DataDisk[]; +} + +/** + * @class + * Initializes a new instance of the AdditionalUnattendContent class. + * @constructor + * Specifies additional XML formatted information that can be included in the + * Unattend.xml file, which is used by Windows Setup. Contents are defined by + * setting name, component name, and the pass in which the content is applied. + * + * @member {string} [passName] The pass name. Currently, the only allowable + * value is OobeSystem. Possible values include: 'OobeSystem' + * @member {string} [componentName] The component name. Currently, the only + * allowable value is Microsoft-Windows-Shell-Setup. Possible values include: + * 'Microsoft-Windows-Shell-Setup' + * @member {string} [settingName] Specifies the name of the setting to which + * the content applies. Possible values are: FirstLogonCommands and AutoLogon. + * Possible values include: 'AutoLogon', 'FirstLogonCommands' + * @member {string} [content] Specifies the XML formatted content that is added + * to the unattend.xml file for the specified path and component. The XML must + * be less than 4KB and must include the root element for the setting or + * feature that is being inserted. + */ +export interface AdditionalUnattendContent { + passName?: string; + componentName?: string; + settingName?: string; + content?: string; +} + +/** + * @class + * Initializes a new instance of the WinRMListener class. + * @constructor + * Describes Protocol and thumbprint of Windows Remote Management listener + * + * @member {string} [protocol] Specifies the protocol of listener.

+ * Possible values are:
**http**

**https**. Possible values + * include: 'Http', 'Https' + * @member {string} [certificateUrl] This is the URL of a certificate that has + * been uploaded to Key Vault as a secret. For adding a secret to the Key + * Vault, see [Add a key or secret to the key + * vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). + * In this case, your certificate needs to be It is the Base64 encoding of the + * following JSON Object which is encoded in UTF-8:

{
+ * "data":"",
"dataType":"pfx",
+ * "password":""
} + */ +export interface WinRMListener { + protocol?: string; + certificateUrl?: string; +} + +/** + * @class + * Initializes a new instance of the WinRMConfiguration class. + * @constructor + * Describes Windows Remote Management configuration of the VM + * + * @member {array} [listeners] The list of Windows Remote Management listeners + */ +export interface WinRMConfiguration { + listeners?: WinRMListener[]; +} + +/** + * @class + * Initializes a new instance of the WindowsConfiguration class. + * @constructor + * Specifies Windows operating system settings on the virtual machine. + * + * @member {boolean} [provisionVMAgent] Indicates whether virtual machine agent + * should be provisioned on the virtual machine.

When this property is + * not specified in the request body, default behavior is to set it to true. + * This will ensure that VM Agent is installed on the VM so that extensions can + * be added to the VM later. + * @member {boolean} [enableAutomaticUpdates] Indicates whether virtual machine + * is enabled for automatic updates. + * @member {string} [timeZone] Specifies the time zone of the virtual machine. + * e.g. "Pacific Standard Time" + * @member {array} [additionalUnattendContent] Specifies additional base-64 + * encoded XML formatted information that can be included in the Unattend.xml + * file, which is used by Windows Setup. + * @member {object} [winRM] Specifies the Windows Remote Management listeners. + * This enables remote Windows PowerShell. + * @member {array} [winRM.listeners] The list of Windows Remote Management + * listeners + */ +export interface WindowsConfiguration { + provisionVMAgent?: boolean; + enableAutomaticUpdates?: boolean; + timeZone?: string; + additionalUnattendContent?: AdditionalUnattendContent[]; + winRM?: WinRMConfiguration; +} + +/** + * @class + * Initializes a new instance of the SshPublicKey class. + * @constructor + * Contains information about SSH certificate public key and the path on the + * Linux VM where the public key is placed. + * + * @member {string} [path] Specifies the full path on the created VM where ssh + * public key is stored. If the file already exists, the specified key is + * appended to the file. Example: /home/user/.ssh/authorized_keys + * @member {string} [keyData] SSH public key certificate used to authenticate + * with the VM through ssh. The key needs to be at least 2048-bit and in + * ssh-rsa format.

For creating ssh keys, see [Create SSH keys on + * Linux and Mac for Linux VMs in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-mac-create-ssh-keys?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + */ +export interface SshPublicKey { + path?: string; + keyData?: string; +} + +/** + * @class + * Initializes a new instance of the SshConfiguration class. + * @constructor + * SSH configuration for Linux based VMs running on Azure + * + * @member {array} [publicKeys] The list of SSH public keys used to + * authenticate with linux based VMs. + */ +export interface SshConfiguration { + publicKeys?: SshPublicKey[]; +} + +/** + * @class + * Initializes a new instance of the LinuxConfiguration class. + * @constructor + * Specifies the Linux operating system settings on the virtual machine. + *

For a list of supported Linux distributions, see [Linux on + * Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @member {boolean} [disablePasswordAuthentication] Specifies whether password + * authentication should be disabled. + * @member {object} [ssh] Specifies the ssh key configuration for a Linux OS. + * @member {array} [ssh.publicKeys] The list of SSH public keys used to + * authenticate with linux based VMs. + */ +export interface LinuxConfiguration { + disablePasswordAuthentication?: boolean; + ssh?: SshConfiguration; +} + +/** + * @class + * Initializes a new instance of the VaultCertificate class. + * @constructor + * Describes a single certificate reference in a Key Vault, and where the + * certificate should reside on the VM. + * + * @member {string} [certificateUrl] This is the URL of a certificate that has + * been uploaded to Key Vault as a secret. For adding a secret to the Key + * Vault, see [Add a key or secret to the key + * vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). + * In this case, your certificate needs to be It is the Base64 encoding of the + * following JSON Object which is encoded in UTF-8:

{
+ * "data":"",
"dataType":"pfx",
+ * "password":""
} + * @member {string} [certificateStore] For Windows VMs, specifies the + * certificate store on the Virtual Machine to which the certificate should be + * added. The specified certificate store is implicitly in the LocalMachine + * account.

For Linux VMs, the certificate file is placed under the + * /var/lib/waagent directory, with the file name .crt for + * the X509 certificate file and .prv for private key. + * Both of these files are .pem formatted. + */ +export interface VaultCertificate { + certificateUrl?: string; + certificateStore?: string; +} + +/** + * @class + * Initializes a new instance of the VaultSecretGroup class. + * @constructor + * Describes a set of certificates which are all in the same Key Vault. + * + * @member {object} [sourceVault] The relative URL of the Key Vault containing + * all of the certificates in VaultCertificates. + * @member {string} [sourceVault.id] Resource Id + * @member {array} [vaultCertificates] The list of key vault references in + * SourceVault which contain certificates. + */ +export interface VaultSecretGroup { + sourceVault?: SubResource; + vaultCertificates?: VaultCertificate[]; +} + +/** + * @class + * Initializes a new instance of the OSProfile class. + * @constructor + * Specifies the operating system settings for the virtual machine. + * + * @member {string} [computerName] Specifies the host OS name of the virtual + * machine.

**Max-length (Windows):** 15 characters

+ * **Max-length (Linux):** 64 characters.

For naming conventions and + * restrictions see [Azure infrastructure services implementation + * guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). + * @member {string} [adminUsername] Specifies the name of the administrator + * account.

**Windows-only restriction:** Cannot end in "."

+ * **Disallowed values:** "administrator", "admin", "user", "user1", "test", + * "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", + * "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", + * "root", "server", "sql", "support", "support_388945a0", "sys", "test2", + * "test3", "user4", "user5".

**Minimum-length (Linux):** 1 character + *

**Max-length (Linux):** 64 characters

**Max-length + * (Windows):** 20 characters

  • For root access to the Linux VM, + * see [Using root privileges on Linux virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in this + * field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * @member {string} [adminPassword] Specifies the password of the administrator + * account.

    **Minimum-length (Windows):** 8 characters

    + * **Minimum-length (Linux):** 6 characters

    **Max-length (Windows):** + * 123 characters

    **Max-length (Linux):** 72 characters

    + * **Complexity requirements:** 3 out of 4 conditions below need to be + * fulfilled
    Has lower characters
    Has upper characters
    Has a + * digit
    Has a special character (Regex match [\W_])

    **Disallowed + * values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", + * "pass@word1", "Password!", "Password1", "Password22", "iloveyou!"

    + * For resetting the password, see [How to reset the Remote Desktop service or + * its login password in a Windows + * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    For resetting root password, see [Manage users, SSH, and check or + * repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + * @member {string} [customData] Specifies a base-64 encoded string of custom + * data. The base-64 encoded string is decoded to a binary array that is saved + * as a file on the Virtual Machine. The maximum length of the binary array is + * 65535 bytes.

    For using cloud-init for your VM, see [Using + * cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * @member {object} [windowsConfiguration] Specifies Windows operating system + * settings on the virtual machine. + * @member {boolean} [windowsConfiguration.provisionVMAgent] Indicates whether + * virtual machine agent should be provisioned on the virtual machine.

    + * When this property is not specified in the request body, default behavior is + * to set it to true. This will ensure that VM Agent is installed on the VM so + * that extensions can be added to the VM later. + * @member {boolean} [windowsConfiguration.enableAutomaticUpdates] Indicates + * whether virtual machine is enabled for automatic updates. + * @member {string} [windowsConfiguration.timeZone] Specifies the time zone of + * the virtual machine. e.g. "Pacific Standard Time" + * @member {array} [windowsConfiguration.additionalUnattendContent] Specifies + * additional base-64 encoded XML formatted information that can be included in + * the Unattend.xml file, which is used by Windows Setup. + * @member {object} [windowsConfiguration.winRM] Specifies the Windows Remote + * Management listeners. This enables remote Windows PowerShell. + * @member {array} [windowsConfiguration.winRM.listeners] The list of Windows + * Remote Management listeners + * @member {object} [linuxConfiguration] Specifies the Linux operating system + * settings on the virtual machine.

    For a list of supported Linux + * distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * @member {boolean} [linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * @member {object} [linuxConfiguration.ssh] Specifies the ssh key + * configuration for a Linux OS. + * @member {array} [linuxConfiguration.ssh.publicKeys] The list of SSH public + * keys used to authenticate with linux based VMs. + * @member {array} [secrets] Specifies set of certificates that should be + * installed onto the virtual machine. + */ +export interface OSProfile { + computerName?: string; + adminUsername?: string; + adminPassword?: string; + customData?: string; + windowsConfiguration?: WindowsConfiguration; + linuxConfiguration?: LinuxConfiguration; + secrets?: VaultSecretGroup[]; +} + +/** + * @class + * Initializes a new instance of the NetworkInterfaceReference class. + * @constructor + * Describes a network interface reference. + * + * @member {boolean} [primary] Specifies the primary network interface in case + * the virtual machine has more than 1 network interface. + */ +export interface NetworkInterfaceReference extends SubResource { + primary?: boolean; +} + +/** + * @class + * Initializes a new instance of the NetworkProfile class. + * @constructor + * Specifies the network interfaces of the virtual machine. + * + * @member {array} [networkInterfaces] Specifies the list of resource Ids for + * the network interfaces associated with the virtual machine. + */ +export interface NetworkProfile { + networkInterfaces?: NetworkInterfaceReference[]; +} + +/** + * @class + * Initializes a new instance of the BootDiagnostics class. + * @constructor + * Boot Diagnostics is a debugging feature which allows you to view Console + * Output and Screenshot to diagnose VM status.

    For Linux Virtual + * Machines, you can easily view the output of your console log.

    For + * both Windows and Linux virtual machines, Azure also enables you to see a + * screenshot of the VM from the hypervisor. + * + * @member {boolean} [enabled] Whether boot diagnostics should be enabled on + * the Virtual Machine. + * @member {string} [storageUri] Uri of the storage account to use for placing + * the console output and screenshot. + */ +export interface BootDiagnostics { + enabled?: boolean; + storageUri?: string; +} + +/** + * @class + * Initializes a new instance of the DiagnosticsProfile class. + * @constructor + * Specifies the boot diagnostic settings state.

    Minimum api-version: + * 2015-06-15. + * + * @member {object} [bootDiagnostics] Boot Diagnostics is a debugging feature + * which allows you to view Console Output and Screenshot to diagnose VM + * status.

    For Linux Virtual Machines, you can easily view the output + * of your console log.

    For both Windows and Linux virtual machines, + * Azure also enables you to see a screenshot of the VM from the hypervisor. + * @member {boolean} [bootDiagnostics.enabled] Whether boot diagnostics should + * be enabled on the Virtual Machine. + * @member {string} [bootDiagnostics.storageUri] Uri of the storage account to + * use for placing the console output and screenshot. + */ +export interface DiagnosticsProfile { + bootDiagnostics?: BootDiagnostics; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineExtensionHandlerInstanceView class. + * @constructor + * The instance view of a virtual machine extension handler. + * + * @member {string} [type] Specifies the type of the extension; an example is + * "CustomScriptExtension". + * @member {string} [typeHandlerVersion] Specifies the version of the script + * handler. + * @member {object} [status] The extension handler status. + * @member {string} [status.code] The status code. + * @member {string} [status.level] The level code. Possible values include: + * 'Info', 'Warning', 'Error' + * @member {string} [status.displayStatus] The short localizable label for the + * status. + * @member {string} [status.message] The detailed status message, including for + * alerts and error messages. + * @member {date} [status.time] The time of the status. + */ +export interface VirtualMachineExtensionHandlerInstanceView { + type?: string; + typeHandlerVersion?: string; + status?: InstanceViewStatus; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineAgentInstanceView class. + * @constructor + * The instance view of the VM Agent running on the virtual machine. + * + * @member {string} [vmAgentVersion] The VM Agent full version. + * @member {array} [extensionHandlers] The virtual machine extension handler + * instance view. + * @member {array} [statuses] The resource status information. + */ +export interface VirtualMachineAgentInstanceView { + vmAgentVersion?: string; + extensionHandlers?: VirtualMachineExtensionHandlerInstanceView[]; + statuses?: InstanceViewStatus[]; +} + +/** + * @class + * Initializes a new instance of the DiskInstanceView class. + * @constructor + * The instance view of the disk. + * + * @member {string} [name] The disk name. + * @member {array} [encryptionSettings] Specifies the encryption settings for + * the OS Disk.

    Minimum api-version: 2015-06-15 + * @member {array} [statuses] The resource status information. + */ +export interface DiskInstanceView { + name?: string; + encryptionSettings?: DiskEncryptionSettings[]; + statuses?: InstanceViewStatus[]; +} + +/** + * @class + * Initializes a new instance of the BootDiagnosticsInstanceView class. + * @constructor + * The instance view of a virtual machine boot diagnostics. + * + * @member {string} [consoleScreenshotBlobUri] The console screenshot blob URI. + * @member {string} [serialConsoleLogBlobUri] The Linux serial console log blob + * Uri. + */ +export interface BootDiagnosticsInstanceView { + consoleScreenshotBlobUri?: string; + serialConsoleLogBlobUri?: string; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineIdentity class. + * @constructor + * Identity for the virtual machine. + * + * @member {string} [principalId] The principal id of virtual machine identity. + * This property will only be provided for a system assigned identity. + * @member {string} [tenantId] The tenant id associated with the virtual + * machine. This property will only be provided for a system assigned identity. + * @member {string} [type] The type of identity used for the virtual machine. + * The type 'SystemAssigned, UserAssigned' includes both an implicitly created + * identity and a set of user assigned identities. The type 'None' will remove + * any identities from the virtual machine. Possible values include: + * 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None' + * @member {array} [identityIds] The list of user identities associated with + * the Virtual Machine. The user identity references will be ARM resource ids + * in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + */ +export interface VirtualMachineIdentity { + readonly principalId?: string; + readonly tenantId?: string; + type?: string; + identityIds?: string[]; +} + +/** + * @class + * Initializes a new instance of the MaintenanceRedeployStatus class. + * @constructor + * Maintenance Operation Status. + * + * @member {boolean} [isCustomerInitiatedMaintenanceAllowed] True, if customer + * is allowed to perform Maintenance. + * @member {date} [preMaintenanceWindowStartTime] Start Time for the Pre + * Maintenance Window. + * @member {date} [preMaintenanceWindowEndTime] End Time for the Pre + * Maintenance Window. + * @member {date} [maintenanceWindowStartTime] Start Time for the Maintenance + * Window. + * @member {date} [maintenanceWindowEndTime] End Time for the Maintenance + * Window. + * @member {string} [lastOperationResultCode] The Last Maintenance Operation + * Result Code. Possible values include: 'None', 'RetryLater', + * 'MaintenanceAborted', 'MaintenanceCompleted' + * @member {string} [lastOperationMessage] Message returned for the last + * Maintenance Operation. + */ +export interface MaintenanceRedeployStatus { + isCustomerInitiatedMaintenanceAllowed?: boolean; + preMaintenanceWindowStartTime?: Date; + preMaintenanceWindowEndTime?: Date; + maintenanceWindowStartTime?: Date; + maintenanceWindowEndTime?: Date; + lastOperationResultCode?: string; + lastOperationMessage?: string; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineInstanceView class. + * @constructor + * The instance view of a virtual machine. + * + * @member {number} [platformUpdateDomain] Specifies the update domain of the + * virtual machine. + * @member {number} [platformFaultDomain] Specifies the fault domain of the + * virtual machine. + * @member {string} [computerName] The computer name assigned to the virtual + * machine. + * @member {string} [osName] The Operating System running on the virtual + * machine. + * @member {string} [osVersion] The version of Operating System running on the + * virtual machine. + * @member {string} [rdpThumbPrint] The Remote desktop certificate thumbprint. + * @member {object} [vmAgent] The VM Agent running on the virtual machine. + * @member {string} [vmAgent.vmAgentVersion] The VM Agent full version. + * @member {array} [vmAgent.extensionHandlers] The virtual machine extension + * handler instance view. + * @member {array} [vmAgent.statuses] The resource status information. + * @member {object} [maintenanceRedeployStatus] The Maintenance Operation + * status on the virtual machine. + * @member {boolean} + * [maintenanceRedeployStatus.isCustomerInitiatedMaintenanceAllowed] True, if + * customer is allowed to perform Maintenance. + * @member {date} [maintenanceRedeployStatus.preMaintenanceWindowStartTime] + * Start Time for the Pre Maintenance Window. + * @member {date} [maintenanceRedeployStatus.preMaintenanceWindowEndTime] End + * Time for the Pre Maintenance Window. + * @member {date} [maintenanceRedeployStatus.maintenanceWindowStartTime] Start + * Time for the Maintenance Window. + * @member {date} [maintenanceRedeployStatus.maintenanceWindowEndTime] End Time + * for the Maintenance Window. + * @member {string} [maintenanceRedeployStatus.lastOperationResultCode] The + * Last Maintenance Operation Result Code. Possible values include: 'None', + * 'RetryLater', 'MaintenanceAborted', 'MaintenanceCompleted' + * @member {string} [maintenanceRedeployStatus.lastOperationMessage] Message + * returned for the last Maintenance Operation. + * @member {array} [disks] The virtual machine disk information. + * @member {array} [extensions] The extensions information. + * @member {object} [bootDiagnostics] Boot Diagnostics is a debugging feature + * which allows you to view Console Output and Screenshot to diagnose VM + * status.

    For Linux Virtual Machines, you can easily view the output + * of your console log.

    For both Windows and Linux virtual machines, + * Azure also enables you to see a screenshot of the VM from the hypervisor. + * @member {string} [bootDiagnostics.consoleScreenshotBlobUri] The console + * screenshot blob URI. + * @member {string} [bootDiagnostics.serialConsoleLogBlobUri] The Linux serial + * console log blob Uri. + * @member {array} [statuses] The resource status information. + */ +export interface VirtualMachineInstanceView { + platformUpdateDomain?: number; + platformFaultDomain?: number; + computerName?: string; + osName?: string; + osVersion?: string; + rdpThumbPrint?: string; + vmAgent?: VirtualMachineAgentInstanceView; + maintenanceRedeployStatus?: MaintenanceRedeployStatus; + disks?: DiskInstanceView[]; + extensions?: VirtualMachineExtensionInstanceView[]; + bootDiagnostics?: BootDiagnosticsInstanceView; + statuses?: InstanceViewStatus[]; +} + +/** + * @class + * Initializes a new instance of the VirtualMachine class. + * @constructor + * Describes a Virtual Machine. + * + * @member {object} [plan] Specifies information about the marketplace image + * used to create the virtual machine. This element is only used for + * marketplace images. Before you can use a marketplace image from an API, you + * must enable the image for programmatic use. In the Azure portal, find the + * marketplace image that you want to use and then click **Want to deploy + * programmatically, Get Started ->**. Enter any required information and then + * click **Save**. + * @member {string} [plan.name] The plan ID. + * @member {string} [plan.publisher] The publisher ID. + * @member {string} [plan.product] Specifies the product of the image from the + * marketplace. This is the same value as Offer under the imageReference + * element. + * @member {string} [plan.promotionCode] The promotion code. + * @member {object} [hardwareProfile] Specifies the hardware settings for the + * virtual machine. + * @member {string} [hardwareProfile.vmSize] Specifies the size of the virtual + * machine. For more information about virtual machine sizes, see [Sizes for + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    The available VM sizes depend on region and availability set. For a + * list of available sizes use these APIs:

    [List all available + * virtual machine sizes in an availability + * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) + *

    [List all available virtual machine sizes in a + * region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) + *

    [List all available virtual machine sizes for + * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). + * Possible values include: '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_B1s', 'Standard_B1ms', + * 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', + * '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_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', + * 'Standard_D32_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', + * 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', + * 'Standard_D64s_v3', '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_DS13-4_v2', 'Standard_DS13-2_v2', + * 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', 'Standard_E2_v3', + * 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', 'Standard_E32_v3', + * 'Standard_E64_v3', 'Standard_E2s_v3', 'Standard_E4s_v3', 'Standard_E8s_v3', + * 'Standard_E16s_v3', 'Standard_E32s_v3', 'Standard_E64s_v3', + * 'Standard_E32-16_v3', 'Standard_E32-8s_v3', 'Standard_E64-32s_v3', + * 'Standard_E64-16s_v3', 'Standard_F1', 'Standard_F2', 'Standard_F4', + * 'Standard_F8', 'Standard_F16', 'Standard_F1s', 'Standard_F2s', + * 'Standard_F4s', 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2', + * 'Standard_F4s_v2', 'Standard_F8s_v2', 'Standard_F16s_v2', + * 'Standard_F32s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1', + * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', + * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', + * 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8', + * 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m', + * 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', + * 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms', + * 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms', + * 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms', + * 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', + * 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2', + * 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3', + * 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s', + * 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6', + * 'Standard_NV12', 'Standard_NV24' + * @member {object} [storageProfile] Specifies the storage settings for the + * virtual machine disks. + * @member {object} [storageProfile.imageReference] Specifies information about + * the image to use. You can specify information about platform images, + * marketplace images, or virtual machine images. This element is required when + * you want to use a platform image, marketplace image, or virtual machine + * image, but is not used in other creation operations. + * @member {string} [storageProfile.imageReference.publisher] The image + * publisher. + * @member {string} [storageProfile.imageReference.offer] Specifies the offer + * of the platform image or marketplace image used to create the virtual + * machine. + * @member {string} [storageProfile.imageReference.sku] The image SKU. + * @member {string} [storageProfile.imageReference.version] Specifies the + * version of the platform image or marketplace image used to create the + * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the + * latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. + * @member {object} [storageProfile.osDisk] Specifies information about the + * operating system disk used by the virtual machine.

    For more + * information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @member {string} [storageProfile.osDisk.osType] This property allows you to + * specify the type of the OS that is included in the disk if creating a VM + * from user-image or a specialized VHD.

    Possible values are:

    + * **Windows**

    **Linux**. Possible values include: 'Windows', 'Linux' + * @member {object} [storageProfile.osDisk.encryptionSettings] Specifies the + * encryption settings for the OS Disk.

    Minimum api-version: + * 2015-06-15 + * @member {object} + * [storageProfile.osDisk.encryptionSettings.diskEncryptionKey] Specifies the + * location of the disk encryption key, which is a Key Vault Secret. + * @member {string} + * [storageProfile.osDisk.encryptionSettings.diskEncryptionKey.secretUrl] The + * URL referencing a secret in a Key Vault. + * @member {object} + * [storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault] The + * relative URL of the Key Vault containing the secret. + * @member {string} + * [storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault.id] + * Resource Id + * @member {object} [storageProfile.osDisk.encryptionSettings.keyEncryptionKey] + * Specifies the location of the key encryption key in Key Vault. + * @member {string} + * [storageProfile.osDisk.encryptionSettings.keyEncryptionKey.keyUrl] The URL + * referencing a key encryption key in Key Vault. + * @member {object} + * [storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault] The + * relative URL of the Key Vault containing the key. + * @member {string} + * [storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault.id] + * Resource Id + * @member {boolean} [storageProfile.osDisk.encryptionSettings.enabled] + * Specifies whether disk encryption should be enabled on the virtual machine. + * @member {string} [storageProfile.osDisk.name] The disk name. + * @member {object} [storageProfile.osDisk.vhd] The virtual hard disk. + * @member {string} [storageProfile.osDisk.vhd.uri] Specifies the virtual hard + * disk's uri. + * @member {object} [storageProfile.osDisk.image] The source user image virtual + * hard disk. The virtual hard disk will be copied before being attached to the + * virtual machine. If SourceImage is provided, the destination virtual hard + * drive must not exist. + * @member {string} [storageProfile.osDisk.image.uri] Specifies the virtual + * hard disk's uri. + * @member {string} [storageProfile.osDisk.caching] Specifies the caching + * requirements.

    Possible values are:

    **None**

    + * **ReadOnly**

    **ReadWrite**

    Default: **None for Standard + * storage. ReadOnly for Premium storage**. Possible values include: 'None', + * 'ReadOnly', 'ReadWrite' + * @member {boolean} [storageProfile.osDisk.writeAcceleratorEnabled] Specifies + * whether writeAccelerator should be enabled or disabled on the disk. + * @member {string} [storageProfile.osDisk.createOption] Specifies how the + * virtual machine should be created.

    Possible values are:

    + * **Attach** \u2013 This value is used when you are using a specialized disk + * to create the virtual machine.

    **FromImage** \u2013 This value is + * used when you are using an image to create the virtual machine. If you are + * using a platform image, you also use the imageReference element described + * above. If you are using a marketplace image, you also use the plan element + * previously described. Possible values include: 'FromImage', 'Empty', + * 'Attach' + * @member {number} [storageProfile.osDisk.diskSizeGB] Specifies the size of an + * empty data disk in gigabytes. This element can be used to overwrite the name + * of the disk in a virtual machine image.

    This value cannot be larger + * than 1023 GB + * @member {object} [storageProfile.osDisk.managedDisk] The managed disk + * parameters. + * @member {string} [storageProfile.osDisk.managedDisk.storageAccountType] + * Specifies the storage account type for the managed disk. Possible values + * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * @member {array} [storageProfile.dataDisks] Specifies the parameters that are + * used to add a data disk to a virtual machine.

    For more information + * about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @member {object} [osProfile] Specifies the operating system settings for the + * virtual machine. + * @member {string} [osProfile.computerName] Specifies the host OS name of the + * virtual machine.

    **Max-length (Windows):** 15 characters

    + * **Max-length (Linux):** 64 characters.

    For naming conventions and + * restrictions see [Azure infrastructure services implementation + * guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). + * @member {string} [osProfile.adminUsername] Specifies the name of the + * administrator account.

    **Windows-only restriction:** Cannot end in + * "."

    **Disallowed values:** "administrator", "admin", "user", + * "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", + * "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", + * "john", "owner", "root", "server", "sql", "support", "support_388945a0", + * "sys", "test2", "test3", "user4", "user5".

    **Minimum-length + * (Linux):** 1 character

    **Max-length (Linux):** 64 characters + *

    **Max-length (Windows):** 20 characters

  • For root + * access to the Linux VM, see [Using root privileges on Linux virtual machines + * in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in this + * field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * @member {string} [osProfile.adminPassword] Specifies the password of the + * administrator account.

    **Minimum-length (Windows):** 8 characters + *

    **Minimum-length (Linux):** 6 characters

    **Max-length + * (Windows):** 123 characters

    **Max-length (Linux):** 72 characters + *

    **Complexity requirements:** 3 out of 4 conditions below need to be + * fulfilled
    Has lower characters
    Has upper characters
    Has a + * digit
    Has a special character (Regex match [\W_])

    **Disallowed + * values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", + * "pass@word1", "Password!", "Password1", "Password22", "iloveyou!"

    + * For resetting the password, see [How to reset the Remote Desktop service or + * its login password in a Windows + * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    For resetting root password, see [Manage users, SSH, and check or + * repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + * @member {string} [osProfile.customData] Specifies a base-64 encoded string + * of custom data. The base-64 encoded string is decoded to a binary array that + * is saved as a file on the Virtual Machine. The maximum length of the binary + * array is 65535 bytes.

    For using cloud-init for your VM, see [Using + * cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * @member {object} [osProfile.windowsConfiguration] Specifies Windows + * operating system settings on the virtual machine. + * @member {boolean} [osProfile.windowsConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * @member {boolean} [osProfile.windowsConfiguration.enableAutomaticUpdates] + * Indicates whether virtual machine is enabled for automatic updates. + * @member {string} [osProfile.windowsConfiguration.timeZone] Specifies the + * time zone of the virtual machine. e.g. "Pacific Standard Time" + * @member {array} [osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * @member {object} [osProfile.windowsConfiguration.winRM] Specifies the + * Windows Remote Management listeners. This enables remote Windows PowerShell. + * @member {array} [osProfile.windowsConfiguration.winRM.listeners] The list of + * Windows Remote Management listeners + * @member {object} [osProfile.linuxConfiguration] Specifies the Linux + * operating system settings on the virtual machine.

    For a list of + * supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * @member {boolean} + * [osProfile.linuxConfiguration.disablePasswordAuthentication] Specifies + * whether password authentication should be disabled. + * @member {object} [osProfile.linuxConfiguration.ssh] Specifies the ssh key + * configuration for a Linux OS. + * @member {array} [osProfile.linuxConfiguration.ssh.publicKeys] The list of + * SSH public keys used to authenticate with linux based VMs. + * @member {array} [osProfile.secrets] Specifies set of certificates that + * should be installed onto the virtual machine. + * @member {object} [networkProfile] Specifies the network interfaces of the + * virtual machine. + * @member {array} [networkProfile.networkInterfaces] Specifies the list of + * resource Ids for the network interfaces associated with the virtual machine. + * @member {object} [diagnosticsProfile] Specifies the boot diagnostic settings + * state.

    Minimum api-version: 2015-06-15. + * @member {object} [diagnosticsProfile.bootDiagnostics] Boot Diagnostics is a + * debugging feature which allows you to view Console Output and Screenshot to + * diagnose VM status.

    For Linux Virtual Machines, you can easily view + * the output of your console log.

    For both Windows and Linux virtual + * machines, Azure also enables you to see a screenshot of the VM from the + * hypervisor. + * @member {boolean} [diagnosticsProfile.bootDiagnostics.enabled] Whether boot + * diagnostics should be enabled on the Virtual Machine. + * @member {string} [diagnosticsProfile.bootDiagnostics.storageUri] Uri of the + * storage account to use for placing the console output and screenshot. + * @member {object} [availabilitySet] Specifies information about the + * availability set that the virtual machine should be assigned to. Virtual + * machines specified in the same availability set are allocated to different + * nodes to maximize availability. For more information about availability + * sets, see [Manage the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    For more information on Azure planned maintainance, see [Planned + * maintenance for virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Currently, a VM can only be added to availability set at creation + * time. An existing VM cannot be added to an availability set. + * @member {string} [availabilitySet.id] Resource Id + * @member {string} [provisioningState] The provisioning state, which only + * appears in the response. + * @member {object} [instanceView] The virtual machine instance view. + * @member {number} [instanceView.platformUpdateDomain] Specifies the update + * domain of the virtual machine. + * @member {number} [instanceView.platformFaultDomain] Specifies the fault + * domain of the virtual machine. + * @member {string} [instanceView.computerName] The computer name assigned to + * the virtual machine. + * @member {string} [instanceView.osName] The Operating System running on the + * virtual machine. + * @member {string} [instanceView.osVersion] The version of Operating System + * running on the virtual machine. + * @member {string} [instanceView.rdpThumbPrint] The Remote desktop certificate + * thumbprint. + * @member {object} [instanceView.vmAgent] The VM Agent running on the virtual + * machine. + * @member {string} [instanceView.vmAgent.vmAgentVersion] The VM Agent full + * version. + * @member {array} [instanceView.vmAgent.extensionHandlers] The virtual machine + * extension handler instance view. + * @member {array} [instanceView.vmAgent.statuses] The resource status + * information. + * @member {object} [instanceView.maintenanceRedeployStatus] The Maintenance + * Operation status on the virtual machine. + * @member {boolean} + * [instanceView.maintenanceRedeployStatus.isCustomerInitiatedMaintenanceAllowed] + * True, if customer is allowed to perform Maintenance. + * @member {date} + * [instanceView.maintenanceRedeployStatus.preMaintenanceWindowStartTime] Start + * Time for the Pre Maintenance Window. + * @member {date} + * [instanceView.maintenanceRedeployStatus.preMaintenanceWindowEndTime] End + * Time for the Pre Maintenance Window. + * @member {date} + * [instanceView.maintenanceRedeployStatus.maintenanceWindowStartTime] Start + * Time for the Maintenance Window. + * @member {date} + * [instanceView.maintenanceRedeployStatus.maintenanceWindowEndTime] End Time + * for the Maintenance Window. + * @member {string} + * [instanceView.maintenanceRedeployStatus.lastOperationResultCode] The Last + * Maintenance Operation Result Code. Possible values include: 'None', + * 'RetryLater', 'MaintenanceAborted', 'MaintenanceCompleted' + * @member {string} + * [instanceView.maintenanceRedeployStatus.lastOperationMessage] Message + * returned for the last Maintenance Operation. + * @member {array} [instanceView.disks] The virtual machine disk information. + * @member {array} [instanceView.extensions] The extensions information. + * @member {object} [instanceView.bootDiagnostics] Boot Diagnostics is a + * debugging feature which allows you to view Console Output and Screenshot to + * diagnose VM status.

    For Linux Virtual Machines, you can easily view + * the output of your console log.

    For both Windows and Linux virtual + * machines, Azure also enables you to see a screenshot of the VM from the + * hypervisor. + * @member {string} [instanceView.bootDiagnostics.consoleScreenshotBlobUri] The + * console screenshot blob URI. + * @member {string} [instanceView.bootDiagnostics.serialConsoleLogBlobUri] The + * Linux serial console log blob Uri. + * @member {array} [instanceView.statuses] The resource status information. + * @member {string} [licenseType] Specifies that the image or disk that is + * being used was licensed on-premises. This element is only used for images + * that contain the Windows Server operating system.

    Possible values + * are:

    Windows_Client

    Windows_Server

    If this + * element is included in a request for an update, the value must match the + * initial value. This value cannot be updated.

    For more information, + * see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Minimum api-version: 2015-06-15 + * @member {string} [vmId] Specifies the VM unique ID which is a 128-bits + * identifier that is encoded and stored in all Azure IaaS VMs SMBIOS and can + * be read using platform BIOS commands. + * @member {array} [resources] The virtual machine child extension resources. + * @member {object} [identity] The identity of the virtual machine, if + * configured. + * @member {string} [identity.principalId] The principal id of virtual machine + * identity. This property will only be provided for a system assigned + * identity. + * @member {string} [identity.tenantId] The tenant id associated with the + * virtual machine. This property will only be provided for a system assigned + * identity. + * @member {string} [identity.type] The type of identity used for the virtual + * machine. The type 'SystemAssigned, UserAssigned' includes both an implicitly + * created identity and a set of user assigned identities. The type 'None' will + * remove any identities from the virtual machine. Possible values include: + * 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None' + * @member {array} [identity.identityIds] The list of user identities + * associated with the Virtual Machine. The user identity references will be + * ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @member {array} [zones] The virtual machine zones. + */ +export interface VirtualMachine extends Resource { + plan?: Plan; + hardwareProfile?: HardwareProfile; + storageProfile?: StorageProfile; + osProfile?: OSProfile; + networkProfile?: NetworkProfile; + diagnosticsProfile?: DiagnosticsProfile; + availabilitySet?: SubResource; + readonly provisioningState?: string; + readonly instanceView?: VirtualMachineInstanceView; + licenseType?: string; + readonly vmId?: string; + readonly resources?: VirtualMachineExtension[]; + identity?: VirtualMachineIdentity; + zones?: string[]; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineUpdate class. + * @constructor + * Describes a Virtual Machine. + * + * @member {object} [plan] Specifies information about the marketplace image + * used to create the virtual machine. This element is only used for + * marketplace images. Before you can use a marketplace image from an API, you + * must enable the image for programmatic use. In the Azure portal, find the + * marketplace image that you want to use and then click **Want to deploy + * programmatically, Get Started ->**. Enter any required information and then + * click **Save**. + * @member {string} [plan.name] The plan ID. + * @member {string} [plan.publisher] The publisher ID. + * @member {string} [plan.product] Specifies the product of the image from the + * marketplace. This is the same value as Offer under the imageReference + * element. + * @member {string} [plan.promotionCode] The promotion code. + * @member {object} [hardwareProfile] Specifies the hardware settings for the + * virtual machine. + * @member {string} [hardwareProfile.vmSize] Specifies the size of the virtual + * machine. For more information about virtual machine sizes, see [Sizes for + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    The available VM sizes depend on region and availability set. For a + * list of available sizes use these APIs:

    [List all available + * virtual machine sizes in an availability + * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) + *

    [List all available virtual machine sizes in a + * region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) + *

    [List all available virtual machine sizes for + * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). + * Possible values include: '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_B1s', 'Standard_B1ms', + * 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', + * '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_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', + * 'Standard_D32_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', + * 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', + * 'Standard_D64s_v3', '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_DS13-4_v2', 'Standard_DS13-2_v2', + * 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', 'Standard_E2_v3', + * 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', 'Standard_E32_v3', + * 'Standard_E64_v3', 'Standard_E2s_v3', 'Standard_E4s_v3', 'Standard_E8s_v3', + * 'Standard_E16s_v3', 'Standard_E32s_v3', 'Standard_E64s_v3', + * 'Standard_E32-16_v3', 'Standard_E32-8s_v3', 'Standard_E64-32s_v3', + * 'Standard_E64-16s_v3', 'Standard_F1', 'Standard_F2', 'Standard_F4', + * 'Standard_F8', 'Standard_F16', 'Standard_F1s', 'Standard_F2s', + * 'Standard_F4s', 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2', + * 'Standard_F4s_v2', 'Standard_F8s_v2', 'Standard_F16s_v2', + * 'Standard_F32s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1', + * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', + * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', + * 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8', + * 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m', + * 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', + * 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms', + * 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms', + * 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms', + * 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', + * 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2', + * 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3', + * 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s', + * 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6', + * 'Standard_NV12', 'Standard_NV24' + * @member {object} [storageProfile] Specifies the storage settings for the + * virtual machine disks. + * @member {object} [storageProfile.imageReference] Specifies information about + * the image to use. You can specify information about platform images, + * marketplace images, or virtual machine images. This element is required when + * you want to use a platform image, marketplace image, or virtual machine + * image, but is not used in other creation operations. + * @member {string} [storageProfile.imageReference.publisher] The image + * publisher. + * @member {string} [storageProfile.imageReference.offer] Specifies the offer + * of the platform image or marketplace image used to create the virtual + * machine. + * @member {string} [storageProfile.imageReference.sku] The image SKU. + * @member {string} [storageProfile.imageReference.version] Specifies the + * version of the platform image or marketplace image used to create the + * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the + * latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. + * @member {object} [storageProfile.osDisk] Specifies information about the + * operating system disk used by the virtual machine.

    For more + * information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @member {string} [storageProfile.osDisk.osType] This property allows you to + * specify the type of the OS that is included in the disk if creating a VM + * from user-image or a specialized VHD.

    Possible values are:

    + * **Windows**

    **Linux**. Possible values include: 'Windows', 'Linux' + * @member {object} [storageProfile.osDisk.encryptionSettings] Specifies the + * encryption settings for the OS Disk.

    Minimum api-version: + * 2015-06-15 + * @member {object} + * [storageProfile.osDisk.encryptionSettings.diskEncryptionKey] Specifies the + * location of the disk encryption key, which is a Key Vault Secret. + * @member {string} + * [storageProfile.osDisk.encryptionSettings.diskEncryptionKey.secretUrl] The + * URL referencing a secret in a Key Vault. + * @member {object} + * [storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault] The + * relative URL of the Key Vault containing the secret. + * @member {string} + * [storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault.id] + * Resource Id + * @member {object} [storageProfile.osDisk.encryptionSettings.keyEncryptionKey] + * Specifies the location of the key encryption key in Key Vault. + * @member {string} + * [storageProfile.osDisk.encryptionSettings.keyEncryptionKey.keyUrl] The URL + * referencing a key encryption key in Key Vault. + * @member {object} + * [storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault] The + * relative URL of the Key Vault containing the key. + * @member {string} + * [storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault.id] + * Resource Id + * @member {boolean} [storageProfile.osDisk.encryptionSettings.enabled] + * Specifies whether disk encryption should be enabled on the virtual machine. + * @member {string} [storageProfile.osDisk.name] The disk name. + * @member {object} [storageProfile.osDisk.vhd] The virtual hard disk. + * @member {string} [storageProfile.osDisk.vhd.uri] Specifies the virtual hard + * disk's uri. + * @member {object} [storageProfile.osDisk.image] The source user image virtual + * hard disk. The virtual hard disk will be copied before being attached to the + * virtual machine. If SourceImage is provided, the destination virtual hard + * drive must not exist. + * @member {string} [storageProfile.osDisk.image.uri] Specifies the virtual + * hard disk's uri. + * @member {string} [storageProfile.osDisk.caching] Specifies the caching + * requirements.

    Possible values are:

    **None**

    + * **ReadOnly**

    **ReadWrite**

    Default: **None for Standard + * storage. ReadOnly for Premium storage**. Possible values include: 'None', + * 'ReadOnly', 'ReadWrite' + * @member {boolean} [storageProfile.osDisk.writeAcceleratorEnabled] Specifies + * whether writeAccelerator should be enabled or disabled on the disk. + * @member {string} [storageProfile.osDisk.createOption] Specifies how the + * virtual machine should be created.

    Possible values are:

    + * **Attach** \u2013 This value is used when you are using a specialized disk + * to create the virtual machine.

    **FromImage** \u2013 This value is + * used when you are using an image to create the virtual machine. If you are + * using a platform image, you also use the imageReference element described + * above. If you are using a marketplace image, you also use the plan element + * previously described. Possible values include: 'FromImage', 'Empty', + * 'Attach' + * @member {number} [storageProfile.osDisk.diskSizeGB] Specifies the size of an + * empty data disk in gigabytes. This element can be used to overwrite the name + * of the disk in a virtual machine image.

    This value cannot be larger + * than 1023 GB + * @member {object} [storageProfile.osDisk.managedDisk] The managed disk + * parameters. + * @member {string} [storageProfile.osDisk.managedDisk.storageAccountType] + * Specifies the storage account type for the managed disk. Possible values + * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * @member {array} [storageProfile.dataDisks] Specifies the parameters that are + * used to add a data disk to a virtual machine.

    For more information + * about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @member {object} [osProfile] Specifies the operating system settings for the + * virtual machine. + * @member {string} [osProfile.computerName] Specifies the host OS name of the + * virtual machine.

    **Max-length (Windows):** 15 characters

    + * **Max-length (Linux):** 64 characters.

    For naming conventions and + * restrictions see [Azure infrastructure services implementation + * guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). + * @member {string} [osProfile.adminUsername] Specifies the name of the + * administrator account.

    **Windows-only restriction:** Cannot end in + * "."

    **Disallowed values:** "administrator", "admin", "user", + * "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", + * "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", + * "john", "owner", "root", "server", "sql", "support", "support_388945a0", + * "sys", "test2", "test3", "user4", "user5".

    **Minimum-length + * (Linux):** 1 character

    **Max-length (Linux):** 64 characters + *

    **Max-length (Windows):** 20 characters

  • For root + * access to the Linux VM, see [Using root privileges on Linux virtual machines + * in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in this + * field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * @member {string} [osProfile.adminPassword] Specifies the password of the + * administrator account.

    **Minimum-length (Windows):** 8 characters + *

    **Minimum-length (Linux):** 6 characters

    **Max-length + * (Windows):** 123 characters

    **Max-length (Linux):** 72 characters + *

    **Complexity requirements:** 3 out of 4 conditions below need to be + * fulfilled
    Has lower characters
    Has upper characters
    Has a + * digit
    Has a special character (Regex match [\W_])

    **Disallowed + * values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", + * "pass@word1", "Password!", "Password1", "Password22", "iloveyou!"

    + * For resetting the password, see [How to reset the Remote Desktop service or + * its login password in a Windows + * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    For resetting root password, see [Manage users, SSH, and check or + * repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + * @member {string} [osProfile.customData] Specifies a base-64 encoded string + * of custom data. The base-64 encoded string is decoded to a binary array that + * is saved as a file on the Virtual Machine. The maximum length of the binary + * array is 65535 bytes.

    For using cloud-init for your VM, see [Using + * cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * @member {object} [osProfile.windowsConfiguration] Specifies Windows + * operating system settings on the virtual machine. + * @member {boolean} [osProfile.windowsConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * @member {boolean} [osProfile.windowsConfiguration.enableAutomaticUpdates] + * Indicates whether virtual machine is enabled for automatic updates. + * @member {string} [osProfile.windowsConfiguration.timeZone] Specifies the + * time zone of the virtual machine. e.g. "Pacific Standard Time" + * @member {array} [osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * @member {object} [osProfile.windowsConfiguration.winRM] Specifies the + * Windows Remote Management listeners. This enables remote Windows PowerShell. + * @member {array} [osProfile.windowsConfiguration.winRM.listeners] The list of + * Windows Remote Management listeners + * @member {object} [osProfile.linuxConfiguration] Specifies the Linux + * operating system settings on the virtual machine.

    For a list of + * supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * @member {boolean} + * [osProfile.linuxConfiguration.disablePasswordAuthentication] Specifies + * whether password authentication should be disabled. + * @member {object} [osProfile.linuxConfiguration.ssh] Specifies the ssh key + * configuration for a Linux OS. + * @member {array} [osProfile.linuxConfiguration.ssh.publicKeys] The list of + * SSH public keys used to authenticate with linux based VMs. + * @member {array} [osProfile.secrets] Specifies set of certificates that + * should be installed onto the virtual machine. + * @member {object} [networkProfile] Specifies the network interfaces of the + * virtual machine. + * @member {array} [networkProfile.networkInterfaces] Specifies the list of + * resource Ids for the network interfaces associated with the virtual machine. + * @member {object} [diagnosticsProfile] Specifies the boot diagnostic settings + * state.

    Minimum api-version: 2015-06-15. + * @member {object} [diagnosticsProfile.bootDiagnostics] Boot Diagnostics is a + * debugging feature which allows you to view Console Output and Screenshot to + * diagnose VM status.

    For Linux Virtual Machines, you can easily view + * the output of your console log.

    For both Windows and Linux virtual + * machines, Azure also enables you to see a screenshot of the VM from the + * hypervisor. + * @member {boolean} [diagnosticsProfile.bootDiagnostics.enabled] Whether boot + * diagnostics should be enabled on the Virtual Machine. + * @member {string} [diagnosticsProfile.bootDiagnostics.storageUri] Uri of the + * storage account to use for placing the console output and screenshot. + * @member {object} [availabilitySet] Specifies information about the + * availability set that the virtual machine should be assigned to. Virtual + * machines specified in the same availability set are allocated to different + * nodes to maximize availability. For more information about availability + * sets, see [Manage the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    For more information on Azure planned maintainance, see [Planned + * maintenance for virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Currently, a VM can only be added to availability set at creation + * time. An existing VM cannot be added to an availability set. + * @member {string} [availabilitySet.id] Resource Id + * @member {string} [provisioningState] The provisioning state, which only + * appears in the response. + * @member {object} [instanceView] The virtual machine instance view. + * @member {number} [instanceView.platformUpdateDomain] Specifies the update + * domain of the virtual machine. + * @member {number} [instanceView.platformFaultDomain] Specifies the fault + * domain of the virtual machine. + * @member {string} [instanceView.computerName] The computer name assigned to + * the virtual machine. + * @member {string} [instanceView.osName] The Operating System running on the + * virtual machine. + * @member {string} [instanceView.osVersion] The version of Operating System + * running on the virtual machine. + * @member {string} [instanceView.rdpThumbPrint] The Remote desktop certificate + * thumbprint. + * @member {object} [instanceView.vmAgent] The VM Agent running on the virtual + * machine. + * @member {string} [instanceView.vmAgent.vmAgentVersion] The VM Agent full + * version. + * @member {array} [instanceView.vmAgent.extensionHandlers] The virtual machine + * extension handler instance view. + * @member {array} [instanceView.vmAgent.statuses] The resource status + * information. + * @member {object} [instanceView.maintenanceRedeployStatus] The Maintenance + * Operation status on the virtual machine. + * @member {boolean} + * [instanceView.maintenanceRedeployStatus.isCustomerInitiatedMaintenanceAllowed] + * True, if customer is allowed to perform Maintenance. + * @member {date} + * [instanceView.maintenanceRedeployStatus.preMaintenanceWindowStartTime] Start + * Time for the Pre Maintenance Window. + * @member {date} + * [instanceView.maintenanceRedeployStatus.preMaintenanceWindowEndTime] End + * Time for the Pre Maintenance Window. + * @member {date} + * [instanceView.maintenanceRedeployStatus.maintenanceWindowStartTime] Start + * Time for the Maintenance Window. + * @member {date} + * [instanceView.maintenanceRedeployStatus.maintenanceWindowEndTime] End Time + * for the Maintenance Window. + * @member {string} + * [instanceView.maintenanceRedeployStatus.lastOperationResultCode] The Last + * Maintenance Operation Result Code. Possible values include: 'None', + * 'RetryLater', 'MaintenanceAborted', 'MaintenanceCompleted' + * @member {string} + * [instanceView.maintenanceRedeployStatus.lastOperationMessage] Message + * returned for the last Maintenance Operation. + * @member {array} [instanceView.disks] The virtual machine disk information. + * @member {array} [instanceView.extensions] The extensions information. + * @member {object} [instanceView.bootDiagnostics] Boot Diagnostics is a + * debugging feature which allows you to view Console Output and Screenshot to + * diagnose VM status.

    For Linux Virtual Machines, you can easily view + * the output of your console log.

    For both Windows and Linux virtual + * machines, Azure also enables you to see a screenshot of the VM from the + * hypervisor. + * @member {string} [instanceView.bootDiagnostics.consoleScreenshotBlobUri] The + * console screenshot blob URI. + * @member {string} [instanceView.bootDiagnostics.serialConsoleLogBlobUri] The + * Linux serial console log blob Uri. + * @member {array} [instanceView.statuses] The resource status information. + * @member {string} [licenseType] Specifies that the image or disk that is + * being used was licensed on-premises. This element is only used for images + * that contain the Windows Server operating system.

    Possible values + * are:

    Windows_Client

    Windows_Server

    If this + * element is included in a request for an update, the value must match the + * initial value. This value cannot be updated.

    For more information, + * see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Minimum api-version: 2015-06-15 + * @member {string} [vmId] Specifies the VM unique ID which is a 128-bits + * identifier that is encoded and stored in all Azure IaaS VMs SMBIOS and can + * be read using platform BIOS commands. + * @member {object} [identity] The identity of the virtual machine, if + * configured. + * @member {string} [identity.principalId] The principal id of virtual machine + * identity. This property will only be provided for a system assigned + * identity. + * @member {string} [identity.tenantId] The tenant id associated with the + * virtual machine. This property will only be provided for a system assigned + * identity. + * @member {string} [identity.type] The type of identity used for the virtual + * machine. The type 'SystemAssigned, UserAssigned' includes both an implicitly + * created identity and a set of user assigned identities. The type 'None' will + * remove any identities from the virtual machine. Possible values include: + * 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None' + * @member {array} [identity.identityIds] The list of user identities + * associated with the Virtual Machine. The user identity references will be + * ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @member {array} [zones] The virtual machine zones. + */ +export interface VirtualMachineUpdate extends UpdateResource { + plan?: Plan; + hardwareProfile?: HardwareProfile; + storageProfile?: StorageProfile; + osProfile?: OSProfile; + networkProfile?: NetworkProfile; + diagnosticsProfile?: DiagnosticsProfile; + availabilitySet?: SubResource; + readonly provisioningState?: string; + readonly instanceView?: VirtualMachineInstanceView; + licenseType?: string; + readonly vmId?: string; + identity?: VirtualMachineIdentity; + zones?: string[]; +} + +/** + * @class + * Initializes a new instance of the RollingUpgradePolicy class. + * @constructor + * The configuration parameters used while performing a rolling upgrade. + * + * @member {number} [maxBatchInstancePercent] The maximum percent of total + * virtual machine instances that will be upgraded simultaneously by the + * rolling upgrade in one batch. As this is a maximum, unhealthy instances in + * previous or future batches can cause the percentage of instances in a batch + * to decrease to ensure higher reliability. The default value for this + * parameter is 20%. + * @member {number} [maxUnhealthyInstancePercent] The maximum percentage of the + * total virtual machine instances in the scale set that can be simultaneously + * unhealthy, either as a result of being upgraded, or by being found in an + * unhealthy state by the virtual machine health checks before the rolling + * upgrade aborts. This constraint will be checked prior to starting any batch. + * The default value for this parameter is 20%. + * @member {number} [maxUnhealthyUpgradedInstancePercent] The maximum + * percentage of upgraded virtual machine instances that can be found to be in + * an unhealthy state. This check will happen after each batch is upgraded. If + * this percentage is ever exceeded, the rolling update aborts. The default + * value for this parameter is 20%. + * @member {string} [pauseTimeBetweenBatches] The wait time between completing + * the update for all virtual machines in one batch and starting the next + * batch. The time duration should be specified in ISO 8601 format. The default + * value is 0 seconds (PT0S). + */ +export interface RollingUpgradePolicy { + maxBatchInstancePercent?: number; + maxUnhealthyInstancePercent?: number; + maxUnhealthyUpgradedInstancePercent?: number; + pauseTimeBetweenBatches?: string; +} + +/** + * @class + * Initializes a new instance of the UpgradePolicy class. + * @constructor + * Describes an upgrade policy - automatic, manual, or rolling. + * + * @member {string} [mode] Specifies the mode of an upgrade to virtual machines + * in the scale set.

    Possible values are:

    **Manual** - + * You control the application of updates to virtual machines in the scale + * set. You do this by using the manualUpgrade action.

    + * **Automatic** - All virtual machines in the scale set are automatically + * updated at the same time. Possible values include: 'Automatic', 'Manual', + * 'Rolling' + * @member {object} [rollingUpgradePolicy] The configuration parameters used + * while performing a rolling upgrade. + * @member {number} [rollingUpgradePolicy.maxBatchInstancePercent] The maximum + * percent of total virtual machine instances that will be upgraded + * simultaneously by the rolling upgrade in one batch. As this is a maximum, + * unhealthy instances in previous or future batches can cause the percentage + * of instances in a batch to decrease to ensure higher reliability. The + * default value for this parameter is 20%. + * @member {number} [rollingUpgradePolicy.maxUnhealthyInstancePercent] The + * maximum percentage of the total virtual machine instances in the scale set + * that can be simultaneously unhealthy, either as a result of being upgraded, + * or by being found in an unhealthy state by the virtual machine health checks + * before the rolling upgrade aborts. This constraint will be checked prior to + * starting any batch. The default value for this parameter is 20%. + * @member {number} [rollingUpgradePolicy.maxUnhealthyUpgradedInstancePercent] + * The maximum percentage of upgraded virtual machine instances that can be + * found to be in an unhealthy state. This check will happen after each batch + * is upgraded. If this percentage is ever exceeded, the rolling update aborts. + * The default value for this parameter is 20%. + * @member {string} [rollingUpgradePolicy.pauseTimeBetweenBatches] The wait + * time between completing the update for all virtual machines in one batch and + * starting the next batch. The time duration should be specified in ISO 8601 + * format. The default value is 0 seconds (PT0S). + * @member {boolean} [automaticOSUpgrade] Whether OS upgrades should + * automatically be applied to scale set instances in a rolling fashion when a + * newer version of the image becomes available. + */ +export interface UpgradePolicy { + mode?: string; + rollingUpgradePolicy?: RollingUpgradePolicy; + automaticOSUpgrade?: boolean; +} + +/** + * @class + * Initializes a new instance of the ImageOSDisk class. + * @constructor + * Describes an Operating System disk. + * + * @member {string} osType This property allows you to specify the type of the + * OS that is included in the disk if creating a VM from a custom image. + *

    Possible values are:

    **Windows**

    **Linux**. + * Possible values include: 'Windows', 'Linux' + * @member {string} osState The OS State. Possible values include: + * 'Generalized', 'Specialized' + * @member {object} [snapshot] The snapshot. + * @member {string} [snapshot.id] Resource Id + * @member {object} [managedDisk] The managedDisk. + * @member {string} [managedDisk.id] Resource Id + * @member {string} [blobUri] The Virtual Hard Disk. + * @member {string} [caching] Specifies the caching requirements.

    + * Possible values are:

    **None**

    **ReadOnly**

    + * **ReadWrite**

    Default: **None for Standard storage. ReadOnly for + * Premium storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite' + * @member {number} [diskSizeGB] Specifies the size of empty data disks in + * gigabytes. This element can be used to overwrite the name of the disk in a + * virtual machine image.

    This value cannot be larger than 1023 GB + * @member {string} [storageAccountType] Specifies the storage account type for + * the managed disk. Possible values are: Standard_LRS or Premium_LRS. Possible + * values include: 'Standard_LRS', 'Premium_LRS' + */ +export interface ImageOSDisk { + osType: string; + osState: string; + snapshot?: SubResource; + managedDisk?: SubResource; + blobUri?: string; + caching?: string; + diskSizeGB?: number; + storageAccountType?: string; +} + +/** + * @class + * Initializes a new instance of the ImageDataDisk class. + * @constructor + * Describes a data disk. + * + * @member {number} lun Specifies the logical unit number of the data disk. + * This value is used to identify data disks within the VM and therefore must + * be unique for each data disk attached to a VM. + * @member {object} [snapshot] The snapshot. + * @member {string} [snapshot.id] Resource Id + * @member {object} [managedDisk] The managedDisk. + * @member {string} [managedDisk.id] Resource Id + * @member {string} [blobUri] The Virtual Hard Disk. + * @member {string} [caching] Specifies the caching requirements.

    + * Possible values are:

    **None**

    **ReadOnly**

    + * **ReadWrite**

    Default: **None for Standard storage. ReadOnly for + * Premium storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite' + * @member {number} [diskSizeGB] Specifies the size of empty data disks in + * gigabytes. This element can be used to overwrite the name of the disk in a + * virtual machine image.

    This value cannot be larger than 1023 GB + * @member {string} [storageAccountType] Specifies the storage account type for + * the managed disk. Possible values are: Standard_LRS or Premium_LRS. Possible + * values include: 'Standard_LRS', 'Premium_LRS' + */ +export interface ImageDataDisk { + lun: number; + snapshot?: SubResource; + managedDisk?: SubResource; + blobUri?: string; + caching?: string; + diskSizeGB?: number; + storageAccountType?: string; +} + +/** + * @class + * Initializes a new instance of the ImageStorageProfile class. + * @constructor + * Describes a storage profile. + * + * @member {object} [osDisk] Specifies information about the operating system + * disk used by the virtual machine.

    For more information about disks, + * see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @member {string} [osDisk.osType] This property allows you to specify the + * type of the OS that is included in the disk if creating a VM from a custom + * image.

    Possible values are:

    **Windows**

    + * **Linux**. Possible values include: 'Windows', 'Linux' + * @member {string} [osDisk.osState] The OS State. Possible values include: + * 'Generalized', 'Specialized' + * @member {object} [osDisk.snapshot] The snapshot. + * @member {string} [osDisk.snapshot.id] Resource Id + * @member {object} [osDisk.managedDisk] The managedDisk. + * @member {string} [osDisk.managedDisk.id] Resource Id + * @member {string} [osDisk.blobUri] The Virtual Hard Disk. + * @member {string} [osDisk.caching] Specifies the caching requirements. + *

    Possible values are:

    **None**

    **ReadOnly** + *

    **ReadWrite**

    Default: **None for Standard storage. + * ReadOnly for Premium storage**. Possible values include: 'None', 'ReadOnly', + * 'ReadWrite' + * @member {number} [osDisk.diskSizeGB] Specifies the size of empty data disks + * in gigabytes. This element can be used to overwrite the name of the disk in + * a virtual machine image.

    This value cannot be larger than 1023 GB + * @member {string} [osDisk.storageAccountType] Specifies the storage account + * type for the managed disk. Possible values are: Standard_LRS or Premium_LRS. + * Possible values include: 'Standard_LRS', 'Premium_LRS' + * @member {array} [dataDisks] Specifies the parameters that are used to add a + * data disk to a virtual machine.

    For more information about disks, + * see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @member {boolean} [zoneResilient] Specifies whether an image is zone + * resilient or not. Default is false. Zone resilient images can be created + * only in regions that provide Zone Redundant Storage (ZRS). + */ +export interface ImageStorageProfile { + osDisk?: ImageOSDisk; + dataDisks?: ImageDataDisk[]; + zoneResilient?: boolean; +} + +/** + * @class + * Initializes a new instance of the Image class. + * @constructor + * The source user image virtual hard disk. The virtual hard disk will be + * copied before being attached to the virtual machine. If SourceImage is + * provided, the destination virtual hard drive must not exist. + * + * @member {object} [sourceVirtualMachine] The source virtual machine from + * which Image is created. + * @member {string} [sourceVirtualMachine.id] Resource Id + * @member {object} [storageProfile] Specifies the storage settings for the + * virtual machine disks. + * @member {object} [storageProfile.osDisk] Specifies information about the + * operating system disk used by the virtual machine.

    For more + * information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @member {string} [storageProfile.osDisk.osType] This property allows you to + * specify the type of the OS that is included in the disk if creating a VM + * from a custom image.

    Possible values are:

    **Windows** + *

    **Linux**. Possible values include: 'Windows', 'Linux' + * @member {string} [storageProfile.osDisk.osState] The OS State. Possible + * values include: 'Generalized', 'Specialized' + * @member {object} [storageProfile.osDisk.snapshot] The snapshot. + * @member {string} [storageProfile.osDisk.snapshot.id] Resource Id + * @member {object} [storageProfile.osDisk.managedDisk] The managedDisk. + * @member {string} [storageProfile.osDisk.managedDisk.id] Resource Id + * @member {string} [storageProfile.osDisk.blobUri] The Virtual Hard Disk. + * @member {string} [storageProfile.osDisk.caching] Specifies the caching + * requirements.

    Possible values are:

    **None**

    + * **ReadOnly**

    **ReadWrite**

    Default: **None for Standard + * storage. ReadOnly for Premium storage**. Possible values include: 'None', + * 'ReadOnly', 'ReadWrite' + * @member {number} [storageProfile.osDisk.diskSizeGB] Specifies the size of + * empty data disks in gigabytes. This element can be used to overwrite the + * name of the disk in a virtual machine image.

    This value cannot be + * larger than 1023 GB + * @member {string} [storageProfile.osDisk.storageAccountType] Specifies the + * storage account type for the managed disk. Possible values are: Standard_LRS + * or Premium_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS' + * @member {array} [storageProfile.dataDisks] Specifies the parameters that are + * used to add a data disk to a virtual machine.

    For more information + * about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @member {boolean} [storageProfile.zoneResilient] Specifies whether an image + * is zone resilient or not. Default is false. Zone resilient images can be + * created only in regions that provide Zone Redundant Storage (ZRS). + * @member {string} [provisioningState] The provisioning state. + */ +export interface Image extends Resource { + sourceVirtualMachine?: SubResource; + storageProfile?: ImageStorageProfile; + readonly provisioningState?: string; +} + +/** + * @class + * Initializes a new instance of the ImageUpdate class. + * @constructor + * The source user image virtual hard disk. The virtual hard disk will be + * copied before being attached to the virtual machine. If SourceImage is + * provided, the destination virtual hard drive must not exist. + * + * @member {object} [sourceVirtualMachine] The source virtual machine from + * which Image is created. + * @member {string} [sourceVirtualMachine.id] Resource Id + * @member {object} [storageProfile] Specifies the storage settings for the + * virtual machine disks. + * @member {object} [storageProfile.osDisk] Specifies information about the + * operating system disk used by the virtual machine.

    For more + * information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @member {string} [storageProfile.osDisk.osType] This property allows you to + * specify the type of the OS that is included in the disk if creating a VM + * from a custom image.

    Possible values are:

    **Windows** + *

    **Linux**. Possible values include: 'Windows', 'Linux' + * @member {string} [storageProfile.osDisk.osState] The OS State. Possible + * values include: 'Generalized', 'Specialized' + * @member {object} [storageProfile.osDisk.snapshot] The snapshot. + * @member {string} [storageProfile.osDisk.snapshot.id] Resource Id + * @member {object} [storageProfile.osDisk.managedDisk] The managedDisk. + * @member {string} [storageProfile.osDisk.managedDisk.id] Resource Id + * @member {string} [storageProfile.osDisk.blobUri] The Virtual Hard Disk. + * @member {string} [storageProfile.osDisk.caching] Specifies the caching + * requirements.

    Possible values are:

    **None**

    + * **ReadOnly**

    **ReadWrite**

    Default: **None for Standard + * storage. ReadOnly for Premium storage**. Possible values include: 'None', + * 'ReadOnly', 'ReadWrite' + * @member {number} [storageProfile.osDisk.diskSizeGB] Specifies the size of + * empty data disks in gigabytes. This element can be used to overwrite the + * name of the disk in a virtual machine image.

    This value cannot be + * larger than 1023 GB + * @member {string} [storageProfile.osDisk.storageAccountType] Specifies the + * storage account type for the managed disk. Possible values are: Standard_LRS + * or Premium_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS' + * @member {array} [storageProfile.dataDisks] Specifies the parameters that are + * used to add a data disk to a virtual machine.

    For more information + * about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @member {boolean} [storageProfile.zoneResilient] Specifies whether an image + * is zone resilient or not. Default is false. Zone resilient images can be + * created only in regions that provide Zone Redundant Storage (ZRS). + * @member {string} [provisioningState] The provisioning state. + */ +export interface ImageUpdate extends UpdateResource { + sourceVirtualMachine?: SubResource; + storageProfile?: ImageStorageProfile; + readonly provisioningState?: string; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineScaleSetIdentity class. + * @constructor + * Identity for the virtual machine scale set. + * + * @member {string} [principalId] The principal id of virtual machine scale set + * identity. This property will only be provided for a system assigned + * identity. + * @member {string} [tenantId] The tenant id associated with the virtual + * machine scale set. This property will only be provided for a system assigned + * identity. + * @member {string} [type] The type of identity used for the virtual machine + * scale set. The type 'SystemAssigned, UserAssigned' includes both an + * implicitly created identity and a set of user assigned identities. The type + * 'None' will remove any identities from the virtual machine scale set. + * Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, + * UserAssigned', 'None' + * @member {array} [identityIds] The list of user identities associated with + * the virtual machine scale set. The user identity references will be ARM + * resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + */ +export interface VirtualMachineScaleSetIdentity { + readonly principalId?: string; + readonly tenantId?: string; + type?: string; + identityIds?: string[]; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineScaleSetOSProfile class. + * @constructor + * Describes a virtual machine scale set OS profile. + * + * @member {string} [computerNamePrefix] Specifies the computer name prefix for + * all of the virtual machines in the scale set. Computer name prefixes must be + * 1 to 15 characters long. + * @member {string} [adminUsername] Specifies the name of the administrator + * account.

    **Windows-only restriction:** Cannot end in "."

    + * **Disallowed values:** "administrator", "admin", "user", "user1", "test", + * "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", + * "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", + * "root", "server", "sql", "support", "support_388945a0", "sys", "test2", + * "test3", "user4", "user5".

    **Minimum-length (Linux):** 1 character + *

    **Max-length (Linux):** 64 characters

    **Max-length + * (Windows):** 20 characters

  • For root access to the Linux VM, + * see [Using root privileges on Linux virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in this + * field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * @member {string} [adminPassword] Specifies the password of the administrator + * account.

    **Minimum-length (Windows):** 8 characters

    + * **Minimum-length (Linux):** 6 characters

    **Max-length (Windows):** + * 123 characters

    **Max-length (Linux):** 72 characters

    + * **Complexity requirements:** 3 out of 4 conditions below need to be + * fulfilled
    Has lower characters
    Has upper characters
    Has a + * digit
    Has a special character (Regex match [\W_])

    **Disallowed + * values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", + * "pass@word1", "Password!", "Password1", "Password22", "iloveyou!"

    + * For resetting the password, see [How to reset the Remote Desktop service or + * its login password in a Windows + * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    For resetting root password, see [Manage users, SSH, and check or + * repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + * @member {string} [customData] Specifies a base-64 encoded string of custom + * data. The base-64 encoded string is decoded to a binary array that is saved + * as a file on the Virtual Machine. The maximum length of the binary array is + * 65535 bytes.

    For using cloud-init for your VM, see [Using + * cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * @member {object} [windowsConfiguration] Specifies Windows operating system + * settings on the virtual machine. + * @member {boolean} [windowsConfiguration.provisionVMAgent] Indicates whether + * virtual machine agent should be provisioned on the virtual machine.

    + * When this property is not specified in the request body, default behavior is + * to set it to true. This will ensure that VM Agent is installed on the VM so + * that extensions can be added to the VM later. + * @member {boolean} [windowsConfiguration.enableAutomaticUpdates] Indicates + * whether virtual machine is enabled for automatic updates. + * @member {string} [windowsConfiguration.timeZone] Specifies the time zone of + * the virtual machine. e.g. "Pacific Standard Time" + * @member {array} [windowsConfiguration.additionalUnattendContent] Specifies + * additional base-64 encoded XML formatted information that can be included in + * the Unattend.xml file, which is used by Windows Setup. + * @member {object} [windowsConfiguration.winRM] Specifies the Windows Remote + * Management listeners. This enables remote Windows PowerShell. + * @member {array} [windowsConfiguration.winRM.listeners] The list of Windows + * Remote Management listeners + * @member {object} [linuxConfiguration] Specifies the Linux operating system + * settings on the virtual machine.

    For a list of supported Linux + * distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * @member {boolean} [linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * @member {object} [linuxConfiguration.ssh] Specifies the ssh key + * configuration for a Linux OS. + * @member {array} [linuxConfiguration.ssh.publicKeys] The list of SSH public + * keys used to authenticate with linux based VMs. + * @member {array} [secrets] Specifies set of certificates that should be + * installed onto the virtual machines in the scale set. + */ +export interface VirtualMachineScaleSetOSProfile { + computerNamePrefix?: string; + adminUsername?: string; + adminPassword?: string; + customData?: string; + windowsConfiguration?: WindowsConfiguration; + linuxConfiguration?: LinuxConfiguration; + secrets?: VaultSecretGroup[]; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineScaleSetUpdateOSProfile class. + * @constructor + * Describes a virtual machine scale set OS profile. + * + * @member {string} [customData] A base-64 encoded string of custom data. + * @member {object} [windowsConfiguration] The Windows Configuration of the OS + * profile. + * @member {boolean} [windowsConfiguration.provisionVMAgent] Indicates whether + * virtual machine agent should be provisioned on the virtual machine.

    + * When this property is not specified in the request body, default behavior is + * to set it to true. This will ensure that VM Agent is installed on the VM so + * that extensions can be added to the VM later. + * @member {boolean} [windowsConfiguration.enableAutomaticUpdates] Indicates + * whether virtual machine is enabled for automatic updates. + * @member {string} [windowsConfiguration.timeZone] Specifies the time zone of + * the virtual machine. e.g. "Pacific Standard Time" + * @member {array} [windowsConfiguration.additionalUnattendContent] Specifies + * additional base-64 encoded XML formatted information that can be included in + * the Unattend.xml file, which is used by Windows Setup. + * @member {object} [windowsConfiguration.winRM] Specifies the Windows Remote + * Management listeners. This enables remote Windows PowerShell. + * @member {array} [windowsConfiguration.winRM.listeners] The list of Windows + * Remote Management listeners + * @member {object} [linuxConfiguration] The Linux Configuration of the OS + * profile. + * @member {boolean} [linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * @member {object} [linuxConfiguration.ssh] Specifies the ssh key + * configuration for a Linux OS. + * @member {array} [linuxConfiguration.ssh.publicKeys] The list of SSH public + * keys used to authenticate with linux based VMs. + * @member {array} [secrets] The List of certificates for addition to the VM. + */ +export interface VirtualMachineScaleSetUpdateOSProfile { + customData?: string; + windowsConfiguration?: WindowsConfiguration; + linuxConfiguration?: LinuxConfiguration; + secrets?: VaultSecretGroup[]; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineScaleSetManagedDiskParameters class. + * @constructor + * Describes the parameters of a ScaleSet managed disk. + * + * @member {string} [storageAccountType] Specifies the storage account type for + * the managed disk. Possible values are: Standard_LRS or Premium_LRS. Possible + * values include: 'Standard_LRS', 'Premium_LRS' + */ +export interface VirtualMachineScaleSetManagedDiskParameters { + storageAccountType?: string; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineScaleSetOSDisk class. + * @constructor + * Describes a virtual machine scale set operating system disk. + * + * @member {string} [name] The disk name. + * @member {string} [caching] Specifies the caching requirements.

    + * Possible values are:

    **None**

    **ReadOnly**

    + * **ReadWrite**

    Default: **None for Standard storage. ReadOnly for + * Premium storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite' + * @member {boolean} [writeAcceleratorEnabled] Specifies whether + * writeAccelerator should be enabled or disabled on the disk. + * @member {string} createOption Specifies how the virtual machines in the + * scale set should be created.

    The only allowed value is: + * **FromImage** \u2013 This value is used when you are using an image to + * create the virtual machine. If you are using a platform image, you also use + * the imageReference element described above. If you are using a marketplace + * image, you also use the plan element previously described. Possible values + * include: 'FromImage', 'Empty', 'Attach' + * @member {string} [osType] This property allows you to specify the type of + * the OS that is included in the disk if creating a VM from user-image or a + * specialized VHD.

    Possible values are:

    **Windows**

    + * **Linux**. Possible values include: 'Windows', 'Linux' + * @member {object} [image] Specifies information about the unmanaged user + * image to base the scale set on. + * @member {string} [image.uri] Specifies the virtual hard disk's uri. + * @member {array} [vhdContainers] Specifies the container urls that are used + * to store operating system disks for the scale set. + * @member {object} [managedDisk] The managed disk parameters. + * @member {string} [managedDisk.storageAccountType] Specifies the storage + * account type for the managed disk. Possible values are: Standard_LRS or + * Premium_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS' + */ +export interface VirtualMachineScaleSetOSDisk { + name?: string; + caching?: string; + writeAcceleratorEnabled?: boolean; + createOption: string; + osType?: string; + image?: VirtualHardDisk; + vhdContainers?: string[]; + managedDisk?: VirtualMachineScaleSetManagedDiskParameters; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineScaleSetUpdateOSDisk class. + * @constructor + * Describes virtual machine scale set operating system disk Update Object. + * This should be used for Updating VMSS OS Disk. + * + * @member {string} [caching] The caching type. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * @member {boolean} [writeAcceleratorEnabled] Specifies whether + * writeAccelerator should be enabled or disabled on the disk. + * @member {object} [image] The Source User Image VirtualHardDisk. This + * VirtualHardDisk will be copied before using it to attach to the Virtual + * Machine. If SourceImage is provided, the destination VirtualHardDisk should + * not exist. + * @member {string} [image.uri] Specifies the virtual hard disk's uri. + * @member {array} [vhdContainers] The list of virtual hard disk container + * uris. + * @member {object} [managedDisk] The managed disk parameters. + * @member {string} [managedDisk.storageAccountType] Specifies the storage + * account type for the managed disk. Possible values are: Standard_LRS or + * Premium_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS' + */ +export interface VirtualMachineScaleSetUpdateOSDisk { + caching?: string; + writeAcceleratorEnabled?: boolean; + image?: VirtualHardDisk; + vhdContainers?: string[]; + managedDisk?: VirtualMachineScaleSetManagedDiskParameters; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineScaleSetDataDisk class. + * @constructor + * Describes a virtual machine scale set data disk. + * + * @member {string} [name] The disk name. + * @member {number} lun Specifies the logical unit number of the data disk. + * This value is used to identify data disks within the VM and therefore must + * be unique for each data disk attached to a VM. + * @member {string} [caching] Specifies the caching requirements.

    + * Possible values are:

    **None**

    **ReadOnly**

    + * **ReadWrite**

    Default: **None for Standard storage. ReadOnly for + * Premium storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite' + * @member {boolean} [writeAcceleratorEnabled] Specifies whether + * writeAccelerator should be enabled or disabled on the disk. + * @member {string} createOption The create option. Possible values include: + * 'FromImage', 'Empty', 'Attach' + * @member {number} [diskSizeGB] Specifies the size of an empty data disk in + * gigabytes. This element can be used to overwrite the name of the disk in a + * virtual machine image.

    This value cannot be larger than 1023 GB + * @member {object} [managedDisk] The managed disk parameters. + * @member {string} [managedDisk.storageAccountType] Specifies the storage + * account type for the managed disk. Possible values are: Standard_LRS or + * Premium_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS' + */ +export interface VirtualMachineScaleSetDataDisk { + name?: string; + lun: number; + caching?: string; + writeAcceleratorEnabled?: boolean; + createOption: string; + diskSizeGB?: number; + managedDisk?: VirtualMachineScaleSetManagedDiskParameters; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineScaleSetStorageProfile class. + * @constructor + * Describes a virtual machine scale set storage profile. + * + * @member {object} [imageReference] Specifies information about the image to + * use. You can specify information about platform images, marketplace images, + * or virtual machine images. This element is required when you want to use a + * platform image, marketplace image, or virtual machine image, but is not used + * in other creation operations. + * @member {string} [imageReference.publisher] The image publisher. + * @member {string} [imageReference.offer] Specifies the offer of the platform + * image or marketplace image used to create the virtual machine. + * @member {string} [imageReference.sku] The image SKU. + * @member {string} [imageReference.version] Specifies the version of the + * platform image or marketplace image used to create the virtual machine. The + * allowed formats are Major.Minor.Build or 'latest'. Major, Minor, and Build + * are decimal numbers. Specify 'latest' to use the latest version of an image + * available at deploy time. Even if you use 'latest', the VM image will not + * automatically update after deploy time even if a new version becomes + * available. + * @member {object} [osDisk] Specifies information about the operating system + * disk used by the virtual machines in the scale set.

    For more + * information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @member {string} [osDisk.name] The disk name. + * @member {string} [osDisk.caching] Specifies the caching requirements. + *

    Possible values are:

    **None**

    **ReadOnly** + *

    **ReadWrite**

    Default: **None for Standard storage. + * ReadOnly for Premium storage**. Possible values include: 'None', 'ReadOnly', + * 'ReadWrite' + * @member {boolean} [osDisk.writeAcceleratorEnabled] Specifies whether + * writeAccelerator should be enabled or disabled on the disk. + * @member {string} [osDisk.createOption] Specifies how the virtual machines in + * the scale set should be created.

    The only allowed value is: + * **FromImage** \u2013 This value is used when you are using an image to + * create the virtual machine. If you are using a platform image, you also use + * the imageReference element described above. If you are using a marketplace + * image, you also use the plan element previously described. Possible values + * include: 'FromImage', 'Empty', 'Attach' + * @member {string} [osDisk.osType] This property allows you to specify the + * type of the OS that is included in the disk if creating a VM from user-image + * or a specialized VHD.

    Possible values are:

    **Windows** + *

    **Linux**. Possible values include: 'Windows', 'Linux' + * @member {object} [osDisk.image] Specifies information about the unmanaged + * user image to base the scale set on. + * @member {string} [osDisk.image.uri] Specifies the virtual hard disk's uri. + * @member {array} [osDisk.vhdContainers] Specifies the container urls that are + * used to store operating system disks for the scale set. + * @member {object} [osDisk.managedDisk] The managed disk parameters. + * @member {string} [osDisk.managedDisk.storageAccountType] Specifies the + * storage account type for the managed disk. Possible values are: Standard_LRS + * or Premium_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS' + * @member {array} [dataDisks] Specifies the parameters that are used to add + * data disks to the virtual machines in the scale set.

    For more + * information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + */ +export interface VirtualMachineScaleSetStorageProfile { + imageReference?: ImageReference; + osDisk?: VirtualMachineScaleSetOSDisk; + dataDisks?: VirtualMachineScaleSetDataDisk[]; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineScaleSetUpdateStorageProfile class. + * @constructor + * Describes a virtual machine scale set storage profile. + * + * @member {object} [imageReference] The image reference. + * @member {string} [imageReference.publisher] The image publisher. + * @member {string} [imageReference.offer] Specifies the offer of the platform + * image or marketplace image used to create the virtual machine. + * @member {string} [imageReference.sku] The image SKU. + * @member {string} [imageReference.version] Specifies the version of the + * platform image or marketplace image used to create the virtual machine. The + * allowed formats are Major.Minor.Build or 'latest'. Major, Minor, and Build + * are decimal numbers. Specify 'latest' to use the latest version of an image + * available at deploy time. Even if you use 'latest', the VM image will not + * automatically update after deploy time even if a new version becomes + * available. + * @member {object} [osDisk] The OS disk. + * @member {string} [osDisk.caching] The caching type. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * @member {boolean} [osDisk.writeAcceleratorEnabled] Specifies whether + * writeAccelerator should be enabled or disabled on the disk. + * @member {object} [osDisk.image] The Source User Image VirtualHardDisk. This + * VirtualHardDisk will be copied before using it to attach to the Virtual + * Machine. If SourceImage is provided, the destination VirtualHardDisk should + * not exist. + * @member {string} [osDisk.image.uri] Specifies the virtual hard disk's uri. + * @member {array} [osDisk.vhdContainers] The list of virtual hard disk + * container uris. + * @member {object} [osDisk.managedDisk] The managed disk parameters. + * @member {string} [osDisk.managedDisk.storageAccountType] Specifies the + * storage account type for the managed disk. Possible values are: Standard_LRS + * or Premium_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS' + * @member {array} [dataDisks] The data disks. + */ +export interface VirtualMachineScaleSetUpdateStorageProfile { + imageReference?: ImageReference; + osDisk?: VirtualMachineScaleSetUpdateOSDisk; + dataDisks?: VirtualMachineScaleSetDataDisk[]; +} + +/** + * @class + * Initializes a new instance of the ApiEntityReference class. + * @constructor + * The API entity reference. + * + * @member {string} [id] The ARM resource id in the form of + * /subscriptions/{SubcriptionId}/resourceGroups/{ResourceGroupName}/... + */ +export interface ApiEntityReference { + id?: string; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings class. + * @constructor + * Describes a virtual machines scale sets network configuration's DNS + * settings. + * + * @member {string} domainNameLabel The Domain name label.The concatenation of + * the domain name label and vm index will be the domain name labels of the + * PublicIPAddress resources that will be created + */ +export interface VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings { + domainNameLabel: string; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineScaleSetPublicIPAddressConfiguration class. + * @constructor + * Describes a virtual machines scale set IP Configuration's PublicIPAddress + * configuration + * + * @member {string} name The publicIP address configuration name. + * @member {number} [idleTimeoutInMinutes] The idle timeout of the public IP + * address. + * @member {object} [dnsSettings] The dns settings to be applied on the + * publicIP addresses . + * @member {string} [dnsSettings.domainNameLabel] The Domain name label.The + * concatenation of the domain name label and vm index will be the domain name + * labels of the PublicIPAddress resources that will be created + */ +export interface VirtualMachineScaleSetPublicIPAddressConfiguration { + name: string; + idleTimeoutInMinutes?: number; + dnsSettings?: VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineScaleSetUpdatePublicIPAddressConfiguration class. + * @constructor + * Describes a virtual machines scale set IP Configuration's PublicIPAddress + * configuration + * + * @member {string} [name] The publicIP address configuration name. + * @member {number} [idleTimeoutInMinutes] The idle timeout of the public IP + * address. + * @member {object} [dnsSettings] The dns settings to be applied on the + * publicIP addresses . + * @member {string} [dnsSettings.domainNameLabel] The Domain name label.The + * concatenation of the domain name label and vm index will be the domain name + * labels of the PublicIPAddress resources that will be created + */ +export interface VirtualMachineScaleSetUpdatePublicIPAddressConfiguration { + name?: string; + idleTimeoutInMinutes?: number; + dnsSettings?: VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineScaleSetIPConfiguration class. + * @constructor + * Describes a virtual machine scale set network profile's IP configuration. + * + * @member {string} name The IP configuration name. + * @member {object} [subnet] Specifies the identifier of the subnet. + * @member {string} [subnet.id] The ARM resource id in the form of + * /subscriptions/{SubcriptionId}/resourceGroups/{ResourceGroupName}/... + * @member {boolean} [primary] Specifies the primary network interface in case + * the virtual machine has more than 1 network interface. + * @member {object} [publicIPAddressConfiguration] The + * publicIPAddressConfiguration. + * @member {string} [publicIPAddressConfiguration.name] The publicIP address + * configuration name. + * @member {number} [publicIPAddressConfiguration.idleTimeoutInMinutes] The + * idle timeout of the public IP address. + * @member {object} [publicIPAddressConfiguration.dnsSettings] The dns settings + * to be applied on the publicIP addresses . + * @member {string} [publicIPAddressConfiguration.dnsSettings.domainNameLabel] + * The Domain name label.The concatenation of the domain name label and vm + * index will be the domain name labels of the PublicIPAddress resources that + * will be created + * @member {string} [privateIPAddressVersion] Available from Api-Version + * 2017-03-30 onwards, it represents whether the specific ipconfiguration is + * IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and + * 'IPv6'. Possible values include: 'IPv4', 'IPv6' + * @member {array} [applicationGatewayBackendAddressPools] Specifies an array + * of references to backend address pools of application gateways. A scale set + * can reference backend address pools of multiple application gateways. + * Multiple scale sets cannot use the same application gateway. + * @member {array} [loadBalancerBackendAddressPools] Specifies an array of + * references to backend address pools of load balancers. A scale set can + * reference backend address pools of one public and one internal load + * balancer. Multiple scale sets cannot use the same load balancer. + * @member {array} [loadBalancerInboundNatPools] Specifies an array of + * references to inbound Nat pools of the load balancers. A scale set can + * reference inbound nat pools of one public and one internal load balancer. + * Multiple scale sets cannot use the same load balancer + */ +export interface VirtualMachineScaleSetIPConfiguration extends SubResource { + name: string; + subnet?: ApiEntityReference; + primary?: boolean; + publicIPAddressConfiguration?: VirtualMachineScaleSetPublicIPAddressConfiguration; + privateIPAddressVersion?: string; + applicationGatewayBackendAddressPools?: SubResource[]; + loadBalancerBackendAddressPools?: SubResource[]; + loadBalancerInboundNatPools?: SubResource[]; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineScaleSetUpdateIPConfiguration class. + * @constructor + * Describes a virtual machine scale set network profile's IP configuration. + * + * @member {string} [name] The IP configuration name. + * @member {object} [subnet] The subnet. + * @member {string} [subnet.id] The ARM resource id in the form of + * /subscriptions/{SubcriptionId}/resourceGroups/{ResourceGroupName}/... + * @member {boolean} [primary] Specifies the primary IP Configuration in case + * the network interface has more than one IP Configuration. + * @member {object} [publicIPAddressConfiguration] The + * publicIPAddressConfiguration. + * @member {string} [publicIPAddressConfiguration.name] The publicIP address + * configuration name. + * @member {number} [publicIPAddressConfiguration.idleTimeoutInMinutes] The + * idle timeout of the public IP address. + * @member {object} [publicIPAddressConfiguration.dnsSettings] The dns settings + * to be applied on the publicIP addresses . + * @member {string} [publicIPAddressConfiguration.dnsSettings.domainNameLabel] + * The Domain name label.The concatenation of the domain name label and vm + * index will be the domain name labels of the PublicIPAddress resources that + * will be created + * @member {string} [privateIPAddressVersion] Available from Api-Version + * 2017-03-30 onwards, it represents whether the specific ipconfiguration is + * IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and + * 'IPv6'. Possible values include: 'IPv4', 'IPv6' + * @member {array} [applicationGatewayBackendAddressPools] The application + * gateway backend address pools. + * @member {array} [loadBalancerBackendAddressPools] The load balancer backend + * address pools. + * @member {array} [loadBalancerInboundNatPools] The load balancer inbound nat + * pools. + */ +export interface VirtualMachineScaleSetUpdateIPConfiguration extends SubResource { + name?: string; + subnet?: ApiEntityReference; + primary?: boolean; + publicIPAddressConfiguration?: VirtualMachineScaleSetUpdatePublicIPAddressConfiguration; + privateIPAddressVersion?: string; + applicationGatewayBackendAddressPools?: SubResource[]; + loadBalancerBackendAddressPools?: SubResource[]; + loadBalancerInboundNatPools?: SubResource[]; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineScaleSetNetworkConfigurationDnsSettings class. + * @constructor + * Describes a virtual machines scale sets network configuration's DNS + * settings. + * + * @member {array} [dnsServers] List of DNS servers IP addresses + */ +export interface VirtualMachineScaleSetNetworkConfigurationDnsSettings { + dnsServers?: string[]; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineScaleSetNetworkConfiguration class. + * @constructor + * Describes a virtual machine scale set network profile's network + * configurations. + * + * @member {string} name The network configuration name. + * @member {boolean} [primary] Specifies the primary network interface in case + * the virtual machine has more than 1 network interface. + * @member {boolean} [enableAcceleratedNetworking] Specifies whether the + * network interface is accelerated networking-enabled. + * @member {object} [networkSecurityGroup] The network security group. + * @member {string} [networkSecurityGroup.id] Resource Id + * @member {object} [dnsSettings] The dns settings to be applied on the network + * interfaces. + * @member {array} [dnsSettings.dnsServers] List of DNS servers IP addresses + * @member {array} ipConfigurations Specifies the IP configurations of the + * network interface. + * @member {boolean} [enableIPForwarding] Whether IP forwarding enabled on this + * NIC. + */ +export interface VirtualMachineScaleSetNetworkConfiguration extends SubResource { + name: string; + primary?: boolean; + enableAcceleratedNetworking?: boolean; + networkSecurityGroup?: SubResource; + dnsSettings?: VirtualMachineScaleSetNetworkConfigurationDnsSettings; + ipConfigurations: VirtualMachineScaleSetIPConfiguration[]; + enableIPForwarding?: boolean; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineScaleSetUpdateNetworkConfiguration class. + * @constructor + * Describes a virtual machine scale set network profile's network + * configurations. + * + * @member {string} [name] The network configuration name. + * @member {boolean} [primary] Whether this is a primary NIC on a virtual + * machine. + * @member {boolean} [enableAcceleratedNetworking] Specifies whether the + * network interface is accelerated networking-enabled. + * @member {object} [networkSecurityGroup] The network security group. + * @member {string} [networkSecurityGroup.id] Resource Id + * @member {object} [dnsSettings] The dns settings to be applied on the network + * interfaces. + * @member {array} [dnsSettings.dnsServers] List of DNS servers IP addresses + * @member {array} [ipConfigurations] The virtual machine scale set IP + * Configuration. + * @member {boolean} [enableIPForwarding] Whether IP forwarding enabled on this + * NIC. + */ +export interface VirtualMachineScaleSetUpdateNetworkConfiguration extends SubResource { + name?: string; + primary?: boolean; + enableAcceleratedNetworking?: boolean; + networkSecurityGroup?: SubResource; + dnsSettings?: VirtualMachineScaleSetNetworkConfigurationDnsSettings; + ipConfigurations?: VirtualMachineScaleSetUpdateIPConfiguration[]; + enableIPForwarding?: boolean; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineScaleSetNetworkProfile class. + * @constructor + * Describes a virtual machine scale set network profile. + * + * @member {object} [healthProbe] A reference to a load balancer probe used to + * determine the health of an instance in the virtual machine scale set. The + * reference will be in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. + * @member {string} [healthProbe.id] The ARM resource id in the form of + * /subscriptions/{SubcriptionId}/resourceGroups/{ResourceGroupName}/... + * @member {array} [networkInterfaceConfigurations] The list of network + * configurations. + */ +export interface VirtualMachineScaleSetNetworkProfile { + healthProbe?: ApiEntityReference; + networkInterfaceConfigurations?: VirtualMachineScaleSetNetworkConfiguration[]; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineScaleSetUpdateNetworkProfile class. + * @constructor + * Describes a virtual machine scale set network profile. + * + * @member {array} [networkInterfaceConfigurations] The list of network + * configurations. + */ +export interface VirtualMachineScaleSetUpdateNetworkProfile { + networkInterfaceConfigurations?: VirtualMachineScaleSetUpdateNetworkConfiguration[]; +} + +/** + * @class + * Initializes a new instance of the SubResourceReadOnly class. + * @constructor + * @member {string} [id] Resource Id + */ +export interface SubResourceReadOnly extends BaseResource { + readonly id?: string; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineScaleSetExtension class. + * @constructor + * Describes a Virtual Machine Scale Set Extension. + * + * @member {string} [name] The name of the extension. + * @member {string} [forceUpdateTag] If a value is provided and is different + * from the previous value, the extension handler will be forced to update even + * if the extension configuration has not changed. + * @member {string} [publisher] The name of the extension handler publisher. + * @member {string} [type] Specifies the type of the extension; an example is + * "CustomScriptExtension". + * @member {string} [typeHandlerVersion] Specifies the version of the script + * handler. + * @member {boolean} [autoUpgradeMinorVersion] Indicates whether the extension + * should use a newer minor version if one is available at deployment time. + * Once deployed, however, the extension will not upgrade minor versions unless + * redeployed, even with this property set to true. + * @member {object} [settings] Json formatted public settings for the + * extension. + * @member {object} [protectedSettings] The extension can contain either + * protectedSettings or protectedSettingsFromKeyVault or no protected settings + * at all. + * @member {string} [provisioningState] The provisioning state, which only + * appears in the response. + */ +export interface VirtualMachineScaleSetExtension extends SubResourceReadOnly { + name?: string; + forceUpdateTag?: string; + publisher?: string; + type?: string; + typeHandlerVersion?: string; + autoUpgradeMinorVersion?: boolean; + settings?: any; + protectedSettings?: any; + readonly provisioningState?: string; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineScaleSetExtensionProfile class. + * @constructor + * Describes a virtual machine scale set extension profile. + * + * @member {array} [extensions] The virtual machine scale set child extension + * resources. + */ +export interface VirtualMachineScaleSetExtensionProfile { + extensions?: VirtualMachineScaleSetExtension[]; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineScaleSetVMProfile class. + * @constructor + * Describes a virtual machine scale set virtual machine profile. + * + * @member {object} [osProfile] Specifies the operating system settings for the + * virtual machines in the scale set. + * @member {string} [osProfile.computerNamePrefix] Specifies the computer name + * prefix for all of the virtual machines in the scale set. Computer name + * prefixes must be 1 to 15 characters long. + * @member {string} [osProfile.adminUsername] Specifies the name of the + * administrator account.

    **Windows-only restriction:** Cannot end in + * "."

    **Disallowed values:** "administrator", "admin", "user", + * "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", + * "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", + * "john", "owner", "root", "server", "sql", "support", "support_388945a0", + * "sys", "test2", "test3", "user4", "user5".

    **Minimum-length + * (Linux):** 1 character

    **Max-length (Linux):** 64 characters + *

    **Max-length (Windows):** 20 characters

  • For root + * access to the Linux VM, see [Using root privileges on Linux virtual machines + * in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in this + * field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * @member {string} [osProfile.adminPassword] Specifies the password of the + * administrator account.

    **Minimum-length (Windows):** 8 characters + *

    **Minimum-length (Linux):** 6 characters

    **Max-length + * (Windows):** 123 characters

    **Max-length (Linux):** 72 characters + *

    **Complexity requirements:** 3 out of 4 conditions below need to be + * fulfilled
    Has lower characters
    Has upper characters
    Has a + * digit
    Has a special character (Regex match [\W_])

    **Disallowed + * values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", + * "pass@word1", "Password!", "Password1", "Password22", "iloveyou!"

    + * For resetting the password, see [How to reset the Remote Desktop service or + * its login password in a Windows + * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    For resetting root password, see [Manage users, SSH, and check or + * repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + * @member {string} [osProfile.customData] Specifies a base-64 encoded string + * of custom data. The base-64 encoded string is decoded to a binary array that + * is saved as a file on the Virtual Machine. The maximum length of the binary + * array is 65535 bytes.

    For using cloud-init for your VM, see [Using + * cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * @member {object} [osProfile.windowsConfiguration] Specifies Windows + * operating system settings on the virtual machine. + * @member {boolean} [osProfile.windowsConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * @member {boolean} [osProfile.windowsConfiguration.enableAutomaticUpdates] + * Indicates whether virtual machine is enabled for automatic updates. + * @member {string} [osProfile.windowsConfiguration.timeZone] Specifies the + * time zone of the virtual machine. e.g. "Pacific Standard Time" + * @member {array} [osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * @member {object} [osProfile.windowsConfiguration.winRM] Specifies the + * Windows Remote Management listeners. This enables remote Windows PowerShell. + * @member {array} [osProfile.windowsConfiguration.winRM.listeners] The list of + * Windows Remote Management listeners + * @member {object} [osProfile.linuxConfiguration] Specifies the Linux + * operating system settings on the virtual machine.

    For a list of + * supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * @member {boolean} + * [osProfile.linuxConfiguration.disablePasswordAuthentication] Specifies + * whether password authentication should be disabled. + * @member {object} [osProfile.linuxConfiguration.ssh] Specifies the ssh key + * configuration for a Linux OS. + * @member {array} [osProfile.linuxConfiguration.ssh.publicKeys] The list of + * SSH public keys used to authenticate with linux based VMs. + * @member {array} [osProfile.secrets] Specifies set of certificates that + * should be installed onto the virtual machines in the scale set. + * @member {object} [storageProfile] Specifies the storage settings for the + * virtual machine disks. + * @member {object} [storageProfile.imageReference] Specifies information about + * the image to use. You can specify information about platform images, + * marketplace images, or virtual machine images. This element is required when + * you want to use a platform image, marketplace image, or virtual machine + * image, but is not used in other creation operations. + * @member {string} [storageProfile.imageReference.publisher] The image + * publisher. + * @member {string} [storageProfile.imageReference.offer] Specifies the offer + * of the platform image or marketplace image used to create the virtual + * machine. + * @member {string} [storageProfile.imageReference.sku] The image SKU. + * @member {string} [storageProfile.imageReference.version] Specifies the + * version of the platform image or marketplace image used to create the + * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the + * latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. + * @member {object} [storageProfile.osDisk] Specifies information about the + * operating system disk used by the virtual machines in the scale set. + *

    For more information about disks, see [About disks and VHDs for + * Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @member {string} [storageProfile.osDisk.name] The disk name. + * @member {string} [storageProfile.osDisk.caching] Specifies the caching + * requirements.

    Possible values are:

    **None**

    + * **ReadOnly**

    **ReadWrite**

    Default: **None for Standard + * storage. ReadOnly for Premium storage**. Possible values include: 'None', + * 'ReadOnly', 'ReadWrite' + * @member {boolean} [storageProfile.osDisk.writeAcceleratorEnabled] Specifies + * whether writeAccelerator should be enabled or disabled on the disk. + * @member {string} [storageProfile.osDisk.createOption] Specifies how the + * virtual machines in the scale set should be created.

    The only + * allowed value is: **FromImage** \u2013 This value is used when you are using + * an image to create the virtual machine. If you are using a platform image, + * you also use the imageReference element described above. If you are using a + * marketplace image, you also use the plan element previously described. + * Possible values include: 'FromImage', 'Empty', 'Attach' + * @member {string} [storageProfile.osDisk.osType] This property allows you to + * specify the type of the OS that is included in the disk if creating a VM + * from user-image or a specialized VHD.

    Possible values are:

    + * **Windows**

    **Linux**. Possible values include: 'Windows', 'Linux' + * @member {object} [storageProfile.osDisk.image] Specifies information about + * the unmanaged user image to base the scale set on. + * @member {string} [storageProfile.osDisk.image.uri] Specifies the virtual + * hard disk's uri. + * @member {array} [storageProfile.osDisk.vhdContainers] Specifies the + * container urls that are used to store operating system disks for the scale + * set. + * @member {object} [storageProfile.osDisk.managedDisk] The managed disk + * parameters. + * @member {string} [storageProfile.osDisk.managedDisk.storageAccountType] + * Specifies the storage account type for the managed disk. Possible values + * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * @member {array} [storageProfile.dataDisks] Specifies the parameters that are + * used to add data disks to the virtual machines in the scale set.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @member {object} [networkProfile] Specifies properties of the network + * interfaces of the virtual machines in the scale set. + * @member {object} [networkProfile.healthProbe] A reference to a load balancer + * probe used to determine the health of an instance in the virtual machine + * scale set. The reference will be in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. + * @member {string} [networkProfile.healthProbe.id] The ARM resource id in the + * form of + * /subscriptions/{SubcriptionId}/resourceGroups/{ResourceGroupName}/... + * @member {array} [networkProfile.networkInterfaceConfigurations] The list of + * network configurations. + * @member {object} [diagnosticsProfile] Specifies the boot diagnostic settings + * state.

    Minimum api-version: 2015-06-15. + * @member {object} [diagnosticsProfile.bootDiagnostics] Boot Diagnostics is a + * debugging feature which allows you to view Console Output and Screenshot to + * diagnose VM status.

    For Linux Virtual Machines, you can easily view + * the output of your console log.

    For both Windows and Linux virtual + * machines, Azure also enables you to see a screenshot of the VM from the + * hypervisor. + * @member {boolean} [diagnosticsProfile.bootDiagnostics.enabled] Whether boot + * diagnostics should be enabled on the Virtual Machine. + * @member {string} [diagnosticsProfile.bootDiagnostics.storageUri] Uri of the + * storage account to use for placing the console output and screenshot. + * @member {object} [extensionProfile] Specifies a collection of settings for + * extensions installed on virtual machines in the scale set. + * @member {array} [extensionProfile.extensions] The virtual machine scale set + * child extension resources. + * @member {string} [licenseType] Specifies that the image or disk that is + * being used was licensed on-premises. This element is only used for images + * that contain the Windows Server operating system.

    Possible values + * are:

    Windows_Client

    Windows_Server

    If this + * element is included in a request for an update, the value must match the + * initial value. This value cannot be updated.

    For more information, + * see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Minimum api-version: 2015-06-15 + * @member {string} [priority] Specifies the priority for the virtual machines + * in the scale set.

    Minimum api-version: 2017-10-30-preview. Possible + * values include: 'Regular', 'Low' + */ +export interface VirtualMachineScaleSetVMProfile { + osProfile?: VirtualMachineScaleSetOSProfile; + storageProfile?: VirtualMachineScaleSetStorageProfile; + networkProfile?: VirtualMachineScaleSetNetworkProfile; + diagnosticsProfile?: DiagnosticsProfile; + extensionProfile?: VirtualMachineScaleSetExtensionProfile; + licenseType?: string; + priority?: string; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineScaleSetUpdateVMProfile class. + * @constructor + * Describes a virtual machine scale set virtual machine profile. + * + * @member {object} [osProfile] The virtual machine scale set OS profile. + * @member {string} [osProfile.customData] A base-64 encoded string of custom + * data. + * @member {object} [osProfile.windowsConfiguration] The Windows Configuration + * of the OS profile. + * @member {boolean} [osProfile.windowsConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * @member {boolean} [osProfile.windowsConfiguration.enableAutomaticUpdates] + * Indicates whether virtual machine is enabled for automatic updates. + * @member {string} [osProfile.windowsConfiguration.timeZone] Specifies the + * time zone of the virtual machine. e.g. "Pacific Standard Time" + * @member {array} [osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * @member {object} [osProfile.windowsConfiguration.winRM] Specifies the + * Windows Remote Management listeners. This enables remote Windows PowerShell. + * @member {array} [osProfile.windowsConfiguration.winRM.listeners] The list of + * Windows Remote Management listeners + * @member {object} [osProfile.linuxConfiguration] The Linux Configuration of + * the OS profile. + * @member {boolean} + * [osProfile.linuxConfiguration.disablePasswordAuthentication] Specifies + * whether password authentication should be disabled. + * @member {object} [osProfile.linuxConfiguration.ssh] Specifies the ssh key + * configuration for a Linux OS. + * @member {array} [osProfile.linuxConfiguration.ssh.publicKeys] The list of + * SSH public keys used to authenticate with linux based VMs. + * @member {array} [osProfile.secrets] The List of certificates for addition to + * the VM. + * @member {object} [storageProfile] The virtual machine scale set storage + * profile. + * @member {object} [storageProfile.imageReference] The image reference. + * @member {string} [storageProfile.imageReference.publisher] The image + * publisher. + * @member {string} [storageProfile.imageReference.offer] Specifies the offer + * of the platform image or marketplace image used to create the virtual + * machine. + * @member {string} [storageProfile.imageReference.sku] The image SKU. + * @member {string} [storageProfile.imageReference.version] Specifies the + * version of the platform image or marketplace image used to create the + * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the + * latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. + * @member {object} [storageProfile.osDisk] The OS disk. + * @member {string} [storageProfile.osDisk.caching] The caching type. Possible + * values include: 'None', 'ReadOnly', 'ReadWrite' + * @member {boolean} [storageProfile.osDisk.writeAcceleratorEnabled] Specifies + * whether writeAccelerator should be enabled or disabled on the disk. + * @member {object} [storageProfile.osDisk.image] The Source User Image + * VirtualHardDisk. This VirtualHardDisk will be copied before using it to + * attach to the Virtual Machine. If SourceImage is provided, the destination + * VirtualHardDisk should not exist. + * @member {string} [storageProfile.osDisk.image.uri] Specifies the virtual + * hard disk's uri. + * @member {array} [storageProfile.osDisk.vhdContainers] The list of virtual + * hard disk container uris. + * @member {object} [storageProfile.osDisk.managedDisk] The managed disk + * parameters. + * @member {string} [storageProfile.osDisk.managedDisk.storageAccountType] + * Specifies the storage account type for the managed disk. Possible values + * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * @member {array} [storageProfile.dataDisks] The data disks. + * @member {object} [networkProfile] The virtual machine scale set network + * profile. + * @member {array} [networkProfile.networkInterfaceConfigurations] The list of + * network configurations. + * @member {object} [diagnosticsProfile] The virtual machine scale set + * diagnostics profile. + * @member {object} [diagnosticsProfile.bootDiagnostics] Boot Diagnostics is a + * debugging feature which allows you to view Console Output and Screenshot to + * diagnose VM status.

    For Linux Virtual Machines, you can easily view + * the output of your console log.

    For both Windows and Linux virtual + * machines, Azure also enables you to see a screenshot of the VM from the + * hypervisor. + * @member {boolean} [diagnosticsProfile.bootDiagnostics.enabled] Whether boot + * diagnostics should be enabled on the Virtual Machine. + * @member {string} [diagnosticsProfile.bootDiagnostics.storageUri] Uri of the + * storage account to use for placing the console output and screenshot. + * @member {object} [extensionProfile] The virtual machine scale set extension + * profile. + * @member {array} [extensionProfile.extensions] The virtual machine scale set + * child extension resources. + * @member {string} [licenseType] The license type, which is for bring your own + * license scenario. + */ +export interface VirtualMachineScaleSetUpdateVMProfile { + osProfile?: VirtualMachineScaleSetUpdateOSProfile; + storageProfile?: VirtualMachineScaleSetUpdateStorageProfile; + networkProfile?: VirtualMachineScaleSetUpdateNetworkProfile; + diagnosticsProfile?: DiagnosticsProfile; + extensionProfile?: VirtualMachineScaleSetExtensionProfile; + licenseType?: string; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineScaleSet class. + * @constructor + * Describes a Virtual Machine Scale Set. + * + * @member {object} [sku] The virtual machine scale set sku. + * @member {string} [sku.name] The sku name. + * @member {string} [sku.tier] Specifies the tier of virtual machines in a + * scale set.

    Possible Values:

    **Standard**

    + * **Basic** + * @member {number} [sku.capacity] Specifies the number of virtual machines in + * the scale set. + * @member {object} [plan] Specifies information about the marketplace image + * used to create the virtual machine. This element is only used for + * marketplace images. Before you can use a marketplace image from an API, you + * must enable the image for programmatic use. In the Azure portal, find the + * marketplace image that you want to use and then click **Want to deploy + * programmatically, Get Started ->**. Enter any required information and then + * click **Save**. + * @member {string} [plan.name] The plan ID. + * @member {string} [plan.publisher] The publisher ID. + * @member {string} [plan.product] Specifies the product of the image from the + * marketplace. This is the same value as Offer under the imageReference + * element. + * @member {string} [plan.promotionCode] The promotion code. + * @member {object} [upgradePolicy] The upgrade policy. + * @member {string} [upgradePolicy.mode] Specifies the mode of an upgrade to + * virtual machines in the scale set.

    Possible values are:

    **Manual** - You control the application of updates to virtual machines + * in the scale set. You do this by using the manualUpgrade action.

    + * **Automatic** - All virtual machines in the scale set are automatically + * updated at the same time. Possible values include: 'Automatic', 'Manual', + * 'Rolling' + * @member {object} [upgradePolicy.rollingUpgradePolicy] The configuration + * parameters used while performing a rolling upgrade. + * @member {number} + * [upgradePolicy.rollingUpgradePolicy.maxBatchInstancePercent] The maximum + * percent of total virtual machine instances that will be upgraded + * simultaneously by the rolling upgrade in one batch. As this is a maximum, + * unhealthy instances in previous or future batches can cause the percentage + * of instances in a batch to decrease to ensure higher reliability. The + * default value for this parameter is 20%. + * @member {number} + * [upgradePolicy.rollingUpgradePolicy.maxUnhealthyInstancePercent] The maximum + * percentage of the total virtual machine instances in the scale set that can + * be simultaneously unhealthy, either as a result of being upgraded, or by + * being found in an unhealthy state by the virtual machine health checks + * before the rolling upgrade aborts. This constraint will be checked prior to + * starting any batch. The default value for this parameter is 20%. + * @member {number} + * [upgradePolicy.rollingUpgradePolicy.maxUnhealthyUpgradedInstancePercent] The + * maximum percentage of upgraded virtual machine instances that can be found + * to be in an unhealthy state. This check will happen after each batch is + * upgraded. If this percentage is ever exceeded, the rolling update aborts. + * The default value for this parameter is 20%. + * @member {string} + * [upgradePolicy.rollingUpgradePolicy.pauseTimeBetweenBatches] The wait time + * between completing the update for all virtual machines in one batch and + * starting the next batch. The time duration should be specified in ISO 8601 + * format. The default value is 0 seconds (PT0S). + * @member {boolean} [upgradePolicy.automaticOSUpgrade] Whether OS upgrades + * should automatically be applied to scale set instances in a rolling fashion + * when a newer version of the image becomes available. + * @member {object} [virtualMachineProfile] The virtual machine profile. + * @member {object} [virtualMachineProfile.osProfile] Specifies the operating + * system settings for the virtual machines in the scale set. + * @member {string} [virtualMachineProfile.osProfile.computerNamePrefix] + * Specifies the computer name prefix for all of the virtual machines in the + * scale set. Computer name prefixes must be 1 to 15 characters long. + * @member {string} [virtualMachineProfile.osProfile.adminUsername] Specifies + * the name of the administrator account.

    **Windows-only + * restriction:** Cannot end in "."

    **Disallowed values:** + * "administrator", "admin", "user", "user1", "test", "user2", "test1", + * "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", + * "backup", "console", "david", "guest", "john", "owner", "root", "server", + * "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", + * "user5".

    **Minimum-length (Linux):** 1 character

    + * **Max-length (Linux):** 64 characters

    **Max-length (Windows):** 20 + * characters

  • For root access to the Linux VM, see [Using root + * privileges on Linux virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in this + * field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * @member {string} [virtualMachineProfile.osProfile.adminPassword] Specifies + * the password of the administrator account.

    **Minimum-length + * (Windows):** 8 characters

    **Minimum-length (Linux):** 6 characters + *

    **Max-length (Windows):** 123 characters

    **Max-length + * (Linux):** 72 characters

    **Complexity requirements:** 3 out of 4 + * conditions below need to be fulfilled
    Has lower characters
    Has + * upper characters
    Has a digit
    Has a special character (Regex match + * [\W_])

    **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", + * "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", + * "Password22", "iloveyou!"

    For resetting the password, see [How to + * reset the Remote Desktop service or its login password in a Windows + * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    For resetting root password, see [Manage users, SSH, and check or + * repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + * @member {string} [virtualMachineProfile.osProfile.customData] Specifies a + * base-64 encoded string of custom data. The base-64 encoded string is decoded + * to a binary array that is saved as a file on the Virtual Machine. The + * maximum length of the binary array is 65535 bytes.

    For using + * cloud-init for your VM, see [Using cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * @member {object} [virtualMachineProfile.osProfile.windowsConfiguration] + * Specifies Windows operating system settings on the virtual machine. + * @member {boolean} + * [virtualMachineProfile.osProfile.windowsConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * @member {boolean} + * [virtualMachineProfile.osProfile.windowsConfiguration.enableAutomaticUpdates] + * Indicates whether virtual machine is enabled for automatic updates. + * @member {string} + * [virtualMachineProfile.osProfile.windowsConfiguration.timeZone] Specifies + * the time zone of the virtual machine. e.g. "Pacific Standard Time" + * @member {array} + * [virtualMachineProfile.osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * @member {object} + * [virtualMachineProfile.osProfile.windowsConfiguration.winRM] Specifies the + * Windows Remote Management listeners. This enables remote Windows PowerShell. + * @member {array} + * [virtualMachineProfile.osProfile.windowsConfiguration.winRM.listeners] The + * list of Windows Remote Management listeners + * @member {object} [virtualMachineProfile.osProfile.linuxConfiguration] + * Specifies the Linux operating system settings on the virtual machine. + *

    For a list of supported Linux distributions, see [Linux on + * Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * @member {boolean} + * [virtualMachineProfile.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * @member {object} [virtualMachineProfile.osProfile.linuxConfiguration.ssh] + * Specifies the ssh key configuration for a Linux OS. + * @member {array} + * [virtualMachineProfile.osProfile.linuxConfiguration.ssh.publicKeys] The list + * of SSH public keys used to authenticate with linux based VMs. + * @member {array} [virtualMachineProfile.osProfile.secrets] Specifies set of + * certificates that should be installed onto the virtual machines in the scale + * set. + * @member {object} [virtualMachineProfile.storageProfile] Specifies the + * storage settings for the virtual machine disks. + * @member {object} [virtualMachineProfile.storageProfile.imageReference] + * Specifies information about the image to use. You can specify information + * about platform images, marketplace images, or virtual machine images. This + * element is required when you want to use a platform image, marketplace + * image, or virtual machine image, but is not used in other creation + * operations. + * @member {string} + * [virtualMachineProfile.storageProfile.imageReference.publisher] The image + * publisher. + * @member {string} [virtualMachineProfile.storageProfile.imageReference.offer] + * Specifies the offer of the platform image or marketplace image used to + * create the virtual machine. + * @member {string} [virtualMachineProfile.storageProfile.imageReference.sku] + * The image SKU. + * @member {string} + * [virtualMachineProfile.storageProfile.imageReference.version] Specifies the + * version of the platform image or marketplace image used to create the + * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the + * latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. + * @member {object} [virtualMachineProfile.storageProfile.osDisk] Specifies + * information about the operating system disk used by the virtual machines in + * the scale set.

    For more information about disks, see [About disks + * and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @member {string} [virtualMachineProfile.storageProfile.osDisk.name] The disk + * name. + * @member {string} [virtualMachineProfile.storageProfile.osDisk.caching] + * Specifies the caching requirements.

    Possible values are:

    + * **None**

    **ReadOnly**

    **ReadWrite**

    Default: + * **None for Standard storage. ReadOnly for Premium storage**. Possible values + * include: 'None', 'ReadOnly', 'ReadWrite' + * @member {boolean} + * [virtualMachineProfile.storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * @member {string} [virtualMachineProfile.storageProfile.osDisk.createOption] + * Specifies how the virtual machines in the scale set should be + * created.

    The only allowed value is: **FromImage** \u2013 This value + * is used when you are using an image to create the virtual machine. If you + * are using a platform image, you also use the imageReference element + * described above. If you are using a marketplace image, you also use the + * plan element previously described. Possible values include: 'FromImage', + * 'Empty', 'Attach' + * @member {string} [virtualMachineProfile.storageProfile.osDisk.osType] This + * property allows you to specify the type of the OS that is included in the + * disk if creating a VM from user-image or a specialized VHD.

    + * Possible values are:

    **Windows**

    **Linux**. Possible + * values include: 'Windows', 'Linux' + * @member {object} [virtualMachineProfile.storageProfile.osDisk.image] + * Specifies information about the unmanaged user image to base the scale set + * on. + * @member {string} [virtualMachineProfile.storageProfile.osDisk.image.uri] + * Specifies the virtual hard disk's uri. + * @member {array} [virtualMachineProfile.storageProfile.osDisk.vhdContainers] + * Specifies the container urls that are used to store operating system disks + * for the scale set. + * @member {object} [virtualMachineProfile.storageProfile.osDisk.managedDisk] + * The managed disk parameters. + * @member {string} + * [virtualMachineProfile.storageProfile.osDisk.managedDisk.storageAccountType] + * Specifies the storage account type for the managed disk. Possible values + * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * @member {array} [virtualMachineProfile.storageProfile.dataDisks] Specifies + * the parameters that are used to add data disks to the virtual machines in + * the scale set.

    For more information about disks, see [About disks + * and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @member {object} [virtualMachineProfile.networkProfile] Specifies properties + * of the network interfaces of the virtual machines in the scale set. + * @member {object} [virtualMachineProfile.networkProfile.healthProbe] A + * reference to a load balancer probe used to determine the health of an + * instance in the virtual machine scale set. The reference will be in the + * form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. + * @member {string} [virtualMachineProfile.networkProfile.healthProbe.id] The + * ARM resource id in the form of + * /subscriptions/{SubcriptionId}/resourceGroups/{ResourceGroupName}/... + * @member {array} + * [virtualMachineProfile.networkProfile.networkInterfaceConfigurations] The + * list of network configurations. + * @member {object} [virtualMachineProfile.diagnosticsProfile] Specifies the + * boot diagnostic settings state.

    Minimum api-version: 2015-06-15. + * @member {object} [virtualMachineProfile.diagnosticsProfile.bootDiagnostics] + * Boot Diagnostics is a debugging feature which allows you to view Console + * Output and Screenshot to diagnose VM status.

    For Linux Virtual + * Machines, you can easily view the output of your console log.

    For + * both Windows and Linux virtual machines, Azure also enables you to see a + * screenshot of the VM from the hypervisor. + * @member {boolean} + * [virtualMachineProfile.diagnosticsProfile.bootDiagnostics.enabled] Whether + * boot diagnostics should be enabled on the Virtual Machine. + * @member {string} + * [virtualMachineProfile.diagnosticsProfile.bootDiagnostics.storageUri] Uri of + * the storage account to use for placing the console output and screenshot. + * @member {object} [virtualMachineProfile.extensionProfile] Specifies a + * collection of settings for extensions installed on virtual machines in the + * scale set. + * @member {array} [virtualMachineProfile.extensionProfile.extensions] The + * virtual machine scale set child extension resources. + * @member {string} [virtualMachineProfile.licenseType] Specifies that the + * image or disk that is being used was licensed on-premises. This element is + * only used for images that contain the Windows Server operating system. + *

    Possible values are:

    Windows_Client

    + * Windows_Server

    If this element is included in a request for an + * update, the value must match the initial value. This value cannot be + * updated.

    For more information, see [Azure Hybrid Use Benefit for + * Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Minimum api-version: 2015-06-15 + * @member {string} [virtualMachineProfile.priority] Specifies the priority for + * the virtual machines in the scale set.

    Minimum api-version: + * 2017-10-30-preview. Possible values include: 'Regular', 'Low' + * @member {string} [provisioningState] The provisioning state, which only + * appears in the response. + * @member {boolean} [overprovision] Specifies whether the Virtual Machine + * Scale Set should be overprovisioned. + * @member {string} [uniqueId] Specifies the ID which uniquely identifies a + * Virtual Machine Scale Set. + * @member {boolean} [singlePlacementGroup] When true this limits the scale set + * to a single placement group, of max size 100 virtual machines. + * @member {boolean} [zoneBalance] Whether to force stictly even Virtual + * Machine distribution cross x-zones in case there is zone outage. + * @member {number} [platformFaultDomainCount] Fault Domain count for each + * placement group. + * @member {object} [identity] The identity of the virtual machine scale set, + * if configured. + * @member {string} [identity.principalId] The principal id of virtual machine + * scale set identity. This property will only be provided for a system + * assigned identity. + * @member {string} [identity.tenantId] The tenant id associated with the + * virtual machine scale set. This property will only be provided for a system + * assigned identity. + * @member {string} [identity.type] The type of identity used for the virtual + * machine scale set. The type 'SystemAssigned, UserAssigned' includes both an + * implicitly created identity and a set of user assigned identities. The type + * 'None' will remove any identities from the virtual machine scale set. + * Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, + * UserAssigned', 'None' + * @member {array} [identity.identityIds] The list of user identities + * associated with the virtual machine scale set. The user identity references + * will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @member {array} [zones] The virtual machine scale set zones. + */ +export interface VirtualMachineScaleSet extends Resource { + sku?: Sku; + plan?: Plan; + upgradePolicy?: UpgradePolicy; + virtualMachineProfile?: VirtualMachineScaleSetVMProfile; + readonly provisioningState?: string; + overprovision?: boolean; + readonly uniqueId?: string; + singlePlacementGroup?: boolean; + zoneBalance?: boolean; + platformFaultDomainCount?: number; + identity?: VirtualMachineScaleSetIdentity; + zones?: string[]; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineScaleSetUpdate class. + * @constructor + * Describes a Virtual Machine Scale Set. + * + * @member {object} [sku] The virtual machine scale set sku. + * @member {string} [sku.name] The sku name. + * @member {string} [sku.tier] Specifies the tier of virtual machines in a + * scale set.

    Possible Values:

    **Standard**

    + * **Basic** + * @member {number} [sku.capacity] Specifies the number of virtual machines in + * the scale set. + * @member {object} [plan] The purchase plan when deploying a virtual machine + * scale set from VM Marketplace images. + * @member {string} [plan.name] The plan ID. + * @member {string} [plan.publisher] The publisher ID. + * @member {string} [plan.product] Specifies the product of the image from the + * marketplace. This is the same value as Offer under the imageReference + * element. + * @member {string} [plan.promotionCode] The promotion code. + * @member {object} [upgradePolicy] The upgrade policy. + * @member {string} [upgradePolicy.mode] Specifies the mode of an upgrade to + * virtual machines in the scale set.

    Possible values are:

    **Manual** - You control the application of updates to virtual machines + * in the scale set. You do this by using the manualUpgrade action.

    + * **Automatic** - All virtual machines in the scale set are automatically + * updated at the same time. Possible values include: 'Automatic', 'Manual', + * 'Rolling' + * @member {object} [upgradePolicy.rollingUpgradePolicy] The configuration + * parameters used while performing a rolling upgrade. + * @member {number} + * [upgradePolicy.rollingUpgradePolicy.maxBatchInstancePercent] The maximum + * percent of total virtual machine instances that will be upgraded + * simultaneously by the rolling upgrade in one batch. As this is a maximum, + * unhealthy instances in previous or future batches can cause the percentage + * of instances in a batch to decrease to ensure higher reliability. The + * default value for this parameter is 20%. + * @member {number} + * [upgradePolicy.rollingUpgradePolicy.maxUnhealthyInstancePercent] The maximum + * percentage of the total virtual machine instances in the scale set that can + * be simultaneously unhealthy, either as a result of being upgraded, or by + * being found in an unhealthy state by the virtual machine health checks + * before the rolling upgrade aborts. This constraint will be checked prior to + * starting any batch. The default value for this parameter is 20%. + * @member {number} + * [upgradePolicy.rollingUpgradePolicy.maxUnhealthyUpgradedInstancePercent] The + * maximum percentage of upgraded virtual machine instances that can be found + * to be in an unhealthy state. This check will happen after each batch is + * upgraded. If this percentage is ever exceeded, the rolling update aborts. + * The default value for this parameter is 20%. + * @member {string} + * [upgradePolicy.rollingUpgradePolicy.pauseTimeBetweenBatches] The wait time + * between completing the update for all virtual machines in one batch and + * starting the next batch. The time duration should be specified in ISO 8601 + * format. The default value is 0 seconds (PT0S). + * @member {boolean} [upgradePolicy.automaticOSUpgrade] Whether OS upgrades + * should automatically be applied to scale set instances in a rolling fashion + * when a newer version of the image becomes available. + * @member {object} [virtualMachineProfile] The virtual machine profile. + * @member {object} [virtualMachineProfile.osProfile] The virtual machine scale + * set OS profile. + * @member {string} [virtualMachineProfile.osProfile.customData] A base-64 + * encoded string of custom data. + * @member {object} [virtualMachineProfile.osProfile.windowsConfiguration] The + * Windows Configuration of the OS profile. + * @member {boolean} + * [virtualMachineProfile.osProfile.windowsConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * @member {boolean} + * [virtualMachineProfile.osProfile.windowsConfiguration.enableAutomaticUpdates] + * Indicates whether virtual machine is enabled for automatic updates. + * @member {string} + * [virtualMachineProfile.osProfile.windowsConfiguration.timeZone] Specifies + * the time zone of the virtual machine. e.g. "Pacific Standard Time" + * @member {array} + * [virtualMachineProfile.osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * @member {object} + * [virtualMachineProfile.osProfile.windowsConfiguration.winRM] Specifies the + * Windows Remote Management listeners. This enables remote Windows PowerShell. + * @member {array} + * [virtualMachineProfile.osProfile.windowsConfiguration.winRM.listeners] The + * list of Windows Remote Management listeners + * @member {object} [virtualMachineProfile.osProfile.linuxConfiguration] The + * Linux Configuration of the OS profile. + * @member {boolean} + * [virtualMachineProfile.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * @member {object} [virtualMachineProfile.osProfile.linuxConfiguration.ssh] + * Specifies the ssh key configuration for a Linux OS. + * @member {array} + * [virtualMachineProfile.osProfile.linuxConfiguration.ssh.publicKeys] The list + * of SSH public keys used to authenticate with linux based VMs. + * @member {array} [virtualMachineProfile.osProfile.secrets] The List of + * certificates for addition to the VM. + * @member {object} [virtualMachineProfile.storageProfile] The virtual machine + * scale set storage profile. + * @member {object} [virtualMachineProfile.storageProfile.imageReference] The + * image reference. + * @member {string} + * [virtualMachineProfile.storageProfile.imageReference.publisher] The image + * publisher. + * @member {string} [virtualMachineProfile.storageProfile.imageReference.offer] + * Specifies the offer of the platform image or marketplace image used to + * create the virtual machine. + * @member {string} [virtualMachineProfile.storageProfile.imageReference.sku] + * The image SKU. + * @member {string} + * [virtualMachineProfile.storageProfile.imageReference.version] Specifies the + * version of the platform image or marketplace image used to create the + * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the + * latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. + * @member {object} [virtualMachineProfile.storageProfile.osDisk] The OS disk. + * @member {string} [virtualMachineProfile.storageProfile.osDisk.caching] The + * caching type. Possible values include: 'None', 'ReadOnly', 'ReadWrite' + * @member {boolean} + * [virtualMachineProfile.storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * @member {object} [virtualMachineProfile.storageProfile.osDisk.image] The + * Source User Image VirtualHardDisk. This VirtualHardDisk will be copied + * before using it to attach to the Virtual Machine. If SourceImage is + * provided, the destination VirtualHardDisk should not exist. + * @member {string} [virtualMachineProfile.storageProfile.osDisk.image.uri] + * Specifies the virtual hard disk's uri. + * @member {array} [virtualMachineProfile.storageProfile.osDisk.vhdContainers] + * The list of virtual hard disk container uris. + * @member {object} [virtualMachineProfile.storageProfile.osDisk.managedDisk] + * The managed disk parameters. + * @member {string} + * [virtualMachineProfile.storageProfile.osDisk.managedDisk.storageAccountType] + * Specifies the storage account type for the managed disk. Possible values + * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * @member {array} [virtualMachineProfile.storageProfile.dataDisks] The data + * disks. + * @member {object} [virtualMachineProfile.networkProfile] The virtual machine + * scale set network profile. + * @member {array} + * [virtualMachineProfile.networkProfile.networkInterfaceConfigurations] The + * list of network configurations. + * @member {object} [virtualMachineProfile.diagnosticsProfile] The virtual + * machine scale set diagnostics profile. + * @member {object} [virtualMachineProfile.diagnosticsProfile.bootDiagnostics] + * Boot Diagnostics is a debugging feature which allows you to view Console + * Output and Screenshot to diagnose VM status.

    For Linux Virtual + * Machines, you can easily view the output of your console log.

    For + * both Windows and Linux virtual machines, Azure also enables you to see a + * screenshot of the VM from the hypervisor. + * @member {boolean} + * [virtualMachineProfile.diagnosticsProfile.bootDiagnostics.enabled] Whether + * boot diagnostics should be enabled on the Virtual Machine. + * @member {string} + * [virtualMachineProfile.diagnosticsProfile.bootDiagnostics.storageUri] Uri of + * the storage account to use for placing the console output and screenshot. + * @member {object} [virtualMachineProfile.extensionProfile] The virtual + * machine scale set extension profile. + * @member {array} [virtualMachineProfile.extensionProfile.extensions] The + * virtual machine scale set child extension resources. + * @member {string} [virtualMachineProfile.licenseType] The license type, which + * is for bring your own license scenario. + * @member {boolean} [overprovision] Specifies whether the Virtual Machine + * Scale Set should be overprovisioned. + * @member {boolean} [singlePlacementGroup] When true this limits the scale set + * to a single placement group, of max size 100 virtual machines. + * @member {object} [identity] The identity of the virtual machine scale set, + * if configured. + * @member {string} [identity.principalId] The principal id of virtual machine + * scale set identity. This property will only be provided for a system + * assigned identity. + * @member {string} [identity.tenantId] The tenant id associated with the + * virtual machine scale set. This property will only be provided for a system + * assigned identity. + * @member {string} [identity.type] The type of identity used for the virtual + * machine scale set. The type 'SystemAssigned, UserAssigned' includes both an + * implicitly created identity and a set of user assigned identities. The type + * 'None' will remove any identities from the virtual machine scale set. + * Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, + * UserAssigned', 'None' + * @member {array} [identity.identityIds] The list of user identities + * associated with the virtual machine scale set. The user identity references + * will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + */ +export interface VirtualMachineScaleSetUpdate extends UpdateResource { + sku?: Sku; + plan?: Plan; + upgradePolicy?: UpgradePolicy; + virtualMachineProfile?: VirtualMachineScaleSetUpdateVMProfile; + overprovision?: boolean; + singlePlacementGroup?: boolean; + identity?: VirtualMachineScaleSetIdentity; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineScaleSetVMInstanceIDs class. + * @constructor + * Specifies a list of virtual machine instance IDs from the VM scale set. + * + * @member {array} [instanceIds] The virtual machine scale set instance ids. + * Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + */ +export interface VirtualMachineScaleSetVMInstanceIDs { + instanceIds?: string[]; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineScaleSetVMInstanceRequiredIDs class. + * @constructor + * Specifies a list of virtual machine instance IDs from the VM scale set. + * + * @member {array} instanceIds The virtual machine scale set instance ids. + */ +export interface VirtualMachineScaleSetVMInstanceRequiredIDs { + instanceIds: string[]; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineStatusCodeCount class. + * @constructor + * The status code and count of the virtual machine scale set instance view + * status summary. + * + * @member {string} [code] The instance view status code. + * @member {number} [count] The number of instances having a particular status + * code. + */ +export interface VirtualMachineStatusCodeCount { + readonly code?: string; + readonly count?: number; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineScaleSetInstanceViewStatusesSummary class. + * @constructor + * Instance view statuses summary for virtual machines of a virtual machine + * scale set. + * + * @member {array} [statusesSummary] The extensions information. + */ +export interface VirtualMachineScaleSetInstanceViewStatusesSummary { + readonly statusesSummary?: VirtualMachineStatusCodeCount[]; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineScaleSetVMExtensionsSummary class. + * @constructor + * Extensions summary for virtual machines of a virtual machine scale set. + * + * @member {string} [name] The extension name. + * @member {array} [statusesSummary] The extensions information. + */ +export interface VirtualMachineScaleSetVMExtensionsSummary { + readonly name?: string; + readonly statusesSummary?: VirtualMachineStatusCodeCount[]; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineScaleSetInstanceView class. + * @constructor + * The instance view of a virtual machine scale set. + * + * @member {object} [virtualMachine] The instance view status summary for the + * virtual machine scale set. + * @member {array} [virtualMachine.statusesSummary] The extensions information. + * @member {array} [extensions] The extensions information. + * @member {array} [statuses] The resource status information. + */ +export interface VirtualMachineScaleSetInstanceView { + readonly virtualMachine?: VirtualMachineScaleSetInstanceViewStatusesSummary; + readonly extensions?: VirtualMachineScaleSetVMExtensionsSummary[]; + statuses?: InstanceViewStatus[]; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineScaleSetSkuCapacity class. + * @constructor + * Describes scaling information of a sku. + * + * @member {number} [minimum] The minimum capacity. + * @member {number} [maximum] The maximum capacity that can be set. + * @member {number} [defaultCapacity] The default capacity. + * @member {string} [scaleType] The scale type applicable to the sku. Possible + * values include: 'Automatic', 'None' + */ +export interface VirtualMachineScaleSetSkuCapacity { + readonly minimum?: number; + readonly maximum?: number; + readonly defaultCapacity?: number; + readonly scaleType?: string; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineScaleSetSku class. + * @constructor + * Describes an available virtual machine scale set sku. + * + * @member {string} [resourceType] The type of resource the sku applies to. + * @member {object} [sku] The Sku. + * @member {string} [sku.name] The sku name. + * @member {string} [sku.tier] Specifies the tier of virtual machines in a + * scale set.

    Possible Values:

    **Standard**

    + * **Basic** + * @member {number} [sku.capacity] Specifies the number of virtual machines in + * the scale set. + * @member {object} [capacity] Specifies the number of virtual machines in the + * scale set. + * @member {number} [capacity.minimum] The minimum capacity. + * @member {number} [capacity.maximum] The maximum capacity that can be set. + * @member {number} [capacity.defaultCapacity] The default capacity. + * @member {string} [capacity.scaleType] The scale type applicable to the sku. + * Possible values include: 'Automatic', 'None' + */ +export interface VirtualMachineScaleSetSku { + readonly resourceType?: string; + readonly sku?: Sku; + readonly capacity?: VirtualMachineScaleSetSkuCapacity; +} + +/** + * @class + * Initializes a new instance of the UpgradeOperationHistoryStatus class. + * @constructor + * Information about the current running state of the overall upgrade. + * + * @member {string} [code] Code indicating the current status of the upgrade. + * Possible values include: 'RollingForward', 'Cancelled', 'Completed', + * 'Faulted' + * @member {date} [startTime] Start time of the upgrade. + * @member {date} [endTime] End time of the upgrade. + */ +export interface UpgradeOperationHistoryStatus { + readonly code?: string; + readonly startTime?: Date; + readonly endTime?: Date; +} + +/** + * @class + * Initializes a new instance of the RollingUpgradeProgressInfo class. + * @constructor + * Information about the number of virtual machine instances in each upgrade + * state. + * + * @member {number} [successfulInstanceCount] The number of instances that have + * been successfully upgraded. + * @member {number} [failedInstanceCount] The number of instances that have + * failed to be upgraded successfully. + * @member {number} [inProgressInstanceCount] The number of instances that are + * currently being upgraded. + * @member {number} [pendingInstanceCount] The number of instances that have + * not yet begun to be upgraded. + */ +export interface RollingUpgradeProgressInfo { + readonly successfulInstanceCount?: number; + readonly failedInstanceCount?: number; + readonly inProgressInstanceCount?: number; + readonly pendingInstanceCount?: number; +} + +/** + * @class + * Initializes a new instance of the ApiErrorBase class. + * @constructor + * Api error base. + * + * @member {string} [code] The error code. + * @member {string} [target] The target of the particular error. + * @member {string} [message] The error message. + */ +export interface ApiErrorBase { + code?: string; + target?: string; + message?: string; +} + +/** + * @class + * Initializes a new instance of the InnerError class. + * @constructor + * Inner error details. + * + * @member {string} [exceptiontype] The exception type. + * @member {string} [errordetail] The internal error message or exception dump. + */ +export interface InnerError { + exceptiontype?: string; + errordetail?: string; +} + +/** + * @class + * Initializes a new instance of the ApiError class. + * @constructor + * Api error. + * + * @member {array} [details] The Api error details + * @member {object} [innererror] The Api inner error + * @member {string} [innererror.exceptiontype] The exception type. + * @member {string} [innererror.errordetail] The internal error message or + * exception dump. + * @member {string} [code] The error code. + * @member {string} [target] The target of the particular error. + * @member {string} [message] The error message. + */ +export interface ApiError { + details?: ApiErrorBase[]; + innererror?: InnerError; + code?: string; + target?: string; + message?: string; +} + +/** + * @class + * Initializes a new instance of the UpgradeOperationHistoricalStatusInfoProperties class. + * @constructor + * Describes each OS upgrade on the Virtual Machine Scale Set. + * + * @member {object} [runningStatus] Information about the overall status of the + * upgrade operation. + * @member {string} [runningStatus.code] Code indicating the current status of + * the upgrade. Possible values include: 'RollingForward', 'Cancelled', + * 'Completed', 'Faulted' + * @member {date} [runningStatus.startTime] Start time of the upgrade. + * @member {date} [runningStatus.endTime] End time of the upgrade. + * @member {object} [progress] Counts of the VM's in each state. + * @member {number} [progress.successfulInstanceCount] The number of instances + * that have been successfully upgraded. + * @member {number} [progress.failedInstanceCount] The number of instances that + * have failed to be upgraded successfully. + * @member {number} [progress.inProgressInstanceCount] The number of instances + * that are currently being upgraded. + * @member {number} [progress.pendingInstanceCount] The number of instances + * that have not yet begun to be upgraded. + * @member {object} [error] Error Details for this upgrade if there are any. + * @member {array} [error.details] The Api error details + * @member {object} [error.innererror] The Api inner error + * @member {string} [error.innererror.exceptiontype] The exception type. + * @member {string} [error.innererror.errordetail] The internal error message + * or exception dump. + * @member {string} [error.code] The error code. + * @member {string} [error.target] The target of the particular error. + * @member {string} [error.message] The error message. + * @member {string} [startedBy] Invoker of the Upgrade Operation. Possible + * values include: 'Unknown', 'User', 'Platform' + * @member {object} [targetImageReference] Image Reference details + * @member {string} [targetImageReference.publisher] The image publisher. + * @member {string} [targetImageReference.offer] Specifies the offer of the + * platform image or marketplace image used to create the virtual machine. + * @member {string} [targetImageReference.sku] The image SKU. + * @member {string} [targetImageReference.version] Specifies the version of the + * platform image or marketplace image used to create the virtual machine. The + * allowed formats are Major.Minor.Build or 'latest'. Major, Minor, and Build + * are decimal numbers. Specify 'latest' to use the latest version of an image + * available at deploy time. Even if you use 'latest', the VM image will not + * automatically update after deploy time even if a new version becomes + * available. + */ +export interface UpgradeOperationHistoricalStatusInfoProperties { + readonly runningStatus?: UpgradeOperationHistoryStatus; + readonly progress?: RollingUpgradeProgressInfo; + readonly error?: ApiError; + readonly startedBy?: string; + readonly targetImageReference?: ImageReference; +} + +/** + * @class + * Initializes a new instance of the UpgradeOperationHistoricalStatusInfo class. + * @constructor + * Virtual Machine Scale Set OS Upgrade History operation response. + * + * @member {object} [properties] Information about the properties of the + * upgrade operation. + * @member {object} [properties.runningStatus] Information about the overall + * status of the upgrade operation. + * @member {string} [properties.runningStatus.code] Code indicating the current + * status of the upgrade. Possible values include: 'RollingForward', + * 'Cancelled', 'Completed', 'Faulted' + * @member {date} [properties.runningStatus.startTime] Start time of the + * upgrade. + * @member {date} [properties.runningStatus.endTime] End time of the upgrade. + * @member {object} [properties.progress] Counts of the VM's in each state. + * @member {number} [properties.progress.successfulInstanceCount] The number of + * instances that have been successfully upgraded. + * @member {number} [properties.progress.failedInstanceCount] The number of + * instances that have failed to be upgraded successfully. + * @member {number} [properties.progress.inProgressInstanceCount] The number of + * instances that are currently being upgraded. + * @member {number} [properties.progress.pendingInstanceCount] The number of + * instances that have not yet begun to be upgraded. + * @member {object} [properties.error] Error Details for this upgrade if there + * are any. + * @member {array} [properties.error.details] The Api error details + * @member {object} [properties.error.innererror] The Api inner error + * @member {string} [properties.error.innererror.exceptiontype] The exception + * type. + * @member {string} [properties.error.innererror.errordetail] The internal + * error message or exception dump. + * @member {string} [properties.error.code] The error code. + * @member {string} [properties.error.target] The target of the particular + * error. + * @member {string} [properties.error.message] The error message. + * @member {string} [properties.startedBy] Invoker of the Upgrade Operation. + * Possible values include: 'Unknown', 'User', 'Platform' + * @member {object} [properties.targetImageReference] Image Reference details + * @member {string} [properties.targetImageReference.publisher] The image + * publisher. + * @member {string} [properties.targetImageReference.offer] Specifies the offer + * of the platform image or marketplace image used to create the virtual + * machine. + * @member {string} [properties.targetImageReference.sku] The image SKU. + * @member {string} [properties.targetImageReference.version] Specifies the + * version of the platform image or marketplace image used to create the + * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the + * latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. + * @member {string} [type] Resource type + * @member {string} [location] Resource location + */ +export interface UpgradeOperationHistoricalStatusInfo { + readonly properties?: UpgradeOperationHistoricalStatusInfoProperties; + readonly type?: string; + readonly location?: string; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineScaleSetVM class. + * @constructor + * Describes a virtual machine scale set virtual machine. + * + * @member {string} [instanceId] The virtual machine instance ID. + * @member {object} [sku] The virtual machine SKU. + * @member {string} [sku.name] The sku name. + * @member {string} [sku.tier] Specifies the tier of virtual machines in a + * scale set.

    Possible Values:

    **Standard**

    + * **Basic** + * @member {number} [sku.capacity] Specifies the number of virtual machines in + * the scale set. + * @member {boolean} [latestModelApplied] Specifies whether the latest model + * has been applied to the virtual machine. + * @member {string} [vmId] Azure VM unique ID. + * @member {object} [instanceView] The virtual machine instance view. + * @member {number} [instanceView.platformUpdateDomain] Specifies the update + * domain of the virtual machine. + * @member {number} [instanceView.platformFaultDomain] Specifies the fault + * domain of the virtual machine. + * @member {string} [instanceView.computerName] The computer name assigned to + * the virtual machine. + * @member {string} [instanceView.osName] The Operating System running on the + * virtual machine. + * @member {string} [instanceView.osVersion] The version of Operating System + * running on the virtual machine. + * @member {string} [instanceView.rdpThumbPrint] The Remote desktop certificate + * thumbprint. + * @member {object} [instanceView.vmAgent] The VM Agent running on the virtual + * machine. + * @member {string} [instanceView.vmAgent.vmAgentVersion] The VM Agent full + * version. + * @member {array} [instanceView.vmAgent.extensionHandlers] The virtual machine + * extension handler instance view. + * @member {array} [instanceView.vmAgent.statuses] The resource status + * information. + * @member {object} [instanceView.maintenanceRedeployStatus] The Maintenance + * Operation status on the virtual machine. + * @member {boolean} + * [instanceView.maintenanceRedeployStatus.isCustomerInitiatedMaintenanceAllowed] + * True, if customer is allowed to perform Maintenance. + * @member {date} + * [instanceView.maintenanceRedeployStatus.preMaintenanceWindowStartTime] Start + * Time for the Pre Maintenance Window. + * @member {date} + * [instanceView.maintenanceRedeployStatus.preMaintenanceWindowEndTime] End + * Time for the Pre Maintenance Window. + * @member {date} + * [instanceView.maintenanceRedeployStatus.maintenanceWindowStartTime] Start + * Time for the Maintenance Window. + * @member {date} + * [instanceView.maintenanceRedeployStatus.maintenanceWindowEndTime] End Time + * for the Maintenance Window. + * @member {string} + * [instanceView.maintenanceRedeployStatus.lastOperationResultCode] The Last + * Maintenance Operation Result Code. Possible values include: 'None', + * 'RetryLater', 'MaintenanceAborted', 'MaintenanceCompleted' + * @member {string} + * [instanceView.maintenanceRedeployStatus.lastOperationMessage] Message + * returned for the last Maintenance Operation. + * @member {array} [instanceView.disks] The virtual machine disk information. + * @member {array} [instanceView.extensions] The extensions information. + * @member {object} [instanceView.bootDiagnostics] Boot Diagnostics is a + * debugging feature which allows you to view Console Output and Screenshot to + * diagnose VM status.

    For Linux Virtual Machines, you can easily view + * the output of your console log.

    For both Windows and Linux virtual + * machines, Azure also enables you to see a screenshot of the VM from the + * hypervisor. + * @member {string} [instanceView.bootDiagnostics.consoleScreenshotBlobUri] The + * console screenshot blob URI. + * @member {string} [instanceView.bootDiagnostics.serialConsoleLogBlobUri] The + * Linux serial console log blob Uri. + * @member {array} [instanceView.statuses] The resource status information. + * @member {object} [hardwareProfile] Specifies the hardware settings for the + * virtual machine. + * @member {string} [hardwareProfile.vmSize] Specifies the size of the virtual + * machine. For more information about virtual machine sizes, see [Sizes for + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    The available VM sizes depend on region and availability set. For a + * list of available sizes use these APIs:

    [List all available + * virtual machine sizes in an availability + * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) + *

    [List all available virtual machine sizes in a + * region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) + *

    [List all available virtual machine sizes for + * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). + * Possible values include: '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_B1s', 'Standard_B1ms', + * 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', + * '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_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', + * 'Standard_D32_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', + * 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', + * 'Standard_D64s_v3', '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_DS13-4_v2', 'Standard_DS13-2_v2', + * 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', 'Standard_E2_v3', + * 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', 'Standard_E32_v3', + * 'Standard_E64_v3', 'Standard_E2s_v3', 'Standard_E4s_v3', 'Standard_E8s_v3', + * 'Standard_E16s_v3', 'Standard_E32s_v3', 'Standard_E64s_v3', + * 'Standard_E32-16_v3', 'Standard_E32-8s_v3', 'Standard_E64-32s_v3', + * 'Standard_E64-16s_v3', 'Standard_F1', 'Standard_F2', 'Standard_F4', + * 'Standard_F8', 'Standard_F16', 'Standard_F1s', 'Standard_F2s', + * 'Standard_F4s', 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2', + * 'Standard_F4s_v2', 'Standard_F8s_v2', 'Standard_F16s_v2', + * 'Standard_F32s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1', + * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', + * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', + * 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8', + * 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m', + * 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', + * 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms', + * 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms', + * 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms', + * 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', + * 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2', + * 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3', + * 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s', + * 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6', + * 'Standard_NV12', 'Standard_NV24' + * @member {object} [storageProfile] Specifies the storage settings for the + * virtual machine disks. + * @member {object} [storageProfile.imageReference] Specifies information about + * the image to use. You can specify information about platform images, + * marketplace images, or virtual machine images. This element is required when + * you want to use a platform image, marketplace image, or virtual machine + * image, but is not used in other creation operations. + * @member {string} [storageProfile.imageReference.publisher] The image + * publisher. + * @member {string} [storageProfile.imageReference.offer] Specifies the offer + * of the platform image or marketplace image used to create the virtual + * machine. + * @member {string} [storageProfile.imageReference.sku] The image SKU. + * @member {string} [storageProfile.imageReference.version] Specifies the + * version of the platform image or marketplace image used to create the + * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the + * latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. + * @member {object} [storageProfile.osDisk] Specifies information about the + * operating system disk used by the virtual machine.

    For more + * information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @member {string} [storageProfile.osDisk.osType] This property allows you to + * specify the type of the OS that is included in the disk if creating a VM + * from user-image or a specialized VHD.

    Possible values are:

    + * **Windows**

    **Linux**. Possible values include: 'Windows', 'Linux' + * @member {object} [storageProfile.osDisk.encryptionSettings] Specifies the + * encryption settings for the OS Disk.

    Minimum api-version: + * 2015-06-15 + * @member {object} + * [storageProfile.osDisk.encryptionSettings.diskEncryptionKey] Specifies the + * location of the disk encryption key, which is a Key Vault Secret. + * @member {string} + * [storageProfile.osDisk.encryptionSettings.diskEncryptionKey.secretUrl] The + * URL referencing a secret in a Key Vault. + * @member {object} + * [storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault] The + * relative URL of the Key Vault containing the secret. + * @member {string} + * [storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault.id] + * Resource Id + * @member {object} [storageProfile.osDisk.encryptionSettings.keyEncryptionKey] + * Specifies the location of the key encryption key in Key Vault. + * @member {string} + * [storageProfile.osDisk.encryptionSettings.keyEncryptionKey.keyUrl] The URL + * referencing a key encryption key in Key Vault. + * @member {object} + * [storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault] The + * relative URL of the Key Vault containing the key. + * @member {string} + * [storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault.id] + * Resource Id + * @member {boolean} [storageProfile.osDisk.encryptionSettings.enabled] + * Specifies whether disk encryption should be enabled on the virtual machine. + * @member {string} [storageProfile.osDisk.name] The disk name. + * @member {object} [storageProfile.osDisk.vhd] The virtual hard disk. + * @member {string} [storageProfile.osDisk.vhd.uri] Specifies the virtual hard + * disk's uri. + * @member {object} [storageProfile.osDisk.image] The source user image virtual + * hard disk. The virtual hard disk will be copied before being attached to the + * virtual machine. If SourceImage is provided, the destination virtual hard + * drive must not exist. + * @member {string} [storageProfile.osDisk.image.uri] Specifies the virtual + * hard disk's uri. + * @member {string} [storageProfile.osDisk.caching] Specifies the caching + * requirements.

    Possible values are:

    **None**

    + * **ReadOnly**

    **ReadWrite**

    Default: **None for Standard + * storage. ReadOnly for Premium storage**. Possible values include: 'None', + * 'ReadOnly', 'ReadWrite' + * @member {boolean} [storageProfile.osDisk.writeAcceleratorEnabled] Specifies + * whether writeAccelerator should be enabled or disabled on the disk. + * @member {string} [storageProfile.osDisk.createOption] Specifies how the + * virtual machine should be created.

    Possible values are:

    + * **Attach** \u2013 This value is used when you are using a specialized disk + * to create the virtual machine.

    **FromImage** \u2013 This value is + * used when you are using an image to create the virtual machine. If you are + * using a platform image, you also use the imageReference element described + * above. If you are using a marketplace image, you also use the plan element + * previously described. Possible values include: 'FromImage', 'Empty', + * 'Attach' + * @member {number} [storageProfile.osDisk.diskSizeGB] Specifies the size of an + * empty data disk in gigabytes. This element can be used to overwrite the name + * of the disk in a virtual machine image.

    This value cannot be larger + * than 1023 GB + * @member {object} [storageProfile.osDisk.managedDisk] The managed disk + * parameters. + * @member {string} [storageProfile.osDisk.managedDisk.storageAccountType] + * Specifies the storage account type for the managed disk. Possible values + * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * @member {array} [storageProfile.dataDisks] Specifies the parameters that are + * used to add a data disk to a virtual machine.

    For more information + * about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @member {object} [osProfile] Specifies the operating system settings for the + * virtual machine. + * @member {string} [osProfile.computerName] Specifies the host OS name of the + * virtual machine.

    **Max-length (Windows):** 15 characters

    + * **Max-length (Linux):** 64 characters.

    For naming conventions and + * restrictions see [Azure infrastructure services implementation + * guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). + * @member {string} [osProfile.adminUsername] Specifies the name of the + * administrator account.

    **Windows-only restriction:** Cannot end in + * "."

    **Disallowed values:** "administrator", "admin", "user", + * "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", + * "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", + * "john", "owner", "root", "server", "sql", "support", "support_388945a0", + * "sys", "test2", "test3", "user4", "user5".

    **Minimum-length + * (Linux):** 1 character

    **Max-length (Linux):** 64 characters + *

    **Max-length (Windows):** 20 characters

  • For root + * access to the Linux VM, see [Using root privileges on Linux virtual machines + * in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in this + * field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * @member {string} [osProfile.adminPassword] Specifies the password of the + * administrator account.

    **Minimum-length (Windows):** 8 characters + *

    **Minimum-length (Linux):** 6 characters

    **Max-length + * (Windows):** 123 characters

    **Max-length (Linux):** 72 characters + *

    **Complexity requirements:** 3 out of 4 conditions below need to be + * fulfilled
    Has lower characters
    Has upper characters
    Has a + * digit
    Has a special character (Regex match [\W_])

    **Disallowed + * values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", + * "pass@word1", "Password!", "Password1", "Password22", "iloveyou!"

    + * For resetting the password, see [How to reset the Remote Desktop service or + * its login password in a Windows + * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    For resetting root password, see [Manage users, SSH, and check or + * repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + * @member {string} [osProfile.customData] Specifies a base-64 encoded string + * of custom data. The base-64 encoded string is decoded to a binary array that + * is saved as a file on the Virtual Machine. The maximum length of the binary + * array is 65535 bytes.

    For using cloud-init for your VM, see [Using + * cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * @member {object} [osProfile.windowsConfiguration] Specifies Windows + * operating system settings on the virtual machine. + * @member {boolean} [osProfile.windowsConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * @member {boolean} [osProfile.windowsConfiguration.enableAutomaticUpdates] + * Indicates whether virtual machine is enabled for automatic updates. + * @member {string} [osProfile.windowsConfiguration.timeZone] Specifies the + * time zone of the virtual machine. e.g. "Pacific Standard Time" + * @member {array} [osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * @member {object} [osProfile.windowsConfiguration.winRM] Specifies the + * Windows Remote Management listeners. This enables remote Windows PowerShell. + * @member {array} [osProfile.windowsConfiguration.winRM.listeners] The list of + * Windows Remote Management listeners + * @member {object} [osProfile.linuxConfiguration] Specifies the Linux + * operating system settings on the virtual machine.

    For a list of + * supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * @member {boolean} + * [osProfile.linuxConfiguration.disablePasswordAuthentication] Specifies + * whether password authentication should be disabled. + * @member {object} [osProfile.linuxConfiguration.ssh] Specifies the ssh key + * configuration for a Linux OS. + * @member {array} [osProfile.linuxConfiguration.ssh.publicKeys] The list of + * SSH public keys used to authenticate with linux based VMs. + * @member {array} [osProfile.secrets] Specifies set of certificates that + * should be installed onto the virtual machine. + * @member {object} [networkProfile] Specifies the network interfaces of the + * virtual machine. + * @member {array} [networkProfile.networkInterfaces] Specifies the list of + * resource Ids for the network interfaces associated with the virtual machine. + * @member {object} [diagnosticsProfile] Specifies the boot diagnostic settings + * state.

    Minimum api-version: 2015-06-15. + * @member {object} [diagnosticsProfile.bootDiagnostics] Boot Diagnostics is a + * debugging feature which allows you to view Console Output and Screenshot to + * diagnose VM status.

    For Linux Virtual Machines, you can easily view + * the output of your console log.

    For both Windows and Linux virtual + * machines, Azure also enables you to see a screenshot of the VM from the + * hypervisor. + * @member {boolean} [diagnosticsProfile.bootDiagnostics.enabled] Whether boot + * diagnostics should be enabled on the Virtual Machine. + * @member {string} [diagnosticsProfile.bootDiagnostics.storageUri] Uri of the + * storage account to use for placing the console output and screenshot. + * @member {object} [availabilitySet] Specifies information about the + * availability set that the virtual machine should be assigned to. Virtual + * machines specified in the same availability set are allocated to different + * nodes to maximize availability. For more information about availability + * sets, see [Manage the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    For more information on Azure planned maintainance, see [Planned + * maintenance for virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Currently, a VM can only be added to availability set at creation + * time. An existing VM cannot be added to an availability set. + * @member {string} [availabilitySet.id] Resource Id + * @member {string} [provisioningState] The provisioning state, which only + * appears in the response. + * @member {string} [licenseType] Specifies that the image or disk that is + * being used was licensed on-premises. This element is only used for images + * that contain the Windows Server operating system.

    Possible values + * are:

    Windows_Client

    Windows_Server

    If this + * element is included in a request for an update, the value must match the + * initial value. This value cannot be updated.

    For more information, + * see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Minimum api-version: 2015-06-15 + * @member {object} [plan] Specifies information about the marketplace image + * used to create the virtual machine. This element is only used for + * marketplace images. Before you can use a marketplace image from an API, you + * must enable the image for programmatic use. In the Azure portal, find the + * marketplace image that you want to use and then click **Want to deploy + * programmatically, Get Started ->**. Enter any required information and then + * click **Save**. + * @member {string} [plan.name] The plan ID. + * @member {string} [plan.publisher] The publisher ID. + * @member {string} [plan.product] Specifies the product of the image from the + * marketplace. This is the same value as Offer under the imageReference + * element. + * @member {string} [plan.promotionCode] The promotion code. + * @member {array} [resources] The virtual machine child extension resources. + */ +export interface VirtualMachineScaleSetVM extends Resource { + readonly instanceId?: string; + readonly sku?: Sku; + readonly latestModelApplied?: boolean; + readonly vmId?: string; + readonly instanceView?: VirtualMachineInstanceView; + hardwareProfile?: HardwareProfile; + storageProfile?: StorageProfile; + osProfile?: OSProfile; + networkProfile?: NetworkProfile; + diagnosticsProfile?: DiagnosticsProfile; + availabilitySet?: SubResource; + readonly provisioningState?: string; + licenseType?: string; + plan?: Plan; + readonly resources?: VirtualMachineExtension[]; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineHealthStatus class. + * @constructor + * The health status of the VM. + * + * @member {object} [status] The health status information for the VM. + * @member {string} [status.code] The status code. + * @member {string} [status.level] The level code. Possible values include: + * 'Info', 'Warning', 'Error' + * @member {string} [status.displayStatus] The short localizable label for the + * status. + * @member {string} [status.message] The detailed status message, including for + * alerts and error messages. + * @member {date} [status.time] The time of the status. + */ +export interface VirtualMachineHealthStatus { + readonly status?: InstanceViewStatus; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineScaleSetVMInstanceView class. + * @constructor + * The instance view of a virtual machine scale set VM. + * + * @member {number} [platformUpdateDomain] The Update Domain count. + * @member {number} [platformFaultDomain] The Fault Domain count. + * @member {string} [rdpThumbPrint] The Remote desktop certificate thumbprint. + * @member {object} [vmAgent] The VM Agent running on the virtual machine. + * @member {string} [vmAgent.vmAgentVersion] The VM Agent full version. + * @member {array} [vmAgent.extensionHandlers] The virtual machine extension + * handler instance view. + * @member {array} [vmAgent.statuses] The resource status information. + * @member {object} [maintenanceRedeployStatus] The Maintenance Operation + * status on the virtual machine. + * @member {boolean} + * [maintenanceRedeployStatus.isCustomerInitiatedMaintenanceAllowed] True, if + * customer is allowed to perform Maintenance. + * @member {date} [maintenanceRedeployStatus.preMaintenanceWindowStartTime] + * Start Time for the Pre Maintenance Window. + * @member {date} [maintenanceRedeployStatus.preMaintenanceWindowEndTime] End + * Time for the Pre Maintenance Window. + * @member {date} [maintenanceRedeployStatus.maintenanceWindowStartTime] Start + * Time for the Maintenance Window. + * @member {date} [maintenanceRedeployStatus.maintenanceWindowEndTime] End Time + * for the Maintenance Window. + * @member {string} [maintenanceRedeployStatus.lastOperationResultCode] The + * Last Maintenance Operation Result Code. Possible values include: 'None', + * 'RetryLater', 'MaintenanceAborted', 'MaintenanceCompleted' + * @member {string} [maintenanceRedeployStatus.lastOperationMessage] Message + * returned for the last Maintenance Operation. + * @member {array} [disks] The disks information. + * @member {array} [extensions] The extensions information. + * @member {object} [vmHealth] The health status for the VM. + * @member {object} [vmHealth.status] The health status information for the VM. + * @member {string} [vmHealth.status.code] The status code. + * @member {string} [vmHealth.status.level] The level code. Possible values + * include: 'Info', 'Warning', 'Error' + * @member {string} [vmHealth.status.displayStatus] The short localizable label + * for the status. + * @member {string} [vmHealth.status.message] The detailed status message, + * including for alerts and error messages. + * @member {date} [vmHealth.status.time] The time of the status. + * @member {object} [bootDiagnostics] Boot Diagnostics is a debugging feature + * which allows you to view Console Output and Screenshot to diagnose VM + * status.

    For Linux Virtual Machines, you can easily view the output + * of your console log.

    For both Windows and Linux virtual machines, + * Azure also enables you to see a screenshot of the VM from the hypervisor. + * @member {string} [bootDiagnostics.consoleScreenshotBlobUri] The console + * screenshot blob URI. + * @member {string} [bootDiagnostics.serialConsoleLogBlobUri] The Linux serial + * console log blob Uri. + * @member {array} [statuses] The resource status information. + * @member {string} [placementGroupId] The placement group in which the VM is + * running. If the VM is deallocated it will not have a placementGroupId. + */ +export interface VirtualMachineScaleSetVMInstanceView { + platformUpdateDomain?: number; + platformFaultDomain?: number; + rdpThumbPrint?: string; + vmAgent?: VirtualMachineAgentInstanceView; + maintenanceRedeployStatus?: MaintenanceRedeployStatus; + disks?: DiskInstanceView[]; + extensions?: VirtualMachineExtensionInstanceView[]; + readonly vmHealth?: VirtualMachineHealthStatus; + bootDiagnostics?: BootDiagnosticsInstanceView; + statuses?: InstanceViewStatus[]; + placementGroupId?: string; +} + +/** + * @class + * Initializes a new instance of the RollingUpgradeRunningStatus class. + * @constructor + * Information about the current running state of the overall upgrade. + * + * @member {string} [code] Code indicating the current status of the upgrade. + * Possible values include: 'RollingForward', 'Cancelled', 'Completed', + * 'Faulted' + * @member {date} [startTime] Start time of the upgrade. + * @member {string} [lastAction] The last action performed on the rolling + * upgrade. Possible values include: 'Start', 'Cancel' + * @member {date} [lastActionTime] Last action time of the upgrade. + */ +export interface RollingUpgradeRunningStatus { + readonly code?: string; + readonly startTime?: Date; + readonly lastAction?: string; + readonly lastActionTime?: Date; +} + +/** + * @class + * Initializes a new instance of the RollingUpgradeStatusInfo class. + * @constructor + * The status of the latest virtual machine scale set rolling upgrade. + * + * @member {object} [policy] The rolling upgrade policies applied for this + * upgrade. + * @member {number} [policy.maxBatchInstancePercent] The maximum percent of + * total virtual machine instances that will be upgraded simultaneously by the + * rolling upgrade in one batch. As this is a maximum, unhealthy instances in + * previous or future batches can cause the percentage of instances in a batch + * to decrease to ensure higher reliability. The default value for this + * parameter is 20%. + * @member {number} [policy.maxUnhealthyInstancePercent] The maximum percentage + * of the total virtual machine instances in the scale set that can be + * simultaneously unhealthy, either as a result of being upgraded, or by being + * found in an unhealthy state by the virtual machine health checks before the + * rolling upgrade aborts. This constraint will be checked prior to starting + * any batch. The default value for this parameter is 20%. + * @member {number} [policy.maxUnhealthyUpgradedInstancePercent] The maximum + * percentage of upgraded virtual machine instances that can be found to be in + * an unhealthy state. This check will happen after each batch is upgraded. If + * this percentage is ever exceeded, the rolling update aborts. The default + * value for this parameter is 20%. + * @member {string} [policy.pauseTimeBetweenBatches] The wait time between + * completing the update for all virtual machines in one batch and starting the + * next batch. The time duration should be specified in ISO 8601 format. The + * default value is 0 seconds (PT0S). + * @member {object} [runningStatus] Information about the current running state + * of the overall upgrade. + * @member {string} [runningStatus.code] Code indicating the current status of + * the upgrade. Possible values include: 'RollingForward', 'Cancelled', + * 'Completed', 'Faulted' + * @member {date} [runningStatus.startTime] Start time of the upgrade. + * @member {string} [runningStatus.lastAction] The last action performed on the + * rolling upgrade. Possible values include: 'Start', 'Cancel' + * @member {date} [runningStatus.lastActionTime] Last action time of the + * upgrade. + * @member {object} [progress] Information about the number of virtual machine + * instances in each upgrade state. + * @member {number} [progress.successfulInstanceCount] The number of instances + * that have been successfully upgraded. + * @member {number} [progress.failedInstanceCount] The number of instances that + * have failed to be upgraded successfully. + * @member {number} [progress.inProgressInstanceCount] The number of instances + * that are currently being upgraded. + * @member {number} [progress.pendingInstanceCount] The number of instances + * that have not yet begun to be upgraded. + * @member {object} [error] Error details for this upgrade, if there are any. + * @member {array} [error.details] The Api error details + * @member {object} [error.innererror] The Api inner error + * @member {string} [error.innererror.exceptiontype] The exception type. + * @member {string} [error.innererror.errordetail] The internal error message + * or exception dump. + * @member {string} [error.code] The error code. + * @member {string} [error.target] The target of the particular error. + * @member {string} [error.message] The error message. + */ +export interface RollingUpgradeStatusInfo extends Resource { + readonly policy?: RollingUpgradePolicy; + readonly runningStatus?: RollingUpgradeRunningStatus; + readonly progress?: RollingUpgradeProgressInfo; + readonly error?: ApiError; +} + +/** + * @class + * Initializes a new instance of the ComputeLongRunningOperationProperties class. + * @constructor + * Compute-specific operation properties, including output + * + * @member {object} [output] Operation output data (raw JSON) + */ +export interface ComputeLongRunningOperationProperties { + output?: any; +} + +/** + * @class + * Initializes a new instance of the RecoveryWalkResponse class. + * @constructor + * Response after calling a manual recovery walk + * + * @member {boolean} [walkPerformed] Whether the recovery walk was performed + * @member {number} [nextPlatformUpdateDomain] The next update domain that + * needs to be walked. Null means walk spanning all update domains has been + * completed + */ +export interface RecoveryWalkResponse { + readonly walkPerformed?: boolean; + readonly nextPlatformUpdateDomain?: number; +} + +/** + * @class + * Initializes a new instance of the OperationStatusResponse class. + * @constructor + * Operation status response + * + * @member {string} [name] Operation ID + * @member {string} [status] Operation status + * @member {date} [startTime] Start time of the operation + * @member {date} [endTime] End time of the operation + * @member {object} [error] Api error + * @member {array} [error.details] The Api error details + * @member {object} [error.innererror] The Api inner error + * @member {string} [error.innererror.exceptiontype] The exception type. + * @member {string} [error.innererror.errordetail] The internal error message + * or exception dump. + * @member {string} [error.code] The error code. + * @member {string} [error.target] The target of the particular error. + * @member {string} [error.message] The error message. + */ +export interface OperationStatusResponse { + readonly name?: string; + readonly status?: string; + readonly startTime?: Date; + readonly endTime?: Date; + readonly error?: ApiError; +} + +/** + * @class + * Initializes a new instance of the LogAnalyticsInputBase class. + * @constructor + * Api input base class for LogAnalytics Api. + * + * @member {string} blobContainerSasUri SAS Uri of the logging blob container + * to which LogAnalytics Api writes output logs to. + * @member {date} fromTime From time of the query + * @member {date} toTime To time of the query + * @member {boolean} [groupByThrottlePolicy] Group query result by Throttle + * Policy applied. + * @member {boolean} [groupByOperationName] Group query result by by Operation + * Name. + * @member {boolean} [groupByResourceName] Group query result by Resource Name. + */ +export interface LogAnalyticsInputBase { + blobContainerSasUri: string; + fromTime: Date; + toTime: Date; + groupByThrottlePolicy?: boolean; + groupByOperationName?: boolean; + groupByResourceName?: boolean; +} + +/** + * @class + * Initializes a new instance of the RequestRateByIntervalInput class. + * @constructor + * Api request input for LogAnalytics getRequestRateByInterval Api. + * + * @member {string} intervalLength Interval value in minutes used to create + * LogAnalytics call rate logs. Possible values include: 'ThreeMins', + * 'FiveMins', 'ThirtyMins', 'SixtyMins' + */ +export interface RequestRateByIntervalInput extends LogAnalyticsInputBase { + intervalLength: string; +} + +/** + * @class + * Initializes a new instance of the ThrottledRequestsInput class. + * @constructor + * Api request input for LogAnalytics getThrottledRequests Api. + * + */ +export interface ThrottledRequestsInput extends LogAnalyticsInputBase { +} + +/** + * @class + * Initializes a new instance of the LogAnalyticsOutput class. + * @constructor + * LogAnalytics output properties + * + * @member {string} [output] Output file Uri path to blob container. + */ +export interface LogAnalyticsOutput { + readonly output?: string; +} + +/** + * @class + * Initializes a new instance of the LogAnalyticsOperationResult class. + * @constructor + * LogAnalytics operation status response + * + * @member {object} [properties] LogAnalyticsOutput + * @member {string} [properties.output] Output file Uri path to blob container. + */ +export interface LogAnalyticsOperationResult extends OperationStatusResponse { + readonly properties?: LogAnalyticsOutput; +} + +/** + * @class + * Initializes a new instance of the RunCommandInputParameter class. + * @constructor + * Describes the properties of a run command parameter. + * + * @member {string} name The run command parameter name. + * @member {string} value The run command parameter value. + */ +export interface RunCommandInputParameter { + name: string; + value: string; +} + +/** + * @class + * Initializes a new instance of the RunCommandInput class. + * @constructor + * Capture Virtual Machine parameters. + * + * @member {string} commandId The run command id. + * @member {array} [script] Optional. The script to be executed. When this + * value is given, the given script will override the default script of the + * command. + * @member {array} [parameters] The run command parameters. + */ +export interface RunCommandInput { + commandId: string; + script?: string[]; + parameters?: RunCommandInputParameter[]; +} + +/** + * @class + * Initializes a new instance of the RunCommandParameterDefinition class. + * @constructor + * Describes the properties of a run command parameter. + * + * @member {string} name The run command parameter name. + * @member {string} type The run command parameter type. + * @member {string} [defaultValue] The run command parameter default value. + * @member {boolean} [required] The run command parameter required. Default + * value: false . + */ +export interface RunCommandParameterDefinition { + name: string; + type: string; + defaultValue?: string; + required?: boolean; +} + +/** + * @class + * Initializes a new instance of the RunCommandDocumentBase class. + * @constructor + * Describes the properties of a Run Command metadata. + * + * @member {string} schema The VM run command schema. + * @member {string} id The VM run command id. + * @member {string} osType The Operating System type. Possible values include: + * 'Windows', 'Linux' + * @member {string} label The VM run command label. + * @member {string} description The VM run command description. + */ +export interface RunCommandDocumentBase { + schema: string; + id: string; + osType: string; + label: string; + description: string; +} + +/** + * @class + * Initializes a new instance of the RunCommandDocument class. + * @constructor + * Describes the properties of a Run Command. + * + * @member {array} script The script to be executed. + * @member {array} [parameters] The parameters used by the script. + */ +export interface RunCommandDocument extends RunCommandDocumentBase { + script: string[]; + parameters?: RunCommandParameterDefinition[]; +} + +/** + * @class + * Initializes a new instance of the RunCommandResult class. + * @constructor + * Run command operation response. + * + * @member {object} [output] Operation output data (raw JSON) + */ +export interface RunCommandResult extends OperationStatusResponse { + output?: any; +} + +/** + * @class + * Initializes a new instance of the ResourceSkuCapacity class. + * @constructor + * Describes scaling information of a SKU. + * + * @member {number} [minimum] The minimum capacity. + * @member {number} [maximum] The maximum capacity that can be set. + * @member {number} [default] The default capacity. + * @member {string} [scaleType] The scale type applicable to the sku. Possible + * values include: 'Automatic', 'Manual', 'None' + */ +export interface ResourceSkuCapacity { + readonly minimum?: number; + readonly maximum?: number; + readonly default?: number; + readonly scaleType?: string; +} + +/** + * @class + * Initializes a new instance of the ResourceSkuCosts class. + * @constructor + * Describes metadata for retrieving price info. + * + * @member {string} [meterID] Used for querying price from commerce. + * @member {number} [quantity] The multiplier is needed to extend the base + * metered cost. + * @member {string} [extendedUnit] An invariant to show the extended unit. + */ +export interface ResourceSkuCosts { + readonly meterID?: string; + readonly quantity?: number; + readonly extendedUnit?: string; +} + +/** + * @class + * Initializes a new instance of the ResourceSkuCapabilities class. + * @constructor + * Describes The SKU capabilites object. + * + * @member {string} [name] An invariant to describe the feature. + * @member {string} [value] An invariant if the feature is measured by + * quantity. + */ +export interface ResourceSkuCapabilities { + readonly name?: string; + readonly value?: string; +} + +/** + * @class + * Initializes a new instance of the ResourceSkuRestrictionInfo class. + * @constructor + * @member {array} [locations] Locations where the SKU is restricted + * @member {array} [zones] List of availability zones where the SKU is + * restricted. + */ +export interface ResourceSkuRestrictionInfo { + readonly locations?: string[]; + readonly zones?: string[]; +} + +/** + * @class + * Initializes a new instance of the ResourceSkuRestrictions class. + * @constructor + * Describes scaling information of a SKU. + * + * @member {string} [type] The type of restrictions. Possible values include: + * 'Location', 'Zone' + * @member {array} [values] The value of restrictions. If the restriction type + * is set to location. This would be different locations where the SKU is + * restricted. + * @member {object} [restrictionInfo] The information about the restriction + * where the SKU cannot be used. + * @member {array} [restrictionInfo.locations] Locations where the SKU is + * restricted + * @member {array} [restrictionInfo.zones] List of availability zones where the + * SKU is restricted. + * @member {string} [reasonCode] The reason for restriction. Possible values + * include: 'QuotaId', 'NotAvailableForSubscription' + */ +export interface ResourceSkuRestrictions { + readonly type?: string; + readonly values?: string[]; + readonly restrictionInfo?: ResourceSkuRestrictionInfo; + readonly reasonCode?: string; +} + +/** + * @class + * Initializes a new instance of the ResourceSkuLocationInfo class. + * @constructor + * @member {string} [location] Location of the SKU + * @member {array} [zones] List of availability zones where the SKU is + * supported. + */ +export interface ResourceSkuLocationInfo { + readonly location?: string; + readonly zones?: string[]; +} + +/** + * @class + * Initializes a new instance of the ResourceSku class. + * @constructor + * Describes an available Compute SKU. + * + * @member {string} [resourceType] The type of resource the SKU applies to. + * @member {string} [name] The name of SKU. + * @member {string} [tier] Specifies the tier of virtual machines in a scale + * set.

    Possible Values:

    **Standard**

    + * **Basic** + * @member {string} [size] The Size of the SKU. + * @member {string} [family] The Family of this particular SKU. + * @member {string} [kind] The Kind of resources that are supported in this + * SKU. + * @member {object} [capacity] Specifies the number of virtual machines in the + * scale set. + * @member {number} [capacity.minimum] The minimum capacity. + * @member {number} [capacity.maximum] The maximum capacity that can be set. + * @member {number} [capacity.default] The default capacity. + * @member {string} [capacity.scaleType] The scale type applicable to the sku. + * Possible values include: 'Automatic', 'Manual', 'None' + * @member {array} [locations] The set of locations that the SKU is available. + * @member {array} [locationInfo] A list of locations and availability zones in + * those locations where the SKU is available. + * @member {array} [apiVersions] The api versions that support this SKU. + * @member {array} [costs] Metadata for retrieving price info. + * @member {array} [capabilities] A name value pair to describe the capability. + * @member {array} [restrictions] The restrictions because of which SKU cannot + * be used. This is empty if there are no restrictions. + */ +export interface ResourceSku { + readonly resourceType?: string; + readonly name?: string; + readonly tier?: string; + readonly size?: string; + readonly family?: string; + readonly kind?: string; + readonly capacity?: ResourceSkuCapacity; + readonly locations?: string[]; + readonly locationInfo?: ResourceSkuLocationInfo[]; + readonly apiVersions?: string[]; + readonly costs?: ResourceSkuCosts[]; + readonly capabilities?: ResourceSkuCapabilities[]; + readonly restrictions?: ResourceSkuRestrictions[]; +} + +/** + * @class + * Initializes a new instance of the DiskSku class. + * @constructor + * The disks sku name. Can be Standard_LRS or Premium_LRS. + * + * @member {string} [name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS' + * @member {string} [tier] The sku tier. Default value: 'Standard' . + */ +export interface DiskSku { + name?: string; + readonly tier?: string; +} + +/** + * @class + * Initializes a new instance of the ResourceUpdate class. + * @constructor + * The Resource model definition. + * + * @member {object} [tags] Resource tags + * @member {object} [sku] + * @member {string} [sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS' + * @member {string} [sku.tier] The sku tier. + */ +export interface ResourceUpdate { + tags?: { [propertyName: string]: string }; + sku?: DiskSku; +} + +/** + * @class + * Initializes a new instance of the ImageDiskReference class. + * @constructor + * The source image used for creating the disk. + * + * @member {string} id A relative uri containing either a Platform Imgage + * Repository or user image reference. + * @member {number} [lun] If the disk is created from an image's data disk, + * this is an index that indicates which of the data disks in the image to use. + * For OS disks, this field is null. + */ +export interface ImageDiskReference { + id: string; + lun?: number; +} + +/** + * @class + * Initializes a new instance of the CreationData class. + * @constructor + * Data used when creating a disk. + * + * @member {string} createOption This enumerates the possible sources of a + * disk's creation. Possible values include: 'Empty', 'Attach', 'FromImage', + * 'Import', 'Copy', 'Restore' + * @member {string} [storageAccountId] If createOption is Import, the Azure + * Resource Manager identifier of the storage account containing the blob to + * import as a disk. Required only if the blob is in a different subscription + * @member {object} [imageReference] Disk source information. + * @member {string} [imageReference.id] A relative uri containing either a + * Platform Imgage Repository or user image reference. + * @member {number} [imageReference.lun] If the disk is created from an image's + * data disk, this is an index that indicates which of the data disks in the + * image to use. For OS disks, this field is null. + * @member {string} [sourceUri] If createOption is Import, this is the URI of a + * blob to be imported into a managed disk. + * @member {string} [sourceResourceId] If createOption is Copy, this is the ARM + * id of the source snapshot or disk. + */ +export interface CreationData { + createOption: string; + storageAccountId?: string; + imageReference?: ImageDiskReference; + sourceUri?: string; + sourceResourceId?: string; +} + +/** + * @class + * Initializes a new instance of the SourceVault class. + * @constructor + * The vault id is an Azure Resource Manager Resoure id in the form + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName} + * + * @member {string} [id] Resource Id + */ +export interface SourceVault { + id?: string; +} + +/** + * @class + * Initializes a new instance of the KeyVaultAndSecretReference class. + * @constructor + * Key Vault Secret Url and vault id of the encryption key + * + * @member {object} sourceVault Resource id of the KeyVault containing the key + * or secret + * @member {string} [sourceVault.id] Resource Id + * @member {string} secretUrl Url pointing to a key or secret in KeyVault + */ +export interface KeyVaultAndSecretReference { + sourceVault: SourceVault; + secretUrl: string; +} + +/** + * @class + * Initializes a new instance of the KeyVaultAndKeyReference class. + * @constructor + * Key Vault Key Url and vault id of KeK, KeK is optional and when provided is + * used to unwrap the encryptionKey + * + * @member {object} sourceVault Resource id of the KeyVault containing the key + * or secret + * @member {string} [sourceVault.id] Resource Id + * @member {string} keyUrl Url pointing to a key or secret in KeyVault + */ +export interface KeyVaultAndKeyReference { + sourceVault: SourceVault; + keyUrl: string; +} + +/** + * @class + * Initializes a new instance of the EncryptionSettings class. + * @constructor + * Encryption settings for disk or snapshot + * + * @member {boolean} [enabled] Set this flag to true and provide + * DiskEncryptionKey and optional KeyEncryptionKey to enable encryption. Set + * this flag to false and remove DiskEncryptionKey and KeyEncryptionKey to + * disable encryption. If EncryptionSettings is null in the request object, the + * existing settings remain unchanged. + * @member {object} [diskEncryptionKey] Key Vault Secret Url and vault id of + * the disk encryption key + * @member {object} [diskEncryptionKey.sourceVault] Resource id of the KeyVault + * containing the key or secret + * @member {string} [diskEncryptionKey.sourceVault.id] Resource Id + * @member {string} [diskEncryptionKey.secretUrl] Url pointing to a key or + * secret in KeyVault + * @member {object} [keyEncryptionKey] Key Vault Key Url and vault id of the + * key encryption key + * @member {object} [keyEncryptionKey.sourceVault] Resource id of the KeyVault + * containing the key or secret + * @member {string} [keyEncryptionKey.sourceVault.id] Resource Id + * @member {string} [keyEncryptionKey.keyUrl] Url pointing to a key or secret + * in KeyVault + */ +export interface EncryptionSettings { + enabled?: boolean; + diskEncryptionKey?: KeyVaultAndSecretReference; + keyEncryptionKey?: KeyVaultAndKeyReference; +} + +/** + * @class + * Initializes a new instance of the Disk class. + * @constructor + * Disk resource. + * + * @member {string} [managedBy] A relative URI containing the ID of the VM that + * has the disk attached. + * @member {object} [sku] + * @member {string} [sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS' + * @member {string} [sku.tier] The sku tier. + * @member {array} [zones] The Logical zone list for Disk. + * @member {date} [timeCreated] The time when the disk was created. + * @member {string} [osType] The Operating System type. Possible values + * include: 'Windows', 'Linux' + * @member {object} creationData Disk source information. CreationData + * information cannot be changed after the disk has been created. + * @member {string} [creationData.createOption] This enumerates the possible + * sources of a disk's creation. Possible values include: 'Empty', 'Attach', + * 'FromImage', 'Import', 'Copy', 'Restore' + * @member {string} [creationData.storageAccountId] If createOption is Import, + * the Azure Resource Manager identifier of the storage account containing the + * blob to import as a disk. Required only if the blob is in a different + * subscription + * @member {object} [creationData.imageReference] Disk source information. + * @member {string} [creationData.imageReference.id] A relative uri containing + * either a Platform Imgage Repository or user image reference. + * @member {number} [creationData.imageReference.lun] If the disk is created + * from an image's data disk, this is an index that indicates which of the data + * disks in the image to use. For OS disks, this field is null. + * @member {string} [creationData.sourceUri] If createOption is Import, this is + * the URI of a blob to be imported into a managed disk. + * @member {string} [creationData.sourceResourceId] If createOption is Copy, + * this is the ARM id of the source snapshot or disk. + * @member {number} [diskSizeGB] If creationData.createOption is Empty, this + * field is mandatory and it indicates the size of the VHD to create. If this + * field is present for updates or creation with other options, it indicates a + * resize. Resizes are only allowed if the disk is not attached to a running + * VM, and can only increase the disk's size. + * @member {object} [encryptionSettings] Encryption settings for disk or + * snapshot + * @member {boolean} [encryptionSettings.enabled] Set this flag to true and + * provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * encryption. Set this flag to false and remove DiskEncryptionKey and + * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the + * request object, the existing settings remain unchanged. + * @member {object} [encryptionSettings.diskEncryptionKey] Key Vault Secret Url + * and vault id of the disk encryption key + * @member {object} [encryptionSettings.diskEncryptionKey.sourceVault] Resource + * id of the KeyVault containing the key or secret + * @member {string} [encryptionSettings.diskEncryptionKey.sourceVault.id] + * Resource Id + * @member {string} [encryptionSettings.diskEncryptionKey.secretUrl] Url + * pointing to a key or secret in KeyVault + * @member {object} [encryptionSettings.keyEncryptionKey] Key Vault Key Url and + * vault id of the key encryption key + * @member {object} [encryptionSettings.keyEncryptionKey.sourceVault] Resource + * id of the KeyVault containing the key or secret + * @member {string} [encryptionSettings.keyEncryptionKey.sourceVault.id] + * Resource Id + * @member {string} [encryptionSettings.keyEncryptionKey.keyUrl] Url pointing + * to a key or secret in KeyVault + * @member {string} [provisioningState] The disk provisioning state. + */ +export interface Disk extends Resource { + readonly managedBy?: string; + sku?: DiskSku; + zones?: string[]; + readonly timeCreated?: Date; + osType?: string; + creationData: CreationData; + diskSizeGB?: number; + encryptionSettings?: EncryptionSettings; + readonly provisioningState?: string; +} + +/** + * @class + * Initializes a new instance of the DiskUpdate class. + * @constructor + * Disk update resource. + * + * @member {string} [osType] the Operating System type. Possible values + * include: 'Windows', 'Linux' + * @member {number} [diskSizeGB] If creationData.createOption is Empty, this + * field is mandatory and it indicates the size of the VHD to create. If this + * field is present for updates or creation with other options, it indicates a + * resize. Resizes are only allowed if the disk is not attached to a running + * VM, and can only increase the disk's size. + * @member {object} [encryptionSettings] Encryption settings for disk or + * snapshot + * @member {boolean} [encryptionSettings.enabled] Set this flag to true and + * provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * encryption. Set this flag to false and remove DiskEncryptionKey and + * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the + * request object, the existing settings remain unchanged. + * @member {object} [encryptionSettings.diskEncryptionKey] Key Vault Secret Url + * and vault id of the disk encryption key + * @member {object} [encryptionSettings.diskEncryptionKey.sourceVault] Resource + * id of the KeyVault containing the key or secret + * @member {string} [encryptionSettings.diskEncryptionKey.sourceVault.id] + * Resource Id + * @member {string} [encryptionSettings.diskEncryptionKey.secretUrl] Url + * pointing to a key or secret in KeyVault + * @member {object} [encryptionSettings.keyEncryptionKey] Key Vault Key Url and + * vault id of the key encryption key + * @member {object} [encryptionSettings.keyEncryptionKey.sourceVault] Resource + * id of the KeyVault containing the key or secret + * @member {string} [encryptionSettings.keyEncryptionKey.sourceVault.id] + * Resource Id + * @member {string} [encryptionSettings.keyEncryptionKey.keyUrl] Url pointing + * to a key or secret in KeyVault + */ +export interface DiskUpdate extends ResourceUpdate { + osType?: string; + diskSizeGB?: number; + encryptionSettings?: EncryptionSettings; +} + +/** + * @class + * Initializes a new instance of the SnapshotSku class. + * @constructor + * The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. + * + * @member {string} [name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS', 'Standard_ZRS' + * @member {string} [tier] The sku tier. Default value: 'Standard' . + */ +export interface SnapshotSku { + name?: string; + readonly tier?: string; +} + +/** + * @class + * Initializes a new instance of the GrantAccessData class. + * @constructor + * Data used for requesting a SAS. + * + * @member {string} access Possible values include: 'None', 'Read' + * @member {number} durationInSeconds Time duration in seconds until the SAS + * access expires. + */ +export interface GrantAccessData { + access: string; + durationInSeconds: number; +} + +/** + * @class + * Initializes a new instance of the AccessUri class. + * @constructor + * A disk access SAS uri. + * + * @member {string} [accessSAS] A SAS uri for accessing a disk. + */ +export interface AccessUri { + readonly accessSAS?: string; +} + +/** + * @class + * Initializes a new instance of the Snapshot class. + * @constructor + * Snapshot resource. + * + * @member {string} [managedBy] Unused. Always Null. + * @member {object} [sku] + * @member {string} [sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS', 'Standard_ZRS' + * @member {string} [sku.tier] The sku tier. + * @member {date} [timeCreated] The time when the disk was created. + * @member {string} [osType] The Operating System type. Possible values + * include: 'Windows', 'Linux' + * @member {object} creationData Disk source information. CreationData + * information cannot be changed after the disk has been created. + * @member {string} [creationData.createOption] This enumerates the possible + * sources of a disk's creation. Possible values include: 'Empty', 'Attach', + * 'FromImage', 'Import', 'Copy', 'Restore' + * @member {string} [creationData.storageAccountId] If createOption is Import, + * the Azure Resource Manager identifier of the storage account containing the + * blob to import as a disk. Required only if the blob is in a different + * subscription + * @member {object} [creationData.imageReference] Disk source information. + * @member {string} [creationData.imageReference.id] A relative uri containing + * either a Platform Imgage Repository or user image reference. + * @member {number} [creationData.imageReference.lun] If the disk is created + * from an image's data disk, this is an index that indicates which of the data + * disks in the image to use. For OS disks, this field is null. + * @member {string} [creationData.sourceUri] If createOption is Import, this is + * the URI of a blob to be imported into a managed disk. + * @member {string} [creationData.sourceResourceId] If createOption is Copy, + * this is the ARM id of the source snapshot or disk. + * @member {number} [diskSizeGB] If creationData.createOption is Empty, this + * field is mandatory and it indicates the size of the VHD to create. If this + * field is present for updates or creation with other options, it indicates a + * resize. Resizes are only allowed if the disk is not attached to a running + * VM, and can only increase the disk's size. + * @member {object} [encryptionSettings] Encryption settings for disk or + * snapshot + * @member {boolean} [encryptionSettings.enabled] Set this flag to true and + * provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * encryption. Set this flag to false and remove DiskEncryptionKey and + * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the + * request object, the existing settings remain unchanged. + * @member {object} [encryptionSettings.diskEncryptionKey] Key Vault Secret Url + * and vault id of the disk encryption key + * @member {object} [encryptionSettings.diskEncryptionKey.sourceVault] Resource + * id of the KeyVault containing the key or secret + * @member {string} [encryptionSettings.diskEncryptionKey.sourceVault.id] + * Resource Id + * @member {string} [encryptionSettings.diskEncryptionKey.secretUrl] Url + * pointing to a key or secret in KeyVault + * @member {object} [encryptionSettings.keyEncryptionKey] Key Vault Key Url and + * vault id of the key encryption key + * @member {object} [encryptionSettings.keyEncryptionKey.sourceVault] Resource + * id of the KeyVault containing the key or secret + * @member {string} [encryptionSettings.keyEncryptionKey.sourceVault.id] + * Resource Id + * @member {string} [encryptionSettings.keyEncryptionKey.keyUrl] Url pointing + * to a key or secret in KeyVault + * @member {string} [provisioningState] The disk provisioning state. + */ +export interface Snapshot extends Resource { + readonly managedBy?: string; + sku?: SnapshotSku; + readonly timeCreated?: Date; + osType?: string; + creationData: CreationData; + diskSizeGB?: number; + encryptionSettings?: EncryptionSettings; + readonly provisioningState?: string; +} + +/** + * @class + * Initializes a new instance of the SnapshotUpdate class. + * @constructor + * Snapshot update resource. + * + * @member {string} [osType] the Operating System type. Possible values + * include: 'Windows', 'Linux' + * @member {number} [diskSizeGB] If creationData.createOption is Empty, this + * field is mandatory and it indicates the size of the VHD to create. If this + * field is present for updates or creation with other options, it indicates a + * resize. Resizes are only allowed if the disk is not attached to a running + * VM, and can only increase the disk's size. + * @member {object} [encryptionSettings] Encryption settings for disk or + * snapshot + * @member {boolean} [encryptionSettings.enabled] Set this flag to true and + * provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * encryption. Set this flag to false and remove DiskEncryptionKey and + * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the + * request object, the existing settings remain unchanged. + * @member {object} [encryptionSettings.diskEncryptionKey] Key Vault Secret Url + * and vault id of the disk encryption key + * @member {object} [encryptionSettings.diskEncryptionKey.sourceVault] Resource + * id of the KeyVault containing the key or secret + * @member {string} [encryptionSettings.diskEncryptionKey.sourceVault.id] + * Resource Id + * @member {string} [encryptionSettings.diskEncryptionKey.secretUrl] Url + * pointing to a key or secret in KeyVault + * @member {object} [encryptionSettings.keyEncryptionKey] Key Vault Key Url and + * vault id of the key encryption key + * @member {object} [encryptionSettings.keyEncryptionKey.sourceVault] Resource + * id of the KeyVault containing the key or secret + * @member {string} [encryptionSettings.keyEncryptionKey.sourceVault.id] + * Resource Id + * @member {string} [encryptionSettings.keyEncryptionKey.keyUrl] Url pointing + * to a key or secret in KeyVault + */ +export interface SnapshotUpdate extends ResourceUpdate { + osType?: string; + diskSizeGB?: number; + encryptionSettings?: EncryptionSettings; +} + +/** + * @class + * Initializes a new instance of the ContainerServiceCustomProfile class. + * @constructor + * Properties to configure a custom container service cluster. + * + * @member {string} orchestrator The name of the custom orchestrator to use. + */ +export interface ContainerServiceCustomProfile { + orchestrator: string; +} + +/** + * @class + * Initializes a new instance of the ContainerServiceServicePrincipalProfile class. + * @constructor + * Information about a service principal identity for the cluster to use for + * manipulating Azure APIs. + * + * @member {string} clientId The ID for the service principal. + * @member {string} secret The secret password associated with the service + * principal. + */ +export interface ContainerServiceServicePrincipalProfile { + clientId: string; + secret: string; +} + +/** + * @class + * Initializes a new instance of the ContainerServiceOrchestratorProfile class. + * @constructor + * Profile for the container service orchestrator. + * + * @member {string} orchestratorType The orchestrator to use to manage + * container service cluster resources. Valid values are Swarm, DCOS, and + * Custom. Possible values include: 'Swarm', 'DCOS', 'Custom', 'Kubernetes' + */ +export interface ContainerServiceOrchestratorProfile { + orchestratorType: string; +} + +/** + * @class + * Initializes a new instance of the ContainerServiceMasterProfile class. + * @constructor + * Profile for the container service master. + * + * @member {number} [count] Number of masters (VMs) in the container service + * cluster. Allowed values are 1, 3, and 5. The default value is 1. Default + * value: 1 . + * @member {string} dnsPrefix DNS prefix to be used to create the FQDN for + * master. + * @member {string} [fqdn] FDQN for the master. + */ +export interface ContainerServiceMasterProfile { + count?: number; + dnsPrefix: string; + readonly fqdn?: string; +} + +/** + * @class + * Initializes a new instance of the ContainerServiceAgentPoolProfile class. + * @constructor + * Profile for the container service agent pool. + * + * @member {string} name Unique name of the agent pool profile in the context + * of the subscription and resource group. + * @member {number} count Number of agents (VMs) to host docker containers. + * Allowed values must be in the range of 1 to 100 (inclusive). The default + * value is 1. . Default value: 1 . + * @member {string} vmSize Size of agent VMs. Possible values include: + * '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_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_G1', 'Standard_G2', + * 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_DS1', 'Standard_DS2', + * 'Standard_DS3', 'Standard_DS4', 'Standard_DS11', 'Standard_DS12', + * 'Standard_DS13', 'Standard_DS14', 'Standard_GS1', 'Standard_GS2', + * 'Standard_GS3', 'Standard_GS4', 'Standard_GS5' + * @member {string} dnsPrefix DNS prefix to be used to create the FQDN for the + * agent pool. + * @member {string} [fqdn] FDQN for the agent pool. + */ +export interface ContainerServiceAgentPoolProfile { + name: string; + count: number; + vmSize: string; + dnsPrefix: string; + readonly fqdn?: string; +} + +/** + * @class + * Initializes a new instance of the ContainerServiceWindowsProfile class. + * @constructor + * Profile for Windows VMs in the container service cluster. + * + * @member {string} adminUsername The administrator username to use for Windows + * VMs. + * @member {string} adminPassword The administrator password to use for Windows + * VMs. + */ +export interface ContainerServiceWindowsProfile { + adminUsername: string; + adminPassword: string; +} + +/** + * @class + * Initializes a new instance of the ContainerServiceSshPublicKey class. + * @constructor + * Contains information about SSH certificate public key data. + * + * @member {string} keyData Certificate public key used to authenticate with + * VMs through SSH. The certificate must be in PEM format with or without + * headers. + */ +export interface ContainerServiceSshPublicKey { + keyData: string; +} + +/** + * @class + * Initializes a new instance of the ContainerServiceSshConfiguration class. + * @constructor + * SSH configuration for Linux-based VMs running on Azure. + * + * @member {array} publicKeys the list of SSH public keys used to authenticate + * with Linux-based VMs. + */ +export interface ContainerServiceSshConfiguration { + publicKeys: ContainerServiceSshPublicKey[]; +} + +/** + * @class + * Initializes a new instance of the ContainerServiceLinuxProfile class. + * @constructor + * Profile for Linux VMs in the container service cluster. + * + * @member {string} adminUsername The administrator username to use for Linux + * VMs. + * @member {object} ssh The ssh key configuration for Linux VMs. + * @member {array} [ssh.publicKeys] the list of SSH public keys used to + * authenticate with Linux-based VMs. + */ +export interface ContainerServiceLinuxProfile { + adminUsername: string; + ssh: ContainerServiceSshConfiguration; +} + +/** + * @class + * Initializes a new instance of the ContainerServiceVMDiagnostics class. + * @constructor + * Profile for diagnostics on the container service VMs. + * + * @member {boolean} enabled Whether the VM diagnostic agent is provisioned on + * the VM. + * @member {string} [storageUri] The URI of the storage account where + * diagnostics are stored. + */ +export interface ContainerServiceVMDiagnostics { + enabled: boolean; + readonly storageUri?: string; +} + +/** + * @class + * Initializes a new instance of the ContainerServiceDiagnosticsProfile class. + * @constructor + * @member {object} vmDiagnostics Profile for the container service VM + * diagnostic agent. + * @member {boolean} [vmDiagnostics.enabled] Whether the VM diagnostic agent is + * provisioned on the VM. + * @member {string} [vmDiagnostics.storageUri] The URI of the storage account + * where diagnostics are stored. + */ +export interface ContainerServiceDiagnosticsProfile { + vmDiagnostics: ContainerServiceVMDiagnostics; +} + +/** + * @class + * Initializes a new instance of the ContainerService class. + * @constructor + * Container service. + * + * @member {string} [provisioningState] the current deployment or provisioning + * state, which only appears in the response. + * @member {object} [orchestratorProfile] Properties of the orchestrator. + * @member {string} [orchestratorProfile.orchestratorType] The orchestrator to + * use to manage container service cluster resources. Valid values are Swarm, + * DCOS, and Custom. Possible values include: 'Swarm', 'DCOS', 'Custom', + * 'Kubernetes' + * @member {object} [customProfile] Properties for custom clusters. + * @member {string} [customProfile.orchestrator] The name of the custom + * orchestrator to use. + * @member {object} [servicePrincipalProfile] Properties for cluster service + * principals. + * @member {string} [servicePrincipalProfile.clientId] The ID for the service + * principal. + * @member {string} [servicePrincipalProfile.secret] The secret password + * associated with the service principal. + * @member {object} masterProfile Properties of master agents. + * @member {number} [masterProfile.count] Number of masters (VMs) in the + * container service cluster. Allowed values are 1, 3, and 5. The default value + * is 1. + * @member {string} [masterProfile.dnsPrefix] DNS prefix to be used to create + * the FQDN for master. + * @member {string} [masterProfile.fqdn] FDQN for the master. + * @member {array} agentPoolProfiles Properties of the agent pool. + * @member {object} [windowsProfile] Properties of Windows VMs. + * @member {string} [windowsProfile.adminUsername] The administrator username + * to use for Windows VMs. + * @member {string} [windowsProfile.adminPassword] The administrator password + * to use for Windows VMs. + * @member {object} linuxProfile Properties of Linux VMs. + * @member {string} [linuxProfile.adminUsername] The administrator username to + * use for Linux VMs. + * @member {object} [linuxProfile.ssh] The ssh key configuration for Linux VMs. + * @member {array} [linuxProfile.ssh.publicKeys] the list of SSH public keys + * used to authenticate with Linux-based VMs. + * @member {object} [diagnosticsProfile] Properties of the diagnostic agent. + * @member {object} [diagnosticsProfile.vmDiagnostics] Profile for the + * container service VM diagnostic agent. + * @member {boolean} [diagnosticsProfile.vmDiagnostics.enabled] Whether the VM + * diagnostic agent is provisioned on the VM. + * @member {string} [diagnosticsProfile.vmDiagnostics.storageUri] The URI of + * the storage account where diagnostics are stored. + */ +export interface ContainerService extends Resource { + readonly provisioningState?: string; + orchestratorProfile?: ContainerServiceOrchestratorProfile; + customProfile?: ContainerServiceCustomProfile; + servicePrincipalProfile?: ContainerServiceServicePrincipalProfile; + masterProfile: ContainerServiceMasterProfile; + agentPoolProfiles: ContainerServiceAgentPoolProfile[]; + windowsProfile?: ContainerServiceWindowsProfile; + linuxProfile: ContainerServiceLinuxProfile; + diagnosticsProfile?: ContainerServiceDiagnosticsProfile; +} + + +/** + * @class + * Initializes a new instance of the ComputeOperationListResult class. + * @constructor + * The List Compute Operation operation response. + * + */ +export interface ComputeOperationListResult extends Array { +} + +/** + * @class + * Initializes a new instance of the AvailabilitySetListResult class. + * @constructor + * The List Availability Set operation response. + * + */ +export interface AvailabilitySetListResult extends Array { +} + +/** + * @class + * Initializes a new instance of the VirtualMachineSizeListResult class. + * @constructor + * The List Virtual Machine operation response. + * + */ +export interface VirtualMachineSizeListResult extends Array { +} + +/** + * @class + * Initializes a new instance of the ListUsagesResult class. + * @constructor + * The List Usages operation response. + * + * @member {string} [nextLink] The URI to fetch the next page of compute + * resource usage information. Call ListNext() with this to fetch the next page + * of compute resource usage information. + */ +export interface ListUsagesResult extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the ImageListResult class. + * @constructor + * The List Image operation response. + * + * @member {string} [nextLink] The uri to fetch the next page of Images. Call + * ListNext() with this to fetch the next page of Images. + */ +export interface ImageListResult extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineListResult class. + * @constructor + * The List Virtual Machine operation response. + * + * @member {string} [nextLink] The URI to fetch the next page of VMs. Call + * ListNext() with this URI to fetch the next page of Virtual Machines. + */ +export interface VirtualMachineListResult extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineScaleSetListResult class. + * @constructor + * The List Virtual Machine operation response. + * + * @member {string} [nextLink] The uri to fetch the next page of Virtual + * Machine Scale Sets. Call ListNext() with this to fetch the next page of + * VMSS. + */ +export interface VirtualMachineScaleSetListResult extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineScaleSetListWithLinkResult class. + * @constructor + * The List Virtual Machine operation response. + * + * @member {string} [nextLink] The uri to fetch the next page of Virtual + * Machine Scale Sets. Call ListNext() with this to fetch the next page of + * Virtual Machine Scale Sets. + */ +export interface VirtualMachineScaleSetListWithLinkResult extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineScaleSetListSkusResult class. + * @constructor + * The Virtual Machine Scale Set List Skus operation response. + * + * @member {string} [nextLink] The uri to fetch the next page of Virtual + * Machine Scale Set Skus. Call ListNext() with this to fetch the next page of + * VMSS Skus. + */ +export interface VirtualMachineScaleSetListSkusResult extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineScaleSetListOSUpgradeHistory class. + * @constructor + * List of Virtual Machine Scale Set OS Upgrade History operation response. + * + * @member {string} [nextLink] The uri to fetch the next page of OS Upgrade + * History. Call ListNext() with this to fetch the next page of history of + * upgrades. + */ +export interface VirtualMachineScaleSetListOSUpgradeHistory extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineScaleSetExtensionListResult class. + * @constructor + * The List VM scale set extension operation response. + * + * @member {string} [nextLink] The uri to fetch the next page of VM scale set + * extensions. Call ListNext() with this to fetch the next page of VM scale set + * extensions. + */ +export interface VirtualMachineScaleSetExtensionListResult extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineScaleSetVMListResult class. + * @constructor + * The List Virtual Machine Scale Set VMs operation response. + * + * @member {string} [nextLink] The uri to fetch the next page of Virtual + * Machine Scale Set VMs. Call ListNext() with this to fetch the next page of + * VMSS VMs + */ +export interface VirtualMachineScaleSetVMListResult extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the RunCommandListResult class. + * @constructor + * The List Virtual Machine operation response. + * + * @member {string} [nextLink] The uri to fetch the next page of run commands. + * Call ListNext() with this to fetch the next page of run commands. + */ +export interface RunCommandListResult extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the ResourceSkusResult class. + * @constructor + * The Compute List Skus operation response. + * + * @member {string} [nextLink] The uri to fetch the next page of Compute Skus. + * Call ListNext() with this to fetch the next page of VMSS Skus. + */ +export interface ResourceSkusResult extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the DiskList class. + * @constructor + * The List Disks operation response. + * + * @member {string} [nextLink] The uri to fetch the next page of disks. Call + * ListNext() with this to fetch the next page of disks. + */ +export interface DiskList extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the SnapshotList class. + * @constructor + * The List Snapshots operation response. + * + * @member {string} [nextLink] The uri to fetch the next page of snapshots. + * Call ListNext() with this to fetch the next page of snapshots. + */ +export interface SnapshotList extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the ContainerServiceListResult class. + * @constructor + * The response from the List Container Services operation. + * + * @member {string} [nextLink] The URL to get the next set of container service + * results. + */ +export interface ContainerServiceListResult extends Array { + nextLink?: string; +} diff --git a/lib/services/computeManagement2/lib/lib/models/index.js b/lib/services/computeManagement2/lib/lib/models/index.js new file mode 100644 index 0000000000..0d6ced15ca --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/index.js @@ -0,0 +1,194 @@ +/* + * 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. + */ + +/* jshint latedef:false */ +/* jshint forin:false */ +/* jshint noempty:false */ + +'use strict'; + +var msRestAzure = require('ms-rest-azure'); + +exports.BaseResource = msRestAzure.BaseResource; +exports.CloudError = msRestAzure.CloudError; +exports.ComputeOperationValue = require('./computeOperationValue'); +exports.InstanceViewStatus = require('./instanceViewStatus'); +exports.SubResource = require('./subResource'); +exports.Sku = require('./sku'); +exports.Resource = require('./resource'); +exports.AvailabilitySet = require('./availabilitySet'); +exports.UpdateResource = require('./updateResource'); +exports.AvailabilitySetUpdate = require('./availabilitySetUpdate'); +exports.VirtualMachineSize = require('./virtualMachineSize'); +exports.VirtualMachineExtensionImage = require('./virtualMachineExtensionImage'); +exports.VirtualMachineImageResource = require('./virtualMachineImageResource'); +exports.VirtualMachineExtensionInstanceView = require('./virtualMachineExtensionInstanceView'); +exports.VirtualMachineExtension = require('./virtualMachineExtension'); +exports.PurchasePlan = require('./purchasePlan'); +exports.OSDiskImage = require('./oSDiskImage'); +exports.DataDiskImage = require('./dataDiskImage'); +exports.VirtualMachineImage = require('./virtualMachineImage'); +exports.UsageName = require('./usageName'); +exports.Usage = require('./usage'); +exports.VirtualMachineCaptureParameters = require('./virtualMachineCaptureParameters'); +exports.VirtualMachineCaptureResult = require('./virtualMachineCaptureResult'); +exports.Plan = require('./plan'); +exports.HardwareProfile = require('./hardwareProfile'); +exports.ImageReference = require('./imageReference'); +exports.KeyVaultSecretReference = require('./keyVaultSecretReference'); +exports.KeyVaultKeyReference = require('./keyVaultKeyReference'); +exports.DiskEncryptionSettings = require('./diskEncryptionSettings'); +exports.VirtualHardDisk = require('./virtualHardDisk'); +exports.ManagedDiskParameters = require('./managedDiskParameters'); +exports.OSDisk = require('./oSDisk'); +exports.DataDisk = require('./dataDisk'); +exports.StorageProfile = require('./storageProfile'); +exports.AdditionalUnattendContent = require('./additionalUnattendContent'); +exports.WinRMListener = require('./winRMListener'); +exports.WinRMConfiguration = require('./winRMConfiguration'); +exports.WindowsConfiguration = require('./windowsConfiguration'); +exports.SshPublicKey = require('./sshPublicKey'); +exports.SshConfiguration = require('./sshConfiguration'); +exports.LinuxConfiguration = require('./linuxConfiguration'); +exports.VaultCertificate = require('./vaultCertificate'); +exports.VaultSecretGroup = require('./vaultSecretGroup'); +exports.OSProfile = require('./oSProfile'); +exports.NetworkInterfaceReference = require('./networkInterfaceReference'); +exports.NetworkProfile = require('./networkProfile'); +exports.BootDiagnostics = require('./bootDiagnostics'); +exports.DiagnosticsProfile = require('./diagnosticsProfile'); +exports.VirtualMachineExtensionHandlerInstanceView = require('./virtualMachineExtensionHandlerInstanceView'); +exports.VirtualMachineAgentInstanceView = require('./virtualMachineAgentInstanceView'); +exports.DiskInstanceView = require('./diskInstanceView'); +exports.BootDiagnosticsInstanceView = require('./bootDiagnosticsInstanceView'); +exports.VirtualMachineIdentity = require('./virtualMachineIdentity'); +exports.MaintenanceRedeployStatus = require('./maintenanceRedeployStatus'); +exports.VirtualMachineInstanceView = require('./virtualMachineInstanceView'); +exports.VirtualMachine = require('./virtualMachine'); +exports.VirtualMachineUpdate = require('./virtualMachineUpdate'); +exports.RollingUpgradePolicy = require('./rollingUpgradePolicy'); +exports.UpgradePolicy = require('./upgradePolicy'); +exports.ImageOSDisk = require('./imageOSDisk'); +exports.ImageDataDisk = require('./imageDataDisk'); +exports.ImageStorageProfile = require('./imageStorageProfile'); +exports.Image = require('./image'); +exports.ImageUpdate = require('./imageUpdate'); +exports.VirtualMachineScaleSetIdentity = require('./virtualMachineScaleSetIdentity'); +exports.VirtualMachineScaleSetOSProfile = require('./virtualMachineScaleSetOSProfile'); +exports.VirtualMachineScaleSetUpdateOSProfile = require('./virtualMachineScaleSetUpdateOSProfile'); +exports.VirtualMachineScaleSetManagedDiskParameters = require('./virtualMachineScaleSetManagedDiskParameters'); +exports.VirtualMachineScaleSetOSDisk = require('./virtualMachineScaleSetOSDisk'); +exports.VirtualMachineScaleSetUpdateOSDisk = require('./virtualMachineScaleSetUpdateOSDisk'); +exports.VirtualMachineScaleSetDataDisk = require('./virtualMachineScaleSetDataDisk'); +exports.VirtualMachineScaleSetStorageProfile = require('./virtualMachineScaleSetStorageProfile'); +exports.VirtualMachineScaleSetUpdateStorageProfile = require('./virtualMachineScaleSetUpdateStorageProfile'); +exports.ApiEntityReference = require('./apiEntityReference'); +exports.VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings = require('./virtualMachineScaleSetPublicIPAddressConfigurationDnsSettings'); +exports.VirtualMachineScaleSetPublicIPAddressConfiguration = require('./virtualMachineScaleSetPublicIPAddressConfiguration'); +exports.VirtualMachineScaleSetUpdatePublicIPAddressConfiguration = require('./virtualMachineScaleSetUpdatePublicIPAddressConfiguration'); +exports.VirtualMachineScaleSetIPConfiguration = require('./virtualMachineScaleSetIPConfiguration'); +exports.VirtualMachineScaleSetUpdateIPConfiguration = require('./virtualMachineScaleSetUpdateIPConfiguration'); +exports.VirtualMachineScaleSetNetworkConfigurationDnsSettings = require('./virtualMachineScaleSetNetworkConfigurationDnsSettings'); +exports.VirtualMachineScaleSetNetworkConfiguration = require('./virtualMachineScaleSetNetworkConfiguration'); +exports.VirtualMachineScaleSetUpdateNetworkConfiguration = require('./virtualMachineScaleSetUpdateNetworkConfiguration'); +exports.VirtualMachineScaleSetNetworkProfile = require('./virtualMachineScaleSetNetworkProfile'); +exports.VirtualMachineScaleSetUpdateNetworkProfile = require('./virtualMachineScaleSetUpdateNetworkProfile'); +exports.SubResourceReadOnly = require('./subResourceReadOnly'); +exports.VirtualMachineScaleSetExtension = require('./virtualMachineScaleSetExtension'); +exports.VirtualMachineScaleSetExtensionProfile = require('./virtualMachineScaleSetExtensionProfile'); +exports.VirtualMachineScaleSetVMProfile = require('./virtualMachineScaleSetVMProfile'); +exports.VirtualMachineScaleSetUpdateVMProfile = require('./virtualMachineScaleSetUpdateVMProfile'); +exports.VirtualMachineScaleSet = require('./virtualMachineScaleSet'); +exports.VirtualMachineScaleSetUpdate = require('./virtualMachineScaleSetUpdate'); +exports.VirtualMachineScaleSetVMInstanceIDs = require('./virtualMachineScaleSetVMInstanceIDs'); +exports.VirtualMachineScaleSetVMInstanceRequiredIDs = require('./virtualMachineScaleSetVMInstanceRequiredIDs'); +exports.VirtualMachineStatusCodeCount = require('./virtualMachineStatusCodeCount'); +exports.VirtualMachineScaleSetInstanceViewStatusesSummary = require('./virtualMachineScaleSetInstanceViewStatusesSummary'); +exports.VirtualMachineScaleSetVMExtensionsSummary = require('./virtualMachineScaleSetVMExtensionsSummary'); +exports.VirtualMachineScaleSetInstanceView = require('./virtualMachineScaleSetInstanceView'); +exports.VirtualMachineScaleSetSkuCapacity = require('./virtualMachineScaleSetSkuCapacity'); +exports.VirtualMachineScaleSetSku = require('./virtualMachineScaleSetSku'); +exports.UpgradeOperationHistoryStatus = require('./upgradeOperationHistoryStatus'); +exports.RollingUpgradeProgressInfo = require('./rollingUpgradeProgressInfo'); +exports.ApiErrorBase = require('./apiErrorBase'); +exports.InnerError = require('./innerError'); +exports.ApiError = require('./apiError'); +exports.UpgradeOperationHistoricalStatusInfoProperties = require('./upgradeOperationHistoricalStatusInfoProperties'); +exports.UpgradeOperationHistoricalStatusInfo = require('./upgradeOperationHistoricalStatusInfo'); +exports.VirtualMachineScaleSetVM = require('./virtualMachineScaleSetVM'); +exports.VirtualMachineHealthStatus = require('./virtualMachineHealthStatus'); +exports.VirtualMachineScaleSetVMInstanceView = require('./virtualMachineScaleSetVMInstanceView'); +exports.RollingUpgradeRunningStatus = require('./rollingUpgradeRunningStatus'); +exports.RollingUpgradeStatusInfo = require('./rollingUpgradeStatusInfo'); +exports.ComputeLongRunningOperationProperties = require('./computeLongRunningOperationProperties'); +exports.RecoveryWalkResponse = require('./recoveryWalkResponse'); +exports.OperationStatusResponse = require('./operationStatusResponse'); +exports.LogAnalyticsInputBase = require('./logAnalyticsInputBase'); +exports.RequestRateByIntervalInput = require('./requestRateByIntervalInput'); +exports.ThrottledRequestsInput = require('./throttledRequestsInput'); +exports.LogAnalyticsOutput = require('./logAnalyticsOutput'); +exports.LogAnalyticsOperationResult = require('./logAnalyticsOperationResult'); +exports.RunCommandInputParameter = require('./runCommandInputParameter'); +exports.RunCommandInput = require('./runCommandInput'); +exports.RunCommandParameterDefinition = require('./runCommandParameterDefinition'); +exports.RunCommandDocumentBase = require('./runCommandDocumentBase'); +exports.RunCommandDocument = require('./runCommandDocument'); +exports.RunCommandResult = require('./runCommandResult'); +exports.ResourceSkuCapacity = require('./resourceSkuCapacity'); +exports.ResourceSkuCosts = require('./resourceSkuCosts'); +exports.ResourceSkuCapabilities = require('./resourceSkuCapabilities'); +exports.ResourceSkuRestrictionInfo = require('./resourceSkuRestrictionInfo'); +exports.ResourceSkuRestrictions = require('./resourceSkuRestrictions'); +exports.ResourceSkuLocationInfo = require('./resourceSkuLocationInfo'); +exports.ResourceSku = require('./resourceSku'); +exports.DiskSku = require('./diskSku'); +exports.ResourceUpdate = require('./resourceUpdate'); +exports.ImageDiskReference = require('./imageDiskReference'); +exports.CreationData = require('./creationData'); +exports.SourceVault = require('./sourceVault'); +exports.KeyVaultAndSecretReference = require('./keyVaultAndSecretReference'); +exports.KeyVaultAndKeyReference = require('./keyVaultAndKeyReference'); +exports.EncryptionSettings = require('./encryptionSettings'); +exports.Disk = require('./disk'); +exports.DiskUpdate = require('./diskUpdate'); +exports.SnapshotSku = require('./snapshotSku'); +exports.GrantAccessData = require('./grantAccessData'); +exports.AccessUri = require('./accessUri'); +exports.Snapshot = require('./snapshot'); +exports.SnapshotUpdate = require('./snapshotUpdate'); +exports.ContainerServiceCustomProfile = require('./containerServiceCustomProfile'); +exports.ContainerServiceServicePrincipalProfile = require('./containerServiceServicePrincipalProfile'); +exports.ContainerServiceOrchestratorProfile = require('./containerServiceOrchestratorProfile'); +exports.ContainerServiceMasterProfile = require('./containerServiceMasterProfile'); +exports.ContainerServiceAgentPoolProfile = require('./containerServiceAgentPoolProfile'); +exports.ContainerServiceWindowsProfile = require('./containerServiceWindowsProfile'); +exports.ContainerServiceSshPublicKey = require('./containerServiceSshPublicKey'); +exports.ContainerServiceSshConfiguration = require('./containerServiceSshConfiguration'); +exports.ContainerServiceLinuxProfile = require('./containerServiceLinuxProfile'); +exports.ContainerServiceVMDiagnostics = require('./containerServiceVMDiagnostics'); +exports.ContainerServiceDiagnosticsProfile = require('./containerServiceDiagnosticsProfile'); +exports.ContainerService = require('./containerService'); +exports.ComputeOperationListResult = require('./computeOperationListResult'); +exports.AvailabilitySetListResult = require('./availabilitySetListResult'); +exports.VirtualMachineSizeListResult = require('./virtualMachineSizeListResult'); +exports.ListUsagesResult = require('./listUsagesResult'); +exports.ImageListResult = require('./imageListResult'); +exports.VirtualMachineListResult = require('./virtualMachineListResult'); +exports.VirtualMachineScaleSetListResult = require('./virtualMachineScaleSetListResult'); +exports.VirtualMachineScaleSetListWithLinkResult = require('./virtualMachineScaleSetListWithLinkResult'); +exports.VirtualMachineScaleSetListSkusResult = require('./virtualMachineScaleSetListSkusResult'); +exports.VirtualMachineScaleSetListOSUpgradeHistory = require('./virtualMachineScaleSetListOSUpgradeHistory'); +exports.VirtualMachineScaleSetExtensionListResult = require('./virtualMachineScaleSetExtensionListResult'); +exports.VirtualMachineScaleSetVMListResult = require('./virtualMachineScaleSetVMListResult'); +exports.RunCommandListResult = require('./runCommandListResult'); +exports.ResourceSkusResult = require('./resourceSkusResult'); +exports.DiskList = require('./diskList'); +exports.SnapshotList = require('./snapshotList'); +exports.ContainerServiceListResult = require('./containerServiceListResult'); diff --git a/lib/services/computeManagement2/lib/lib/models/innerError.js b/lib/services/computeManagement2/lib/lib/models/innerError.js new file mode 100644 index 0000000000..95c1a511d5 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/innerError.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'; + +/** + * Inner error details. + * + */ +class InnerError { + /** + * Create a InnerError. + * @member {string} [exceptiontype] The exception type. + * @member {string} [errordetail] The internal error message or exception + * dump. + */ + constructor() { + } + + /** + * Defines the metadata of InnerError + * + * @returns {object} metadata of InnerError + * + */ + mapper() { + return { + required: false, + serializedName: 'InnerError', + type: { + name: 'Composite', + className: 'InnerError', + modelProperties: { + exceptiontype: { + required: false, + serializedName: 'exceptiontype', + type: { + name: 'String' + } + }, + errordetail: { + required: false, + serializedName: 'errordetail', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = InnerError; diff --git a/lib/services/computeManagement2/lib/lib/models/instanceViewStatus.js b/lib/services/computeManagement2/lib/lib/models/instanceViewStatus.js new file mode 100644 index 0000000000..fdc583e161 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/instanceViewStatus.js @@ -0,0 +1,88 @@ +/* + * 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'; + +/** + * Instance view status. + * + */ +class InstanceViewStatus { + /** + * Create a InstanceViewStatus. + * @member {string} [code] The status code. + * @member {string} [level] The level code. Possible values include: 'Info', + * 'Warning', 'Error' + * @member {string} [displayStatus] The short localizable label for the + * status. + * @member {string} [message] The detailed status message, including for + * alerts and error messages. + * @member {date} [time] The time of the status. + */ + constructor() { + } + + /** + * Defines the metadata of InstanceViewStatus + * + * @returns {object} metadata of InstanceViewStatus + * + */ + mapper() { + return { + required: false, + serializedName: 'InstanceViewStatus', + type: { + name: 'Composite', + className: 'InstanceViewStatus', + modelProperties: { + code: { + required: false, + serializedName: 'code', + type: { + name: 'String' + } + }, + level: { + required: false, + serializedName: 'level', + type: { + name: 'Enum', + allowedValues: [ 'Info', 'Warning', 'Error' ] + } + }, + displayStatus: { + required: false, + serializedName: 'displayStatus', + type: { + name: 'String' + } + }, + message: { + required: false, + serializedName: 'message', + type: { + name: 'String' + } + }, + time: { + required: false, + serializedName: 'time', + type: { + name: 'DateTime' + } + } + } + } + }; + } +} + +module.exports = InstanceViewStatus; diff --git a/lib/services/computeManagement2/lib/lib/models/keyVaultAndKeyReference.js b/lib/services/computeManagement2/lib/lib/models/keyVaultAndKeyReference.js new file mode 100644 index 0000000000..a20c7e9b39 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/keyVaultAndKeyReference.js @@ -0,0 +1,66 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Key Vault Key Url and vault id of KeK, KeK is optional and when provided is + * used to unwrap the encryptionKey + * + */ +class KeyVaultAndKeyReference { + /** + * Create a KeyVaultAndKeyReference. + * @member {object} sourceVault Resource id of the KeyVault containing the + * key or secret + * @member {string} [sourceVault.id] Resource Id + * @member {string} keyUrl Url pointing to a key or secret in KeyVault + */ + constructor() { + } + + /** + * Defines the metadata of KeyVaultAndKeyReference + * + * @returns {object} metadata of KeyVaultAndKeyReference + * + */ + mapper() { + return { + required: false, + serializedName: 'KeyVaultAndKeyReference', + type: { + name: 'Composite', + className: 'KeyVaultAndKeyReference', + modelProperties: { + sourceVault: { + required: true, + serializedName: 'sourceVault', + type: { + name: 'Composite', + className: 'SourceVault' + } + }, + keyUrl: { + required: true, + serializedName: 'keyUrl', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = KeyVaultAndKeyReference; diff --git a/lib/services/computeManagement2/lib/lib/models/keyVaultAndSecretReference.js b/lib/services/computeManagement2/lib/lib/models/keyVaultAndSecretReference.js new file mode 100644 index 0000000000..967bc9c38c --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/keyVaultAndSecretReference.js @@ -0,0 +1,65 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Key Vault Secret Url and vault id of the encryption key + * + */ +class KeyVaultAndSecretReference { + /** + * Create a KeyVaultAndSecretReference. + * @member {object} sourceVault Resource id of the KeyVault containing the + * key or secret + * @member {string} [sourceVault.id] Resource Id + * @member {string} secretUrl Url pointing to a key or secret in KeyVault + */ + constructor() { + } + + /** + * Defines the metadata of KeyVaultAndSecretReference + * + * @returns {object} metadata of KeyVaultAndSecretReference + * + */ + mapper() { + return { + required: false, + serializedName: 'KeyVaultAndSecretReference', + type: { + name: 'Composite', + className: 'KeyVaultAndSecretReference', + modelProperties: { + sourceVault: { + required: true, + serializedName: 'sourceVault', + type: { + name: 'Composite', + className: 'SourceVault' + } + }, + secretUrl: { + required: true, + serializedName: 'secretUrl', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = KeyVaultAndSecretReference; diff --git a/lib/services/computeManagement2/lib/lib/models/keyVaultKeyReference.js b/lib/services/computeManagement2/lib/lib/models/keyVaultKeyReference.js new file mode 100644 index 0000000000..d5875b2927 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/keyVaultKeyReference.js @@ -0,0 +1,66 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Describes a reference to Key Vault Key + * + */ +class KeyVaultKeyReference { + /** + * Create a KeyVaultKeyReference. + * @member {string} keyUrl The URL referencing a key encryption key in Key + * Vault. + * @member {object} sourceVault The relative URL of the Key Vault containing + * the key. + * @member {string} [sourceVault.id] Resource Id + */ + constructor() { + } + + /** + * Defines the metadata of KeyVaultKeyReference + * + * @returns {object} metadata of KeyVaultKeyReference + * + */ + mapper() { + return { + required: false, + serializedName: 'KeyVaultKeyReference', + type: { + name: 'Composite', + className: 'KeyVaultKeyReference', + modelProperties: { + keyUrl: { + required: true, + serializedName: 'keyUrl', + type: { + name: 'String' + } + }, + sourceVault: { + required: true, + serializedName: 'sourceVault', + type: { + name: 'Composite', + className: 'SubResource' + } + } + } + } + }; + } +} + +module.exports = KeyVaultKeyReference; diff --git a/lib/services/computeManagement2/lib/lib/models/keyVaultSecretReference.js b/lib/services/computeManagement2/lib/lib/models/keyVaultSecretReference.js new file mode 100644 index 0000000000..ea317e47e8 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/keyVaultSecretReference.js @@ -0,0 +1,65 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Describes a reference to Key Vault Secret + * + */ +class KeyVaultSecretReference { + /** + * Create a KeyVaultSecretReference. + * @member {string} secretUrl The URL referencing a secret in a Key Vault. + * @member {object} sourceVault The relative URL of the Key Vault containing + * the secret. + * @member {string} [sourceVault.id] Resource Id + */ + constructor() { + } + + /** + * Defines the metadata of KeyVaultSecretReference + * + * @returns {object} metadata of KeyVaultSecretReference + * + */ + mapper() { + return { + required: false, + serializedName: 'KeyVaultSecretReference', + type: { + name: 'Composite', + className: 'KeyVaultSecretReference', + modelProperties: { + secretUrl: { + required: true, + serializedName: 'secretUrl', + type: { + name: 'String' + } + }, + sourceVault: { + required: true, + serializedName: 'sourceVault', + type: { + name: 'Composite', + className: 'SubResource' + } + } + } + } + }; + } +} + +module.exports = KeyVaultSecretReference; diff --git a/lib/services/computeManagement2/lib/lib/models/linuxConfiguration.js b/lib/services/computeManagement2/lib/lib/models/linuxConfiguration.js new file mode 100644 index 0000000000..879d4b2cc5 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/linuxConfiguration.js @@ -0,0 +1,72 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Specifies the Linux operating system settings on the virtual machine. + *

    For a list of supported Linux distributions, see [Linux on + * Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + */ +class LinuxConfiguration { + /** + * Create a LinuxConfiguration. + * @member {boolean} [disablePasswordAuthentication] Specifies whether + * password authentication should be disabled. + * @member {object} [ssh] Specifies the ssh key configuration for a Linux OS. + * @member {array} [ssh.publicKeys] The list of SSH public keys used to + * authenticate with linux based VMs. + */ + constructor() { + } + + /** + * Defines the metadata of LinuxConfiguration + * + * @returns {object} metadata of LinuxConfiguration + * + */ + mapper() { + return { + required: false, + serializedName: 'LinuxConfiguration', + type: { + name: 'Composite', + className: 'LinuxConfiguration', + modelProperties: { + disablePasswordAuthentication: { + required: false, + serializedName: 'disablePasswordAuthentication', + type: { + name: 'Boolean' + } + }, + ssh: { + required: false, + serializedName: 'ssh', + type: { + name: 'Composite', + className: 'SshConfiguration' + } + } + } + } + }; + } +} + +module.exports = LinuxConfiguration; diff --git a/lib/services/computeManagement2/lib/lib/models/listUsagesResult.js b/lib/services/computeManagement2/lib/lib/models/listUsagesResult.js new file mode 100644 index 0000000000..b47f4a7160 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/listUsagesResult.js @@ -0,0 +1,69 @@ +/* + * 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 List Usages operation response. + */ +class ListUsagesResult extends Array { + /** + * Create a ListUsagesResult. + * @member {string} [nextLink] The URI to fetch the next page of compute + * resource usage information. Call ListNext() with this to fetch the next + * page of compute resource usage information. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ListUsagesResult + * + * @returns {object} metadata of ListUsagesResult + * + */ + mapper() { + return { + required: false, + serializedName: 'ListUsagesResult', + type: { + name: 'Composite', + className: 'ListUsagesResult', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'UsageElementType', + type: { + name: 'Composite', + className: 'Usage' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ListUsagesResult; diff --git a/lib/services/computeManagement2/lib/lib/models/logAnalyticsInputBase.js b/lib/services/computeManagement2/lib/lib/models/logAnalyticsInputBase.js new file mode 100644 index 0000000000..83958ab6b1 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/logAnalyticsInputBase.js @@ -0,0 +1,96 @@ +/* + * 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'; + +/** + * Api input base class for LogAnalytics Api. + * + */ +class LogAnalyticsInputBase { + /** + * Create a LogAnalyticsInputBase. + * @member {string} blobContainerSasUri SAS Uri of the logging blob container + * to which LogAnalytics Api writes output logs to. + * @member {date} fromTime From time of the query + * @member {date} toTime To time of the query + * @member {boolean} [groupByThrottlePolicy] Group query result by Throttle + * Policy applied. + * @member {boolean} [groupByOperationName] Group query result by by + * Operation Name. + * @member {boolean} [groupByResourceName] Group query result by Resource + * Name. + */ + constructor() { + } + + /** + * Defines the metadata of LogAnalyticsInputBase + * + * @returns {object} metadata of LogAnalyticsInputBase + * + */ + mapper() { + return { + required: false, + serializedName: 'LogAnalyticsInputBase', + type: { + name: 'Composite', + className: 'LogAnalyticsInputBase', + modelProperties: { + blobContainerSasUri: { + required: true, + serializedName: 'blobContainerSasUri', + type: { + name: 'String' + } + }, + fromTime: { + required: true, + serializedName: 'fromTime', + type: { + name: 'DateTime' + } + }, + toTime: { + required: true, + serializedName: 'toTime', + type: { + name: 'DateTime' + } + }, + groupByThrottlePolicy: { + required: false, + serializedName: 'groupByThrottlePolicy', + type: { + name: 'Boolean' + } + }, + groupByOperationName: { + required: false, + serializedName: 'groupByOperationName', + type: { + name: 'Boolean' + } + }, + groupByResourceName: { + required: false, + serializedName: 'groupByResourceName', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = LogAnalyticsInputBase; diff --git a/lib/services/computeManagement2/lib/lib/models/logAnalyticsOperationResult.js b/lib/services/computeManagement2/lib/lib/models/logAnalyticsOperationResult.js new file mode 100644 index 0000000000..0bc73509e1 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/logAnalyticsOperationResult.js @@ -0,0 +1,101 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * LogAnalytics operation status response + * + * @extends models['OperationStatusResponse'] + */ +class LogAnalyticsOperationResult extends models['OperationStatusResponse'] { + /** + * Create a LogAnalyticsOperationResult. + * @member {object} [properties] LogAnalyticsOutput + * @member {string} [properties.output] Output file Uri path to blob + * container. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of LogAnalyticsOperationResult + * + * @returns {object} metadata of LogAnalyticsOperationResult + * + */ + mapper() { + return { + required: false, + serializedName: 'LogAnalyticsOperationResult', + type: { + name: 'Composite', + className: 'LogAnalyticsOperationResult', + modelProperties: { + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + status: { + required: false, + readOnly: true, + serializedName: 'status', + type: { + name: 'String' + } + }, + startTime: { + required: false, + readOnly: true, + serializedName: 'startTime', + type: { + name: 'DateTime' + } + }, + endTime: { + required: false, + readOnly: true, + serializedName: 'endTime', + type: { + name: 'DateTime' + } + }, + error: { + required: false, + readOnly: true, + serializedName: 'error', + type: { + name: 'Composite', + className: 'ApiError' + } + }, + properties: { + required: false, + readOnly: true, + serializedName: 'properties', + type: { + name: 'Composite', + className: 'LogAnalyticsOutput' + } + } + } + } + }; + } +} + +module.exports = LogAnalyticsOperationResult; diff --git a/lib/services/computeManagement2/lib/lib/models/logAnalyticsOutput.js b/lib/services/computeManagement2/lib/lib/models/logAnalyticsOutput.js new file mode 100644 index 0000000000..a69e948aed --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/logAnalyticsOutput.js @@ -0,0 +1,53 @@ +/* + * 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'; + +/** + * LogAnalytics output properties + * + */ +class LogAnalyticsOutput { + /** + * Create a LogAnalyticsOutput. + * @member {string} [output] Output file Uri path to blob container. + */ + constructor() { + } + + /** + * Defines the metadata of LogAnalyticsOutput + * + * @returns {object} metadata of LogAnalyticsOutput + * + */ + mapper() { + return { + required: false, + serializedName: 'LogAnalyticsOutput', + type: { + name: 'Composite', + className: 'LogAnalyticsOutput', + modelProperties: { + output: { + required: false, + readOnly: true, + serializedName: 'output', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = LogAnalyticsOutput; diff --git a/lib/services/computeManagement2/lib/lib/models/maintenanceRedeployStatus.js b/lib/services/computeManagement2/lib/lib/models/maintenanceRedeployStatus.js new file mode 100644 index 0000000000..4fdc491a23 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/maintenanceRedeployStatus.js @@ -0,0 +1,109 @@ +/* + * 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'; + +/** + * Maintenance Operation Status. + * + */ +class MaintenanceRedeployStatus { + /** + * Create a MaintenanceRedeployStatus. + * @member {boolean} [isCustomerInitiatedMaintenanceAllowed] True, if + * customer is allowed to perform Maintenance. + * @member {date} [preMaintenanceWindowStartTime] Start Time for the Pre + * Maintenance Window. + * @member {date} [preMaintenanceWindowEndTime] End Time for the Pre + * Maintenance Window. + * @member {date} [maintenanceWindowStartTime] Start Time for the Maintenance + * Window. + * @member {date} [maintenanceWindowEndTime] End Time for the Maintenance + * Window. + * @member {string} [lastOperationResultCode] The Last Maintenance Operation + * Result Code. Possible values include: 'None', 'RetryLater', + * 'MaintenanceAborted', 'MaintenanceCompleted' + * @member {string} [lastOperationMessage] Message returned for the last + * Maintenance Operation. + */ + constructor() { + } + + /** + * Defines the metadata of MaintenanceRedeployStatus + * + * @returns {object} metadata of MaintenanceRedeployStatus + * + */ + mapper() { + return { + required: false, + serializedName: 'MaintenanceRedeployStatus', + type: { + name: 'Composite', + className: 'MaintenanceRedeployStatus', + modelProperties: { + isCustomerInitiatedMaintenanceAllowed: { + required: false, + serializedName: 'isCustomerInitiatedMaintenanceAllowed', + type: { + name: 'Boolean' + } + }, + preMaintenanceWindowStartTime: { + required: false, + serializedName: 'preMaintenanceWindowStartTime', + type: { + name: 'DateTime' + } + }, + preMaintenanceWindowEndTime: { + required: false, + serializedName: 'preMaintenanceWindowEndTime', + type: { + name: 'DateTime' + } + }, + maintenanceWindowStartTime: { + required: false, + serializedName: 'maintenanceWindowStartTime', + type: { + name: 'DateTime' + } + }, + maintenanceWindowEndTime: { + required: false, + serializedName: 'maintenanceWindowEndTime', + type: { + name: 'DateTime' + } + }, + lastOperationResultCode: { + required: false, + serializedName: 'lastOperationResultCode', + type: { + name: 'Enum', + allowedValues: [ 'None', 'RetryLater', 'MaintenanceAborted', 'MaintenanceCompleted' ] + } + }, + lastOperationMessage: { + required: false, + serializedName: 'lastOperationMessage', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = MaintenanceRedeployStatus; diff --git a/lib/services/computeManagement2/lib/lib/models/managedDiskParameters.js b/lib/services/computeManagement2/lib/lib/models/managedDiskParameters.js new file mode 100644 index 0000000000..3764fa7812 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/managedDiskParameters.js @@ -0,0 +1,65 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The parameters of a managed disk. + * + * @extends models['SubResource'] + */ +class ManagedDiskParameters extends models['SubResource'] { + /** + * Create a ManagedDiskParameters. + * @member {string} [storageAccountType] Specifies the storage account type + * for the managed disk. Possible values are: Standard_LRS or Premium_LRS. + * Possible values include: 'Standard_LRS', 'Premium_LRS' + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ManagedDiskParameters + * + * @returns {object} metadata of ManagedDiskParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'ManagedDiskParameters', + type: { + name: 'Composite', + className: 'ManagedDiskParameters', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + storageAccountType: { + required: false, + serializedName: 'storageAccountType', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ManagedDiskParameters; diff --git a/lib/services/computeManagement2/lib/lib/models/networkInterfaceReference.js b/lib/services/computeManagement2/lib/lib/models/networkInterfaceReference.js new file mode 100644 index 0000000000..d378edc9d1 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/networkInterfaceReference.js @@ -0,0 +1,64 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Describes a network interface reference. + * + * @extends models['SubResource'] + */ +class NetworkInterfaceReference extends models['SubResource'] { + /** + * Create a NetworkInterfaceReference. + * @member {boolean} [primary] Specifies the primary network interface in + * case the virtual machine has more than 1 network interface. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of NetworkInterfaceReference + * + * @returns {object} metadata of NetworkInterfaceReference + * + */ + mapper() { + return { + required: false, + serializedName: 'NetworkInterfaceReference', + type: { + name: 'Composite', + className: 'NetworkInterfaceReference', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + primary: { + required: false, + serializedName: 'properties.primary', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = NetworkInterfaceReference; diff --git a/lib/services/computeManagement2/lib/lib/models/networkProfile.js b/lib/services/computeManagement2/lib/lib/models/networkProfile.js new file mode 100644 index 0000000000..050b2faa00 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/networkProfile.js @@ -0,0 +1,63 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Specifies the network interfaces of the virtual machine. + * + */ +class NetworkProfile { + /** + * Create a NetworkProfile. + * @member {array} [networkInterfaces] Specifies the list of resource Ids for + * the network interfaces associated with the virtual machine. + */ + constructor() { + } + + /** + * Defines the metadata of NetworkProfile + * + * @returns {object} metadata of NetworkProfile + * + */ + mapper() { + return { + required: false, + serializedName: 'NetworkProfile', + type: { + name: 'Composite', + className: 'NetworkProfile', + modelProperties: { + networkInterfaces: { + required: false, + serializedName: 'networkInterfaces', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NetworkInterfaceReferenceElementType', + type: { + name: 'Composite', + className: 'NetworkInterfaceReference' + } + } + } + } + } + } + }; + } +} + +module.exports = NetworkProfile; diff --git a/lib/services/computeManagement2/lib/lib/models/oSDisk.js b/lib/services/computeManagement2/lib/lib/models/oSDisk.js new file mode 100644 index 0000000000..bf576f1740 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/oSDisk.js @@ -0,0 +1,179 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Specifies information about the operating system disk used by the virtual + * machine.

    For more information about disks, see [About disks and + * VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + */ +class OSDisk { + /** + * Create a OSDisk. + * @member {string} [osType] This property allows you to specify the type of + * the OS that is included in the disk if creating a VM from user-image or a + * specialized VHD.

    Possible values are:

    **Windows** + *

    **Linux**. Possible values include: 'Windows', 'Linux' + * @member {object} [encryptionSettings] Specifies the encryption settings + * for the OS Disk.

    Minimum api-version: 2015-06-15 + * @member {object} [encryptionSettings.diskEncryptionKey] Specifies the + * location of the disk encryption key, which is a Key Vault Secret. + * @member {string} [encryptionSettings.diskEncryptionKey.secretUrl] The URL + * referencing a secret in a Key Vault. + * @member {object} [encryptionSettings.diskEncryptionKey.sourceVault] The + * relative URL of the Key Vault containing the secret. + * @member {string} [encryptionSettings.diskEncryptionKey.sourceVault.id] + * Resource Id + * @member {object} [encryptionSettings.keyEncryptionKey] Specifies the + * location of the key encryption key in Key Vault. + * @member {string} [encryptionSettings.keyEncryptionKey.keyUrl] The URL + * referencing a key encryption key in Key Vault. + * @member {object} [encryptionSettings.keyEncryptionKey.sourceVault] The + * relative URL of the Key Vault containing the key. + * @member {string} [encryptionSettings.keyEncryptionKey.sourceVault.id] + * Resource Id + * @member {boolean} [encryptionSettings.enabled] Specifies whether disk + * encryption should be enabled on the virtual machine. + * @member {string} [name] The disk name. + * @member {object} [vhd] The virtual hard disk. + * @member {string} [vhd.uri] Specifies the virtual hard disk's uri. + * @member {object} [image] The source user image virtual hard disk. The + * virtual hard disk will be copied before being attached to the virtual + * machine. If SourceImage is provided, the destination virtual hard drive + * must not exist. + * @member {string} [image.uri] Specifies the virtual hard disk's uri. + * @member {string} [caching] Specifies the caching requirements.

    + * Possible values are:

    **None**

    **ReadOnly**

    + * **ReadWrite**

    Default: **None for Standard storage. ReadOnly for + * Premium storage**. Possible values include: 'None', 'ReadOnly', + * 'ReadWrite' + * @member {boolean} [writeAcceleratorEnabled] Specifies whether + * writeAccelerator should be enabled or disabled on the disk. + * @member {string} createOption Specifies how the virtual machine should be + * created.

    Possible values are:

    **Attach** \u2013 This value + * is used when you are using a specialized disk to create the virtual + * machine.

    **FromImage** \u2013 This value is used when you are + * using an image to create the virtual machine. If you are using a platform + * image, you also use the imageReference element described above. If you are + * using a marketplace image, you also use the plan element previously + * described. Possible values include: 'FromImage', 'Empty', 'Attach' + * @member {number} [diskSizeGB] Specifies the size of an empty data disk in + * gigabytes. This element can be used to overwrite the name of the disk in a + * virtual machine image.

    This value cannot be larger than 1023 GB + * @member {object} [managedDisk] The managed disk parameters. + * @member {string} [managedDisk.storageAccountType] Specifies the storage + * account type for the managed disk. Possible values are: Standard_LRS or + * Premium_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS' + */ + constructor() { + } + + /** + * Defines the metadata of OSDisk + * + * @returns {object} metadata of OSDisk + * + */ + mapper() { + return { + required: false, + serializedName: 'OSDisk', + type: { + name: 'Composite', + className: 'OSDisk', + modelProperties: { + osType: { + required: false, + serializedName: 'osType', + type: { + name: 'Enum', + allowedValues: [ 'Windows', 'Linux' ] + } + }, + encryptionSettings: { + required: false, + serializedName: 'encryptionSettings', + type: { + name: 'Composite', + className: 'DiskEncryptionSettings' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + vhd: { + required: false, + serializedName: 'vhd', + type: { + name: 'Composite', + className: 'VirtualHardDisk' + } + }, + image: { + required: false, + serializedName: 'image', + type: { + name: 'Composite', + className: 'VirtualHardDisk' + } + }, + caching: { + required: false, + serializedName: 'caching', + type: { + name: 'Enum', + allowedValues: [ 'None', 'ReadOnly', 'ReadWrite' ] + } + }, + writeAcceleratorEnabled: { + required: false, + serializedName: 'writeAcceleratorEnabled', + type: { + name: 'Boolean' + } + }, + createOption: { + required: true, + serializedName: 'createOption', + type: { + name: 'String' + } + }, + diskSizeGB: { + required: false, + serializedName: 'diskSizeGB', + type: { + name: 'Number' + } + }, + managedDisk: { + required: false, + serializedName: 'managedDisk', + type: { + name: 'Composite', + className: 'ManagedDiskParameters' + } + } + } + } + }; + } +} + +module.exports = OSDisk; diff --git a/lib/services/computeManagement2/lib/lib/models/oSDiskImage.js b/lib/services/computeManagement2/lib/lib/models/oSDiskImage.js new file mode 100644 index 0000000000..8dff55f85e --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/oSDiskImage.js @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Contains the os disk image information. + * + */ +class OSDiskImage { + /** + * Create a OSDiskImage. + * @member {string} operatingSystem The operating system of the osDiskImage. + * Possible values include: 'Windows', 'Linux' + */ + constructor() { + } + + /** + * Defines the metadata of OSDiskImage + * + * @returns {object} metadata of OSDiskImage + * + */ + mapper() { + return { + required: false, + serializedName: 'OSDiskImage', + type: { + name: 'Composite', + className: 'OSDiskImage', + modelProperties: { + operatingSystem: { + required: true, + serializedName: 'operatingSystem', + type: { + name: 'Enum', + allowedValues: [ 'Windows', 'Linux' ] + } + } + } + } + }; + } +} + +module.exports = OSDiskImage; diff --git a/lib/services/computeManagement2/lib/lib/models/oSProfile.js b/lib/services/computeManagement2/lib/lib/models/oSProfile.js new file mode 100644 index 0000000000..cf904eba6f --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/oSProfile.js @@ -0,0 +1,178 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Specifies the operating system settings for the virtual machine. + * + */ +class OSProfile { + /** + * Create a OSProfile. + * @member {string} [computerName] Specifies the host OS name of the virtual + * machine.

    **Max-length (Windows):** 15 characters

    + * **Max-length (Linux):** 64 characters.

    For naming conventions and + * restrictions see [Azure infrastructure services implementation + * guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). + * @member {string} [adminUsername] Specifies the name of the administrator + * account.

    **Windows-only restriction:** Cannot end in "."

    + * **Disallowed values:** "administrator", "admin", "user", "user1", "test", + * "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", + * "admin2", "aspnet", "backup", "console", "david", "guest", "john", + * "owner", "root", "server", "sql", "support", "support_388945a0", "sys", + * "test2", "test3", "user4", "user5".

    **Minimum-length (Linux):** 1 + * character

    **Max-length (Linux):** 64 characters

    + * **Max-length (Windows):** 20 characters

  • For root access to + * the Linux VM, see [Using root privileges on Linux virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in + * this field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * @member {string} [adminPassword] Specifies the password of the + * administrator account.

    **Minimum-length (Windows):** 8 characters + *

    **Minimum-length (Linux):** 6 characters

    **Max-length + * (Windows):** 123 characters

    **Max-length (Linux):** 72 characters + *

    **Complexity requirements:** 3 out of 4 conditions below need to + * be fulfilled
    Has lower characters
    Has upper characters
    Has a + * digit
    Has a special character (Regex match [\W_])

    + * **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", + * "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", + * "iloveyou!"

    For resetting the password, see [How to reset the + * Remote Desktop service or its login password in a Windows + * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    For resetting root password, see [Manage users, SSH, and check or + * repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + * @member {string} [customData] Specifies a base-64 encoded string of custom + * data. The base-64 encoded string is decoded to a binary array that is + * saved as a file on the Virtual Machine. The maximum length of the binary + * array is 65535 bytes.

    For using cloud-init for your VM, see + * [Using cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * @member {object} [windowsConfiguration] Specifies Windows operating system + * settings on the virtual machine. + * @member {boolean} [windowsConfiguration.provisionVMAgent] Indicates + * whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * @member {boolean} [windowsConfiguration.enableAutomaticUpdates] Indicates + * whether virtual machine is enabled for automatic updates. + * @member {string} [windowsConfiguration.timeZone] Specifies the time zone + * of the virtual machine. e.g. "Pacific Standard Time" + * @member {array} [windowsConfiguration.additionalUnattendContent] Specifies + * additional base-64 encoded XML formatted information that can be included + * in the Unattend.xml file, which is used by Windows Setup. + * @member {object} [windowsConfiguration.winRM] Specifies the Windows Remote + * Management listeners. This enables remote Windows PowerShell. + * @member {array} [windowsConfiguration.winRM.listeners] The list of Windows + * Remote Management listeners + * @member {object} [linuxConfiguration] Specifies the Linux operating system + * settings on the virtual machine.

    For a list of supported Linux + * distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * @member {boolean} [linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * @member {object} [linuxConfiguration.ssh] Specifies the ssh key + * configuration for a Linux OS. + * @member {array} [linuxConfiguration.ssh.publicKeys] The list of SSH public + * keys used to authenticate with linux based VMs. + * @member {array} [secrets] Specifies set of certificates that should be + * installed onto the virtual machine. + */ + constructor() { + } + + /** + * Defines the metadata of OSProfile + * + * @returns {object} metadata of OSProfile + * + */ + mapper() { + return { + required: false, + serializedName: 'OSProfile', + type: { + name: 'Composite', + className: 'OSProfile', + modelProperties: { + computerName: { + required: false, + serializedName: 'computerName', + type: { + name: 'String' + } + }, + adminUsername: { + required: false, + serializedName: 'adminUsername', + type: { + name: 'String' + } + }, + adminPassword: { + required: false, + serializedName: 'adminPassword', + type: { + name: 'String' + } + }, + customData: { + required: false, + serializedName: 'customData', + type: { + name: 'String' + } + }, + windowsConfiguration: { + required: false, + serializedName: 'windowsConfiguration', + type: { + name: 'Composite', + className: 'WindowsConfiguration' + } + }, + linuxConfiguration: { + required: false, + serializedName: 'linuxConfiguration', + type: { + name: 'Composite', + className: 'LinuxConfiguration' + } + }, + secrets: { + required: false, + serializedName: 'secrets', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VaultSecretGroupElementType', + type: { + name: 'Composite', + className: 'VaultSecretGroup' + } + } + } + } + } + } + }; + } +} + +module.exports = OSProfile; diff --git a/lib/services/computeManagement2/lib/lib/models/operationStatusResponse.js b/lib/services/computeManagement2/lib/lib/models/operationStatusResponse.js new file mode 100644 index 0000000000..cba0c062cc --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/operationStatusResponse.js @@ -0,0 +1,100 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Operation status response + * + */ +class OperationStatusResponse { + /** + * Create a OperationStatusResponse. + * @member {string} [name] Operation ID + * @member {string} [status] Operation status + * @member {date} [startTime] Start time of the operation + * @member {date} [endTime] End time of the operation + * @member {object} [error] Api error + * @member {array} [error.details] The Api error details + * @member {object} [error.innererror] The Api inner error + * @member {string} [error.innererror.exceptiontype] The exception type. + * @member {string} [error.innererror.errordetail] The internal error message + * or exception dump. + * @member {string} [error.code] The error code. + * @member {string} [error.target] The target of the particular error. + * @member {string} [error.message] The error message. + */ + constructor() { + } + + /** + * Defines the metadata of OperationStatusResponse + * + * @returns {object} metadata of OperationStatusResponse + * + */ + mapper() { + return { + required: false, + serializedName: 'OperationStatusResponse', + type: { + name: 'Composite', + className: 'OperationStatusResponse', + modelProperties: { + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + status: { + required: false, + readOnly: true, + serializedName: 'status', + type: { + name: 'String' + } + }, + startTime: { + required: false, + readOnly: true, + serializedName: 'startTime', + type: { + name: 'DateTime' + } + }, + endTime: { + required: false, + readOnly: true, + serializedName: 'endTime', + type: { + name: 'DateTime' + } + }, + error: { + required: false, + readOnly: true, + serializedName: 'error', + type: { + name: 'Composite', + className: 'ApiError' + } + } + } + } + }; + } +} + +module.exports = OperationStatusResponse; diff --git a/lib/services/computeManagement2/lib/lib/models/plan.js b/lib/services/computeManagement2/lib/lib/models/plan.js new file mode 100644 index 0000000000..e033d4c30b --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/plan.js @@ -0,0 +1,83 @@ +/* + * 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'; + +/** + * Specifies information about the marketplace image used to create the virtual + * machine. This element is only used for marketplace images. Before you can + * use a marketplace image from an API, you must enable the image for + * programmatic use. In the Azure portal, find the marketplace image that you + * want to use and then click **Want to deploy programmatically, Get Started + * ->**. Enter any required information and then click **Save**. + * + */ +class Plan { + /** + * Create a Plan. + * @member {string} [name] The plan ID. + * @member {string} [publisher] The publisher ID. + * @member {string} [product] Specifies the product of the image from the + * marketplace. This is the same value as Offer under the imageReference + * element. + * @member {string} [promotionCode] The promotion code. + */ + constructor() { + } + + /** + * Defines the metadata of Plan + * + * @returns {object} metadata of Plan + * + */ + mapper() { + return { + required: false, + serializedName: 'Plan', + type: { + name: 'Composite', + className: 'Plan', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + publisher: { + required: false, + serializedName: 'publisher', + type: { + name: 'String' + } + }, + product: { + required: false, + serializedName: 'product', + type: { + name: 'String' + } + }, + promotionCode: { + required: false, + serializedName: 'promotionCode', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = Plan; diff --git a/lib/services/computeManagement2/lib/lib/models/purchasePlan.js b/lib/services/computeManagement2/lib/lib/models/purchasePlan.js new file mode 100644 index 0000000000..28c42e6acb --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/purchasePlan.js @@ -0,0 +1,71 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Used for establishing the purchase context of any 3rd Party artifact through + * MarketPlace. + * + */ +class PurchasePlan { + /** + * Create a PurchasePlan. + * @member {string} publisher The publisher ID. + * @member {string} name The plan ID. + * @member {string} product Specifies the product of the image from the + * marketplace. This is the same value as Offer under the imageReference + * element. + */ + constructor() { + } + + /** + * Defines the metadata of PurchasePlan + * + * @returns {object} metadata of PurchasePlan + * + */ + mapper() { + return { + required: false, + serializedName: 'PurchasePlan', + type: { + name: 'Composite', + className: 'PurchasePlan', + modelProperties: { + publisher: { + required: true, + serializedName: 'publisher', + type: { + name: 'String' + } + }, + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + product: { + required: true, + serializedName: 'product', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = PurchasePlan; diff --git a/lib/services/computeManagement2/lib/lib/models/recoveryWalkResponse.js b/lib/services/computeManagement2/lib/lib/models/recoveryWalkResponse.js new file mode 100644 index 0000000000..ffe245c464 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/recoveryWalkResponse.js @@ -0,0 +1,64 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Response after calling a manual recovery walk + * + */ +class RecoveryWalkResponse { + /** + * Create a RecoveryWalkResponse. + * @member {boolean} [walkPerformed] Whether the recovery walk was performed + * @member {number} [nextPlatformUpdateDomain] The next update domain that + * needs to be walked. Null means walk spanning all update domains has been + * completed + */ + constructor() { + } + + /** + * Defines the metadata of RecoveryWalkResponse + * + * @returns {object} metadata of RecoveryWalkResponse + * + */ + mapper() { + return { + required: false, + serializedName: 'RecoveryWalkResponse', + type: { + name: 'Composite', + className: 'RecoveryWalkResponse', + modelProperties: { + walkPerformed: { + required: false, + readOnly: true, + serializedName: 'walkPerformed', + type: { + name: 'Boolean' + } + }, + nextPlatformUpdateDomain: { + required: false, + readOnly: true, + serializedName: 'nextPlatformUpdateDomain', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = RecoveryWalkResponse; diff --git a/lib/services/computeManagement2/lib/lib/models/requestRateByIntervalInput.js b/lib/services/computeManagement2/lib/lib/models/requestRateByIntervalInput.js new file mode 100644 index 0000000000..be5f178830 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/requestRateByIntervalInput.js @@ -0,0 +1,101 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Api request input for LogAnalytics getRequestRateByInterval Api. + * + * @extends models['LogAnalyticsInputBase'] + */ +class RequestRateByIntervalInput extends models['LogAnalyticsInputBase'] { + /** + * Create a RequestRateByIntervalInput. + * @member {string} intervalLength Interval value in minutes used to create + * LogAnalytics call rate logs. Possible values include: 'ThreeMins', + * 'FiveMins', 'ThirtyMins', 'SixtyMins' + */ + constructor() { + super(); + } + + /** + * Defines the metadata of RequestRateByIntervalInput + * + * @returns {object} metadata of RequestRateByIntervalInput + * + */ + mapper() { + return { + required: false, + serializedName: 'RequestRateByIntervalInput', + type: { + name: 'Composite', + className: 'RequestRateByIntervalInput', + modelProperties: { + blobContainerSasUri: { + required: true, + serializedName: 'blobContainerSasUri', + type: { + name: 'String' + } + }, + fromTime: { + required: true, + serializedName: 'fromTime', + type: { + name: 'DateTime' + } + }, + toTime: { + required: true, + serializedName: 'toTime', + type: { + name: 'DateTime' + } + }, + groupByThrottlePolicy: { + required: false, + serializedName: 'groupByThrottlePolicy', + type: { + name: 'Boolean' + } + }, + groupByOperationName: { + required: false, + serializedName: 'groupByOperationName', + type: { + name: 'Boolean' + } + }, + groupByResourceName: { + required: false, + serializedName: 'groupByResourceName', + type: { + name: 'Boolean' + } + }, + intervalLength: { + required: true, + serializedName: 'intervalLength', + type: { + name: 'Enum', + allowedValues: [ 'ThreeMins', 'FiveMins', 'ThirtyMins', 'SixtyMins' ] + } + } + } + } + }; + } +} + +module.exports = RequestRateByIntervalInput; diff --git a/lib/services/computeManagement2/lib/lib/models/resource.js b/lib/services/computeManagement2/lib/lib/models/resource.js new file mode 100644 index 0000000000..7c1448890e --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/resource.js @@ -0,0 +1,98 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The Resource model definition. + * + * @extends models['BaseResource'] + */ +class Resource extends models['BaseResource'] { + /** + * Create a Resource. + * @member {string} [id] Resource Id + * @member {string} [name] Resource name + * @member {string} [type] Resource type + * @member {string} location Resource location + * @member {object} [tags] Resource tags + */ + constructor() { + super(); + } + + /** + * Defines the metadata of Resource + * + * @returns {object} metadata of Resource + * + */ + mapper() { + return { + required: false, + serializedName: 'Resource', + type: { + name: 'Composite', + className: 'Resource', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: true, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = Resource; diff --git a/lib/services/computeManagement2/lib/lib/models/resourceSku.js b/lib/services/computeManagement2/lib/lib/models/resourceSku.js new file mode 100644 index 0000000000..848c0dc886 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/resourceSku.js @@ -0,0 +1,223 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Describes an available Compute SKU. + * + */ +class ResourceSku { + /** + * Create a ResourceSku. + * @member {string} [resourceType] The type of resource the SKU applies to. + * @member {string} [name] The name of SKU. + * @member {string} [tier] Specifies the tier of virtual machines in a scale + * set.

    Possible Values:

    **Standard**

    + * **Basic** + * @member {string} [size] The Size of the SKU. + * @member {string} [family] The Family of this particular SKU. + * @member {string} [kind] The Kind of resources that are supported in this + * SKU. + * @member {object} [capacity] Specifies the number of virtual machines in + * the scale set. + * @member {number} [capacity.minimum] The minimum capacity. + * @member {number} [capacity.maximum] The maximum capacity that can be set. + * @member {number} [capacity.default] The default capacity. + * @member {string} [capacity.scaleType] The scale type applicable to the + * sku. Possible values include: 'Automatic', 'Manual', 'None' + * @member {array} [locations] The set of locations that the SKU is + * available. + * @member {array} [locationInfo] A list of locations and availability zones + * in those locations where the SKU is available. + * @member {array} [apiVersions] The api versions that support this SKU. + * @member {array} [costs] Metadata for retrieving price info. + * @member {array} [capabilities] A name value pair to describe the + * capability. + * @member {array} [restrictions] The restrictions because of which SKU + * cannot be used. This is empty if there are no restrictions. + */ + constructor() { + } + + /** + * Defines the metadata of ResourceSku + * + * @returns {object} metadata of ResourceSku + * + */ + mapper() { + return { + required: false, + serializedName: 'ResourceSku', + type: { + name: 'Composite', + className: 'ResourceSku', + modelProperties: { + resourceType: { + required: false, + readOnly: true, + serializedName: 'resourceType', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + tier: { + required: false, + readOnly: true, + serializedName: 'tier', + type: { + name: 'String' + } + }, + size: { + required: false, + readOnly: true, + serializedName: 'size', + type: { + name: 'String' + } + }, + family: { + required: false, + readOnly: true, + serializedName: 'family', + type: { + name: 'String' + } + }, + kind: { + required: false, + readOnly: true, + serializedName: 'kind', + type: { + name: 'String' + } + }, + capacity: { + required: false, + readOnly: true, + serializedName: 'capacity', + type: { + name: 'Composite', + className: 'ResourceSkuCapacity' + } + }, + locations: { + required: false, + readOnly: true, + serializedName: 'locations', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + locationInfo: { + required: false, + readOnly: true, + serializedName: 'locationInfo', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ResourceSkuLocationInfoElementType', + type: { + name: 'Composite', + className: 'ResourceSkuLocationInfo' + } + } + } + }, + apiVersions: { + required: false, + readOnly: true, + serializedName: 'apiVersions', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + costs: { + required: false, + readOnly: true, + serializedName: 'costs', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ResourceSkuCostsElementType', + type: { + name: 'Composite', + className: 'ResourceSkuCosts' + } + } + } + }, + capabilities: { + required: false, + readOnly: true, + serializedName: 'capabilities', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ResourceSkuCapabilitiesElementType', + type: { + name: 'Composite', + className: 'ResourceSkuCapabilities' + } + } + } + }, + restrictions: { + required: false, + readOnly: true, + serializedName: 'restrictions', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ResourceSkuRestrictionsElementType', + type: { + name: 'Composite', + className: 'ResourceSkuRestrictions' + } + } + } + } + } + } + }; + } +} + +module.exports = ResourceSku; diff --git a/lib/services/computeManagement2/lib/lib/models/resourceSkuCapabilities.js b/lib/services/computeManagement2/lib/lib/models/resourceSkuCapabilities.js new file mode 100644 index 0000000000..77ae0d4489 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/resourceSkuCapabilities.js @@ -0,0 +1,63 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Describes The SKU capabilites object. + * + */ +class ResourceSkuCapabilities { + /** + * Create a ResourceSkuCapabilities. + * @member {string} [name] An invariant to describe the feature. + * @member {string} [value] An invariant if the feature is measured by + * quantity. + */ + constructor() { + } + + /** + * Defines the metadata of ResourceSkuCapabilities + * + * @returns {object} metadata of ResourceSkuCapabilities + * + */ + mapper() { + return { + required: false, + serializedName: 'ResourceSkuCapabilities', + type: { + name: 'Composite', + className: 'ResourceSkuCapabilities', + modelProperties: { + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + value: { + required: false, + readOnly: true, + serializedName: 'value', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ResourceSkuCapabilities; diff --git a/lib/services/computeManagement2/lib/lib/models/resourceSkuCapacity.js b/lib/services/computeManagement2/lib/lib/models/resourceSkuCapacity.js new file mode 100644 index 0000000000..b36906fb80 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/resourceSkuCapacity.js @@ -0,0 +1,82 @@ +/* + * 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'; + +/** + * Describes scaling information of a SKU. + * + */ +class ResourceSkuCapacity { + /** + * Create a ResourceSkuCapacity. + * @member {number} [minimum] The minimum capacity. + * @member {number} [maximum] The maximum capacity that can be set. + * @member {number} [default] The default capacity. + * @member {string} [scaleType] The scale type applicable to the sku. + * Possible values include: 'Automatic', 'Manual', 'None' + */ + constructor() { + } + + /** + * Defines the metadata of ResourceSkuCapacity + * + * @returns {object} metadata of ResourceSkuCapacity + * + */ + mapper() { + return { + required: false, + serializedName: 'ResourceSkuCapacity', + type: { + name: 'Composite', + className: 'ResourceSkuCapacity', + modelProperties: { + minimum: { + required: false, + readOnly: true, + serializedName: 'minimum', + type: { + name: 'Number' + } + }, + maximum: { + required: false, + readOnly: true, + serializedName: 'maximum', + type: { + name: 'Number' + } + }, + default: { + required: false, + readOnly: true, + serializedName: 'default', + type: { + name: 'Number' + } + }, + scaleType: { + required: false, + readOnly: true, + serializedName: 'scaleType', + type: { + name: 'Enum', + allowedValues: [ 'Automatic', 'Manual', 'None' ] + } + } + } + } + }; + } +} + +module.exports = ResourceSkuCapacity; diff --git a/lib/services/computeManagement2/lib/lib/models/resourceSkuCosts.js b/lib/services/computeManagement2/lib/lib/models/resourceSkuCosts.js new file mode 100644 index 0000000000..08e2bd632b --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/resourceSkuCosts.js @@ -0,0 +1,72 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Describes metadata for retrieving price info. + * + */ +class ResourceSkuCosts { + /** + * Create a ResourceSkuCosts. + * @member {string} [meterID] Used for querying price from commerce. + * @member {number} [quantity] The multiplier is needed to extend the base + * metered cost. + * @member {string} [extendedUnit] An invariant to show the extended unit. + */ + constructor() { + } + + /** + * Defines the metadata of ResourceSkuCosts + * + * @returns {object} metadata of ResourceSkuCosts + * + */ + mapper() { + return { + required: false, + serializedName: 'ResourceSkuCosts', + type: { + name: 'Composite', + className: 'ResourceSkuCosts', + modelProperties: { + meterID: { + required: false, + readOnly: true, + serializedName: 'meterID', + type: { + name: 'String' + } + }, + quantity: { + required: false, + readOnly: true, + serializedName: 'quantity', + type: { + name: 'Number' + } + }, + extendedUnit: { + required: false, + readOnly: true, + serializedName: 'extendedUnit', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ResourceSkuCosts; diff --git a/lib/services/computeManagement2/lib/lib/models/resourceSkuLocationInfo.js b/lib/services/computeManagement2/lib/lib/models/resourceSkuLocationInfo.js new file mode 100644 index 0000000000..0b9c382836 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/resourceSkuLocationInfo.js @@ -0,0 +1,69 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Class representing a ResourceSkuLocationInfo. + */ +class ResourceSkuLocationInfo { + /** + * Create a ResourceSkuLocationInfo. + * @member {string} [location] Location of the SKU + * @member {array} [zones] List of availability zones where the SKU is + * supported. + */ + constructor() { + } + + /** + * Defines the metadata of ResourceSkuLocationInfo + * + * @returns {object} metadata of ResourceSkuLocationInfo + * + */ + mapper() { + return { + required: false, + serializedName: 'ResourceSkuLocationInfo', + type: { + name: 'Composite', + className: 'ResourceSkuLocationInfo', + modelProperties: { + location: { + required: false, + readOnly: true, + serializedName: 'location', + type: { + name: 'String' + } + }, + zones: { + required: false, + readOnly: true, + serializedName: 'zones', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = ResourceSkuLocationInfo; diff --git a/lib/services/computeManagement2/lib/lib/models/resourceSkuRestrictionInfo.js b/lib/services/computeManagement2/lib/lib/models/resourceSkuRestrictionInfo.js new file mode 100644 index 0000000000..9772ff3185 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/resourceSkuRestrictionInfo.js @@ -0,0 +1,76 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Class representing a ResourceSkuRestrictionInfo. + */ +class ResourceSkuRestrictionInfo { + /** + * Create a ResourceSkuRestrictionInfo. + * @member {array} [locations] Locations where the SKU is restricted + * @member {array} [zones] List of availability zones where the SKU is + * restricted. + */ + constructor() { + } + + /** + * Defines the metadata of ResourceSkuRestrictionInfo + * + * @returns {object} metadata of ResourceSkuRestrictionInfo + * + */ + mapper() { + return { + required: false, + serializedName: 'ResourceSkuRestrictionInfo', + type: { + name: 'Composite', + className: 'ResourceSkuRestrictionInfo', + modelProperties: { + locations: { + required: false, + readOnly: true, + serializedName: 'locations', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + zones: { + required: false, + readOnly: true, + serializedName: 'zones', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = ResourceSkuRestrictionInfo; diff --git a/lib/services/computeManagement2/lib/lib/models/resourceSkuRestrictions.js b/lib/services/computeManagement2/lib/lib/models/resourceSkuRestrictions.js new file mode 100644 index 0000000000..e163e71ec6 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/resourceSkuRestrictions.js @@ -0,0 +1,101 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Describes scaling information of a SKU. + * + */ +class ResourceSkuRestrictions { + /** + * Create a ResourceSkuRestrictions. + * @member {string} [type] The type of restrictions. Possible values include: + * 'Location', 'Zone' + * @member {array} [values] The value of restrictions. If the restriction + * type is set to location. This would be different locations where the SKU + * is restricted. + * @member {object} [restrictionInfo] The information about the restriction + * where the SKU cannot be used. + * @member {array} [restrictionInfo.locations] Locations where the SKU is + * restricted + * @member {array} [restrictionInfo.zones] List of availability zones where + * the SKU is restricted. + * @member {string} [reasonCode] The reason for restriction. Possible values + * include: 'QuotaId', 'NotAvailableForSubscription' + */ + constructor() { + } + + /** + * Defines the metadata of ResourceSkuRestrictions + * + * @returns {object} metadata of ResourceSkuRestrictions + * + */ + mapper() { + return { + required: false, + serializedName: 'ResourceSkuRestrictions', + type: { + name: 'Composite', + className: 'ResourceSkuRestrictions', + modelProperties: { + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'Enum', + allowedValues: [ 'Location', 'Zone' ] + } + }, + values: { + required: false, + readOnly: true, + serializedName: 'values', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + restrictionInfo: { + required: false, + readOnly: true, + serializedName: 'restrictionInfo', + type: { + name: 'Composite', + className: 'ResourceSkuRestrictionInfo' + } + }, + reasonCode: { + required: false, + readOnly: true, + serializedName: 'reasonCode', + type: { + name: 'Enum', + allowedValues: [ 'QuotaId', 'NotAvailableForSubscription' ] + } + } + } + } + }; + } +} + +module.exports = ResourceSkuRestrictions; diff --git a/lib/services/computeManagement2/lib/lib/models/resourceSkusResult.js b/lib/services/computeManagement2/lib/lib/models/resourceSkusResult.js new file mode 100644 index 0000000000..5e48b5aac0 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/resourceSkusResult.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The Compute List Skus operation response. + */ +class ResourceSkusResult extends Array { + /** + * Create a ResourceSkusResult. + * @member {string} [nextLink] The uri to fetch the next page of Compute + * Skus. Call ListNext() with this to fetch the next page of VMSS Skus. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ResourceSkusResult + * + * @returns {object} metadata of ResourceSkusResult + * + */ + mapper() { + return { + required: false, + serializedName: 'ResourceSkusResult', + type: { + name: 'Composite', + className: 'ResourceSkusResult', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ResourceSkuElementType', + type: { + name: 'Composite', + className: 'ResourceSku' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ResourceSkusResult; diff --git a/lib/services/computeManagement2/lib/lib/models/resourceUpdate.js b/lib/services/computeManagement2/lib/lib/models/resourceUpdate.js new file mode 100644 index 0000000000..70e3d15ab5 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/resourceUpdate.js @@ -0,0 +1,73 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The Resource model definition. + * + */ +class ResourceUpdate { + /** + * Create a ResourceUpdate. + * @member {object} [tags] Resource tags + * @member {object} [sku] + * @member {string} [sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS' + * @member {string} [sku.tier] The sku tier. + */ + constructor() { + } + + /** + * Defines the metadata of ResourceUpdate + * + * @returns {object} metadata of ResourceUpdate + * + */ + mapper() { + return { + required: false, + serializedName: 'ResourceUpdate', + type: { + name: 'Composite', + className: 'ResourceUpdate', + modelProperties: { + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + sku: { + required: false, + serializedName: 'sku', + type: { + name: 'Composite', + className: 'DiskSku' + } + } + } + } + }; + } +} + +module.exports = ResourceUpdate; diff --git a/lib/services/computeManagement2/lib/lib/models/rollingUpgradePolicy.js b/lib/services/computeManagement2/lib/lib/models/rollingUpgradePolicy.js new file mode 100644 index 0000000000..b0ca116c76 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/rollingUpgradePolicy.js @@ -0,0 +1,105 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The configuration parameters used while performing a rolling upgrade. + * + */ +class RollingUpgradePolicy { + /** + * Create a RollingUpgradePolicy. + * @member {number} [maxBatchInstancePercent] The maximum percent of total + * virtual machine instances that will be upgraded simultaneously by the + * rolling upgrade in one batch. As this is a maximum, unhealthy instances in + * previous or future batches can cause the percentage of instances in a + * batch to decrease to ensure higher reliability. The default value for this + * parameter is 20%. + * @member {number} [maxUnhealthyInstancePercent] The maximum percentage of + * the total virtual machine instances in the scale set that can be + * simultaneously unhealthy, either as a result of being upgraded, or by + * being found in an unhealthy state by the virtual machine health checks + * before the rolling upgrade aborts. This constraint will be checked prior + * to starting any batch. The default value for this parameter is 20%. + * @member {number} [maxUnhealthyUpgradedInstancePercent] The maximum + * percentage of upgraded virtual machine instances that can be found to be + * in an unhealthy state. This check will happen after each batch is + * upgraded. If this percentage is ever exceeded, the rolling update aborts. + * The default value for this parameter is 20%. + * @member {string} [pauseTimeBetweenBatches] The wait time between + * completing the update for all virtual machines in one batch and starting + * the next batch. The time duration should be specified in ISO 8601 format. + * The default value is 0 seconds (PT0S). + */ + constructor() { + } + + /** + * Defines the metadata of RollingUpgradePolicy + * + * @returns {object} metadata of RollingUpgradePolicy + * + */ + mapper() { + return { + required: false, + serializedName: 'RollingUpgradePolicy', + type: { + name: 'Composite', + className: 'RollingUpgradePolicy', + modelProperties: { + maxBatchInstancePercent: { + required: false, + serializedName: 'maxBatchInstancePercent', + constraints: { + InclusiveMaximum: 100, + InclusiveMinimum: 5 + }, + type: { + name: 'Number' + } + }, + maxUnhealthyInstancePercent: { + required: false, + serializedName: 'maxUnhealthyInstancePercent', + constraints: { + InclusiveMaximum: 100, + InclusiveMinimum: 5 + }, + type: { + name: 'Number' + } + }, + maxUnhealthyUpgradedInstancePercent: { + required: false, + serializedName: 'maxUnhealthyUpgradedInstancePercent', + constraints: { + InclusiveMaximum: 100, + InclusiveMinimum: 0 + }, + type: { + name: 'Number' + } + }, + pauseTimeBetweenBatches: { + required: false, + serializedName: 'pauseTimeBetweenBatches', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = RollingUpgradePolicy; diff --git a/lib/services/computeManagement2/lib/lib/models/rollingUpgradeProgressInfo.js b/lib/services/computeManagement2/lib/lib/models/rollingUpgradeProgressInfo.js new file mode 100644 index 0000000000..caab866d39 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/rollingUpgradeProgressInfo.js @@ -0,0 +1,85 @@ +/* + * 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'; + +/** + * Information about the number of virtual machine instances in each upgrade + * state. + * + */ +class RollingUpgradeProgressInfo { + /** + * Create a RollingUpgradeProgressInfo. + * @member {number} [successfulInstanceCount] The number of instances that + * have been successfully upgraded. + * @member {number} [failedInstanceCount] The number of instances that have + * failed to be upgraded successfully. + * @member {number} [inProgressInstanceCount] The number of instances that + * are currently being upgraded. + * @member {number} [pendingInstanceCount] The number of instances that have + * not yet begun to be upgraded. + */ + constructor() { + } + + /** + * Defines the metadata of RollingUpgradeProgressInfo + * + * @returns {object} metadata of RollingUpgradeProgressInfo + * + */ + mapper() { + return { + required: false, + serializedName: 'RollingUpgradeProgressInfo', + type: { + name: 'Composite', + className: 'RollingUpgradeProgressInfo', + modelProperties: { + successfulInstanceCount: { + required: false, + readOnly: true, + serializedName: 'successfulInstanceCount', + type: { + name: 'Number' + } + }, + failedInstanceCount: { + required: false, + readOnly: true, + serializedName: 'failedInstanceCount', + type: { + name: 'Number' + } + }, + inProgressInstanceCount: { + required: false, + readOnly: true, + serializedName: 'inProgressInstanceCount', + type: { + name: 'Number' + } + }, + pendingInstanceCount: { + required: false, + readOnly: true, + serializedName: 'pendingInstanceCount', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = RollingUpgradeProgressInfo; diff --git a/lib/services/computeManagement2/lib/lib/models/rollingUpgradeRunningStatus.js b/lib/services/computeManagement2/lib/lib/models/rollingUpgradeRunningStatus.js new file mode 100644 index 0000000000..7ad18db085 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/rollingUpgradeRunningStatus.js @@ -0,0 +1,85 @@ +/* + * 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'; + +/** + * Information about the current running state of the overall upgrade. + * + */ +class RollingUpgradeRunningStatus { + /** + * Create a RollingUpgradeRunningStatus. + * @member {string} [code] Code indicating the current status of the upgrade. + * Possible values include: 'RollingForward', 'Cancelled', 'Completed', + * 'Faulted' + * @member {date} [startTime] Start time of the upgrade. + * @member {string} [lastAction] The last action performed on the rolling + * upgrade. Possible values include: 'Start', 'Cancel' + * @member {date} [lastActionTime] Last action time of the upgrade. + */ + constructor() { + } + + /** + * Defines the metadata of RollingUpgradeRunningStatus + * + * @returns {object} metadata of RollingUpgradeRunningStatus + * + */ + mapper() { + return { + required: false, + serializedName: 'RollingUpgradeRunningStatus', + type: { + name: 'Composite', + className: 'RollingUpgradeRunningStatus', + modelProperties: { + code: { + required: false, + readOnly: true, + serializedName: 'code', + type: { + name: 'Enum', + allowedValues: [ 'RollingForward', 'Cancelled', 'Completed', 'Faulted' ] + } + }, + startTime: { + required: false, + readOnly: true, + serializedName: 'startTime', + type: { + name: 'DateTime' + } + }, + lastAction: { + required: false, + readOnly: true, + serializedName: 'lastAction', + type: { + name: 'Enum', + allowedValues: [ 'Start', 'Cancel' ] + } + }, + lastActionTime: { + required: false, + readOnly: true, + serializedName: 'lastActionTime', + type: { + name: 'DateTime' + } + } + } + } + }; + } +} + +module.exports = RollingUpgradeRunningStatus; diff --git a/lib/services/computeManagement2/lib/lib/models/rollingUpgradeStatusInfo.js b/lib/services/computeManagement2/lib/lib/models/rollingUpgradeStatusInfo.js new file mode 100644 index 0000000000..6e64400b78 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/rollingUpgradeStatusInfo.js @@ -0,0 +1,181 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The status of the latest virtual machine scale set rolling upgrade. + * + * @extends models['Resource'] + */ +class RollingUpgradeStatusInfo extends models['Resource'] { + /** + * Create a RollingUpgradeStatusInfo. + * @member {object} [policy] The rolling upgrade policies applied for this + * upgrade. + * @member {number} [policy.maxBatchInstancePercent] The maximum percent of + * total virtual machine instances that will be upgraded simultaneously by + * the rolling upgrade in one batch. As this is a maximum, unhealthy + * instances in previous or future batches can cause the percentage of + * instances in a batch to decrease to ensure higher reliability. The default + * value for this parameter is 20%. + * @member {number} [policy.maxUnhealthyInstancePercent] The maximum + * percentage of the total virtual machine instances in the scale set that + * can be simultaneously unhealthy, either as a result of being upgraded, or + * by being found in an unhealthy state by the virtual machine health checks + * before the rolling upgrade aborts. This constraint will be checked prior + * to starting any batch. The default value for this parameter is 20%. + * @member {number} [policy.maxUnhealthyUpgradedInstancePercent] The maximum + * percentage of upgraded virtual machine instances that can be found to be + * in an unhealthy state. This check will happen after each batch is + * upgraded. If this percentage is ever exceeded, the rolling update aborts. + * The default value for this parameter is 20%. + * @member {string} [policy.pauseTimeBetweenBatches] The wait time between + * completing the update for all virtual machines in one batch and starting + * the next batch. The time duration should be specified in ISO 8601 format. + * The default value is 0 seconds (PT0S). + * @member {object} [runningStatus] Information about the current running + * state of the overall upgrade. + * @member {string} [runningStatus.code] Code indicating the current status + * of the upgrade. Possible values include: 'RollingForward', 'Cancelled', + * 'Completed', 'Faulted' + * @member {date} [runningStatus.startTime] Start time of the upgrade. + * @member {string} [runningStatus.lastAction] The last action performed on + * the rolling upgrade. Possible values include: 'Start', 'Cancel' + * @member {date} [runningStatus.lastActionTime] Last action time of the + * upgrade. + * @member {object} [progress] Information about the number of virtual + * machine instances in each upgrade state. + * @member {number} [progress.successfulInstanceCount] The number of + * instances that have been successfully upgraded. + * @member {number} [progress.failedInstanceCount] The number of instances + * that have failed to be upgraded successfully. + * @member {number} [progress.inProgressInstanceCount] The number of + * instances that are currently being upgraded. + * @member {number} [progress.pendingInstanceCount] The number of instances + * that have not yet begun to be upgraded. + * @member {object} [error] Error details for this upgrade, if there are any. + * @member {array} [error.details] The Api error details + * @member {object} [error.innererror] The Api inner error + * @member {string} [error.innererror.exceptiontype] The exception type. + * @member {string} [error.innererror.errordetail] The internal error message + * or exception dump. + * @member {string} [error.code] The error code. + * @member {string} [error.target] The target of the particular error. + * @member {string} [error.message] The error message. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of RollingUpgradeStatusInfo + * + * @returns {object} metadata of RollingUpgradeStatusInfo + * + */ + mapper() { + return { + required: false, + serializedName: 'RollingUpgradeStatusInfo', + type: { + name: 'Composite', + className: 'RollingUpgradeStatusInfo', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: true, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + policy: { + required: false, + readOnly: true, + serializedName: 'properties.policy', + type: { + name: 'Composite', + className: 'RollingUpgradePolicy' + } + }, + runningStatus: { + required: false, + readOnly: true, + serializedName: 'properties.runningStatus', + type: { + name: 'Composite', + className: 'RollingUpgradeRunningStatus' + } + }, + progress: { + required: false, + readOnly: true, + serializedName: 'properties.progress', + type: { + name: 'Composite', + className: 'RollingUpgradeProgressInfo' + } + }, + error: { + required: false, + readOnly: true, + serializedName: 'properties.error', + type: { + name: 'Composite', + className: 'ApiError' + } + } + } + } + }; + } +} + +module.exports = RollingUpgradeStatusInfo; diff --git a/lib/services/computeManagement2/lib/lib/models/runCommandDocument.js b/lib/services/computeManagement2/lib/lib/models/runCommandDocument.js new file mode 100644 index 0000000000..2843629882 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/runCommandDocument.js @@ -0,0 +1,115 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Describes the properties of a Run Command. + * + * @extends models['RunCommandDocumentBase'] + */ +class RunCommandDocument extends models['RunCommandDocumentBase'] { + /** + * Create a RunCommandDocument. + * @member {array} script The script to be executed. + * @member {array} [parameters] The parameters used by the script. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of RunCommandDocument + * + * @returns {object} metadata of RunCommandDocument + * + */ + mapper() { + return { + required: false, + serializedName: 'RunCommandDocument', + type: { + name: 'Composite', + className: 'RunCommandDocument', + modelProperties: { + schema: { + required: true, + serializedName: '$schema', + type: { + name: 'String' + } + }, + id: { + required: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + osType: { + required: true, + serializedName: 'osType', + type: { + name: 'Enum', + allowedValues: [ 'Windows', 'Linux' ] + } + }, + label: { + required: true, + serializedName: 'label', + type: { + name: 'String' + } + }, + description: { + required: true, + serializedName: 'description', + type: { + name: 'String' + } + }, + script: { + required: true, + serializedName: 'script', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + parameters: { + required: false, + serializedName: 'parameters', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'RunCommandParameterDefinitionElementType', + type: { + name: 'Composite', + className: 'RunCommandParameterDefinition' + } + } + } + } + } + } + }; + } +} + +module.exports = RunCommandDocument; diff --git a/lib/services/computeManagement2/lib/lib/models/runCommandDocumentBase.js b/lib/services/computeManagement2/lib/lib/models/runCommandDocumentBase.js new file mode 100644 index 0000000000..e464a5cc02 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/runCommandDocumentBase.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'; + +/** + * Describes the properties of a Run Command metadata. + * + */ +class RunCommandDocumentBase { + /** + * Create a RunCommandDocumentBase. + * @member {string} schema The VM run command schema. + * @member {string} id The VM run command id. + * @member {string} osType The Operating System type. Possible values + * include: 'Windows', 'Linux' + * @member {string} label The VM run command label. + * @member {string} description The VM run command description. + */ + constructor() { + } + + /** + * Defines the metadata of RunCommandDocumentBase + * + * @returns {object} metadata of RunCommandDocumentBase + * + */ + mapper() { + return { + required: false, + serializedName: 'RunCommandDocumentBase', + type: { + name: 'Composite', + className: 'RunCommandDocumentBase', + modelProperties: { + schema: { + required: true, + serializedName: '$schema', + type: { + name: 'String' + } + }, + id: { + required: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + osType: { + required: true, + serializedName: 'osType', + type: { + name: 'Enum', + allowedValues: [ 'Windows', 'Linux' ] + } + }, + label: { + required: true, + serializedName: 'label', + type: { + name: 'String' + } + }, + description: { + required: true, + serializedName: 'description', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = RunCommandDocumentBase; diff --git a/lib/services/computeManagement2/lib/lib/models/runCommandInput.js b/lib/services/computeManagement2/lib/lib/models/runCommandInput.js new file mode 100644 index 0000000000..e245ae5fe0 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/runCommandInput.js @@ -0,0 +1,87 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Capture Virtual Machine parameters. + * + */ +class RunCommandInput { + /** + * Create a RunCommandInput. + * @member {string} commandId The run command id. + * @member {array} [script] Optional. The script to be executed. When this + * value is given, the given script will override the default script of the + * command. + * @member {array} [parameters] The run command parameters. + */ + constructor() { + } + + /** + * Defines the metadata of RunCommandInput + * + * @returns {object} metadata of RunCommandInput + * + */ + mapper() { + return { + required: false, + serializedName: 'RunCommandInput', + type: { + name: 'Composite', + className: 'RunCommandInput', + modelProperties: { + commandId: { + required: true, + serializedName: 'commandId', + type: { + name: 'String' + } + }, + script: { + required: false, + serializedName: 'script', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + parameters: { + required: false, + serializedName: 'parameters', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'RunCommandInputParameterElementType', + type: { + name: 'Composite', + className: 'RunCommandInputParameter' + } + } + } + } + } + } + }; + } +} + +module.exports = RunCommandInput; diff --git a/lib/services/computeManagement2/lib/lib/models/runCommandInputParameter.js b/lib/services/computeManagement2/lib/lib/models/runCommandInputParameter.js new file mode 100644 index 0000000000..157c76d917 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/runCommandInputParameter.js @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Describes the properties of a run command parameter. + * + */ +class RunCommandInputParameter { + /** + * Create a RunCommandInputParameter. + * @member {string} name The run command parameter name. + * @member {string} value The run command parameter value. + */ + constructor() { + } + + /** + * Defines the metadata of RunCommandInputParameter + * + * @returns {object} metadata of RunCommandInputParameter + * + */ + mapper() { + return { + required: false, + serializedName: 'RunCommandInputParameter', + type: { + name: 'Composite', + className: 'RunCommandInputParameter', + modelProperties: { + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + value: { + required: true, + serializedName: 'value', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = RunCommandInputParameter; diff --git a/lib/services/computeManagement2/lib/lib/models/runCommandListResult.js b/lib/services/computeManagement2/lib/lib/models/runCommandListResult.js new file mode 100644 index 0000000000..314b5e148e --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/runCommandListResult.js @@ -0,0 +1,69 @@ +/* + * 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 List Virtual Machine operation response. + */ +class RunCommandListResult extends Array { + /** + * Create a RunCommandListResult. + * @member {string} [nextLink] The uri to fetch the next page of run + * commands. Call ListNext() with this to fetch the next page of run + * commands. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of RunCommandListResult + * + * @returns {object} metadata of RunCommandListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'RunCommandListResult', + type: { + name: 'Composite', + className: 'RunCommandListResult', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'RunCommandDocumentBaseElementType', + type: { + name: 'Composite', + className: 'RunCommandDocumentBase' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = RunCommandListResult; diff --git a/lib/services/computeManagement2/lib/lib/models/runCommandParameterDefinition.js b/lib/services/computeManagement2/lib/lib/models/runCommandParameterDefinition.js new file mode 100644 index 0000000000..f725a842ec --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/runCommandParameterDefinition.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'; + +/** + * Describes the properties of a run command parameter. + * + */ +class RunCommandParameterDefinition { + /** + * Create a RunCommandParameterDefinition. + * @member {string} name The run command parameter name. + * @member {string} type The run command parameter type. + * @member {string} [defaultValue] The run command parameter default value. + * @member {boolean} [required] The run command parameter required. Default + * value: false . + */ + constructor() { + } + + /** + * Defines the metadata of RunCommandParameterDefinition + * + * @returns {object} metadata of RunCommandParameterDefinition + * + */ + mapper() { + return { + required: false, + serializedName: 'RunCommandParameterDefinition', + type: { + name: 'Composite', + className: 'RunCommandParameterDefinition', + modelProperties: { + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + defaultValue: { + required: false, + serializedName: 'defaultValue', + type: { + name: 'String' + } + }, + required: { + required: false, + serializedName: 'required', + defaultValue: false, + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = RunCommandParameterDefinition; diff --git a/lib/services/computeManagement2/lib/lib/models/runCommandResult.js b/lib/services/computeManagement2/lib/lib/models/runCommandResult.js new file mode 100644 index 0000000000..f23a7d1b8c --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/runCommandResult.js @@ -0,0 +1,97 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Run command operation response. + * + * @extends models['OperationStatusResponse'] + */ +class RunCommandResult extends models['OperationStatusResponse'] { + /** + * Create a RunCommandResult. + * @member {object} [output] Operation output data (raw JSON) + */ + constructor() { + super(); + } + + /** + * Defines the metadata of RunCommandResult + * + * @returns {object} metadata of RunCommandResult + * + */ + mapper() { + return { + required: false, + serializedName: 'RunCommandResult', + type: { + name: 'Composite', + className: 'RunCommandResult', + modelProperties: { + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + status: { + required: false, + readOnly: true, + serializedName: 'status', + type: { + name: 'String' + } + }, + startTime: { + required: false, + readOnly: true, + serializedName: 'startTime', + type: { + name: 'DateTime' + } + }, + endTime: { + required: false, + readOnly: true, + serializedName: 'endTime', + type: { + name: 'DateTime' + } + }, + error: { + required: false, + readOnly: true, + serializedName: 'error', + type: { + name: 'Composite', + className: 'ApiError' + } + }, + output: { + required: false, + serializedName: 'properties.output', + type: { + name: 'Object' + } + } + } + } + }; + } +} + +module.exports = RunCommandResult; diff --git a/lib/services/computeManagement2/lib/lib/models/sku.js b/lib/services/computeManagement2/lib/lib/models/sku.js new file mode 100644 index 0000000000..94624da2bc --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/sku.js @@ -0,0 +1,71 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Describes a virtual machine scale set sku. + * + */ +class Sku { + /** + * Create a Sku. + * @member {string} [name] The sku name. + * @member {string} [tier] Specifies the tier of virtual machines in a scale + * set.

    Possible Values:

    **Standard**

    + * **Basic** + * @member {number} [capacity] Specifies the number of virtual machines in + * the scale set. + */ + constructor() { + } + + /** + * Defines the metadata of Sku + * + * @returns {object} metadata of Sku + * + */ + mapper() { + return { + required: false, + serializedName: 'Sku', + type: { + name: 'Composite', + className: 'Sku', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + tier: { + required: false, + serializedName: 'tier', + type: { + name: 'String' + } + }, + capacity: { + required: false, + serializedName: 'capacity', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = Sku; diff --git a/lib/services/computeManagement2/lib/lib/models/snapshot.js b/lib/services/computeManagement2/lib/lib/models/snapshot.js new file mode 100644 index 0000000000..0e55bb0706 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/snapshot.js @@ -0,0 +1,212 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Snapshot resource. + * + * @extends models['Resource'] + */ +class Snapshot extends models['Resource'] { + /** + * Create a Snapshot. + * @member {string} [managedBy] Unused. Always Null. + * @member {object} [sku] + * @member {string} [sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS', 'Standard_ZRS' + * @member {string} [sku.tier] The sku tier. + * @member {date} [timeCreated] The time when the disk was created. + * @member {string} [osType] The Operating System type. Possible values + * include: 'Windows', 'Linux' + * @member {object} creationData Disk source information. CreationData + * information cannot be changed after the disk has been created. + * @member {string} [creationData.createOption] This enumerates the possible + * sources of a disk's creation. Possible values include: 'Empty', 'Attach', + * 'FromImage', 'Import', 'Copy', 'Restore' + * @member {string} [creationData.storageAccountId] If createOption is + * Import, the Azure Resource Manager identifier of the storage account + * containing the blob to import as a disk. Required only if the blob is in a + * different subscription + * @member {object} [creationData.imageReference] Disk source information. + * @member {string} [creationData.imageReference.id] A relative uri + * containing either a Platform Imgage Repository or user image reference. + * @member {number} [creationData.imageReference.lun] If the disk is created + * from an image's data disk, this is an index that indicates which of the + * data disks in the image to use. For OS disks, this field is null. + * @member {string} [creationData.sourceUri] If createOption is Import, this + * is the URI of a blob to be imported into a managed disk. + * @member {string} [creationData.sourceResourceId] If createOption is Copy, + * this is the ARM id of the source snapshot or disk. + * @member {number} [diskSizeGB] If creationData.createOption is Empty, this + * field is mandatory and it indicates the size of the VHD to create. If this + * field is present for updates or creation with other options, it indicates + * a resize. Resizes are only allowed if the disk is not attached to a + * running VM, and can only increase the disk's size. + * @member {object} [encryptionSettings] Encryption settings for disk or + * snapshot + * @member {boolean} [encryptionSettings.enabled] Set this flag to true and + * provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * encryption. Set this flag to false and remove DiskEncryptionKey and + * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in + * the request object, the existing settings remain unchanged. + * @member {object} [encryptionSettings.diskEncryptionKey] Key Vault Secret + * Url and vault id of the disk encryption key + * @member {object} [encryptionSettings.diskEncryptionKey.sourceVault] + * Resource id of the KeyVault containing the key or secret + * @member {string} [encryptionSettings.diskEncryptionKey.sourceVault.id] + * Resource Id + * @member {string} [encryptionSettings.diskEncryptionKey.secretUrl] Url + * pointing to a key or secret in KeyVault + * @member {object} [encryptionSettings.keyEncryptionKey] Key Vault Key Url + * and vault id of the key encryption key + * @member {object} [encryptionSettings.keyEncryptionKey.sourceVault] + * Resource id of the KeyVault containing the key or secret + * @member {string} [encryptionSettings.keyEncryptionKey.sourceVault.id] + * Resource Id + * @member {string} [encryptionSettings.keyEncryptionKey.keyUrl] Url pointing + * to a key or secret in KeyVault + * @member {string} [provisioningState] The disk provisioning state. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of Snapshot + * + * @returns {object} metadata of Snapshot + * + */ + mapper() { + return { + required: false, + serializedName: 'Snapshot', + type: { + name: 'Composite', + className: 'Snapshot', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: true, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + managedBy: { + required: false, + readOnly: true, + serializedName: 'managedBy', + type: { + name: 'String' + } + }, + sku: { + required: false, + serializedName: 'sku', + type: { + name: 'Composite', + className: 'SnapshotSku' + } + }, + timeCreated: { + required: false, + readOnly: true, + serializedName: 'properties.timeCreated', + type: { + name: 'DateTime' + } + }, + osType: { + required: false, + serializedName: 'properties.osType', + type: { + name: 'Enum', + allowedValues: [ 'Windows', 'Linux' ] + } + }, + creationData: { + required: true, + serializedName: 'properties.creationData', + type: { + name: 'Composite', + className: 'CreationData' + } + }, + diskSizeGB: { + required: false, + serializedName: 'properties.diskSizeGB', + type: { + name: 'Number' + } + }, + encryptionSettings: { + required: false, + serializedName: 'properties.encryptionSettings', + type: { + name: 'Composite', + className: 'EncryptionSettings' + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = Snapshot; diff --git a/lib/services/computeManagement2/lib/lib/models/snapshotList.js b/lib/services/computeManagement2/lib/lib/models/snapshotList.js new file mode 100644 index 0000000000..ae3710c778 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/snapshotList.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The List Snapshots operation response. + */ +class SnapshotList extends Array { + /** + * Create a SnapshotList. + * @member {string} [nextLink] The uri to fetch the next page of snapshots. + * Call ListNext() with this to fetch the next page of snapshots. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of SnapshotList + * + * @returns {object} metadata of SnapshotList + * + */ + mapper() { + return { + required: false, + serializedName: 'SnapshotList', + type: { + name: 'Composite', + className: 'SnapshotList', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SnapshotElementType', + type: { + name: 'Composite', + className: 'Snapshot' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SnapshotList; diff --git a/lib/services/computeManagement2/lib/lib/models/snapshotSku.js b/lib/services/computeManagement2/lib/lib/models/snapshotSku.js new file mode 100644 index 0000000000..ad7c46d018 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/snapshotSku.js @@ -0,0 +1,63 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. + * + */ +class SnapshotSku { + /** + * Create a SnapshotSku. + * @member {string} [name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS', 'Standard_ZRS' + * @member {string} [tier] The sku tier. Default value: 'Standard' . + */ + constructor() { + } + + /** + * Defines the metadata of SnapshotSku + * + * @returns {object} metadata of SnapshotSku + * + */ + mapper() { + return { + required: false, + serializedName: 'SnapshotSku', + type: { + name: 'Composite', + className: 'SnapshotSku', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + tier: { + required: false, + readOnly: true, + serializedName: 'tier', + defaultValue: 'Standard', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SnapshotSku; diff --git a/lib/services/computeManagement2/lib/lib/models/snapshotUpdate.js b/lib/services/computeManagement2/lib/lib/models/snapshotUpdate.js new file mode 100644 index 0000000000..c09c4e427f --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/snapshotUpdate.js @@ -0,0 +1,123 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Snapshot update resource. + * + * @extends models['ResourceUpdate'] + */ +class SnapshotUpdate extends models['ResourceUpdate'] { + /** + * Create a SnapshotUpdate. + * @member {string} [osType] the Operating System type. Possible values + * include: 'Windows', 'Linux' + * @member {number} [diskSizeGB] If creationData.createOption is Empty, this + * field is mandatory and it indicates the size of the VHD to create. If this + * field is present for updates or creation with other options, it indicates + * a resize. Resizes are only allowed if the disk is not attached to a + * running VM, and can only increase the disk's size. + * @member {object} [encryptionSettings] Encryption settings for disk or + * snapshot + * @member {boolean} [encryptionSettings.enabled] Set this flag to true and + * provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * encryption. Set this flag to false and remove DiskEncryptionKey and + * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in + * the request object, the existing settings remain unchanged. + * @member {object} [encryptionSettings.diskEncryptionKey] Key Vault Secret + * Url and vault id of the disk encryption key + * @member {object} [encryptionSettings.diskEncryptionKey.sourceVault] + * Resource id of the KeyVault containing the key or secret + * @member {string} [encryptionSettings.diskEncryptionKey.sourceVault.id] + * Resource Id + * @member {string} [encryptionSettings.diskEncryptionKey.secretUrl] Url + * pointing to a key or secret in KeyVault + * @member {object} [encryptionSettings.keyEncryptionKey] Key Vault Key Url + * and vault id of the key encryption key + * @member {object} [encryptionSettings.keyEncryptionKey.sourceVault] + * Resource id of the KeyVault containing the key or secret + * @member {string} [encryptionSettings.keyEncryptionKey.sourceVault.id] + * Resource Id + * @member {string} [encryptionSettings.keyEncryptionKey.keyUrl] Url pointing + * to a key or secret in KeyVault + */ + constructor() { + super(); + } + + /** + * Defines the metadata of SnapshotUpdate + * + * @returns {object} metadata of SnapshotUpdate + * + */ + mapper() { + return { + required: false, + serializedName: 'SnapshotUpdate', + type: { + name: 'Composite', + className: 'SnapshotUpdate', + modelProperties: { + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + sku: { + required: false, + serializedName: 'sku', + type: { + name: 'Composite', + className: 'DiskSku' + } + }, + osType: { + required: false, + serializedName: 'properties.osType', + type: { + name: 'Enum', + allowedValues: [ 'Windows', 'Linux' ] + } + }, + diskSizeGB: { + required: false, + serializedName: 'properties.diskSizeGB', + type: { + name: 'Number' + } + }, + encryptionSettings: { + required: false, + serializedName: 'properties.encryptionSettings', + type: { + name: 'Composite', + className: 'EncryptionSettings' + } + } + } + } + }; + } +} + +module.exports = SnapshotUpdate; diff --git a/lib/services/computeManagement2/lib/lib/models/sourceVault.js b/lib/services/computeManagement2/lib/lib/models/sourceVault.js new file mode 100644 index 0000000000..67e5d06c45 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/sourceVault.js @@ -0,0 +1,53 @@ +/* + * 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 vault id is an Azure Resource Manager Resoure id in the form + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName} + * + */ +class SourceVault { + /** + * Create a SourceVault. + * @member {string} [id] Resource Id + */ + constructor() { + } + + /** + * Defines the metadata of SourceVault + * + * @returns {object} metadata of SourceVault + * + */ + mapper() { + return { + required: false, + serializedName: 'SourceVault', + type: { + name: 'Composite', + className: 'SourceVault', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SourceVault; diff --git a/lib/services/computeManagement2/lib/lib/models/sshConfiguration.js b/lib/services/computeManagement2/lib/lib/models/sshConfiguration.js new file mode 100644 index 0000000000..0dc25e1a7e --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/sshConfiguration.js @@ -0,0 +1,63 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * SSH configuration for Linux based VMs running on Azure + * + */ +class SshConfiguration { + /** + * Create a SshConfiguration. + * @member {array} [publicKeys] The list of SSH public keys used to + * authenticate with linux based VMs. + */ + constructor() { + } + + /** + * Defines the metadata of SshConfiguration + * + * @returns {object} metadata of SshConfiguration + * + */ + mapper() { + return { + required: false, + serializedName: 'SshConfiguration', + type: { + name: 'Composite', + className: 'SshConfiguration', + modelProperties: { + publicKeys: { + required: false, + serializedName: 'publicKeys', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SshPublicKeyElementType', + type: { + name: 'Composite', + className: 'SshPublicKey' + } + } + } + } + } + } + }; + } +} + +module.exports = SshConfiguration; diff --git a/lib/services/computeManagement2/lib/lib/models/sshPublicKey.js b/lib/services/computeManagement2/lib/lib/models/sshPublicKey.js new file mode 100644 index 0000000000..38e8dd8379 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/sshPublicKey.js @@ -0,0 +1,67 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Contains information about SSH certificate public key and the path on the + * Linux VM where the public key is placed. + * + */ +class SshPublicKey { + /** + * Create a SshPublicKey. + * @member {string} [path] Specifies the full path on the created VM where + * ssh public key is stored. If the file already exists, the specified key is + * appended to the file. Example: /home/user/.ssh/authorized_keys + * @member {string} [keyData] SSH public key certificate used to authenticate + * with the VM through ssh. The key needs to be at least 2048-bit and in + * ssh-rsa format.

    For creating ssh keys, see [Create SSH keys on + * Linux and Mac for Linux VMs in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-mac-create-ssh-keys?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + */ + constructor() { + } + + /** + * Defines the metadata of SshPublicKey + * + * @returns {object} metadata of SshPublicKey + * + */ + mapper() { + return { + required: false, + serializedName: 'SshPublicKey', + type: { + name: 'Composite', + className: 'SshPublicKey', + modelProperties: { + path: { + required: false, + serializedName: 'path', + type: { + name: 'String' + } + }, + keyData: { + required: false, + serializedName: 'keyData', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SshPublicKey; diff --git a/lib/services/computeManagement2/lib/lib/models/storageProfile.js b/lib/services/computeManagement2/lib/lib/models/storageProfile.js new file mode 100644 index 0000000000..38b108fcd0 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/storageProfile.js @@ -0,0 +1,159 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Specifies the storage settings for the virtual machine disks. + * + */ +class StorageProfile { + /** + * Create a StorageProfile. + * @member {object} [imageReference] Specifies information about the image to + * use. You can specify information about platform images, marketplace + * images, or virtual machine images. This element is required when you want + * to use a platform image, marketplace image, or virtual machine image, but + * is not used in other creation operations. + * @member {string} [imageReference.publisher] The image publisher. + * @member {string} [imageReference.offer] Specifies the offer of the + * platform image or marketplace image used to create the virtual machine. + * @member {string} [imageReference.sku] The image SKU. + * @member {string} [imageReference.version] Specifies the version of the + * platform image or marketplace image used to create the virtual machine. + * The allowed formats are Major.Minor.Build or 'latest'. Major, Minor, and + * Build are decimal numbers. Specify 'latest' to use the latest version of + * an image available at deploy time. Even if you use 'latest', the VM image + * will not automatically update after deploy time even if a new version + * becomes available. + * @member {object} [osDisk] Specifies information about the operating system + * disk used by the virtual machine.

    For more information about + * disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @member {string} [osDisk.osType] This property allows you to specify the + * type of the OS that is included in the disk if creating a VM from + * user-image or a specialized VHD.

    Possible values are:

    + * **Windows**

    **Linux**. Possible values include: 'Windows', + * 'Linux' + * @member {object} [osDisk.encryptionSettings] Specifies the encryption + * settings for the OS Disk.

    Minimum api-version: 2015-06-15 + * @member {object} [osDisk.encryptionSettings.diskEncryptionKey] Specifies + * the location of the disk encryption key, which is a Key Vault Secret. + * @member {string} [osDisk.encryptionSettings.diskEncryptionKey.secretUrl] + * The URL referencing a secret in a Key Vault. + * @member {object} [osDisk.encryptionSettings.diskEncryptionKey.sourceVault] + * The relative URL of the Key Vault containing the secret. + * @member {string} + * [osDisk.encryptionSettings.diskEncryptionKey.sourceVault.id] Resource Id + * @member {object} [osDisk.encryptionSettings.keyEncryptionKey] Specifies + * the location of the key encryption key in Key Vault. + * @member {string} [osDisk.encryptionSettings.keyEncryptionKey.keyUrl] The + * URL referencing a key encryption key in Key Vault. + * @member {object} [osDisk.encryptionSettings.keyEncryptionKey.sourceVault] + * The relative URL of the Key Vault containing the key. + * @member {string} + * [osDisk.encryptionSettings.keyEncryptionKey.sourceVault.id] Resource Id + * @member {boolean} [osDisk.encryptionSettings.enabled] Specifies whether + * disk encryption should be enabled on the virtual machine. + * @member {string} [osDisk.name] The disk name. + * @member {object} [osDisk.vhd] The virtual hard disk. + * @member {string} [osDisk.vhd.uri] Specifies the virtual hard disk's uri. + * @member {object} [osDisk.image] The source user image virtual hard disk. + * The virtual hard disk will be copied before being attached to the virtual + * machine. If SourceImage is provided, the destination virtual hard drive + * must not exist. + * @member {string} [osDisk.image.uri] Specifies the virtual hard disk's uri. + * @member {string} [osDisk.caching] Specifies the caching requirements. + *

    Possible values are:

    **None**

    **ReadOnly** + *

    **ReadWrite**

    Default: **None for Standard storage. + * ReadOnly for Premium storage**. Possible values include: 'None', + * 'ReadOnly', 'ReadWrite' + * @member {boolean} [osDisk.writeAcceleratorEnabled] Specifies whether + * writeAccelerator should be enabled or disabled on the disk. + * @member {string} [osDisk.createOption] Specifies how the virtual machine + * should be created.

    Possible values are:

    **Attach** \u2013 + * This value is used when you are using a specialized disk to create the + * virtual machine.

    **FromImage** \u2013 This value is used when you + * are using an image to create the virtual machine. If you are using a + * platform image, you also use the imageReference element described above. + * If you are using a marketplace image, you also use the plan element + * previously described. Possible values include: 'FromImage', 'Empty', + * 'Attach' + * @member {number} [osDisk.diskSizeGB] Specifies the size of an empty data + * disk in gigabytes. This element can be used to overwrite the name of the + * disk in a virtual machine image.

    This value cannot be larger than + * 1023 GB + * @member {object} [osDisk.managedDisk] The managed disk parameters. + * @member {string} [osDisk.managedDisk.storageAccountType] Specifies the + * storage account type for the managed disk. Possible values are: + * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * @member {array} [dataDisks] Specifies the parameters that are used to add + * a data disk to a virtual machine.

    For more information about + * disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + */ + constructor() { + } + + /** + * Defines the metadata of StorageProfile + * + * @returns {object} metadata of StorageProfile + * + */ + mapper() { + return { + required: false, + serializedName: 'StorageProfile', + type: { + name: 'Composite', + className: 'StorageProfile', + modelProperties: { + imageReference: { + required: false, + serializedName: 'imageReference', + type: { + name: 'Composite', + className: 'ImageReference' + } + }, + osDisk: { + required: false, + serializedName: 'osDisk', + type: { + name: 'Composite', + className: 'OSDisk' + } + }, + dataDisks: { + required: false, + serializedName: 'dataDisks', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DataDiskElementType', + type: { + name: 'Composite', + className: 'DataDisk' + } + } + } + } + } + } + }; + } +} + +module.exports = StorageProfile; diff --git a/lib/services/computeManagement2/lib/lib/models/subResource.js b/lib/services/computeManagement2/lib/lib/models/subResource.js new file mode 100644 index 0000000000..5e3baea5a4 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/subResource.js @@ -0,0 +1,55 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Class representing a SubResource. + * @extends models['BaseResource'] + */ +class SubResource extends models['BaseResource'] { + /** + * Create a SubResource. + * @member {string} [id] Resource Id + */ + constructor() { + super(); + } + + /** + * Defines the metadata of SubResource + * + * @returns {object} metadata of SubResource + * + */ + mapper() { + return { + required: false, + serializedName: 'SubResource', + type: { + name: 'Composite', + className: 'SubResource', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SubResource; diff --git a/lib/services/computeManagement2/lib/lib/models/subResourceReadOnly.js b/lib/services/computeManagement2/lib/lib/models/subResourceReadOnly.js new file mode 100644 index 0000000000..98b60a6738 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/subResourceReadOnly.js @@ -0,0 +1,56 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Class representing a SubResourceReadOnly. + * @extends models['BaseResource'] + */ +class SubResourceReadOnly extends models['BaseResource'] { + /** + * Create a SubResourceReadOnly. + * @member {string} [id] Resource Id + */ + constructor() { + super(); + } + + /** + * Defines the metadata of SubResourceReadOnly + * + * @returns {object} metadata of SubResourceReadOnly + * + */ + mapper() { + return { + required: false, + serializedName: 'SubResourceReadOnly', + type: { + name: 'Composite', + className: 'SubResourceReadOnly', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SubResourceReadOnly; diff --git a/lib/services/computeManagement2/lib/lib/models/throttledRequestsInput.js b/lib/services/computeManagement2/lib/lib/models/throttledRequestsInput.js new file mode 100644 index 0000000000..1684715bcf --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/throttledRequestsInput.js @@ -0,0 +1,90 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Api request input for LogAnalytics getThrottledRequests Api. + * + * @extends models['LogAnalyticsInputBase'] + */ +class ThrottledRequestsInput extends models['LogAnalyticsInputBase'] { + /** + * Create a ThrottledRequestsInput. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ThrottledRequestsInput + * + * @returns {object} metadata of ThrottledRequestsInput + * + */ + mapper() { + return { + required: false, + serializedName: 'ThrottledRequestsInput', + type: { + name: 'Composite', + className: 'ThrottledRequestsInput', + modelProperties: { + blobContainerSasUri: { + required: true, + serializedName: 'blobContainerSasUri', + type: { + name: 'String' + } + }, + fromTime: { + required: true, + serializedName: 'fromTime', + type: { + name: 'DateTime' + } + }, + toTime: { + required: true, + serializedName: 'toTime', + type: { + name: 'DateTime' + } + }, + groupByThrottlePolicy: { + required: false, + serializedName: 'groupByThrottlePolicy', + type: { + name: 'Boolean' + } + }, + groupByOperationName: { + required: false, + serializedName: 'groupByOperationName', + type: { + name: 'Boolean' + } + }, + groupByResourceName: { + required: false, + serializedName: 'groupByResourceName', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = ThrottledRequestsInput; diff --git a/lib/services/computeManagement2/lib/lib/models/updateResource.js b/lib/services/computeManagement2/lib/lib/models/updateResource.js new file mode 100644 index 0000000000..069580f99a --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/updateResource.js @@ -0,0 +1,63 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The Update Resource model definition. + * + * @extends models['BaseResource'] + */ +class UpdateResource extends models['BaseResource'] { + /** + * Create a UpdateResource. + * @member {object} [tags] Resource tags + */ + constructor() { + super(); + } + + /** + * Defines the metadata of UpdateResource + * + * @returns {object} metadata of UpdateResource + * + */ + mapper() { + return { + required: false, + serializedName: 'UpdateResource', + type: { + name: 'Composite', + className: 'UpdateResource', + modelProperties: { + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = UpdateResource; diff --git a/lib/services/computeManagement2/lib/lib/models/upgradeOperationHistoricalStatusInfo.js b/lib/services/computeManagement2/lib/lib/models/upgradeOperationHistoricalStatusInfo.js new file mode 100644 index 0000000000..daf419ea2b --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/upgradeOperationHistoricalStatusInfo.js @@ -0,0 +1,120 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Virtual Machine Scale Set OS Upgrade History operation response. + * + */ +class UpgradeOperationHistoricalStatusInfo { + /** + * Create a UpgradeOperationHistoricalStatusInfo. + * @member {object} [properties] Information about the properties of the + * upgrade operation. + * @member {object} [properties.runningStatus] Information about the overall + * status of the upgrade operation. + * @member {string} [properties.runningStatus.code] Code indicating the + * current status of the upgrade. Possible values include: 'RollingForward', + * 'Cancelled', 'Completed', 'Faulted' + * @member {date} [properties.runningStatus.startTime] Start time of the + * upgrade. + * @member {date} [properties.runningStatus.endTime] End time of the upgrade. + * @member {object} [properties.progress] Counts of the VM's in each state. + * @member {number} [properties.progress.successfulInstanceCount] The number + * of instances that have been successfully upgraded. + * @member {number} [properties.progress.failedInstanceCount] The number of + * instances that have failed to be upgraded successfully. + * @member {number} [properties.progress.inProgressInstanceCount] The number + * of instances that are currently being upgraded. + * @member {number} [properties.progress.pendingInstanceCount] The number of + * instances that have not yet begun to be upgraded. + * @member {object} [properties.error] Error Details for this upgrade if + * there are any. + * @member {array} [properties.error.details] The Api error details + * @member {object} [properties.error.innererror] The Api inner error + * @member {string} [properties.error.innererror.exceptiontype] The exception + * type. + * @member {string} [properties.error.innererror.errordetail] The internal + * error message or exception dump. + * @member {string} [properties.error.code] The error code. + * @member {string} [properties.error.target] The target of the particular + * error. + * @member {string} [properties.error.message] The error message. + * @member {string} [properties.startedBy] Invoker of the Upgrade Operation. + * Possible values include: 'Unknown', 'User', 'Platform' + * @member {object} [properties.targetImageReference] Image Reference details + * @member {string} [properties.targetImageReference.publisher] The image + * publisher. + * @member {string} [properties.targetImageReference.offer] Specifies the + * offer of the platform image or marketplace image used to create the + * virtual machine. + * @member {string} [properties.targetImageReference.sku] The image SKU. + * @member {string} [properties.targetImageReference.version] Specifies the + * version of the platform image or marketplace image used to create the + * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the + * latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time + * even if a new version becomes available. + * @member {string} [type] Resource type + * @member {string} [location] Resource location + */ + constructor() { + } + + /** + * Defines the metadata of UpgradeOperationHistoricalStatusInfo + * + * @returns {object} metadata of UpgradeOperationHistoricalStatusInfo + * + */ + mapper() { + return { + required: false, + serializedName: 'UpgradeOperationHistoricalStatusInfo', + type: { + name: 'Composite', + className: 'UpgradeOperationHistoricalStatusInfo', + modelProperties: { + properties: { + required: false, + readOnly: true, + serializedName: 'properties', + type: { + name: 'Composite', + className: 'UpgradeOperationHistoricalStatusInfoProperties' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: false, + readOnly: true, + serializedName: 'location', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = UpgradeOperationHistoricalStatusInfo; diff --git a/lib/services/computeManagement2/lib/lib/models/upgradeOperationHistoricalStatusInfoProperties.js b/lib/services/computeManagement2/lib/lib/models/upgradeOperationHistoricalStatusInfoProperties.js new file mode 100644 index 0000000000..caea20f210 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/upgradeOperationHistoricalStatusInfoProperties.js @@ -0,0 +1,130 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Describes each OS upgrade on the Virtual Machine Scale Set. + * + */ +class UpgradeOperationHistoricalStatusInfoProperties { + /** + * Create a UpgradeOperationHistoricalStatusInfoProperties. + * @member {object} [runningStatus] Information about the overall status of + * the upgrade operation. + * @member {string} [runningStatus.code] Code indicating the current status + * of the upgrade. Possible values include: 'RollingForward', 'Cancelled', + * 'Completed', 'Faulted' + * @member {date} [runningStatus.startTime] Start time of the upgrade. + * @member {date} [runningStatus.endTime] End time of the upgrade. + * @member {object} [progress] Counts of the VM's in each state. + * @member {number} [progress.successfulInstanceCount] The number of + * instances that have been successfully upgraded. + * @member {number} [progress.failedInstanceCount] The number of instances + * that have failed to be upgraded successfully. + * @member {number} [progress.inProgressInstanceCount] The number of + * instances that are currently being upgraded. + * @member {number} [progress.pendingInstanceCount] The number of instances + * that have not yet begun to be upgraded. + * @member {object} [error] Error Details for this upgrade if there are any. + * @member {array} [error.details] The Api error details + * @member {object} [error.innererror] The Api inner error + * @member {string} [error.innererror.exceptiontype] The exception type. + * @member {string} [error.innererror.errordetail] The internal error message + * or exception dump. + * @member {string} [error.code] The error code. + * @member {string} [error.target] The target of the particular error. + * @member {string} [error.message] The error message. + * @member {string} [startedBy] Invoker of the Upgrade Operation. Possible + * values include: 'Unknown', 'User', 'Platform' + * @member {object} [targetImageReference] Image Reference details + * @member {string} [targetImageReference.publisher] The image publisher. + * @member {string} [targetImageReference.offer] Specifies the offer of the + * platform image or marketplace image used to create the virtual machine. + * @member {string} [targetImageReference.sku] The image SKU. + * @member {string} [targetImageReference.version] Specifies the version of + * the platform image or marketplace image used to create the virtual + * machine. The allowed formats are Major.Minor.Build or 'latest'. Major, + * Minor, and Build are decimal numbers. Specify 'latest' to use the latest + * version of an image available at deploy time. Even if you use 'latest', + * the VM image will not automatically update after deploy time even if a new + * version becomes available. + */ + constructor() { + } + + /** + * Defines the metadata of UpgradeOperationHistoricalStatusInfoProperties + * + * @returns {object} metadata of UpgradeOperationHistoricalStatusInfoProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'UpgradeOperationHistoricalStatusInfoProperties', + type: { + name: 'Composite', + className: 'UpgradeOperationHistoricalStatusInfoProperties', + modelProperties: { + runningStatus: { + required: false, + readOnly: true, + serializedName: 'runningStatus', + type: { + name: 'Composite', + className: 'UpgradeOperationHistoryStatus' + } + }, + progress: { + required: false, + readOnly: true, + serializedName: 'progress', + type: { + name: 'Composite', + className: 'RollingUpgradeProgressInfo' + } + }, + error: { + required: false, + readOnly: true, + serializedName: 'error', + type: { + name: 'Composite', + className: 'ApiError' + } + }, + startedBy: { + required: false, + readOnly: true, + serializedName: 'startedBy', + type: { + name: 'Enum', + allowedValues: [ 'Unknown', 'User', 'Platform' ] + } + }, + targetImageReference: { + required: false, + readOnly: true, + serializedName: 'targetImageReference', + type: { + name: 'Composite', + className: 'ImageReference' + } + } + } + } + }; + } +} + +module.exports = UpgradeOperationHistoricalStatusInfoProperties; diff --git a/lib/services/computeManagement2/lib/lib/models/upgradeOperationHistoryStatus.js b/lib/services/computeManagement2/lib/lib/models/upgradeOperationHistoryStatus.js new file mode 100644 index 0000000000..989c1480d4 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/upgradeOperationHistoryStatus.js @@ -0,0 +1,74 @@ +/* + * 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'; + +/** + * Information about the current running state of the overall upgrade. + * + */ +class UpgradeOperationHistoryStatus { + /** + * Create a UpgradeOperationHistoryStatus. + * @member {string} [code] Code indicating the current status of the upgrade. + * Possible values include: 'RollingForward', 'Cancelled', 'Completed', + * 'Faulted' + * @member {date} [startTime] Start time of the upgrade. + * @member {date} [endTime] End time of the upgrade. + */ + constructor() { + } + + /** + * Defines the metadata of UpgradeOperationHistoryStatus + * + * @returns {object} metadata of UpgradeOperationHistoryStatus + * + */ + mapper() { + return { + required: false, + serializedName: 'UpgradeOperationHistoryStatus', + type: { + name: 'Composite', + className: 'UpgradeOperationHistoryStatus', + modelProperties: { + code: { + required: false, + readOnly: true, + serializedName: 'code', + type: { + name: 'Enum', + allowedValues: [ 'RollingForward', 'Cancelled', 'Completed', 'Faulted' ] + } + }, + startTime: { + required: false, + readOnly: true, + serializedName: 'startTime', + type: { + name: 'DateTime' + } + }, + endTime: { + required: false, + readOnly: true, + serializedName: 'endTime', + type: { + name: 'DateTime' + } + } + } + } + }; + } +} + +module.exports = UpgradeOperationHistoryStatus; diff --git a/lib/services/computeManagement2/lib/lib/models/upgradePolicy.js b/lib/services/computeManagement2/lib/lib/models/upgradePolicy.js new file mode 100644 index 0000000000..eb5f4643c8 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/upgradePolicy.js @@ -0,0 +1,104 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Describes an upgrade policy - automatic, manual, or rolling. + * + */ +class UpgradePolicy { + /** + * Create a UpgradePolicy. + * @member {string} [mode] Specifies the mode of an upgrade to virtual + * machines in the scale set.

    Possible values are:

    + * **Manual** - You control the application of updates to virtual machines + * in the scale set. You do this by using the manualUpgrade action.

    **Automatic** - All virtual machines in the scale set are + * automatically updated at the same time. Possible values include: + * 'Automatic', 'Manual', 'Rolling' + * @member {object} [rollingUpgradePolicy] The configuration parameters used + * while performing a rolling upgrade. + * @member {number} [rollingUpgradePolicy.maxBatchInstancePercent] The + * maximum percent of total virtual machine instances that will be upgraded + * simultaneously by the rolling upgrade in one batch. As this is a maximum, + * unhealthy instances in previous or future batches can cause the percentage + * of instances in a batch to decrease to ensure higher reliability. The + * default value for this parameter is 20%. + * @member {number} [rollingUpgradePolicy.maxUnhealthyInstancePercent] The + * maximum percentage of the total virtual machine instances in the scale set + * that can be simultaneously unhealthy, either as a result of being + * upgraded, or by being found in an unhealthy state by the virtual machine + * health checks before the rolling upgrade aborts. This constraint will be + * checked prior to starting any batch. The default value for this parameter + * is 20%. + * @member {number} + * [rollingUpgradePolicy.maxUnhealthyUpgradedInstancePercent] The maximum + * percentage of upgraded virtual machine instances that can be found to be + * in an unhealthy state. This check will happen after each batch is + * upgraded. If this percentage is ever exceeded, the rolling update aborts. + * The default value for this parameter is 20%. + * @member {string} [rollingUpgradePolicy.pauseTimeBetweenBatches] The wait + * time between completing the update for all virtual machines in one batch + * and starting the next batch. The time duration should be specified in ISO + * 8601 format. The default value is 0 seconds (PT0S). + * @member {boolean} [automaticOSUpgrade] Whether OS upgrades should + * automatically be applied to scale set instances in a rolling fashion when + * a newer version of the image becomes available. + */ + constructor() { + } + + /** + * Defines the metadata of UpgradePolicy + * + * @returns {object} metadata of UpgradePolicy + * + */ + mapper() { + return { + required: false, + serializedName: 'UpgradePolicy', + type: { + name: 'Composite', + className: 'UpgradePolicy', + modelProperties: { + mode: { + required: false, + serializedName: 'mode', + type: { + name: 'Enum', + allowedValues: [ 'Automatic', 'Manual', 'Rolling' ] + } + }, + rollingUpgradePolicy: { + required: false, + serializedName: 'rollingUpgradePolicy', + type: { + name: 'Composite', + className: 'RollingUpgradePolicy' + } + }, + automaticOSUpgrade: { + required: false, + serializedName: 'automaticOSUpgrade', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = UpgradePolicy; diff --git a/lib/services/computeManagement2/lib/lib/models/usage.js b/lib/services/computeManagement2/lib/lib/models/usage.js new file mode 100644 index 0000000000..8566e4ebee --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/usage.js @@ -0,0 +1,82 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Describes Compute Resource Usage. + * + */ +class Usage { + /** + * Create a Usage. + * @member {number} currentValue The current usage of the resource. + * @member {number} limit The maximum permitted usage of the resource. + * @member {object} name The name of the type of usage. + * @member {string} [name.value] The name of the resource. + * @member {string} [name.localizedValue] The localized name of the resource. + */ + constructor() { + } + + /** + * Defines the metadata of Usage + * + * @returns {object} metadata of Usage + * + */ + mapper() { + return { + required: false, + serializedName: 'Usage', + type: { + name: 'Composite', + className: 'Usage', + modelProperties: { + unit: { + required: true, + isConstant: true, + serializedName: 'unit', + defaultValue: 'Count', + type: { + name: 'String' + } + }, + currentValue: { + required: true, + serializedName: 'currentValue', + type: { + name: 'Number' + } + }, + limit: { + required: true, + serializedName: 'limit', + type: { + name: 'Number' + } + }, + name: { + required: true, + serializedName: 'name', + type: { + name: 'Composite', + className: 'UsageName' + } + } + } + } + }; + } +} + +module.exports = Usage; diff --git a/lib/services/computeManagement2/lib/lib/models/usageName.js b/lib/services/computeManagement2/lib/lib/models/usageName.js new file mode 100644 index 0000000000..fc33444bc4 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/usageName.js @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The Usage Names. + * + */ +class UsageName { + /** + * Create a UsageName. + * @member {string} [value] The name of the resource. + * @member {string} [localizedValue] The localized name of the resource. + */ + constructor() { + } + + /** + * Defines the metadata of UsageName + * + * @returns {object} metadata of UsageName + * + */ + mapper() { + return { + required: false, + serializedName: 'UsageName', + type: { + name: 'Composite', + className: 'UsageName', + modelProperties: { + value: { + required: false, + serializedName: 'value', + type: { + name: 'String' + } + }, + localizedValue: { + required: false, + serializedName: 'localizedValue', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = UsageName; diff --git a/lib/services/computeManagement2/lib/lib/models/vaultCertificate.js b/lib/services/computeManagement2/lib/lib/models/vaultCertificate.js new file mode 100644 index 0000000000..81a1fa70ec --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/vaultCertificate.js @@ -0,0 +1,75 @@ +/* + * 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'; + +/** + * Describes a single certificate reference in a Key Vault, and where the + * certificate should reside on the VM. + * + */ +class VaultCertificate { + /** + * Create a VaultCertificate. + * @member {string} [certificateUrl] This is the URL of a certificate that + * has been uploaded to Key Vault as a secret. For adding a secret to the Key + * Vault, see [Add a key or secret to the key + * vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). + * In this case, your certificate needs to be It is the Base64 encoding of + * the following JSON Object which is encoded in UTF-8:

    {
    + * "data":"",
    "dataType":"pfx",
    + * "password":""
    } + * @member {string} [certificateStore] For Windows VMs, specifies the + * certificate store on the Virtual Machine to which the certificate should + * be added. The specified certificate store is implicitly in the + * LocalMachine account.

    For Linux VMs, the certificate file is + * placed under the /var/lib/waagent directory, with the file name + * .crt for the X509 certificate file and + * .prv for private key. Both of these files are .pem + * formatted. + */ + constructor() { + } + + /** + * Defines the metadata of VaultCertificate + * + * @returns {object} metadata of VaultCertificate + * + */ + mapper() { + return { + required: false, + serializedName: 'VaultCertificate', + type: { + name: 'Composite', + className: 'VaultCertificate', + modelProperties: { + certificateUrl: { + required: false, + serializedName: 'certificateUrl', + type: { + name: 'String' + } + }, + certificateStore: { + required: false, + serializedName: 'certificateStore', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VaultCertificate; diff --git a/lib/services/computeManagement2/lib/lib/models/vaultSecretGroup.js b/lib/services/computeManagement2/lib/lib/models/vaultSecretGroup.js new file mode 100644 index 0000000000..e1a7e3f5ff --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/vaultSecretGroup.js @@ -0,0 +1,74 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Describes a set of certificates which are all in the same Key Vault. + * + */ +class VaultSecretGroup { + /** + * Create a VaultSecretGroup. + * @member {object} [sourceVault] The relative URL of the Key Vault + * containing all of the certificates in VaultCertificates. + * @member {string} [sourceVault.id] Resource Id + * @member {array} [vaultCertificates] The list of key vault references in + * SourceVault which contain certificates. + */ + constructor() { + } + + /** + * Defines the metadata of VaultSecretGroup + * + * @returns {object} metadata of VaultSecretGroup + * + */ + mapper() { + return { + required: false, + serializedName: 'VaultSecretGroup', + type: { + name: 'Composite', + className: 'VaultSecretGroup', + modelProperties: { + sourceVault: { + required: false, + serializedName: 'sourceVault', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + vaultCertificates: { + required: false, + serializedName: 'vaultCertificates', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VaultCertificateElementType', + type: { + name: 'Composite', + className: 'VaultCertificate' + } + } + } + } + } + } + }; + } +} + +module.exports = VaultSecretGroup; diff --git a/lib/services/computeManagement2/lib/lib/models/virtualHardDisk.js b/lib/services/computeManagement2/lib/lib/models/virtualHardDisk.js new file mode 100644 index 0000000000..1fbc70dca7 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/virtualHardDisk.js @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Describes the uri of a disk. + * + */ +class VirtualHardDisk { + /** + * Create a VirtualHardDisk. + * @member {string} [uri] Specifies the virtual hard disk's uri. + */ + constructor() { + } + + /** + * Defines the metadata of VirtualHardDisk + * + * @returns {object} metadata of VirtualHardDisk + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualHardDisk', + type: { + name: 'Composite', + className: 'VirtualHardDisk', + modelProperties: { + uri: { + required: false, + serializedName: 'uri', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VirtualHardDisk; diff --git a/lib/services/computeManagement2/lib/lib/models/virtualMachine.js b/lib/services/computeManagement2/lib/lib/models/virtualMachine.js new file mode 100644 index 0000000000..dfb237a362 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/virtualMachine.js @@ -0,0 +1,593 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Describes a Virtual Machine. + * + * @extends models['Resource'] + */ +class VirtualMachine extends models['Resource'] { + /** + * Create a VirtualMachine. + * @member {object} [plan] Specifies information about the marketplace image + * used to create the virtual machine. This element is only used for + * marketplace images. Before you can use a marketplace image from an API, + * you must enable the image for programmatic use. In the Azure portal, find + * the marketplace image that you want to use and then click **Want to deploy + * programmatically, Get Started ->**. Enter any required information and + * then click **Save**. + * @member {string} [plan.name] The plan ID. + * @member {string} [plan.publisher] The publisher ID. + * @member {string} [plan.product] Specifies the product of the image from + * the marketplace. This is the same value as Offer under the imageReference + * element. + * @member {string} [plan.promotionCode] The promotion code. + * @member {object} [hardwareProfile] Specifies the hardware settings for the + * virtual machine. + * @member {string} [hardwareProfile.vmSize] Specifies the size of the + * virtual machine. For more information about virtual machine sizes, see + * [Sizes for virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    The available VM sizes depend on region and availability set. For + * a list of available sizes use these APIs:

    [List all available + * virtual machine sizes in an availability + * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) + *

    [List all available virtual machine sizes in a + * region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) + *

    [List all available virtual machine sizes for + * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). + * Possible values include: '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_B1s', 'Standard_B1ms', + * 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', + * '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_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', + * 'Standard_D16_v3', 'Standard_D32_v3', 'Standard_D64_v3', + * 'Standard_D2s_v3', 'Standard_D4s_v3', 'Standard_D8s_v3', + * 'Standard_D16s_v3', 'Standard_D32s_v3', 'Standard_D64s_v3', + * '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_DS13-4_v2', + * 'Standard_DS13-2_v2', 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', + * 'Standard_E2_v3', 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', + * 'Standard_E32_v3', 'Standard_E64_v3', 'Standard_E2s_v3', + * 'Standard_E4s_v3', 'Standard_E8s_v3', 'Standard_E16s_v3', + * 'Standard_E32s_v3', 'Standard_E64s_v3', 'Standard_E32-16_v3', + * 'Standard_E32-8s_v3', 'Standard_E64-32s_v3', 'Standard_E64-16s_v3', + * 'Standard_F1', 'Standard_F2', 'Standard_F4', 'Standard_F8', + * 'Standard_F16', 'Standard_F1s', 'Standard_F2s', 'Standard_F4s', + * 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2', 'Standard_F4s_v2', + * 'Standard_F8s_v2', 'Standard_F16s_v2', 'Standard_F32s_v2', + * 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1', 'Standard_G2', + * 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', + * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', + * 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8', + * 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m', + * 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', + * 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms', + * 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms', + * 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms', + * 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', + * 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2', + * 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3', + * 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s', + * 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6', + * 'Standard_NV12', 'Standard_NV24' + * @member {object} [storageProfile] Specifies the storage settings for the + * virtual machine disks. + * @member {object} [storageProfile.imageReference] Specifies information + * about the image to use. You can specify information about platform images, + * marketplace images, or virtual machine images. This element is required + * when you want to use a platform image, marketplace image, or virtual + * machine image, but is not used in other creation operations. + * @member {string} [storageProfile.imageReference.publisher] The image + * publisher. + * @member {string} [storageProfile.imageReference.offer] Specifies the offer + * of the platform image or marketplace image used to create the virtual + * machine. + * @member {string} [storageProfile.imageReference.sku] The image SKU. + * @member {string} [storageProfile.imageReference.version] Specifies the + * version of the platform image or marketplace image used to create the + * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the + * latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time + * even if a new version becomes available. + * @member {object} [storageProfile.osDisk] Specifies information about the + * operating system disk used by the virtual machine.

    For more + * information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @member {string} [storageProfile.osDisk.osType] This property allows you + * to specify the type of the OS that is included in the disk if creating a + * VM from user-image or a specialized VHD.

    Possible values are: + *

    **Windows**

    **Linux**. Possible values include: + * 'Windows', 'Linux' + * @member {object} [storageProfile.osDisk.encryptionSettings] Specifies the + * encryption settings for the OS Disk.

    Minimum api-version: + * 2015-06-15 + * @member {object} + * [storageProfile.osDisk.encryptionSettings.diskEncryptionKey] Specifies the + * location of the disk encryption key, which is a Key Vault Secret. + * @member {string} + * [storageProfile.osDisk.encryptionSettings.diskEncryptionKey.secretUrl] The + * URL referencing a secret in a Key Vault. + * @member {object} + * [storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault] + * The relative URL of the Key Vault containing the secret. + * @member {string} + * [storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault.id] + * Resource Id + * @member {object} + * [storageProfile.osDisk.encryptionSettings.keyEncryptionKey] Specifies the + * location of the key encryption key in Key Vault. + * @member {string} + * [storageProfile.osDisk.encryptionSettings.keyEncryptionKey.keyUrl] The URL + * referencing a key encryption key in Key Vault. + * @member {object} + * [storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault] + * The relative URL of the Key Vault containing the key. + * @member {string} + * [storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault.id] + * Resource Id + * @member {boolean} [storageProfile.osDisk.encryptionSettings.enabled] + * Specifies whether disk encryption should be enabled on the virtual + * machine. + * @member {string} [storageProfile.osDisk.name] The disk name. + * @member {object} [storageProfile.osDisk.vhd] The virtual hard disk. + * @member {string} [storageProfile.osDisk.vhd.uri] Specifies the virtual + * hard disk's uri. + * @member {object} [storageProfile.osDisk.image] The source user image + * virtual hard disk. The virtual hard disk will be copied before being + * attached to the virtual machine. If SourceImage is provided, the + * destination virtual hard drive must not exist. + * @member {string} [storageProfile.osDisk.image.uri] Specifies the virtual + * hard disk's uri. + * @member {string} [storageProfile.osDisk.caching] Specifies the caching + * requirements.

    Possible values are:

    **None**

    + * **ReadOnly**

    **ReadWrite**

    Default: **None for Standard + * storage. ReadOnly for Premium storage**. Possible values include: 'None', + * 'ReadOnly', 'ReadWrite' + * @member {boolean} [storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * @member {string} [storageProfile.osDisk.createOption] Specifies how the + * virtual machine should be created.

    Possible values are:

    + * **Attach** \u2013 This value is used when you are using a specialized disk + * to create the virtual machine.

    **FromImage** \u2013 This value is + * used when you are using an image to create the virtual machine. If you are + * using a platform image, you also use the imageReference element described + * above. If you are using a marketplace image, you also use the plan + * element previously described. Possible values include: 'FromImage', + * 'Empty', 'Attach' + * @member {number} [storageProfile.osDisk.diskSizeGB] Specifies the size of + * an empty data disk in gigabytes. This element can be used to overwrite the + * name of the disk in a virtual machine image.

    This value cannot be + * larger than 1023 GB + * @member {object} [storageProfile.osDisk.managedDisk] The managed disk + * parameters. + * @member {string} [storageProfile.osDisk.managedDisk.storageAccountType] + * Specifies the storage account type for the managed disk. Possible values + * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * @member {array} [storageProfile.dataDisks] Specifies the parameters that + * are used to add a data disk to a virtual machine.

    For more + * information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @member {object} [osProfile] Specifies the operating system settings for + * the virtual machine. + * @member {string} [osProfile.computerName] Specifies the host OS name of + * the virtual machine.

    **Max-length (Windows):** 15 characters + *

    **Max-length (Linux):** 64 characters.

    For naming + * conventions and restrictions see [Azure infrastructure services + * implementation + * guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). + * @member {string} [osProfile.adminUsername] Specifies the name of the + * administrator account.

    **Windows-only restriction:** Cannot end + * in "."

    **Disallowed values:** "administrator", "admin", "user", + * "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", + * "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", + * "guest", "john", "owner", "root", "server", "sql", "support", + * "support_388945a0", "sys", "test2", "test3", "user4", "user5".

    + * **Minimum-length (Linux):** 1 character

    **Max-length (Linux):** + * 64 characters

    **Max-length (Windows):** 20 characters + *

  • For root access to the Linux VM, see [Using root privileges + * on Linux virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in + * this field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * @member {string} [osProfile.adminPassword] Specifies the password of the + * administrator account.

    **Minimum-length (Windows):** 8 characters + *

    **Minimum-length (Linux):** 6 characters

    **Max-length + * (Windows):** 123 characters

    **Max-length (Linux):** 72 characters + *

    **Complexity requirements:** 3 out of 4 conditions below need to + * be fulfilled
    Has lower characters
    Has upper characters
    Has a + * digit
    Has a special character (Regex match [\W_])

    + * **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", + * "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", + * "iloveyou!"

    For resetting the password, see [How to reset the + * Remote Desktop service or its login password in a Windows + * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    For resetting root password, see [Manage users, SSH, and check or + * repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + * @member {string} [osProfile.customData] Specifies a base-64 encoded string + * of custom data. The base-64 encoded string is decoded to a binary array + * that is saved as a file on the Virtual Machine. The maximum length of the + * binary array is 65535 bytes.

    For using cloud-init for your VM, + * see [Using cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * @member {object} [osProfile.windowsConfiguration] Specifies Windows + * operating system settings on the virtual machine. + * @member {boolean} [osProfile.windowsConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the + * virtual machine.

    When this property is not specified in the + * request body, default behavior is to set it to true. This will ensure + * that VM Agent is installed on the VM so that extensions can be added to + * the VM later. + * @member {boolean} [osProfile.windowsConfiguration.enableAutomaticUpdates] + * Indicates whether virtual machine is enabled for automatic updates. + * @member {string} [osProfile.windowsConfiguration.timeZone] Specifies the + * time zone of the virtual machine. e.g. "Pacific Standard Time" + * @member {array} [osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * @member {object} [osProfile.windowsConfiguration.winRM] Specifies the + * Windows Remote Management listeners. This enables remote Windows + * PowerShell. + * @member {array} [osProfile.windowsConfiguration.winRM.listeners] The list + * of Windows Remote Management listeners + * @member {object} [osProfile.linuxConfiguration] Specifies the Linux + * operating system settings on the virtual machine.

    For a list of + * supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * @member {boolean} + * [osProfile.linuxConfiguration.disablePasswordAuthentication] Specifies + * whether password authentication should be disabled. + * @member {object} [osProfile.linuxConfiguration.ssh] Specifies the ssh key + * configuration for a Linux OS. + * @member {array} [osProfile.linuxConfiguration.ssh.publicKeys] The list of + * SSH public keys used to authenticate with linux based VMs. + * @member {array} [osProfile.secrets] Specifies set of certificates that + * should be installed onto the virtual machine. + * @member {object} [networkProfile] Specifies the network interfaces of the + * virtual machine. + * @member {array} [networkProfile.networkInterfaces] Specifies the list of + * resource Ids for the network interfaces associated with the virtual + * machine. + * @member {object} [diagnosticsProfile] Specifies the boot diagnostic + * settings state.

    Minimum api-version: 2015-06-15. + * @member {object} [diagnosticsProfile.bootDiagnostics] Boot Diagnostics is + * a debugging feature which allows you to view Console Output and Screenshot + * to diagnose VM status.

    For Linux Virtual Machines, you can easily + * view the output of your console log.

    For both Windows and Linux + * virtual machines, Azure also enables you to see a screenshot of the VM + * from the hypervisor. + * @member {boolean} [diagnosticsProfile.bootDiagnostics.enabled] Whether + * boot diagnostics should be enabled on the Virtual Machine. + * @member {string} [diagnosticsProfile.bootDiagnostics.storageUri] Uri of + * the storage account to use for placing the console output and screenshot. + * @member {object} [availabilitySet] Specifies information about the + * availability set that the virtual machine should be assigned to. Virtual + * machines specified in the same availability set are allocated to different + * nodes to maximize availability. For more information about availability + * sets, see [Manage the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    For more information on Azure planned maintainance, see [Planned + * maintenance for virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Currently, a VM can only be added to availability set at creation + * time. An existing VM cannot be added to an availability set. + * @member {string} [availabilitySet.id] Resource Id + * @member {string} [provisioningState] The provisioning state, which only + * appears in the response. + * @member {object} [instanceView] The virtual machine instance view. + * @member {number} [instanceView.platformUpdateDomain] Specifies the update + * domain of the virtual machine. + * @member {number} [instanceView.platformFaultDomain] Specifies the fault + * domain of the virtual machine. + * @member {string} [instanceView.computerName] The computer name assigned to + * the virtual machine. + * @member {string} [instanceView.osName] The Operating System running on the + * virtual machine. + * @member {string} [instanceView.osVersion] The version of Operating System + * running on the virtual machine. + * @member {string} [instanceView.rdpThumbPrint] The Remote desktop + * certificate thumbprint. + * @member {object} [instanceView.vmAgent] The VM Agent running on the + * virtual machine. + * @member {string} [instanceView.vmAgent.vmAgentVersion] The VM Agent full + * version. + * @member {array} [instanceView.vmAgent.extensionHandlers] The virtual + * machine extension handler instance view. + * @member {array} [instanceView.vmAgent.statuses] The resource status + * information. + * @member {object} [instanceView.maintenanceRedeployStatus] The Maintenance + * Operation status on the virtual machine. + * @member {boolean} + * [instanceView.maintenanceRedeployStatus.isCustomerInitiatedMaintenanceAllowed] + * True, if customer is allowed to perform Maintenance. + * @member {date} + * [instanceView.maintenanceRedeployStatus.preMaintenanceWindowStartTime] + * Start Time for the Pre Maintenance Window. + * @member {date} + * [instanceView.maintenanceRedeployStatus.preMaintenanceWindowEndTime] End + * Time for the Pre Maintenance Window. + * @member {date} + * [instanceView.maintenanceRedeployStatus.maintenanceWindowStartTime] Start + * Time for the Maintenance Window. + * @member {date} + * [instanceView.maintenanceRedeployStatus.maintenanceWindowEndTime] End Time + * for the Maintenance Window. + * @member {string} + * [instanceView.maintenanceRedeployStatus.lastOperationResultCode] The Last + * Maintenance Operation Result Code. Possible values include: 'None', + * 'RetryLater', 'MaintenanceAborted', 'MaintenanceCompleted' + * @member {string} + * [instanceView.maintenanceRedeployStatus.lastOperationMessage] Message + * returned for the last Maintenance Operation. + * @member {array} [instanceView.disks] The virtual machine disk information. + * @member {array} [instanceView.extensions] The extensions information. + * @member {object} [instanceView.bootDiagnostics] Boot Diagnostics is a + * debugging feature which allows you to view Console Output and Screenshot + * to diagnose VM status.

    For Linux Virtual Machines, you can easily + * view the output of your console log.

    For both Windows and Linux + * virtual machines, Azure also enables you to see a screenshot of the VM + * from the hypervisor. + * @member {string} [instanceView.bootDiagnostics.consoleScreenshotBlobUri] + * The console screenshot blob URI. + * @member {string} [instanceView.bootDiagnostics.serialConsoleLogBlobUri] + * The Linux serial console log blob Uri. + * @member {array} [instanceView.statuses] The resource status information. + * @member {string} [licenseType] Specifies that the image or disk that is + * being used was licensed on-premises. This element is only used for images + * that contain the Windows Server operating system.

    Possible values + * are:

    Windows_Client

    Windows_Server

    If this + * element is included in a request for an update, the value must match the + * initial value. This value cannot be updated.

    For more + * information, see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Minimum api-version: 2015-06-15 + * @member {string} [vmId] Specifies the VM unique ID which is a 128-bits + * identifier that is encoded and stored in all Azure IaaS VMs SMBIOS and can + * be read using platform BIOS commands. + * @member {array} [resources] The virtual machine child extension resources. + * @member {object} [identity] The identity of the virtual machine, if + * configured. + * @member {string} [identity.principalId] The principal id of virtual + * machine identity. This property will only be provided for a system + * assigned identity. + * @member {string} [identity.tenantId] The tenant id associated with the + * virtual machine. This property will only be provided for a system assigned + * identity. + * @member {string} [identity.type] The type of identity used for the virtual + * machine. The type 'SystemAssigned, UserAssigned' includes both an + * implicitly created identity and a set of user assigned identities. The + * type 'None' will remove any identities from the virtual machine. Possible + * values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, + * UserAssigned', 'None' + * @member {array} [identity.identityIds] The list of user identities + * associated with the Virtual Machine. The user identity references will be + * ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @member {array} [zones] The virtual machine zones. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VirtualMachine + * + * @returns {object} metadata of VirtualMachine + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachine', + type: { + name: 'Composite', + className: 'VirtualMachine', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: true, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + plan: { + required: false, + serializedName: 'plan', + type: { + name: 'Composite', + className: 'Plan' + } + }, + hardwareProfile: { + required: false, + serializedName: 'properties.hardwareProfile', + type: { + name: 'Composite', + className: 'HardwareProfile' + } + }, + storageProfile: { + required: false, + serializedName: 'properties.storageProfile', + type: { + name: 'Composite', + className: 'StorageProfile' + } + }, + osProfile: { + required: false, + serializedName: 'properties.osProfile', + type: { + name: 'Composite', + className: 'OSProfile' + } + }, + networkProfile: { + required: false, + serializedName: 'properties.networkProfile', + type: { + name: 'Composite', + className: 'NetworkProfile' + } + }, + diagnosticsProfile: { + required: false, + serializedName: 'properties.diagnosticsProfile', + type: { + name: 'Composite', + className: 'DiagnosticsProfile' + } + }, + availabilitySet: { + required: false, + serializedName: 'properties.availabilitySet', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + instanceView: { + required: false, + readOnly: true, + serializedName: 'properties.instanceView', + type: { + name: 'Composite', + className: 'VirtualMachineInstanceView' + } + }, + licenseType: { + required: false, + serializedName: 'properties.licenseType', + type: { + name: 'String' + } + }, + vmId: { + required: false, + readOnly: true, + serializedName: 'properties.vmId', + type: { + name: 'String' + } + }, + resources: { + required: false, + readOnly: true, + serializedName: 'resources', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VirtualMachineExtensionElementType', + type: { + name: 'Composite', + className: 'VirtualMachineExtension' + } + } + } + }, + identity: { + required: false, + serializedName: 'identity', + type: { + name: 'Composite', + className: 'VirtualMachineIdentity' + } + }, + zones: { + required: false, + serializedName: 'zones', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = VirtualMachine; diff --git a/lib/services/computeManagement2/lib/lib/models/virtualMachineAgentInstanceView.js b/lib/services/computeManagement2/lib/lib/models/virtualMachineAgentInstanceView.js new file mode 100644 index 0000000000..93bc2c51be --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/virtualMachineAgentInstanceView.js @@ -0,0 +1,87 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The instance view of the VM Agent running on the virtual machine. + * + */ +class VirtualMachineAgentInstanceView { + /** + * Create a VirtualMachineAgentInstanceView. + * @member {string} [vmAgentVersion] The VM Agent full version. + * @member {array} [extensionHandlers] The virtual machine extension handler + * instance view. + * @member {array} [statuses] The resource status information. + */ + constructor() { + } + + /** + * Defines the metadata of VirtualMachineAgentInstanceView + * + * @returns {object} metadata of VirtualMachineAgentInstanceView + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineAgentInstanceView', + type: { + name: 'Composite', + className: 'VirtualMachineAgentInstanceView', + modelProperties: { + vmAgentVersion: { + required: false, + serializedName: 'vmAgentVersion', + type: { + name: 'String' + } + }, + extensionHandlers: { + required: false, + serializedName: 'extensionHandlers', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VirtualMachineExtensionHandlerInstanceViewElementType', + type: { + name: 'Composite', + className: 'VirtualMachineExtensionHandlerInstanceView' + } + } + } + }, + statuses: { + required: false, + serializedName: 'statuses', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'InstanceViewStatusElementType', + type: { + name: 'Composite', + className: 'InstanceViewStatus' + } + } + } + } + } + } + }; + } +} + +module.exports = VirtualMachineAgentInstanceView; diff --git a/lib/services/computeManagement2/lib/lib/models/virtualMachineCaptureParameters.js b/lib/services/computeManagement2/lib/lib/models/virtualMachineCaptureParameters.js new file mode 100644 index 0000000000..37455a63a1 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/virtualMachineCaptureParameters.js @@ -0,0 +1,69 @@ +/* + * 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'; + +/** + * Capture Virtual Machine parameters. + * + */ +class VirtualMachineCaptureParameters { + /** + * Create a VirtualMachineCaptureParameters. + * @member {string} vhdPrefix The captured virtual hard disk's name prefix. + * @member {string} destinationContainerName The destination container name. + * @member {boolean} overwriteVhds Specifies whether to overwrite the + * destination virtual hard disk, in case of conflict. + */ + constructor() { + } + + /** + * Defines the metadata of VirtualMachineCaptureParameters + * + * @returns {object} metadata of VirtualMachineCaptureParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineCaptureParameters', + type: { + name: 'Composite', + className: 'VirtualMachineCaptureParameters', + modelProperties: { + vhdPrefix: { + required: true, + serializedName: 'vhdPrefix', + type: { + name: 'String' + } + }, + destinationContainerName: { + required: true, + serializedName: 'destinationContainerName', + type: { + name: 'String' + } + }, + overwriteVhds: { + required: true, + serializedName: 'overwriteVhds', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = VirtualMachineCaptureParameters; diff --git a/lib/services/computeManagement2/lib/lib/models/virtualMachineCaptureResult.js b/lib/services/computeManagement2/lib/lib/models/virtualMachineCaptureResult.js new file mode 100644 index 0000000000..82d3ef372b --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/virtualMachineCaptureResult.js @@ -0,0 +1,63 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Resource Id. + * + * @extends models['SubResource'] + */ +class VirtualMachineCaptureResult extends models['SubResource'] { + /** + * Create a VirtualMachineCaptureResult. + * @member {object} [output] Operation output data (raw JSON) + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VirtualMachineCaptureResult + * + * @returns {object} metadata of VirtualMachineCaptureResult + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineCaptureResult', + type: { + name: 'Composite', + className: 'VirtualMachineCaptureResult', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + output: { + required: false, + serializedName: 'properties.output', + type: { + name: 'Object' + } + } + } + } + }; + } +} + +module.exports = VirtualMachineCaptureResult; diff --git a/lib/services/computeManagement2/lib/lib/models/virtualMachineExtension.js b/lib/services/computeManagement2/lib/lib/models/virtualMachineExtension.js new file mode 100644 index 0000000000..86e56017ac --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/virtualMachineExtension.js @@ -0,0 +1,186 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Describes a Virtual Machine Extension. + * + * @extends models['Resource'] + */ +class VirtualMachineExtension extends models['Resource'] { + /** + * Create a VirtualMachineExtension. + * @member {string} [forceUpdateTag] How the extension handler should be + * forced to update even if the extension configuration has not changed. + * @member {string} [publisher] The name of the extension handler publisher. + * @member {string} [virtualMachineExtensionType] Specifies the type of the + * extension; an example is "CustomScriptExtension". + * @member {string} [typeHandlerVersion] Specifies the version of the script + * handler. + * @member {boolean} [autoUpgradeMinorVersion] Indicates whether the + * extension should use a newer minor version if one is available at + * deployment time. Once deployed, however, the extension will not upgrade + * minor versions unless redeployed, even with this property set to true. + * @member {object} [settings] Json formatted public settings for the + * extension. + * @member {object} [protectedSettings] The extension can contain either + * protectedSettings or protectedSettingsFromKeyVault or no protected + * settings at all. + * @member {string} [provisioningState] The provisioning state, which only + * appears in the response. + * @member {object} [instanceView] The virtual machine extension instance + * view. + * @member {string} [instanceView.name] The virtual machine extension name. + * @member {string} [instanceView.type] Specifies the type of the extension; + * an example is "CustomScriptExtension". + * @member {string} [instanceView.typeHandlerVersion] Specifies the version + * of the script handler. + * @member {array} [instanceView.substatuses] The resource status + * information. + * @member {array} [instanceView.statuses] The resource status information. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VirtualMachineExtension + * + * @returns {object} metadata of VirtualMachineExtension + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineExtension', + type: { + name: 'Composite', + className: 'VirtualMachineExtension', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: true, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + forceUpdateTag: { + required: false, + serializedName: 'properties.forceUpdateTag', + type: { + name: 'String' + } + }, + publisher: { + required: false, + serializedName: 'properties.publisher', + type: { + name: 'String' + } + }, + virtualMachineExtensionType: { + required: false, + serializedName: 'properties.type', + type: { + name: 'String' + } + }, + typeHandlerVersion: { + required: false, + serializedName: 'properties.typeHandlerVersion', + type: { + name: 'String' + } + }, + autoUpgradeMinorVersion: { + required: false, + serializedName: 'properties.autoUpgradeMinorVersion', + type: { + name: 'Boolean' + } + }, + settings: { + required: false, + serializedName: 'properties.settings', + type: { + name: 'Object' + } + }, + protectedSettings: { + required: false, + serializedName: 'properties.protectedSettings', + type: { + name: 'Object' + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + instanceView: { + required: false, + serializedName: 'properties.instanceView', + type: { + name: 'Composite', + className: 'VirtualMachineExtensionInstanceView' + } + } + } + } + }; + } +} + +module.exports = VirtualMachineExtension; diff --git a/lib/services/computeManagement2/lib/lib/models/virtualMachineExtensionHandlerInstanceView.js b/lib/services/computeManagement2/lib/lib/models/virtualMachineExtensionHandlerInstanceView.js new file mode 100644 index 0000000000..a4ce866b57 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/virtualMachineExtensionHandlerInstanceView.js @@ -0,0 +1,81 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The instance view of a virtual machine extension handler. + * + */ +class VirtualMachineExtensionHandlerInstanceView { + /** + * Create a VirtualMachineExtensionHandlerInstanceView. + * @member {string} [type] Specifies the type of the extension; an example is + * "CustomScriptExtension". + * @member {string} [typeHandlerVersion] Specifies the version of the script + * handler. + * @member {object} [status] The extension handler status. + * @member {string} [status.code] The status code. + * @member {string} [status.level] The level code. Possible values include: + * 'Info', 'Warning', 'Error' + * @member {string} [status.displayStatus] The short localizable label for + * the status. + * @member {string} [status.message] The detailed status message, including + * for alerts and error messages. + * @member {date} [status.time] The time of the status. + */ + constructor() { + } + + /** + * Defines the metadata of VirtualMachineExtensionHandlerInstanceView + * + * @returns {object} metadata of VirtualMachineExtensionHandlerInstanceView + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineExtensionHandlerInstanceView', + type: { + name: 'Composite', + className: 'VirtualMachineExtensionHandlerInstanceView', + modelProperties: { + type: { + required: false, + serializedName: 'type', + type: { + name: 'String' + } + }, + typeHandlerVersion: { + required: false, + serializedName: 'typeHandlerVersion', + type: { + name: 'String' + } + }, + status: { + required: false, + serializedName: 'status', + type: { + name: 'Composite', + className: 'InstanceViewStatus' + } + } + } + } + }; + } +} + +module.exports = VirtualMachineExtensionHandlerInstanceView; diff --git a/lib/services/computeManagement2/lib/lib/models/virtualMachineExtensionImage.js b/lib/services/computeManagement2/lib/lib/models/virtualMachineExtensionImage.js new file mode 100644 index 0000000000..b25bb88e7d --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/virtualMachineExtensionImage.js @@ -0,0 +1,140 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Describes a Virtual Machine Extension Image. + * + * @extends models['Resource'] + */ +class VirtualMachineExtensionImage extends models['Resource'] { + /** + * Create a VirtualMachineExtensionImage. + * @member {string} operatingSystem The operating system this extension + * supports. + * @member {string} computeRole The type of role (IaaS or PaaS) this + * extension supports. + * @member {string} handlerSchema The schema defined by publisher, where + * extension consumers should provide settings in a matching schema. + * @member {boolean} [vmScaleSetEnabled] Whether the extension can be used on + * xRP VMScaleSets. By default existing extensions are usable on scalesets, + * but there might be cases where a publisher wants to explicitly indicate + * the extension is only enabled for CRP VMs but not VMSS. + * @member {boolean} [supportsMultipleExtensions] Whether the handler can + * support multiple extensions. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VirtualMachineExtensionImage + * + * @returns {object} metadata of VirtualMachineExtensionImage + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineExtensionImage', + type: { + name: 'Composite', + className: 'VirtualMachineExtensionImage', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: true, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + operatingSystem: { + required: true, + serializedName: 'properties.operatingSystem', + type: { + name: 'String' + } + }, + computeRole: { + required: true, + serializedName: 'properties.computeRole', + type: { + name: 'String' + } + }, + handlerSchema: { + required: true, + serializedName: 'properties.handlerSchema', + type: { + name: 'String' + } + }, + vmScaleSetEnabled: { + required: false, + serializedName: 'properties.vmScaleSetEnabled', + type: { + name: 'Boolean' + } + }, + supportsMultipleExtensions: { + required: false, + serializedName: 'properties.supportsMultipleExtensions', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = VirtualMachineExtensionImage; diff --git a/lib/services/computeManagement2/lib/lib/models/virtualMachineExtensionInstanceView.js b/lib/services/computeManagement2/lib/lib/models/virtualMachineExtensionInstanceView.js new file mode 100644 index 0000000000..cdd03e40d8 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/virtualMachineExtensionInstanceView.js @@ -0,0 +1,104 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The instance view of a virtual machine extension. + * + */ +class VirtualMachineExtensionInstanceView { + /** + * Create a VirtualMachineExtensionInstanceView. + * @member {string} [name] The virtual machine extension name. + * @member {string} [type] Specifies the type of the extension; an example is + * "CustomScriptExtension". + * @member {string} [typeHandlerVersion] Specifies the version of the script + * handler. + * @member {array} [substatuses] The resource status information. + * @member {array} [statuses] The resource status information. + */ + constructor() { + } + + /** + * Defines the metadata of VirtualMachineExtensionInstanceView + * + * @returns {object} metadata of VirtualMachineExtensionInstanceView + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineExtensionInstanceView', + type: { + name: 'Composite', + className: 'VirtualMachineExtensionInstanceView', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + serializedName: 'type', + type: { + name: 'String' + } + }, + typeHandlerVersion: { + required: false, + serializedName: 'typeHandlerVersion', + type: { + name: 'String' + } + }, + substatuses: { + required: false, + serializedName: 'substatuses', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'InstanceViewStatusElementType', + type: { + name: 'Composite', + className: 'InstanceViewStatus' + } + } + } + }, + statuses: { + required: false, + serializedName: 'statuses', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'InstanceViewStatusElementType', + type: { + name: 'Composite', + className: 'InstanceViewStatus' + } + } + } + } + } + } + }; + } +} + +module.exports = VirtualMachineExtensionInstanceView; diff --git a/lib/services/computeManagement2/lib/lib/models/virtualMachineHealthStatus.js b/lib/services/computeManagement2/lib/lib/models/virtualMachineHealthStatus.js new file mode 100644 index 0000000000..0ccd89fedd --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/virtualMachineHealthStatus.js @@ -0,0 +1,64 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The health status of the VM. + * + */ +class VirtualMachineHealthStatus { + /** + * Create a VirtualMachineHealthStatus. + * @member {object} [status] The health status information for the VM. + * @member {string} [status.code] The status code. + * @member {string} [status.level] The level code. Possible values include: + * 'Info', 'Warning', 'Error' + * @member {string} [status.displayStatus] The short localizable label for + * the status. + * @member {string} [status.message] The detailed status message, including + * for alerts and error messages. + * @member {date} [status.time] The time of the status. + */ + constructor() { + } + + /** + * Defines the metadata of VirtualMachineHealthStatus + * + * @returns {object} metadata of VirtualMachineHealthStatus + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineHealthStatus', + type: { + name: 'Composite', + className: 'VirtualMachineHealthStatus', + modelProperties: { + status: { + required: false, + readOnly: true, + serializedName: 'status', + type: { + name: 'Composite', + className: 'InstanceViewStatus' + } + } + } + } + }; + } +} + +module.exports = VirtualMachineHealthStatus; diff --git a/lib/services/computeManagement2/lib/lib/models/virtualMachineIdentity.js b/lib/services/computeManagement2/lib/lib/models/virtualMachineIdentity.js new file mode 100644 index 0000000000..741dcde48e --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/virtualMachineIdentity.js @@ -0,0 +1,98 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Identity for the virtual machine. + * + */ +class VirtualMachineIdentity { + /** + * Create a VirtualMachineIdentity. + * @member {string} [principalId] The principal id of virtual machine + * identity. This property will only be provided for a system assigned + * identity. + * @member {string} [tenantId] The tenant id associated with the virtual + * machine. This property will only be provided for a system assigned + * identity. + * @member {string} [type] The type of identity used for the virtual machine. + * The type 'SystemAssigned, UserAssigned' includes both an implicitly + * created identity and a set of user assigned identities. The type 'None' + * will remove any identities from the virtual machine. Possible values + * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', + * 'None' + * @member {array} [identityIds] The list of user identities associated with + * the Virtual Machine. The user identity references will be ARM resource ids + * in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + */ + constructor() { + } + + /** + * Defines the metadata of VirtualMachineIdentity + * + * @returns {object} metadata of VirtualMachineIdentity + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineIdentity', + type: { + name: 'Composite', + className: 'VirtualMachineIdentity', + modelProperties: { + principalId: { + required: false, + readOnly: true, + serializedName: 'principalId', + type: { + name: 'String' + } + }, + tenantId: { + required: false, + readOnly: true, + serializedName: 'tenantId', + type: { + name: 'String' + } + }, + type: { + required: false, + serializedName: 'type', + type: { + name: 'Enum', + allowedValues: [ 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None' ] + } + }, + identityIds: { + required: false, + serializedName: 'identityIds', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = VirtualMachineIdentity; diff --git a/lib/services/computeManagement2/lib/lib/models/virtualMachineImage.js b/lib/services/computeManagement2/lib/lib/models/virtualMachineImage.js new file mode 100644 index 0000000000..7eb1f0fe24 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/virtualMachineImage.js @@ -0,0 +1,124 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Describes a Virtual Machine Image. + * + * @extends models['VirtualMachineImageResource'] + */ +class VirtualMachineImage extends models['VirtualMachineImageResource'] { + /** + * Create a VirtualMachineImage. + * @member {object} [plan] + * @member {string} [plan.publisher] The publisher ID. + * @member {string} [plan.name] The plan ID. + * @member {string} [plan.product] Specifies the product of the image from + * the marketplace. This is the same value as Offer under the imageReference + * element. + * @member {object} [osDiskImage] + * @member {string} [osDiskImage.operatingSystem] The operating system of the + * osDiskImage. Possible values include: 'Windows', 'Linux' + * @member {array} [dataDiskImages] + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VirtualMachineImage + * + * @returns {object} metadata of VirtualMachineImage + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineImage', + type: { + name: 'Composite', + className: 'VirtualMachineImage', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + location: { + required: true, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + plan: { + required: false, + serializedName: 'properties.plan', + type: { + name: 'Composite', + className: 'PurchasePlan' + } + }, + osDiskImage: { + required: false, + serializedName: 'properties.osDiskImage', + type: { + name: 'Composite', + className: 'OSDiskImage' + } + }, + dataDiskImages: { + required: false, + serializedName: 'properties.dataDiskImages', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DataDiskImageElementType', + type: { + name: 'Composite', + className: 'DataDiskImage' + } + } + } + } + } + } + }; + } +} + +module.exports = VirtualMachineImage; diff --git a/lib/services/computeManagement2/lib/lib/models/virtualMachineImageResource.js b/lib/services/computeManagement2/lib/lib/models/virtualMachineImageResource.js new file mode 100644 index 0000000000..93e856089d --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/virtualMachineImageResource.js @@ -0,0 +1,89 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Virtual machine image resource information. + * + * @extends models['SubResource'] + */ +class VirtualMachineImageResource extends models['SubResource'] { + /** + * Create a VirtualMachineImageResource. + * @member {string} name The name of the resource. + * @member {string} location The supported Azure location of the resource. + * @member {object} [tags] Specifies the tags that are assigned to the + * virtual machine. For more information about using tags, see [Using tags to + * organize your Azure + * resources](https://docs.microsoft.com/azure/azure-resource-manager/resource-group-using-tags.md). + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VirtualMachineImageResource + * + * @returns {object} metadata of VirtualMachineImageResource + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineImageResource', + type: { + name: 'Composite', + className: 'VirtualMachineImageResource', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + location: { + required: true, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = VirtualMachineImageResource; diff --git a/lib/services/computeManagement2/lib/lib/models/virtualMachineInstanceView.js b/lib/services/computeManagement2/lib/lib/models/virtualMachineInstanceView.js new file mode 100644 index 0000000000..aa4805f496 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/virtualMachineInstanceView.js @@ -0,0 +1,205 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The instance view of a virtual machine. + * + */ +class VirtualMachineInstanceView { + /** + * Create a VirtualMachineInstanceView. + * @member {number} [platformUpdateDomain] Specifies the update domain of the + * virtual machine. + * @member {number} [platformFaultDomain] Specifies the fault domain of the + * virtual machine. + * @member {string} [computerName] The computer name assigned to the virtual + * machine. + * @member {string} [osName] The Operating System running on the virtual + * machine. + * @member {string} [osVersion] The version of Operating System running on + * the virtual machine. + * @member {string} [rdpThumbPrint] The Remote desktop certificate + * thumbprint. + * @member {object} [vmAgent] The VM Agent running on the virtual machine. + * @member {string} [vmAgent.vmAgentVersion] The VM Agent full version. + * @member {array} [vmAgent.extensionHandlers] The virtual machine extension + * handler instance view. + * @member {array} [vmAgent.statuses] The resource status information. + * @member {object} [maintenanceRedeployStatus] The Maintenance Operation + * status on the virtual machine. + * @member {boolean} + * [maintenanceRedeployStatus.isCustomerInitiatedMaintenanceAllowed] True, if + * customer is allowed to perform Maintenance. + * @member {date} [maintenanceRedeployStatus.preMaintenanceWindowStartTime] + * Start Time for the Pre Maintenance Window. + * @member {date} [maintenanceRedeployStatus.preMaintenanceWindowEndTime] End + * Time for the Pre Maintenance Window. + * @member {date} [maintenanceRedeployStatus.maintenanceWindowStartTime] + * Start Time for the Maintenance Window. + * @member {date} [maintenanceRedeployStatus.maintenanceWindowEndTime] End + * Time for the Maintenance Window. + * @member {string} [maintenanceRedeployStatus.lastOperationResultCode] The + * Last Maintenance Operation Result Code. Possible values include: 'None', + * 'RetryLater', 'MaintenanceAborted', 'MaintenanceCompleted' + * @member {string} [maintenanceRedeployStatus.lastOperationMessage] Message + * returned for the last Maintenance Operation. + * @member {array} [disks] The virtual machine disk information. + * @member {array} [extensions] The extensions information. + * @member {object} [bootDiagnostics] Boot Diagnostics is a debugging feature + * which allows you to view Console Output and Screenshot to diagnose VM + * status.

    For Linux Virtual Machines, you can easily view the + * output of your console log.

    For both Windows and Linux virtual + * machines, Azure also enables you to see a screenshot of the VM from the + * hypervisor. + * @member {string} [bootDiagnostics.consoleScreenshotBlobUri] The console + * screenshot blob URI. + * @member {string} [bootDiagnostics.serialConsoleLogBlobUri] The Linux + * serial console log blob Uri. + * @member {array} [statuses] The resource status information. + */ + constructor() { + } + + /** + * Defines the metadata of VirtualMachineInstanceView + * + * @returns {object} metadata of VirtualMachineInstanceView + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineInstanceView', + type: { + name: 'Composite', + className: 'VirtualMachineInstanceView', + modelProperties: { + platformUpdateDomain: { + required: false, + serializedName: 'platformUpdateDomain', + type: { + name: 'Number' + } + }, + platformFaultDomain: { + required: false, + serializedName: 'platformFaultDomain', + type: { + name: 'Number' + } + }, + computerName: { + required: false, + serializedName: 'computerName', + type: { + name: 'String' + } + }, + osName: { + required: false, + serializedName: 'osName', + type: { + name: 'String' + } + }, + osVersion: { + required: false, + serializedName: 'osVersion', + type: { + name: 'String' + } + }, + rdpThumbPrint: { + required: false, + serializedName: 'rdpThumbPrint', + type: { + name: 'String' + } + }, + vmAgent: { + required: false, + serializedName: 'vmAgent', + type: { + name: 'Composite', + className: 'VirtualMachineAgentInstanceView' + } + }, + maintenanceRedeployStatus: { + required: false, + serializedName: 'maintenanceRedeployStatus', + type: { + name: 'Composite', + className: 'MaintenanceRedeployStatus' + } + }, + disks: { + required: false, + serializedName: 'disks', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DiskInstanceViewElementType', + type: { + name: 'Composite', + className: 'DiskInstanceView' + } + } + } + }, + extensions: { + required: false, + serializedName: 'extensions', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VirtualMachineExtensionInstanceViewElementType', + type: { + name: 'Composite', + className: 'VirtualMachineExtensionInstanceView' + } + } + } + }, + bootDiagnostics: { + required: false, + serializedName: 'bootDiagnostics', + type: { + name: 'Composite', + className: 'BootDiagnosticsInstanceView' + } + }, + statuses: { + required: false, + serializedName: 'statuses', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'InstanceViewStatusElementType', + type: { + name: 'Composite', + className: 'InstanceViewStatus' + } + } + } + } + } + } + }; + } +} + +module.exports = VirtualMachineInstanceView; diff --git a/lib/services/computeManagement2/lib/lib/models/virtualMachineListResult.js b/lib/services/computeManagement2/lib/lib/models/virtualMachineListResult.js new file mode 100644 index 0000000000..f3cd4ea797 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/virtualMachineListResult.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The List Virtual Machine operation response. + */ +class VirtualMachineListResult extends Array { + /** + * Create a VirtualMachineListResult. + * @member {string} [nextLink] The URI to fetch the next page of VMs. Call + * ListNext() with this URI to fetch the next page of Virtual Machines. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VirtualMachineListResult + * + * @returns {object} metadata of VirtualMachineListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineListResult', + type: { + name: 'Composite', + className: 'VirtualMachineListResult', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VirtualMachineElementType', + type: { + name: 'Composite', + className: 'VirtualMachine' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VirtualMachineListResult; diff --git a/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSet.js b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSet.js new file mode 100644 index 0000000000..58136094b6 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSet.js @@ -0,0 +1,493 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Describes a Virtual Machine Scale Set. + * + * @extends models['Resource'] + */ +class VirtualMachineScaleSet extends models['Resource'] { + /** + * Create a VirtualMachineScaleSet. + * @member {object} [sku] The virtual machine scale set sku. + * @member {string} [sku.name] The sku name. + * @member {string} [sku.tier] Specifies the tier of virtual machines in a + * scale set.

    Possible Values:

    **Standard**

    **Basic** + * @member {number} [sku.capacity] Specifies the number of virtual machines + * in the scale set. + * @member {object} [plan] Specifies information about the marketplace image + * used to create the virtual machine. This element is only used for + * marketplace images. Before you can use a marketplace image from an API, + * you must enable the image for programmatic use. In the Azure portal, find + * the marketplace image that you want to use and then click **Want to deploy + * programmatically, Get Started ->**. Enter any required information and + * then click **Save**. + * @member {string} [plan.name] The plan ID. + * @member {string} [plan.publisher] The publisher ID. + * @member {string} [plan.product] Specifies the product of the image from + * the marketplace. This is the same value as Offer under the imageReference + * element. + * @member {string} [plan.promotionCode] The promotion code. + * @member {object} [upgradePolicy] The upgrade policy. + * @member {string} [upgradePolicy.mode] Specifies the mode of an upgrade to + * virtual machines in the scale set.

    Possible values are:

    **Manual** - You control the application of updates to virtual + * machines in the scale set. You do this by using the manualUpgrade + * action.

    **Automatic** - All virtual machines in the scale set + * are automatically updated at the same time. Possible values include: + * 'Automatic', 'Manual', 'Rolling' + * @member {object} [upgradePolicy.rollingUpgradePolicy] The configuration + * parameters used while performing a rolling upgrade. + * @member {number} + * [upgradePolicy.rollingUpgradePolicy.maxBatchInstancePercent] The maximum + * percent of total virtual machine instances that will be upgraded + * simultaneously by the rolling upgrade in one batch. As this is a maximum, + * unhealthy instances in previous or future batches can cause the percentage + * of instances in a batch to decrease to ensure higher reliability. The + * default value for this parameter is 20%. + * @member {number} + * [upgradePolicy.rollingUpgradePolicy.maxUnhealthyInstancePercent] The + * maximum percentage of the total virtual machine instances in the scale set + * that can be simultaneously unhealthy, either as a result of being + * upgraded, or by being found in an unhealthy state by the virtual machine + * health checks before the rolling upgrade aborts. This constraint will be + * checked prior to starting any batch. The default value for this parameter + * is 20%. + * @member {number} + * [upgradePolicy.rollingUpgradePolicy.maxUnhealthyUpgradedInstancePercent] + * The maximum percentage of upgraded virtual machine instances that can be + * found to be in an unhealthy state. This check will happen after each batch + * is upgraded. If this percentage is ever exceeded, the rolling update + * aborts. The default value for this parameter is 20%. + * @member {string} + * [upgradePolicy.rollingUpgradePolicy.pauseTimeBetweenBatches] The wait time + * between completing the update for all virtual machines in one batch and + * starting the next batch. The time duration should be specified in ISO 8601 + * format. The default value is 0 seconds (PT0S). + * @member {boolean} [upgradePolicy.automaticOSUpgrade] Whether OS upgrades + * should automatically be applied to scale set instances in a rolling + * fashion when a newer version of the image becomes available. + * @member {object} [virtualMachineProfile] The virtual machine profile. + * @member {object} [virtualMachineProfile.osProfile] Specifies the operating + * system settings for the virtual machines in the scale set. + * @member {string} [virtualMachineProfile.osProfile.computerNamePrefix] + * Specifies the computer name prefix for all of the virtual machines in the + * scale set. Computer name prefixes must be 1 to 15 characters long. + * @member {string} [virtualMachineProfile.osProfile.adminUsername] Specifies + * the name of the administrator account.

    **Windows-only + * restriction:** Cannot end in "."

    **Disallowed values:** + * "administrator", "admin", "user", "user1", "test", "user2", "test1", + * "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", + * "backup", "console", "david", "guest", "john", "owner", "root", "server", + * "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", + * "user5".

    **Minimum-length (Linux):** 1 character

    + * **Max-length (Linux):** 64 characters

    **Max-length (Windows):** + * 20 characters

  • For root access to the Linux VM, see [Using + * root privileges on Linux virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in + * this field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * @member {string} [virtualMachineProfile.osProfile.adminPassword] Specifies + * the password of the administrator account.

    **Minimum-length + * (Windows):** 8 characters

    **Minimum-length (Linux):** 6 + * characters

    **Max-length (Windows):** 123 characters

    + * **Max-length (Linux):** 72 characters

    **Complexity + * requirements:** 3 out of 4 conditions below need to be fulfilled
    Has + * lower characters
    Has upper characters
    Has a digit
    Has a + * special character (Regex match [\W_])

    **Disallowed values:** + * "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", + * "pass@word1", "Password!", "Password1", "Password22", "iloveyou!"

    + * For resetting the password, see [How to reset the Remote Desktop service + * or its login password in a Windows + * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    For resetting root password, see [Manage users, SSH, and check or + * repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + * @member {string} [virtualMachineProfile.osProfile.customData] Specifies a + * base-64 encoded string of custom data. The base-64 encoded string is + * decoded to a binary array that is saved as a file on the Virtual Machine. + * The maximum length of the binary array is 65535 bytes.

    For using + * cloud-init for your VM, see [Using cloud-init to customize a Linux VM + * during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * @member {object} [virtualMachineProfile.osProfile.windowsConfiguration] + * Specifies Windows operating system settings on the virtual machine. + * @member {boolean} + * [virtualMachineProfile.osProfile.windowsConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the + * virtual machine.

    When this property is not specified in the + * request body, default behavior is to set it to true. This will ensure + * that VM Agent is installed on the VM so that extensions can be added to + * the VM later. + * @member {boolean} + * [virtualMachineProfile.osProfile.windowsConfiguration.enableAutomaticUpdates] + * Indicates whether virtual machine is enabled for automatic updates. + * @member {string} + * [virtualMachineProfile.osProfile.windowsConfiguration.timeZone] Specifies + * the time zone of the virtual machine. e.g. "Pacific Standard Time" + * @member {array} + * [virtualMachineProfile.osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * @member {object} + * [virtualMachineProfile.osProfile.windowsConfiguration.winRM] Specifies the + * Windows Remote Management listeners. This enables remote Windows + * PowerShell. + * @member {array} + * [virtualMachineProfile.osProfile.windowsConfiguration.winRM.listeners] The + * list of Windows Remote Management listeners + * @member {object} [virtualMachineProfile.osProfile.linuxConfiguration] + * Specifies the Linux operating system settings on the virtual machine. + *

    For a list of supported Linux distributions, see [Linux on + * Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * @member {boolean} + * [virtualMachineProfile.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * @member {object} [virtualMachineProfile.osProfile.linuxConfiguration.ssh] + * Specifies the ssh key configuration for a Linux OS. + * @member {array} + * [virtualMachineProfile.osProfile.linuxConfiguration.ssh.publicKeys] The + * list of SSH public keys used to authenticate with linux based VMs. + * @member {array} [virtualMachineProfile.osProfile.secrets] Specifies set of + * certificates that should be installed onto the virtual machines in the + * scale set. + * @member {object} [virtualMachineProfile.storageProfile] Specifies the + * storage settings for the virtual machine disks. + * @member {object} [virtualMachineProfile.storageProfile.imageReference] + * Specifies information about the image to use. You can specify information + * about platform images, marketplace images, or virtual machine images. This + * element is required when you want to use a platform image, marketplace + * image, or virtual machine image, but is not used in other creation + * operations. + * @member {string} + * [virtualMachineProfile.storageProfile.imageReference.publisher] The image + * publisher. + * @member {string} + * [virtualMachineProfile.storageProfile.imageReference.offer] Specifies the + * offer of the platform image or marketplace image used to create the + * virtual machine. + * @member {string} [virtualMachineProfile.storageProfile.imageReference.sku] + * The image SKU. + * @member {string} + * [virtualMachineProfile.storageProfile.imageReference.version] Specifies + * the version of the platform image or marketplace image used to create the + * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the + * latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time + * even if a new version becomes available. + * @member {object} [virtualMachineProfile.storageProfile.osDisk] Specifies + * information about the operating system disk used by the virtual machines + * in the scale set.

    For more information about disks, see [About + * disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @member {string} [virtualMachineProfile.storageProfile.osDisk.name] The + * disk name. + * @member {string} [virtualMachineProfile.storageProfile.osDisk.caching] + * Specifies the caching requirements.

    Possible values are:

    + * **None**

    **ReadOnly**

    **ReadWrite**

    Default: + * **None for Standard storage. ReadOnly for Premium storage**. Possible + * values include: 'None', 'ReadOnly', 'ReadWrite' + * @member {boolean} + * [virtualMachineProfile.storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * @member {string} + * [virtualMachineProfile.storageProfile.osDisk.createOption] Specifies how + * the virtual machines in the scale set should be created.

    The only + * allowed value is: **FromImage** \u2013 This value is used when you are + * using an image to create the virtual machine. If you are using a platform + * image, you also use the imageReference element described above. If you are + * using a marketplace image, you also use the plan element previously + * described. Possible values include: 'FromImage', 'Empty', 'Attach' + * @member {string} [virtualMachineProfile.storageProfile.osDisk.osType] This + * property allows you to specify the type of the OS that is included in the + * disk if creating a VM from user-image or a specialized VHD.

    + * Possible values are:

    **Windows**

    **Linux**. Possible + * values include: 'Windows', 'Linux' + * @member {object} [virtualMachineProfile.storageProfile.osDisk.image] + * Specifies information about the unmanaged user image to base the scale set + * on. + * @member {string} [virtualMachineProfile.storageProfile.osDisk.image.uri] + * Specifies the virtual hard disk's uri. + * @member {array} + * [virtualMachineProfile.storageProfile.osDisk.vhdContainers] Specifies the + * container urls that are used to store operating system disks for the scale + * set. + * @member {object} [virtualMachineProfile.storageProfile.osDisk.managedDisk] + * The managed disk parameters. + * @member {string} + * [virtualMachineProfile.storageProfile.osDisk.managedDisk.storageAccountType] + * Specifies the storage account type for the managed disk. Possible values + * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * @member {array} [virtualMachineProfile.storageProfile.dataDisks] Specifies + * the parameters that are used to add data disks to the virtual machines in + * the scale set.

    For more information about disks, see [About disks + * and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @member {object} [virtualMachineProfile.networkProfile] Specifies + * properties of the network interfaces of the virtual machines in the scale + * set. + * @member {object} [virtualMachineProfile.networkProfile.healthProbe] A + * reference to a load balancer probe used to determine the health of an + * instance in the virtual machine scale set. The reference will be in the + * form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. + * @member {string} [virtualMachineProfile.networkProfile.healthProbe.id] The + * ARM resource id in the form of + * /subscriptions/{SubcriptionId}/resourceGroups/{ResourceGroupName}/... + * @member {array} + * [virtualMachineProfile.networkProfile.networkInterfaceConfigurations] The + * list of network configurations. + * @member {object} [virtualMachineProfile.diagnosticsProfile] Specifies the + * boot diagnostic settings state.

    Minimum api-version: 2015-06-15. + * @member {object} + * [virtualMachineProfile.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, + * you can easily view the output of your console log.

    For both + * Windows and Linux virtual machines, Azure also enables you to see a + * screenshot of the VM from the hypervisor. + * @member {boolean} + * [virtualMachineProfile.diagnosticsProfile.bootDiagnostics.enabled] Whether + * boot diagnostics should be enabled on the Virtual Machine. + * @member {string} + * [virtualMachineProfile.diagnosticsProfile.bootDiagnostics.storageUri] Uri + * of the storage account to use for placing the console output and + * screenshot. + * @member {object} [virtualMachineProfile.extensionProfile] Specifies a + * collection of settings for extensions installed on virtual machines in the + * scale set. + * @member {array} [virtualMachineProfile.extensionProfile.extensions] The + * virtual machine scale set child extension resources. + * @member {string} [virtualMachineProfile.licenseType] Specifies that the + * image or disk that is being used was licensed on-premises. This element is + * only used for images that contain the Windows Server operating system. + *

    Possible values are:

    Windows_Client

    + * Windows_Server

    If this element is included in a request for an + * update, the value must match the initial value. This value cannot be + * updated.

    For more information, see [Azure Hybrid Use Benefit for + * Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Minimum api-version: 2015-06-15 + * @member {string} [virtualMachineProfile.priority] Specifies the priority + * for the virtual machines in the scale set.

    Minimum api-version: + * 2017-10-30-preview. Possible values include: 'Regular', 'Low' + * @member {string} [provisioningState] The provisioning state, which only + * appears in the response. + * @member {boolean} [overprovision] Specifies whether the Virtual Machine + * Scale Set should be overprovisioned. + * @member {string} [uniqueId] Specifies the ID which uniquely identifies a + * Virtual Machine Scale Set. + * @member {boolean} [singlePlacementGroup] When true this limits the scale + * set to a single placement group, of max size 100 virtual machines. + * @member {boolean} [zoneBalance] Whether to force stictly even Virtual + * Machine distribution cross x-zones in case there is zone outage. + * @member {number} [platformFaultDomainCount] Fault Domain count for each + * placement group. + * @member {object} [identity] The identity of the virtual machine scale set, + * if configured. + * @member {string} [identity.principalId] The principal id of virtual + * machine scale set identity. This property will only be provided for a + * system assigned identity. + * @member {string} [identity.tenantId] The tenant id associated with the + * virtual machine scale set. This property will only be provided for a + * system assigned identity. + * @member {string} [identity.type] The type of identity used for the virtual + * machine scale set. The type 'SystemAssigned, UserAssigned' includes both + * an implicitly created identity and a set of user assigned identities. The + * type 'None' will remove any identities from the virtual machine scale set. + * Possible values include: 'SystemAssigned', 'UserAssigned', + * 'SystemAssigned, UserAssigned', 'None' + * @member {array} [identity.identityIds] The list of user identities + * associated with the virtual machine scale set. The user identity + * references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @member {array} [zones] The virtual machine scale set zones. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VirtualMachineScaleSet + * + * @returns {object} metadata of VirtualMachineScaleSet + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineScaleSet', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSet', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: true, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + sku: { + required: false, + serializedName: 'sku', + type: { + name: 'Composite', + className: 'Sku' + } + }, + plan: { + required: false, + serializedName: 'plan', + type: { + name: 'Composite', + className: 'Plan' + } + }, + upgradePolicy: { + required: false, + serializedName: 'properties.upgradePolicy', + type: { + name: 'Composite', + className: 'UpgradePolicy' + } + }, + virtualMachineProfile: { + required: false, + serializedName: 'properties.virtualMachineProfile', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetVMProfile' + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + overprovision: { + required: false, + serializedName: 'properties.overprovision', + type: { + name: 'Boolean' + } + }, + uniqueId: { + required: false, + readOnly: true, + serializedName: 'properties.uniqueId', + type: { + name: 'String' + } + }, + singlePlacementGroup: { + required: false, + serializedName: 'properties.singlePlacementGroup', + type: { + name: 'Boolean' + } + }, + zoneBalance: { + required: false, + serializedName: 'properties.zoneBalance', + type: { + name: 'Boolean' + } + }, + platformFaultDomainCount: { + required: false, + serializedName: 'properties.platformFaultDomainCount', + type: { + name: 'Number' + } + }, + identity: { + required: false, + serializedName: 'identity', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetIdentity' + } + }, + zones: { + required: false, + serializedName: 'zones', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = VirtualMachineScaleSet; diff --git a/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetDataDisk.js b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetDataDisk.js new file mode 100644 index 0000000000..764ded8a19 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetDataDisk.js @@ -0,0 +1,117 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Describes a virtual machine scale set data disk. + * + */ +class VirtualMachineScaleSetDataDisk { + /** + * Create a VirtualMachineScaleSetDataDisk. + * @member {string} [name] The disk name. + * @member {number} lun Specifies the logical unit number of the data disk. + * This value is used to identify data disks within the VM and therefore must + * be unique for each data disk attached to a VM. + * @member {string} [caching] Specifies the caching requirements.

    + * Possible values are:

    **None**

    **ReadOnly**

    + * **ReadWrite**

    Default: **None for Standard storage. ReadOnly for + * Premium storage**. Possible values include: 'None', 'ReadOnly', + * 'ReadWrite' + * @member {boolean} [writeAcceleratorEnabled] Specifies whether + * writeAccelerator should be enabled or disabled on the disk. + * @member {string} createOption The create option. Possible values include: + * 'FromImage', 'Empty', 'Attach' + * @member {number} [diskSizeGB] Specifies the size of an empty data disk in + * gigabytes. This element can be used to overwrite the name of the disk in a + * virtual machine image.

    This value cannot be larger than 1023 GB + * @member {object} [managedDisk] The managed disk parameters. + * @member {string} [managedDisk.storageAccountType] Specifies the storage + * account type for the managed disk. Possible values are: Standard_LRS or + * Premium_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS' + */ + constructor() { + } + + /** + * Defines the metadata of VirtualMachineScaleSetDataDisk + * + * @returns {object} metadata of VirtualMachineScaleSetDataDisk + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineScaleSetDataDisk', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetDataDisk', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + lun: { + required: true, + serializedName: 'lun', + type: { + name: 'Number' + } + }, + caching: { + required: false, + serializedName: 'caching', + type: { + name: 'Enum', + allowedValues: [ 'None', 'ReadOnly', 'ReadWrite' ] + } + }, + writeAcceleratorEnabled: { + required: false, + serializedName: 'writeAcceleratorEnabled', + type: { + name: 'Boolean' + } + }, + createOption: { + required: true, + serializedName: 'createOption', + type: { + name: 'String' + } + }, + diskSizeGB: { + required: false, + serializedName: 'diskSizeGB', + type: { + name: 'Number' + } + }, + managedDisk: { + required: false, + serializedName: 'managedDisk', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetManagedDiskParameters' + } + } + } + } + }; + } +} + +module.exports = VirtualMachineScaleSetDataDisk; diff --git a/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetExtension.js b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetExtension.js new file mode 100644 index 0000000000..039e6fa071 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetExtension.js @@ -0,0 +1,140 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Describes a Virtual Machine Scale Set Extension. + * + * @extends models['SubResourceReadOnly'] + */ +class VirtualMachineScaleSetExtension extends models['SubResourceReadOnly'] { + /** + * Create a VirtualMachineScaleSetExtension. + * @member {string} [name] The name of the extension. + * @member {string} [forceUpdateTag] If a value is provided and is different + * from the previous value, the extension handler will be forced to update + * even if the extension configuration has not changed. + * @member {string} [publisher] The name of the extension handler publisher. + * @member {string} [type] Specifies the type of the extension; an example is + * "CustomScriptExtension". + * @member {string} [typeHandlerVersion] Specifies the version of the script + * handler. + * @member {boolean} [autoUpgradeMinorVersion] Indicates whether the + * extension should use a newer minor version if one is available at + * deployment time. Once deployed, however, the extension will not upgrade + * minor versions unless redeployed, even with this property set to true. + * @member {object} [settings] Json formatted public settings for the + * extension. + * @member {object} [protectedSettings] The extension can contain either + * protectedSettings or protectedSettingsFromKeyVault or no protected + * settings at all. + * @member {string} [provisioningState] The provisioning state, which only + * appears in the response. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VirtualMachineScaleSetExtension + * + * @returns {object} metadata of VirtualMachineScaleSetExtension + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineScaleSetExtension', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetExtension', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + forceUpdateTag: { + required: false, + serializedName: 'properties.forceUpdateTag', + type: { + name: 'String' + } + }, + publisher: { + required: false, + serializedName: 'properties.publisher', + type: { + name: 'String' + } + }, + type: { + required: false, + serializedName: 'properties.type', + type: { + name: 'String' + } + }, + typeHandlerVersion: { + required: false, + serializedName: 'properties.typeHandlerVersion', + type: { + name: 'String' + } + }, + autoUpgradeMinorVersion: { + required: false, + serializedName: 'properties.autoUpgradeMinorVersion', + type: { + name: 'Boolean' + } + }, + settings: { + required: false, + serializedName: 'properties.settings', + type: { + name: 'Object' + } + }, + protectedSettings: { + required: false, + serializedName: 'properties.protectedSettings', + type: { + name: 'Object' + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VirtualMachineScaleSetExtension; diff --git a/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetExtensionListResult.js b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetExtensionListResult.js new file mode 100644 index 0000000000..1b2b603469 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetExtensionListResult.js @@ -0,0 +1,69 @@ +/* + * 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 List VM scale set extension operation response. + */ +class VirtualMachineScaleSetExtensionListResult extends Array { + /** + * Create a VirtualMachineScaleSetExtensionListResult. + * @member {string} [nextLink] The uri to fetch the next page of VM scale set + * extensions. Call ListNext() with this to fetch the next page of VM scale + * set extensions. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VirtualMachineScaleSetExtensionListResult + * + * @returns {object} metadata of VirtualMachineScaleSetExtensionListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineScaleSetExtensionListResult', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetExtensionListResult', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VirtualMachineScaleSetExtensionElementType', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetExtension' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VirtualMachineScaleSetExtensionListResult; diff --git a/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetExtensionProfile.js b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetExtensionProfile.js new file mode 100644 index 0000000000..fa2d107f7e --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetExtensionProfile.js @@ -0,0 +1,63 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Describes a virtual machine scale set extension profile. + * + */ +class VirtualMachineScaleSetExtensionProfile { + /** + * Create a VirtualMachineScaleSetExtensionProfile. + * @member {array} [extensions] The virtual machine scale set child extension + * resources. + */ + constructor() { + } + + /** + * Defines the metadata of VirtualMachineScaleSetExtensionProfile + * + * @returns {object} metadata of VirtualMachineScaleSetExtensionProfile + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineScaleSetExtensionProfile', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetExtensionProfile', + modelProperties: { + extensions: { + required: false, + serializedName: 'extensions', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VirtualMachineScaleSetExtensionElementType', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetExtension' + } + } + } + } + } + } + }; + } +} + +module.exports = VirtualMachineScaleSetExtensionProfile; diff --git a/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetIPConfiguration.js b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetIPConfiguration.js new file mode 100644 index 0000000000..acba9a2b2c --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetIPConfiguration.js @@ -0,0 +1,171 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Describes a virtual machine scale set network profile's IP configuration. + * + * @extends models['SubResource'] + */ +class VirtualMachineScaleSetIPConfiguration extends models['SubResource'] { + /** + * Create a VirtualMachineScaleSetIPConfiguration. + * @member {string} name The IP configuration name. + * @member {object} [subnet] Specifies the identifier of the subnet. + * @member {string} [subnet.id] The ARM resource id in the form of + * /subscriptions/{SubcriptionId}/resourceGroups/{ResourceGroupName}/... + * @member {boolean} [primary] Specifies the primary network interface in + * case the virtual machine has more than 1 network interface. + * @member {object} [publicIPAddressConfiguration] The + * publicIPAddressConfiguration. + * @member {string} [publicIPAddressConfiguration.name] The publicIP address + * configuration name. + * @member {number} [publicIPAddressConfiguration.idleTimeoutInMinutes] The + * idle timeout of the public IP address. + * @member {object} [publicIPAddressConfiguration.dnsSettings] The dns + * settings to be applied on the publicIP addresses . + * @member {string} + * [publicIPAddressConfiguration.dnsSettings.domainNameLabel] The Domain name + * label.The concatenation of the domain name label and vm index will be the + * domain name labels of the PublicIPAddress resources that will be created + * @member {string} [privateIPAddressVersion] Available from Api-Version + * 2017-03-30 onwards, it represents whether the specific ipconfiguration is + * IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and + * 'IPv6'. Possible values include: 'IPv4', 'IPv6' + * @member {array} [applicationGatewayBackendAddressPools] Specifies an array + * of references to backend address pools of application gateways. A scale + * set can reference backend address pools of multiple application gateways. + * Multiple scale sets cannot use the same application gateway. + * @member {array} [loadBalancerBackendAddressPools] Specifies an array of + * references to backend address pools of load balancers. A scale set can + * reference backend address pools of one public and one internal load + * balancer. Multiple scale sets cannot use the same load balancer. + * @member {array} [loadBalancerInboundNatPools] Specifies an array of + * references to inbound Nat pools of the load balancers. A scale set can + * reference inbound nat pools of one public and one internal load balancer. + * Multiple scale sets cannot use the same load balancer + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VirtualMachineScaleSetIPConfiguration + * + * @returns {object} metadata of VirtualMachineScaleSetIPConfiguration + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineScaleSetIPConfiguration', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetIPConfiguration', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + subnet: { + required: false, + serializedName: 'properties.subnet', + type: { + name: 'Composite', + className: 'ApiEntityReference' + } + }, + primary: { + required: false, + serializedName: 'properties.primary', + type: { + name: 'Boolean' + } + }, + publicIPAddressConfiguration: { + required: false, + serializedName: 'properties.publicIPAddressConfiguration', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetPublicIPAddressConfiguration' + } + }, + privateIPAddressVersion: { + required: false, + serializedName: 'properties.privateIPAddressVersion', + type: { + name: 'String' + } + }, + applicationGatewayBackendAddressPools: { + required: false, + serializedName: 'properties.applicationGatewayBackendAddressPools', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SubResourceElementType', + type: { + name: 'Composite', + className: 'SubResource' + } + } + } + }, + loadBalancerBackendAddressPools: { + required: false, + serializedName: 'properties.loadBalancerBackendAddressPools', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SubResourceElementType', + type: { + name: 'Composite', + className: 'SubResource' + } + } + } + }, + loadBalancerInboundNatPools: { + required: false, + serializedName: 'properties.loadBalancerInboundNatPools', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SubResourceElementType', + type: { + name: 'Composite', + className: 'SubResource' + } + } + } + } + } + } + }; + } +} + +module.exports = VirtualMachineScaleSetIPConfiguration; diff --git a/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetIdentity.js b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetIdentity.js new file mode 100644 index 0000000000..c820acdcf9 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetIdentity.js @@ -0,0 +1,98 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Identity for the virtual machine scale set. + * + */ +class VirtualMachineScaleSetIdentity { + /** + * Create a VirtualMachineScaleSetIdentity. + * @member {string} [principalId] The principal id of virtual machine scale + * set identity. This property will only be provided for a system assigned + * identity. + * @member {string} [tenantId] The tenant id associated with the virtual + * machine scale set. This property will only be provided for a system + * assigned identity. + * @member {string} [type] The type of identity used for the virtual machine + * scale set. The type 'SystemAssigned, UserAssigned' includes both an + * implicitly created identity and a set of user assigned identities. The + * type 'None' will remove any identities from the virtual machine scale set. + * Possible values include: 'SystemAssigned', 'UserAssigned', + * 'SystemAssigned, UserAssigned', 'None' + * @member {array} [identityIds] The list of user identities associated with + * the virtual machine scale set. The user identity references will be ARM + * resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + */ + constructor() { + } + + /** + * Defines the metadata of VirtualMachineScaleSetIdentity + * + * @returns {object} metadata of VirtualMachineScaleSetIdentity + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineScaleSetIdentity', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetIdentity', + modelProperties: { + principalId: { + required: false, + readOnly: true, + serializedName: 'principalId', + type: { + name: 'String' + } + }, + tenantId: { + required: false, + readOnly: true, + serializedName: 'tenantId', + type: { + name: 'String' + } + }, + type: { + required: false, + serializedName: 'type', + type: { + name: 'Enum', + allowedValues: [ 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None' ] + } + }, + identityIds: { + required: false, + serializedName: 'identityIds', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = VirtualMachineScaleSetIdentity; diff --git a/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetInstanceView.js b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetInstanceView.js new file mode 100644 index 0000000000..b1ef6a6a1f --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetInstanceView.js @@ -0,0 +1,92 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The instance view of a virtual machine scale set. + * + */ +class VirtualMachineScaleSetInstanceView { + /** + * Create a VirtualMachineScaleSetInstanceView. + * @member {object} [virtualMachine] The instance view status summary for the + * virtual machine scale set. + * @member {array} [virtualMachine.statusesSummary] The extensions + * information. + * @member {array} [extensions] The extensions information. + * @member {array} [statuses] The resource status information. + */ + constructor() { + } + + /** + * Defines the metadata of VirtualMachineScaleSetInstanceView + * + * @returns {object} metadata of VirtualMachineScaleSetInstanceView + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineScaleSetInstanceView', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetInstanceView', + modelProperties: { + virtualMachine: { + required: false, + readOnly: true, + serializedName: 'virtualMachine', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetInstanceViewStatusesSummary' + } + }, + extensions: { + required: false, + readOnly: true, + serializedName: 'extensions', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VirtualMachineScaleSetVMExtensionsSummaryElementType', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetVMExtensionsSummary' + } + } + } + }, + statuses: { + required: false, + serializedName: 'statuses', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'InstanceViewStatusElementType', + type: { + name: 'Composite', + className: 'InstanceViewStatus' + } + } + } + } + } + } + }; + } +} + +module.exports = VirtualMachineScaleSetInstanceView; diff --git a/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetInstanceViewStatusesSummary.js b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetInstanceViewStatusesSummary.js new file mode 100644 index 0000000000..c5755dfc84 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetInstanceViewStatusesSummary.js @@ -0,0 +1,64 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Instance view statuses summary for virtual machines of a virtual machine + * scale set. + * + */ +class VirtualMachineScaleSetInstanceViewStatusesSummary { + /** + * Create a VirtualMachineScaleSetInstanceViewStatusesSummary. + * @member {array} [statusesSummary] The extensions information. + */ + constructor() { + } + + /** + * Defines the metadata of VirtualMachineScaleSetInstanceViewStatusesSummary + * + * @returns {object} metadata of VirtualMachineScaleSetInstanceViewStatusesSummary + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineScaleSetInstanceViewStatusesSummary', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetInstanceViewStatusesSummary', + modelProperties: { + statusesSummary: { + required: false, + readOnly: true, + serializedName: 'statusesSummary', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VirtualMachineStatusCodeCountElementType', + type: { + name: 'Composite', + className: 'VirtualMachineStatusCodeCount' + } + } + } + } + } + } + }; + } +} + +module.exports = VirtualMachineScaleSetInstanceViewStatusesSummary; diff --git a/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetListOSUpgradeHistory.js b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetListOSUpgradeHistory.js new file mode 100644 index 0000000000..67be7c8893 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetListOSUpgradeHistory.js @@ -0,0 +1,69 @@ +/* + * 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 Virtual Machine Scale Set OS Upgrade History operation response. + */ +class VirtualMachineScaleSetListOSUpgradeHistory extends Array { + /** + * Create a VirtualMachineScaleSetListOSUpgradeHistory. + * @member {string} [nextLink] The uri to fetch the next page of OS Upgrade + * History. Call ListNext() with this to fetch the next page of history of + * upgrades. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VirtualMachineScaleSetListOSUpgradeHistory + * + * @returns {object} metadata of VirtualMachineScaleSetListOSUpgradeHistory + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineScaleSetListOSUpgradeHistory', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetListOSUpgradeHistory', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'UpgradeOperationHistoricalStatusInfoElementType', + type: { + name: 'Composite', + className: 'UpgradeOperationHistoricalStatusInfo' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VirtualMachineScaleSetListOSUpgradeHistory; diff --git a/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetListResult.js b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetListResult.js new file mode 100644 index 0000000000..7da6f67de9 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetListResult.js @@ -0,0 +1,69 @@ +/* + * 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 List Virtual Machine operation response. + */ +class VirtualMachineScaleSetListResult extends Array { + /** + * Create a VirtualMachineScaleSetListResult. + * @member {string} [nextLink] The uri to fetch the next page of Virtual + * Machine Scale Sets. Call ListNext() with this to fetch the next page of + * VMSS. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VirtualMachineScaleSetListResult + * + * @returns {object} metadata of VirtualMachineScaleSetListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineScaleSetListResult', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetListResult', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VirtualMachineScaleSetElementType', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSet' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VirtualMachineScaleSetListResult; diff --git a/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetListSkusResult.js b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetListSkusResult.js new file mode 100644 index 0000000000..9ef34f3c99 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetListSkusResult.js @@ -0,0 +1,69 @@ +/* + * 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 Virtual Machine Scale Set List Skus operation response. + */ +class VirtualMachineScaleSetListSkusResult extends Array { + /** + * Create a VirtualMachineScaleSetListSkusResult. + * @member {string} [nextLink] The uri to fetch the next page of Virtual + * Machine Scale Set Skus. Call ListNext() with this to fetch the next page + * of VMSS Skus. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VirtualMachineScaleSetListSkusResult + * + * @returns {object} metadata of VirtualMachineScaleSetListSkusResult + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineScaleSetListSkusResult', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetListSkusResult', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VirtualMachineScaleSetSkuElementType', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetSku' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VirtualMachineScaleSetListSkusResult; diff --git a/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetListWithLinkResult.js b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetListWithLinkResult.js new file mode 100644 index 0000000000..18582e2a55 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetListWithLinkResult.js @@ -0,0 +1,69 @@ +/* + * 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 List Virtual Machine operation response. + */ +class VirtualMachineScaleSetListWithLinkResult extends Array { + /** + * Create a VirtualMachineScaleSetListWithLinkResult. + * @member {string} [nextLink] The uri to fetch the next page of Virtual + * Machine Scale Sets. Call ListNext() with this to fetch the next page of + * Virtual Machine Scale Sets. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VirtualMachineScaleSetListWithLinkResult + * + * @returns {object} metadata of VirtualMachineScaleSetListWithLinkResult + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineScaleSetListWithLinkResult', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetListWithLinkResult', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VirtualMachineScaleSetElementType', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSet' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VirtualMachineScaleSetListWithLinkResult; diff --git a/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetManagedDiskParameters.js b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetManagedDiskParameters.js new file mode 100644 index 0000000000..a11dae5d33 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetManagedDiskParameters.js @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Describes the parameters of a ScaleSet managed disk. + * + */ +class VirtualMachineScaleSetManagedDiskParameters { + /** + * Create a VirtualMachineScaleSetManagedDiskParameters. + * @member {string} [storageAccountType] Specifies the storage account type + * for the managed disk. Possible values are: Standard_LRS or Premium_LRS. + * Possible values include: 'Standard_LRS', 'Premium_LRS' + */ + constructor() { + } + + /** + * Defines the metadata of VirtualMachineScaleSetManagedDiskParameters + * + * @returns {object} metadata of VirtualMachineScaleSetManagedDiskParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineScaleSetManagedDiskParameters', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetManagedDiskParameters', + modelProperties: { + storageAccountType: { + required: false, + serializedName: 'storageAccountType', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VirtualMachineScaleSetManagedDiskParameters; diff --git a/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetNetworkConfiguration.js b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetNetworkConfiguration.js new file mode 100644 index 0000000000..2bd1cfb512 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetNetworkConfiguration.js @@ -0,0 +1,129 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Describes a virtual machine scale set network profile's network + * configurations. + * + * @extends models['SubResource'] + */ +class VirtualMachineScaleSetNetworkConfiguration extends models['SubResource'] { + /** + * Create a VirtualMachineScaleSetNetworkConfiguration. + * @member {string} name The network configuration name. + * @member {boolean} [primary] Specifies the primary network interface in + * case the virtual machine has more than 1 network interface. + * @member {boolean} [enableAcceleratedNetworking] Specifies whether the + * network interface is accelerated networking-enabled. + * @member {object} [networkSecurityGroup] The network security group. + * @member {string} [networkSecurityGroup.id] Resource Id + * @member {object} [dnsSettings] The dns settings to be applied on the + * network interfaces. + * @member {array} [dnsSettings.dnsServers] List of DNS servers IP addresses + * @member {array} ipConfigurations Specifies the IP configurations of the + * network interface. + * @member {boolean} [enableIPForwarding] Whether IP forwarding enabled on + * this NIC. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VirtualMachineScaleSetNetworkConfiguration + * + * @returns {object} metadata of VirtualMachineScaleSetNetworkConfiguration + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineScaleSetNetworkConfiguration', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetNetworkConfiguration', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + primary: { + required: false, + serializedName: 'properties.primary', + type: { + name: 'Boolean' + } + }, + enableAcceleratedNetworking: { + required: false, + serializedName: 'properties.enableAcceleratedNetworking', + type: { + name: 'Boolean' + } + }, + networkSecurityGroup: { + required: false, + serializedName: 'properties.networkSecurityGroup', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + dnsSettings: { + required: false, + serializedName: 'properties.dnsSettings', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetNetworkConfigurationDnsSettings' + } + }, + ipConfigurations: { + required: true, + serializedName: 'properties.ipConfigurations', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VirtualMachineScaleSetIPConfigurationElementType', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetIPConfiguration' + } + } + } + }, + enableIPForwarding: { + required: false, + serializedName: 'properties.enableIPForwarding', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = VirtualMachineScaleSetNetworkConfiguration; diff --git a/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetNetworkConfigurationDnsSettings.js b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetNetworkConfigurationDnsSettings.js new file mode 100644 index 0000000000..cf26dfa1c9 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetNetworkConfigurationDnsSettings.js @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Describes a virtual machines scale sets network configuration's DNS + * settings. + * + */ +class VirtualMachineScaleSetNetworkConfigurationDnsSettings { + /** + * Create a VirtualMachineScaleSetNetworkConfigurationDnsSettings. + * @member {array} [dnsServers] List of DNS servers IP addresses + */ + constructor() { + } + + /** + * Defines the metadata of VirtualMachineScaleSetNetworkConfigurationDnsSettings + * + * @returns {object} metadata of VirtualMachineScaleSetNetworkConfigurationDnsSettings + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineScaleSetNetworkConfigurationDnsSettings', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetNetworkConfigurationDnsSettings', + modelProperties: { + dnsServers: { + required: false, + serializedName: 'dnsServers', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = VirtualMachineScaleSetNetworkConfigurationDnsSettings; diff --git a/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetNetworkProfile.js b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetNetworkProfile.js new file mode 100644 index 0000000000..f3b8e80b4e --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetNetworkProfile.js @@ -0,0 +1,77 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Describes a virtual machine scale set network profile. + * + */ +class VirtualMachineScaleSetNetworkProfile { + /** + * Create a VirtualMachineScaleSetNetworkProfile. + * @member {object} [healthProbe] A reference to a load balancer probe used + * to determine the health of an instance in the virtual machine scale set. + * The reference will be in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. + * @member {string} [healthProbe.id] The ARM resource id in the form of + * /subscriptions/{SubcriptionId}/resourceGroups/{ResourceGroupName}/... + * @member {array} [networkInterfaceConfigurations] The list of network + * configurations. + */ + constructor() { + } + + /** + * Defines the metadata of VirtualMachineScaleSetNetworkProfile + * + * @returns {object} metadata of VirtualMachineScaleSetNetworkProfile + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineScaleSetNetworkProfile', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetNetworkProfile', + modelProperties: { + healthProbe: { + required: false, + serializedName: 'healthProbe', + type: { + name: 'Composite', + className: 'ApiEntityReference' + } + }, + networkInterfaceConfigurations: { + required: false, + serializedName: 'networkInterfaceConfigurations', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VirtualMachineScaleSetNetworkConfigurationElementType', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetNetworkConfiguration' + } + } + } + } + } + } + }; + } +} + +module.exports = VirtualMachineScaleSetNetworkProfile; diff --git a/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetOSDisk.js b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetOSDisk.js new file mode 100644 index 0000000000..737b7c9db1 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetOSDisk.js @@ -0,0 +1,141 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Describes a virtual machine scale set operating system disk. + * + */ +class VirtualMachineScaleSetOSDisk { + /** + * Create a VirtualMachineScaleSetOSDisk. + * @member {string} [name] The disk name. + * @member {string} [caching] Specifies the caching requirements.

    + * Possible values are:

    **None**

    **ReadOnly**

    + * **ReadWrite**

    Default: **None for Standard storage. ReadOnly for + * Premium storage**. Possible values include: 'None', 'ReadOnly', + * 'ReadWrite' + * @member {boolean} [writeAcceleratorEnabled] Specifies whether + * writeAccelerator should be enabled or disabled on the disk. + * @member {string} createOption Specifies how the virtual machines in the + * scale set should be created.

    The only allowed value is: + * **FromImage** \u2013 This value is used when you are using an image to + * create the virtual machine. If you are using a platform image, you also + * use the imageReference element described above. If you are using a + * marketplace image, you also use the plan element previously described. + * Possible values include: 'FromImage', 'Empty', 'Attach' + * @member {string} [osType] This property allows you to specify the type of + * the OS that is included in the disk if creating a VM from user-image or a + * specialized VHD.

    Possible values are:

    **Windows** + *

    **Linux**. Possible values include: 'Windows', 'Linux' + * @member {object} [image] Specifies information about the unmanaged user + * image to base the scale set on. + * @member {string} [image.uri] Specifies the virtual hard disk's uri. + * @member {array} [vhdContainers] Specifies the container urls that are used + * to store operating system disks for the scale set. + * @member {object} [managedDisk] The managed disk parameters. + * @member {string} [managedDisk.storageAccountType] Specifies the storage + * account type for the managed disk. Possible values are: Standard_LRS or + * Premium_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS' + */ + constructor() { + } + + /** + * Defines the metadata of VirtualMachineScaleSetOSDisk + * + * @returns {object} metadata of VirtualMachineScaleSetOSDisk + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineScaleSetOSDisk', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetOSDisk', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + caching: { + required: false, + serializedName: 'caching', + type: { + name: 'Enum', + allowedValues: [ 'None', 'ReadOnly', 'ReadWrite' ] + } + }, + writeAcceleratorEnabled: { + required: false, + serializedName: 'writeAcceleratorEnabled', + type: { + name: 'Boolean' + } + }, + createOption: { + required: true, + serializedName: 'createOption', + type: { + name: 'String' + } + }, + osType: { + required: false, + serializedName: 'osType', + type: { + name: 'Enum', + allowedValues: [ 'Windows', 'Linux' ] + } + }, + image: { + required: false, + serializedName: 'image', + type: { + name: 'Composite', + className: 'VirtualHardDisk' + } + }, + vhdContainers: { + required: false, + serializedName: 'vhdContainers', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + managedDisk: { + required: false, + serializedName: 'managedDisk', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetManagedDiskParameters' + } + } + } + } + }; + } +} + +module.exports = VirtualMachineScaleSetOSDisk; diff --git a/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetOSProfile.js b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetOSProfile.js new file mode 100644 index 0000000000..83622b758e --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetOSProfile.js @@ -0,0 +1,176 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Describes a virtual machine scale set OS profile. + * + */ +class VirtualMachineScaleSetOSProfile { + /** + * Create a VirtualMachineScaleSetOSProfile. + * @member {string} [computerNamePrefix] Specifies the computer name prefix + * for all of the virtual machines in the scale set. Computer name prefixes + * must be 1 to 15 characters long. + * @member {string} [adminUsername] Specifies the name of the administrator + * account.

    **Windows-only restriction:** Cannot end in "."

    + * **Disallowed values:** "administrator", "admin", "user", "user1", "test", + * "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", + * "admin2", "aspnet", "backup", "console", "david", "guest", "john", + * "owner", "root", "server", "sql", "support", "support_388945a0", "sys", + * "test2", "test3", "user4", "user5".

    **Minimum-length (Linux):** 1 + * character

    **Max-length (Linux):** 64 characters

    + * **Max-length (Windows):** 20 characters

  • For root access to + * the Linux VM, see [Using root privileges on Linux virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in + * this field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * @member {string} [adminPassword] Specifies the password of the + * administrator account.

    **Minimum-length (Windows):** 8 characters + *

    **Minimum-length (Linux):** 6 characters

    **Max-length + * (Windows):** 123 characters

    **Max-length (Linux):** 72 characters + *

    **Complexity requirements:** 3 out of 4 conditions below need to + * be fulfilled
    Has lower characters
    Has upper characters
    Has a + * digit
    Has a special character (Regex match [\W_])

    + * **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", + * "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", + * "iloveyou!"

    For resetting the password, see [How to reset the + * Remote Desktop service or its login password in a Windows + * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    For resetting root password, see [Manage users, SSH, and check or + * repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + * @member {string} [customData] Specifies a base-64 encoded string of custom + * data. The base-64 encoded string is decoded to a binary array that is + * saved as a file on the Virtual Machine. The maximum length of the binary + * array is 65535 bytes.

    For using cloud-init for your VM, see + * [Using cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * @member {object} [windowsConfiguration] Specifies Windows operating system + * settings on the virtual machine. + * @member {boolean} [windowsConfiguration.provisionVMAgent] Indicates + * whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * @member {boolean} [windowsConfiguration.enableAutomaticUpdates] Indicates + * whether virtual machine is enabled for automatic updates. + * @member {string} [windowsConfiguration.timeZone] Specifies the time zone + * of the virtual machine. e.g. "Pacific Standard Time" + * @member {array} [windowsConfiguration.additionalUnattendContent] Specifies + * additional base-64 encoded XML formatted information that can be included + * in the Unattend.xml file, which is used by Windows Setup. + * @member {object} [windowsConfiguration.winRM] Specifies the Windows Remote + * Management listeners. This enables remote Windows PowerShell. + * @member {array} [windowsConfiguration.winRM.listeners] The list of Windows + * Remote Management listeners + * @member {object} [linuxConfiguration] Specifies the Linux operating system + * settings on the virtual machine.

    For a list of supported Linux + * distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * @member {boolean} [linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * @member {object} [linuxConfiguration.ssh] Specifies the ssh key + * configuration for a Linux OS. + * @member {array} [linuxConfiguration.ssh.publicKeys] The list of SSH public + * keys used to authenticate with linux based VMs. + * @member {array} [secrets] Specifies set of certificates that should be + * installed onto the virtual machines in the scale set. + */ + constructor() { + } + + /** + * Defines the metadata of VirtualMachineScaleSetOSProfile + * + * @returns {object} metadata of VirtualMachineScaleSetOSProfile + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineScaleSetOSProfile', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetOSProfile', + modelProperties: { + computerNamePrefix: { + required: false, + serializedName: 'computerNamePrefix', + type: { + name: 'String' + } + }, + adminUsername: { + required: false, + serializedName: 'adminUsername', + type: { + name: 'String' + } + }, + adminPassword: { + required: false, + serializedName: 'adminPassword', + type: { + name: 'String' + } + }, + customData: { + required: false, + serializedName: 'customData', + type: { + name: 'String' + } + }, + windowsConfiguration: { + required: false, + serializedName: 'windowsConfiguration', + type: { + name: 'Composite', + className: 'WindowsConfiguration' + } + }, + linuxConfiguration: { + required: false, + serializedName: 'linuxConfiguration', + type: { + name: 'Composite', + className: 'LinuxConfiguration' + } + }, + secrets: { + required: false, + serializedName: 'secrets', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VaultSecretGroupElementType', + type: { + name: 'Composite', + className: 'VaultSecretGroup' + } + } + } + } + } + } + }; + } +} + +module.exports = VirtualMachineScaleSetOSProfile; diff --git a/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetPublicIPAddressConfiguration.js b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetPublicIPAddressConfiguration.js new file mode 100644 index 0000000000..7b99a1abf7 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetPublicIPAddressConfiguration.js @@ -0,0 +1,77 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Describes a virtual machines scale set IP Configuration's PublicIPAddress + * configuration + * + */ +class VirtualMachineScaleSetPublicIPAddressConfiguration { + /** + * Create a VirtualMachineScaleSetPublicIPAddressConfiguration. + * @member {string} name The publicIP address configuration name. + * @member {number} [idleTimeoutInMinutes] The idle timeout of the public IP + * address. + * @member {object} [dnsSettings] The dns settings to be applied on the + * publicIP addresses . + * @member {string} [dnsSettings.domainNameLabel] The Domain name label.The + * concatenation of the domain name label and vm index will be the domain + * name labels of the PublicIPAddress resources that will be created + */ + constructor() { + } + + /** + * Defines the metadata of VirtualMachineScaleSetPublicIPAddressConfiguration + * + * @returns {object} metadata of VirtualMachineScaleSetPublicIPAddressConfiguration + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineScaleSetPublicIPAddressConfiguration', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetPublicIPAddressConfiguration', + modelProperties: { + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + idleTimeoutInMinutes: { + required: false, + serializedName: 'properties.idleTimeoutInMinutes', + type: { + name: 'Number' + } + }, + dnsSettings: { + required: false, + serializedName: 'properties.dnsSettings', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings' + } + } + } + } + }; + } +} + +module.exports = VirtualMachineScaleSetPublicIPAddressConfiguration; diff --git a/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetPublicIPAddressConfigurationDnsSettings.js b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetPublicIPAddressConfigurationDnsSettings.js new file mode 100644 index 0000000000..e3fe9b5390 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetPublicIPAddressConfigurationDnsSettings.js @@ -0,0 +1,55 @@ +/* + * 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'; + +/** + * Describes a virtual machines scale sets network configuration's DNS + * settings. + * + */ +class VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings { + /** + * Create a VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings. + * @member {string} domainNameLabel The Domain name label.The concatenation + * of the domain name label and vm index will be the domain name labels of + * the PublicIPAddress resources that will be created + */ + constructor() { + } + + /** + * Defines the metadata of VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings + * + * @returns {object} metadata of VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings', + modelProperties: { + domainNameLabel: { + required: true, + serializedName: 'domainNameLabel', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings; diff --git a/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetSku.js b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetSku.js new file mode 100644 index 0000000000..6fe583507e --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetSku.js @@ -0,0 +1,87 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Describes an available virtual machine scale set sku. + * + */ +class VirtualMachineScaleSetSku { + /** + * Create a VirtualMachineScaleSetSku. + * @member {string} [resourceType] The type of resource the sku applies to. + * @member {object} [sku] The Sku. + * @member {string} [sku.name] The sku name. + * @member {string} [sku.tier] Specifies the tier of virtual machines in a + * scale set.

    Possible Values:

    **Standard**

    **Basic** + * @member {number} [sku.capacity] Specifies the number of virtual machines + * in the scale set. + * @member {object} [capacity] Specifies the number of virtual machines in + * the scale set. + * @member {number} [capacity.minimum] The minimum capacity. + * @member {number} [capacity.maximum] The maximum capacity that can be set. + * @member {number} [capacity.defaultCapacity] The default capacity. + * @member {string} [capacity.scaleType] The scale type applicable to the + * sku. Possible values include: 'Automatic', 'None' + */ + constructor() { + } + + /** + * Defines the metadata of VirtualMachineScaleSetSku + * + * @returns {object} metadata of VirtualMachineScaleSetSku + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineScaleSetSku', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetSku', + modelProperties: { + resourceType: { + required: false, + readOnly: true, + serializedName: 'resourceType', + type: { + name: 'String' + } + }, + sku: { + required: false, + readOnly: true, + serializedName: 'sku', + type: { + name: 'Composite', + className: 'Sku' + } + }, + capacity: { + required: false, + readOnly: true, + serializedName: 'capacity', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetSkuCapacity' + } + } + } + } + }; + } +} + +module.exports = VirtualMachineScaleSetSku; diff --git a/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetSkuCapacity.js b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetSkuCapacity.js new file mode 100644 index 0000000000..2f59fba9c6 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetSkuCapacity.js @@ -0,0 +1,82 @@ +/* + * 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'; + +/** + * Describes scaling information of a sku. + * + */ +class VirtualMachineScaleSetSkuCapacity { + /** + * Create a VirtualMachineScaleSetSkuCapacity. + * @member {number} [minimum] The minimum capacity. + * @member {number} [maximum] The maximum capacity that can be set. + * @member {number} [defaultCapacity] The default capacity. + * @member {string} [scaleType] The scale type applicable to the sku. + * Possible values include: 'Automatic', 'None' + */ + constructor() { + } + + /** + * Defines the metadata of VirtualMachineScaleSetSkuCapacity + * + * @returns {object} metadata of VirtualMachineScaleSetSkuCapacity + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineScaleSetSkuCapacity', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetSkuCapacity', + modelProperties: { + minimum: { + required: false, + readOnly: true, + serializedName: 'minimum', + type: { + name: 'Number' + } + }, + maximum: { + required: false, + readOnly: true, + serializedName: 'maximum', + type: { + name: 'Number' + } + }, + defaultCapacity: { + required: false, + readOnly: true, + serializedName: 'defaultCapacity', + type: { + name: 'Number' + } + }, + scaleType: { + required: false, + readOnly: true, + serializedName: 'scaleType', + type: { + name: 'Enum', + allowedValues: [ 'Automatic', 'None' ] + } + } + } + } + }; + } +} + +module.exports = VirtualMachineScaleSetSkuCapacity; diff --git a/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetStorageProfile.js b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetStorageProfile.js new file mode 100644 index 0000000000..b8ab9a175b --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetStorageProfile.js @@ -0,0 +1,131 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Describes a virtual machine scale set storage profile. + * + */ +class VirtualMachineScaleSetStorageProfile { + /** + * Create a VirtualMachineScaleSetStorageProfile. + * @member {object} [imageReference] Specifies information about the image to + * use. You can specify information about platform images, marketplace + * images, or virtual machine images. This element is required when you want + * to use a platform image, marketplace image, or virtual machine image, but + * is not used in other creation operations. + * @member {string} [imageReference.publisher] The image publisher. + * @member {string} [imageReference.offer] Specifies the offer of the + * platform image or marketplace image used to create the virtual machine. + * @member {string} [imageReference.sku] The image SKU. + * @member {string} [imageReference.version] Specifies the version of the + * platform image or marketplace image used to create the virtual machine. + * The allowed formats are Major.Minor.Build or 'latest'. Major, Minor, and + * Build are decimal numbers. Specify 'latest' to use the latest version of + * an image available at deploy time. Even if you use 'latest', the VM image + * will not automatically update after deploy time even if a new version + * becomes available. + * @member {object} [osDisk] Specifies information about the operating system + * disk used by the virtual machines in the scale set.

    For more + * information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @member {string} [osDisk.name] The disk name. + * @member {string} [osDisk.caching] Specifies the caching requirements. + *

    Possible values are:

    **None**

    **ReadOnly** + *

    **ReadWrite**

    Default: **None for Standard storage. + * ReadOnly for Premium storage**. Possible values include: 'None', + * 'ReadOnly', 'ReadWrite' + * @member {boolean} [osDisk.writeAcceleratorEnabled] Specifies whether + * writeAccelerator should be enabled or disabled on the disk. + * @member {string} [osDisk.createOption] Specifies how the virtual machines + * in the scale set should be created.

    The only allowed value is: + * **FromImage** \u2013 This value is used when you are using an image to + * create the virtual machine. If you are using a platform image, you also + * use the imageReference element described above. If you are using a + * marketplace image, you also use the plan element previously described. + * Possible values include: 'FromImage', 'Empty', 'Attach' + * @member {string} [osDisk.osType] This property allows you to specify the + * type of the OS that is included in the disk if creating a VM from + * user-image or a specialized VHD.

    Possible values are:

    + * **Windows**

    **Linux**. Possible values include: 'Windows', + * 'Linux' + * @member {object} [osDisk.image] Specifies information about the unmanaged + * user image to base the scale set on. + * @member {string} [osDisk.image.uri] Specifies the virtual hard disk's uri. + * @member {array} [osDisk.vhdContainers] Specifies the container urls that + * are used to store operating system disks for the scale set. + * @member {object} [osDisk.managedDisk] The managed disk parameters. + * @member {string} [osDisk.managedDisk.storageAccountType] Specifies the + * storage account type for the managed disk. Possible values are: + * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * @member {array} [dataDisks] Specifies the parameters that are used to add + * data disks to the virtual machines in the scale set.

    For more + * information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + */ + constructor() { + } + + /** + * Defines the metadata of VirtualMachineScaleSetStorageProfile + * + * @returns {object} metadata of VirtualMachineScaleSetStorageProfile + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineScaleSetStorageProfile', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetStorageProfile', + modelProperties: { + imageReference: { + required: false, + serializedName: 'imageReference', + type: { + name: 'Composite', + className: 'ImageReference' + } + }, + osDisk: { + required: false, + serializedName: 'osDisk', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetOSDisk' + } + }, + dataDisks: { + required: false, + serializedName: 'dataDisks', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VirtualMachineScaleSetDataDiskElementType', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetDataDisk' + } + } + } + } + } + } + }; + } +} + +module.exports = VirtualMachineScaleSetStorageProfile; diff --git a/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetUpdate.js b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetUpdate.js new file mode 100644 index 0000000000..693917b226 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetUpdate.js @@ -0,0 +1,309 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Describes a Virtual Machine Scale Set. + * + * @extends models['UpdateResource'] + */ +class VirtualMachineScaleSetUpdate extends models['UpdateResource'] { + /** + * Create a VirtualMachineScaleSetUpdate. + * @member {object} [sku] The virtual machine scale set sku. + * @member {string} [sku.name] The sku name. + * @member {string} [sku.tier] Specifies the tier of virtual machines in a + * scale set.

    Possible Values:

    **Standard**

    **Basic** + * @member {number} [sku.capacity] Specifies the number of virtual machines + * in the scale set. + * @member {object} [plan] The purchase plan when deploying a virtual machine + * scale set from VM Marketplace images. + * @member {string} [plan.name] The plan ID. + * @member {string} [plan.publisher] The publisher ID. + * @member {string} [plan.product] Specifies the product of the image from + * the marketplace. This is the same value as Offer under the imageReference + * element. + * @member {string} [plan.promotionCode] The promotion code. + * @member {object} [upgradePolicy] The upgrade policy. + * @member {string} [upgradePolicy.mode] Specifies the mode of an upgrade to + * virtual machines in the scale set.

    Possible values are:

    **Manual** - You control the application of updates to virtual + * machines in the scale set. You do this by using the manualUpgrade + * action.

    **Automatic** - All virtual machines in the scale set + * are automatically updated at the same time. Possible values include: + * 'Automatic', 'Manual', 'Rolling' + * @member {object} [upgradePolicy.rollingUpgradePolicy] The configuration + * parameters used while performing a rolling upgrade. + * @member {number} + * [upgradePolicy.rollingUpgradePolicy.maxBatchInstancePercent] The maximum + * percent of total virtual machine instances that will be upgraded + * simultaneously by the rolling upgrade in one batch. As this is a maximum, + * unhealthy instances in previous or future batches can cause the percentage + * of instances in a batch to decrease to ensure higher reliability. The + * default value for this parameter is 20%. + * @member {number} + * [upgradePolicy.rollingUpgradePolicy.maxUnhealthyInstancePercent] The + * maximum percentage of the total virtual machine instances in the scale set + * that can be simultaneously unhealthy, either as a result of being + * upgraded, or by being found in an unhealthy state by the virtual machine + * health checks before the rolling upgrade aborts. This constraint will be + * checked prior to starting any batch. The default value for this parameter + * is 20%. + * @member {number} + * [upgradePolicy.rollingUpgradePolicy.maxUnhealthyUpgradedInstancePercent] + * The maximum percentage of upgraded virtual machine instances that can be + * found to be in an unhealthy state. This check will happen after each batch + * is upgraded. If this percentage is ever exceeded, the rolling update + * aborts. The default value for this parameter is 20%. + * @member {string} + * [upgradePolicy.rollingUpgradePolicy.pauseTimeBetweenBatches] The wait time + * between completing the update for all virtual machines in one batch and + * starting the next batch. The time duration should be specified in ISO 8601 + * format. The default value is 0 seconds (PT0S). + * @member {boolean} [upgradePolicy.automaticOSUpgrade] Whether OS upgrades + * should automatically be applied to scale set instances in a rolling + * fashion when a newer version of the image becomes available. + * @member {object} [virtualMachineProfile] The virtual machine profile. + * @member {object} [virtualMachineProfile.osProfile] The virtual machine + * scale set OS profile. + * @member {string} [virtualMachineProfile.osProfile.customData] A base-64 + * encoded string of custom data. + * @member {object} [virtualMachineProfile.osProfile.windowsConfiguration] + * The Windows Configuration of the OS profile. + * @member {boolean} + * [virtualMachineProfile.osProfile.windowsConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the + * virtual machine.

    When this property is not specified in the + * request body, default behavior is to set it to true. This will ensure + * that VM Agent is installed on the VM so that extensions can be added to + * the VM later. + * @member {boolean} + * [virtualMachineProfile.osProfile.windowsConfiguration.enableAutomaticUpdates] + * Indicates whether virtual machine is enabled for automatic updates. + * @member {string} + * [virtualMachineProfile.osProfile.windowsConfiguration.timeZone] Specifies + * the time zone of the virtual machine. e.g. "Pacific Standard Time" + * @member {array} + * [virtualMachineProfile.osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * @member {object} + * [virtualMachineProfile.osProfile.windowsConfiguration.winRM] Specifies the + * Windows Remote Management listeners. This enables remote Windows + * PowerShell. + * @member {array} + * [virtualMachineProfile.osProfile.windowsConfiguration.winRM.listeners] The + * list of Windows Remote Management listeners + * @member {object} [virtualMachineProfile.osProfile.linuxConfiguration] The + * Linux Configuration of the OS profile. + * @member {boolean} + * [virtualMachineProfile.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * @member {object} [virtualMachineProfile.osProfile.linuxConfiguration.ssh] + * Specifies the ssh key configuration for a Linux OS. + * @member {array} + * [virtualMachineProfile.osProfile.linuxConfiguration.ssh.publicKeys] The + * list of SSH public keys used to authenticate with linux based VMs. + * @member {array} [virtualMachineProfile.osProfile.secrets] The List of + * certificates for addition to the VM. + * @member {object} [virtualMachineProfile.storageProfile] The virtual + * machine scale set storage profile. + * @member {object} [virtualMachineProfile.storageProfile.imageReference] The + * image reference. + * @member {string} + * [virtualMachineProfile.storageProfile.imageReference.publisher] The image + * publisher. + * @member {string} + * [virtualMachineProfile.storageProfile.imageReference.offer] Specifies the + * offer of the platform image or marketplace image used to create the + * virtual machine. + * @member {string} [virtualMachineProfile.storageProfile.imageReference.sku] + * The image SKU. + * @member {string} + * [virtualMachineProfile.storageProfile.imageReference.version] Specifies + * the version of the platform image or marketplace image used to create the + * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the + * latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time + * even if a new version becomes available. + * @member {object} [virtualMachineProfile.storageProfile.osDisk] The OS + * disk. + * @member {string} [virtualMachineProfile.storageProfile.osDisk.caching] The + * caching type. Possible values include: 'None', 'ReadOnly', 'ReadWrite' + * @member {boolean} + * [virtualMachineProfile.storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * @member {object} [virtualMachineProfile.storageProfile.osDisk.image] The + * Source User Image VirtualHardDisk. This VirtualHardDisk will be copied + * before using it to attach to the Virtual Machine. If SourceImage is + * provided, the destination VirtualHardDisk should not exist. + * @member {string} [virtualMachineProfile.storageProfile.osDisk.image.uri] + * Specifies the virtual hard disk's uri. + * @member {array} + * [virtualMachineProfile.storageProfile.osDisk.vhdContainers] The list of + * virtual hard disk container uris. + * @member {object} [virtualMachineProfile.storageProfile.osDisk.managedDisk] + * The managed disk parameters. + * @member {string} + * [virtualMachineProfile.storageProfile.osDisk.managedDisk.storageAccountType] + * Specifies the storage account type for the managed disk. Possible values + * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * @member {array} [virtualMachineProfile.storageProfile.dataDisks] The data + * disks. + * @member {object} [virtualMachineProfile.networkProfile] The virtual + * machine scale set network profile. + * @member {array} + * [virtualMachineProfile.networkProfile.networkInterfaceConfigurations] The + * list of network configurations. + * @member {object} [virtualMachineProfile.diagnosticsProfile] The virtual + * machine scale set diagnostics profile. + * @member {object} + * [virtualMachineProfile.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, + * you can easily view the output of your console log.

    For both + * Windows and Linux virtual machines, Azure also enables you to see a + * screenshot of the VM from the hypervisor. + * @member {boolean} + * [virtualMachineProfile.diagnosticsProfile.bootDiagnostics.enabled] Whether + * boot diagnostics should be enabled on the Virtual Machine. + * @member {string} + * [virtualMachineProfile.diagnosticsProfile.bootDiagnostics.storageUri] Uri + * of the storage account to use for placing the console output and + * screenshot. + * @member {object} [virtualMachineProfile.extensionProfile] The virtual + * machine scale set extension profile. + * @member {array} [virtualMachineProfile.extensionProfile.extensions] The + * virtual machine scale set child extension resources. + * @member {string} [virtualMachineProfile.licenseType] The license type, + * which is for bring your own license scenario. + * @member {boolean} [overprovision] Specifies whether the Virtual Machine + * Scale Set should be overprovisioned. + * @member {boolean} [singlePlacementGroup] When true this limits the scale + * set to a single placement group, of max size 100 virtual machines. + * @member {object} [identity] The identity of the virtual machine scale set, + * if configured. + * @member {string} [identity.principalId] The principal id of virtual + * machine scale set identity. This property will only be provided for a + * system assigned identity. + * @member {string} [identity.tenantId] The tenant id associated with the + * virtual machine scale set. This property will only be provided for a + * system assigned identity. + * @member {string} [identity.type] The type of identity used for the virtual + * machine scale set. The type 'SystemAssigned, UserAssigned' includes both + * an implicitly created identity and a set of user assigned identities. The + * type 'None' will remove any identities from the virtual machine scale set. + * Possible values include: 'SystemAssigned', 'UserAssigned', + * 'SystemAssigned, UserAssigned', 'None' + * @member {array} [identity.identityIds] The list of user identities + * associated with the virtual machine scale set. The user identity + * references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VirtualMachineScaleSetUpdate + * + * @returns {object} metadata of VirtualMachineScaleSetUpdate + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineScaleSetUpdate', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetUpdate', + modelProperties: { + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + sku: { + required: false, + serializedName: 'sku', + type: { + name: 'Composite', + className: 'Sku' + } + }, + plan: { + required: false, + serializedName: 'plan', + type: { + name: 'Composite', + className: 'Plan' + } + }, + upgradePolicy: { + required: false, + serializedName: 'properties.upgradePolicy', + type: { + name: 'Composite', + className: 'UpgradePolicy' + } + }, + virtualMachineProfile: { + required: false, + serializedName: 'properties.virtualMachineProfile', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetUpdateVMProfile' + } + }, + overprovision: { + required: false, + serializedName: 'properties.overprovision', + type: { + name: 'Boolean' + } + }, + singlePlacementGroup: { + required: false, + serializedName: 'properties.singlePlacementGroup', + type: { + name: 'Boolean' + } + }, + identity: { + required: false, + serializedName: 'identity', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetIdentity' + } + } + } + } + }; + } +} + +module.exports = VirtualMachineScaleSetUpdate; diff --git a/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetUpdateIPConfiguration.js b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetUpdateIPConfiguration.js new file mode 100644 index 0000000000..861de94e23 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetUpdateIPConfiguration.js @@ -0,0 +1,165 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Describes a virtual machine scale set network profile's IP configuration. + * + * @extends models['SubResource'] + */ +class VirtualMachineScaleSetUpdateIPConfiguration extends models['SubResource'] { + /** + * Create a VirtualMachineScaleSetUpdateIPConfiguration. + * @member {string} [name] The IP configuration name. + * @member {object} [subnet] The subnet. + * @member {string} [subnet.id] The ARM resource id in the form of + * /subscriptions/{SubcriptionId}/resourceGroups/{ResourceGroupName}/... + * @member {boolean} [primary] Specifies the primary IP Configuration in case + * the network interface has more than one IP Configuration. + * @member {object} [publicIPAddressConfiguration] The + * publicIPAddressConfiguration. + * @member {string} [publicIPAddressConfiguration.name] The publicIP address + * configuration name. + * @member {number} [publicIPAddressConfiguration.idleTimeoutInMinutes] The + * idle timeout of the public IP address. + * @member {object} [publicIPAddressConfiguration.dnsSettings] The dns + * settings to be applied on the publicIP addresses . + * @member {string} + * [publicIPAddressConfiguration.dnsSettings.domainNameLabel] The Domain name + * label.The concatenation of the domain name label and vm index will be the + * domain name labels of the PublicIPAddress resources that will be created + * @member {string} [privateIPAddressVersion] Available from Api-Version + * 2017-03-30 onwards, it represents whether the specific ipconfiguration is + * IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and + * 'IPv6'. Possible values include: 'IPv4', 'IPv6' + * @member {array} [applicationGatewayBackendAddressPools] The application + * gateway backend address pools. + * @member {array} [loadBalancerBackendAddressPools] The load balancer + * backend address pools. + * @member {array} [loadBalancerInboundNatPools] The load balancer inbound + * nat pools. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VirtualMachineScaleSetUpdateIPConfiguration + * + * @returns {object} metadata of VirtualMachineScaleSetUpdateIPConfiguration + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineScaleSetUpdateIPConfiguration', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetUpdateIPConfiguration', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + subnet: { + required: false, + serializedName: 'properties.subnet', + type: { + name: 'Composite', + className: 'ApiEntityReference' + } + }, + primary: { + required: false, + serializedName: 'properties.primary', + type: { + name: 'Boolean' + } + }, + publicIPAddressConfiguration: { + required: false, + serializedName: 'properties.publicIPAddressConfiguration', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetUpdatePublicIPAddressConfiguration' + } + }, + privateIPAddressVersion: { + required: false, + serializedName: 'properties.privateIPAddressVersion', + type: { + name: 'String' + } + }, + applicationGatewayBackendAddressPools: { + required: false, + serializedName: 'properties.applicationGatewayBackendAddressPools', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SubResourceElementType', + type: { + name: 'Composite', + className: 'SubResource' + } + } + } + }, + loadBalancerBackendAddressPools: { + required: false, + serializedName: 'properties.loadBalancerBackendAddressPools', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SubResourceElementType', + type: { + name: 'Composite', + className: 'SubResource' + } + } + } + }, + loadBalancerInboundNatPools: { + required: false, + serializedName: 'properties.loadBalancerInboundNatPools', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SubResourceElementType', + type: { + name: 'Composite', + className: 'SubResource' + } + } + } + } + } + } + }; + } +} + +module.exports = VirtualMachineScaleSetUpdateIPConfiguration; diff --git a/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetUpdateNetworkConfiguration.js b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetUpdateNetworkConfiguration.js new file mode 100644 index 0000000000..873e9ce870 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetUpdateNetworkConfiguration.js @@ -0,0 +1,129 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Describes a virtual machine scale set network profile's network + * configurations. + * + * @extends models['SubResource'] + */ +class VirtualMachineScaleSetUpdateNetworkConfiguration extends models['SubResource'] { + /** + * Create a VirtualMachineScaleSetUpdateNetworkConfiguration. + * @member {string} [name] The network configuration name. + * @member {boolean} [primary] Whether this is a primary NIC on a virtual + * machine. + * @member {boolean} [enableAcceleratedNetworking] Specifies whether the + * network interface is accelerated networking-enabled. + * @member {object} [networkSecurityGroup] The network security group. + * @member {string} [networkSecurityGroup.id] Resource Id + * @member {object} [dnsSettings] The dns settings to be applied on the + * network interfaces. + * @member {array} [dnsSettings.dnsServers] List of DNS servers IP addresses + * @member {array} [ipConfigurations] The virtual machine scale set IP + * Configuration. + * @member {boolean} [enableIPForwarding] Whether IP forwarding enabled on + * this NIC. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VirtualMachineScaleSetUpdateNetworkConfiguration + * + * @returns {object} metadata of VirtualMachineScaleSetUpdateNetworkConfiguration + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineScaleSetUpdateNetworkConfiguration', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetUpdateNetworkConfiguration', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + primary: { + required: false, + serializedName: 'properties.primary', + type: { + name: 'Boolean' + } + }, + enableAcceleratedNetworking: { + required: false, + serializedName: 'properties.enableAcceleratedNetworking', + type: { + name: 'Boolean' + } + }, + networkSecurityGroup: { + required: false, + serializedName: 'properties.networkSecurityGroup', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + dnsSettings: { + required: false, + serializedName: 'properties.dnsSettings', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetNetworkConfigurationDnsSettings' + } + }, + ipConfigurations: { + required: false, + serializedName: 'properties.ipConfigurations', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VirtualMachineScaleSetUpdateIPConfigurationElementType', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetUpdateIPConfiguration' + } + } + } + }, + enableIPForwarding: { + required: false, + serializedName: 'properties.enableIPForwarding', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = VirtualMachineScaleSetUpdateNetworkConfiguration; diff --git a/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetUpdateNetworkProfile.js b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetUpdateNetworkProfile.js new file mode 100644 index 0000000000..9b4153b3ab --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetUpdateNetworkProfile.js @@ -0,0 +1,63 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Describes a virtual machine scale set network profile. + * + */ +class VirtualMachineScaleSetUpdateNetworkProfile { + /** + * Create a VirtualMachineScaleSetUpdateNetworkProfile. + * @member {array} [networkInterfaceConfigurations] The list of network + * configurations. + */ + constructor() { + } + + /** + * Defines the metadata of VirtualMachineScaleSetUpdateNetworkProfile + * + * @returns {object} metadata of VirtualMachineScaleSetUpdateNetworkProfile + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineScaleSetUpdateNetworkProfile', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetUpdateNetworkProfile', + modelProperties: { + networkInterfaceConfigurations: { + required: false, + serializedName: 'networkInterfaceConfigurations', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VirtualMachineScaleSetUpdateNetworkConfigurationElementType', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetUpdateNetworkConfiguration' + } + } + } + } + } + } + }; + } +} + +module.exports = VirtualMachineScaleSetUpdateNetworkProfile; diff --git a/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetUpdateOSDisk.js b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetUpdateOSDisk.js new file mode 100644 index 0000000000..3ef0f2ea89 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetUpdateOSDisk.js @@ -0,0 +1,107 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Describes virtual machine scale set operating system disk Update Object. + * This should be used for Updating VMSS OS Disk. + * + */ +class VirtualMachineScaleSetUpdateOSDisk { + /** + * Create a VirtualMachineScaleSetUpdateOSDisk. + * @member {string} [caching] The caching type. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * @member {boolean} [writeAcceleratorEnabled] Specifies whether + * writeAccelerator should be enabled or disabled on the disk. + * @member {object} [image] The Source User Image VirtualHardDisk. This + * VirtualHardDisk will be copied before using it to attach to the Virtual + * Machine. If SourceImage is provided, the destination VirtualHardDisk + * should not exist. + * @member {string} [image.uri] Specifies the virtual hard disk's uri. + * @member {array} [vhdContainers] The list of virtual hard disk container + * uris. + * @member {object} [managedDisk] The managed disk parameters. + * @member {string} [managedDisk.storageAccountType] Specifies the storage + * account type for the managed disk. Possible values are: Standard_LRS or + * Premium_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS' + */ + constructor() { + } + + /** + * Defines the metadata of VirtualMachineScaleSetUpdateOSDisk + * + * @returns {object} metadata of VirtualMachineScaleSetUpdateOSDisk + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineScaleSetUpdateOSDisk', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetUpdateOSDisk', + modelProperties: { + caching: { + required: false, + serializedName: 'caching', + type: { + name: 'Enum', + allowedValues: [ 'None', 'ReadOnly', 'ReadWrite' ] + } + }, + writeAcceleratorEnabled: { + required: false, + serializedName: 'writeAcceleratorEnabled', + type: { + name: 'Boolean' + } + }, + image: { + required: false, + serializedName: 'image', + type: { + name: 'Composite', + className: 'VirtualHardDisk' + } + }, + vhdContainers: { + required: false, + serializedName: 'vhdContainers', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + managedDisk: { + required: false, + serializedName: 'managedDisk', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetManagedDiskParameters' + } + } + } + } + }; + } +} + +module.exports = VirtualMachineScaleSetUpdateOSDisk; diff --git a/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetUpdateOSProfile.js b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetUpdateOSProfile.js new file mode 100644 index 0000000000..54fbf6cd9d --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetUpdateOSProfile.js @@ -0,0 +1,112 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Describes a virtual machine scale set OS profile. + * + */ +class VirtualMachineScaleSetUpdateOSProfile { + /** + * Create a VirtualMachineScaleSetUpdateOSProfile. + * @member {string} [customData] A base-64 encoded string of custom data. + * @member {object} [windowsConfiguration] The Windows Configuration of the + * OS profile. + * @member {boolean} [windowsConfiguration.provisionVMAgent] Indicates + * whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * @member {boolean} [windowsConfiguration.enableAutomaticUpdates] Indicates + * whether virtual machine is enabled for automatic updates. + * @member {string} [windowsConfiguration.timeZone] Specifies the time zone + * of the virtual machine. e.g. "Pacific Standard Time" + * @member {array} [windowsConfiguration.additionalUnattendContent] Specifies + * additional base-64 encoded XML formatted information that can be included + * in the Unattend.xml file, which is used by Windows Setup. + * @member {object} [windowsConfiguration.winRM] Specifies the Windows Remote + * Management listeners. This enables remote Windows PowerShell. + * @member {array} [windowsConfiguration.winRM.listeners] The list of Windows + * Remote Management listeners + * @member {object} [linuxConfiguration] The Linux Configuration of the OS + * profile. + * @member {boolean} [linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * @member {object} [linuxConfiguration.ssh] Specifies the ssh key + * configuration for a Linux OS. + * @member {array} [linuxConfiguration.ssh.publicKeys] The list of SSH public + * keys used to authenticate with linux based VMs. + * @member {array} [secrets] The List of certificates for addition to the VM. + */ + constructor() { + } + + /** + * Defines the metadata of VirtualMachineScaleSetUpdateOSProfile + * + * @returns {object} metadata of VirtualMachineScaleSetUpdateOSProfile + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineScaleSetUpdateOSProfile', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetUpdateOSProfile', + modelProperties: { + customData: { + required: false, + serializedName: 'customData', + type: { + name: 'String' + } + }, + windowsConfiguration: { + required: false, + serializedName: 'windowsConfiguration', + type: { + name: 'Composite', + className: 'WindowsConfiguration' + } + }, + linuxConfiguration: { + required: false, + serializedName: 'linuxConfiguration', + type: { + name: 'Composite', + className: 'LinuxConfiguration' + } + }, + secrets: { + required: false, + serializedName: 'secrets', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VaultSecretGroupElementType', + type: { + name: 'Composite', + className: 'VaultSecretGroup' + } + } + } + } + } + } + }; + } +} + +module.exports = VirtualMachineScaleSetUpdateOSProfile; diff --git a/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetUpdatePublicIPAddressConfiguration.js b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetUpdatePublicIPAddressConfiguration.js new file mode 100644 index 0000000000..66c86376cc --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetUpdatePublicIPAddressConfiguration.js @@ -0,0 +1,77 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Describes a virtual machines scale set IP Configuration's PublicIPAddress + * configuration + * + */ +class VirtualMachineScaleSetUpdatePublicIPAddressConfiguration { + /** + * Create a VirtualMachineScaleSetUpdatePublicIPAddressConfiguration. + * @member {string} [name] The publicIP address configuration name. + * @member {number} [idleTimeoutInMinutes] The idle timeout of the public IP + * address. + * @member {object} [dnsSettings] The dns settings to be applied on the + * publicIP addresses . + * @member {string} [dnsSettings.domainNameLabel] The Domain name label.The + * concatenation of the domain name label and vm index will be the domain + * name labels of the PublicIPAddress resources that will be created + */ + constructor() { + } + + /** + * Defines the metadata of VirtualMachineScaleSetUpdatePublicIPAddressConfiguration + * + * @returns {object} metadata of VirtualMachineScaleSetUpdatePublicIPAddressConfiguration + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineScaleSetUpdatePublicIPAddressConfiguration', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetUpdatePublicIPAddressConfiguration', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + idleTimeoutInMinutes: { + required: false, + serializedName: 'properties.idleTimeoutInMinutes', + type: { + name: 'Number' + } + }, + dnsSettings: { + required: false, + serializedName: 'properties.dnsSettings', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings' + } + } + } + } + }; + } +} + +module.exports = VirtualMachineScaleSetUpdatePublicIPAddressConfiguration; diff --git a/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetUpdateStorageProfile.js b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetUpdateStorageProfile.js new file mode 100644 index 0000000000..4d51b93ded --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetUpdateStorageProfile.js @@ -0,0 +1,107 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Describes a virtual machine scale set storage profile. + * + */ +class VirtualMachineScaleSetUpdateStorageProfile { + /** + * Create a VirtualMachineScaleSetUpdateStorageProfile. + * @member {object} [imageReference] The image reference. + * @member {string} [imageReference.publisher] The image publisher. + * @member {string} [imageReference.offer] Specifies the offer of the + * platform image or marketplace image used to create the virtual machine. + * @member {string} [imageReference.sku] The image SKU. + * @member {string} [imageReference.version] Specifies the version of the + * platform image or marketplace image used to create the virtual machine. + * The allowed formats are Major.Minor.Build or 'latest'. Major, Minor, and + * Build are decimal numbers. Specify 'latest' to use the latest version of + * an image available at deploy time. Even if you use 'latest', the VM image + * will not automatically update after deploy time even if a new version + * becomes available. + * @member {object} [osDisk] The OS disk. + * @member {string} [osDisk.caching] The caching type. Possible values + * include: 'None', 'ReadOnly', 'ReadWrite' + * @member {boolean} [osDisk.writeAcceleratorEnabled] Specifies whether + * writeAccelerator should be enabled or disabled on the disk. + * @member {object} [osDisk.image] The Source User Image VirtualHardDisk. + * This VirtualHardDisk will be copied before using it to attach to the + * Virtual Machine. If SourceImage is provided, the destination + * VirtualHardDisk should not exist. + * @member {string} [osDisk.image.uri] Specifies the virtual hard disk's uri. + * @member {array} [osDisk.vhdContainers] The list of virtual hard disk + * container uris. + * @member {object} [osDisk.managedDisk] The managed disk parameters. + * @member {string} [osDisk.managedDisk.storageAccountType] Specifies the + * storage account type for the managed disk. Possible values are: + * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * @member {array} [dataDisks] The data disks. + */ + constructor() { + } + + /** + * Defines the metadata of VirtualMachineScaleSetUpdateStorageProfile + * + * @returns {object} metadata of VirtualMachineScaleSetUpdateStorageProfile + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineScaleSetUpdateStorageProfile', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetUpdateStorageProfile', + modelProperties: { + imageReference: { + required: false, + serializedName: 'imageReference', + type: { + name: 'Composite', + className: 'ImageReference' + } + }, + osDisk: { + required: false, + serializedName: 'osDisk', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetUpdateOSDisk' + } + }, + dataDisks: { + required: false, + serializedName: 'dataDisks', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VirtualMachineScaleSetDataDiskElementType', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetDataDisk' + } + } + } + } + } + } + }; + } +} + +module.exports = VirtualMachineScaleSetUpdateStorageProfile; diff --git a/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetUpdateVMProfile.js b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetUpdateVMProfile.js new file mode 100644 index 0000000000..4f8962feef --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetUpdateVMProfile.js @@ -0,0 +1,186 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Describes a virtual machine scale set virtual machine profile. + * + */ +class VirtualMachineScaleSetUpdateVMProfile { + /** + * Create a VirtualMachineScaleSetUpdateVMProfile. + * @member {object} [osProfile] The virtual machine scale set OS profile. + * @member {string} [osProfile.customData] A base-64 encoded string of custom + * data. + * @member {object} [osProfile.windowsConfiguration] The Windows + * Configuration of the OS profile. + * @member {boolean} [osProfile.windowsConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the + * virtual machine.

    When this property is not specified in the + * request body, default behavior is to set it to true. This will ensure + * that VM Agent is installed on the VM so that extensions can be added to + * the VM later. + * @member {boolean} [osProfile.windowsConfiguration.enableAutomaticUpdates] + * Indicates whether virtual machine is enabled for automatic updates. + * @member {string} [osProfile.windowsConfiguration.timeZone] Specifies the + * time zone of the virtual machine. e.g. "Pacific Standard Time" + * @member {array} [osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * @member {object} [osProfile.windowsConfiguration.winRM] Specifies the + * Windows Remote Management listeners. This enables remote Windows + * PowerShell. + * @member {array} [osProfile.windowsConfiguration.winRM.listeners] The list + * of Windows Remote Management listeners + * @member {object} [osProfile.linuxConfiguration] The Linux Configuration of + * the OS profile. + * @member {boolean} + * [osProfile.linuxConfiguration.disablePasswordAuthentication] Specifies + * whether password authentication should be disabled. + * @member {object} [osProfile.linuxConfiguration.ssh] Specifies the ssh key + * configuration for a Linux OS. + * @member {array} [osProfile.linuxConfiguration.ssh.publicKeys] The list of + * SSH public keys used to authenticate with linux based VMs. + * @member {array} [osProfile.secrets] The List of certificates for addition + * to the VM. + * @member {object} [storageProfile] The virtual machine scale set storage + * profile. + * @member {object} [storageProfile.imageReference] The image reference. + * @member {string} [storageProfile.imageReference.publisher] The image + * publisher. + * @member {string} [storageProfile.imageReference.offer] Specifies the offer + * of the platform image or marketplace image used to create the virtual + * machine. + * @member {string} [storageProfile.imageReference.sku] The image SKU. + * @member {string} [storageProfile.imageReference.version] Specifies the + * version of the platform image or marketplace image used to create the + * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the + * latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time + * even if a new version becomes available. + * @member {object} [storageProfile.osDisk] The OS disk. + * @member {string} [storageProfile.osDisk.caching] The caching type. + * Possible values include: 'None', 'ReadOnly', 'ReadWrite' + * @member {boolean} [storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * @member {object} [storageProfile.osDisk.image] The Source User Image + * VirtualHardDisk. This VirtualHardDisk will be copied before using it to + * attach to the Virtual Machine. If SourceImage is provided, the destination + * VirtualHardDisk should not exist. + * @member {string} [storageProfile.osDisk.image.uri] Specifies the virtual + * hard disk's uri. + * @member {array} [storageProfile.osDisk.vhdContainers] The list of virtual + * hard disk container uris. + * @member {object} [storageProfile.osDisk.managedDisk] The managed disk + * parameters. + * @member {string} [storageProfile.osDisk.managedDisk.storageAccountType] + * Specifies the storage account type for the managed disk. Possible values + * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * @member {array} [storageProfile.dataDisks] The data disks. + * @member {object} [networkProfile] The virtual machine scale set network + * profile. + * @member {array} [networkProfile.networkInterfaceConfigurations] The list + * of network configurations. + * @member {object} [diagnosticsProfile] The virtual machine scale set + * diagnostics profile. + * @member {object} [diagnosticsProfile.bootDiagnostics] Boot Diagnostics is + * a debugging feature which allows you to view Console Output and Screenshot + * to diagnose VM status.

    For Linux Virtual Machines, you can easily + * view the output of your console log.

    For both Windows and Linux + * virtual machines, Azure also enables you to see a screenshot of the VM + * from the hypervisor. + * @member {boolean} [diagnosticsProfile.bootDiagnostics.enabled] Whether + * boot diagnostics should be enabled on the Virtual Machine. + * @member {string} [diagnosticsProfile.bootDiagnostics.storageUri] Uri of + * the storage account to use for placing the console output and screenshot. + * @member {object} [extensionProfile] The virtual machine scale set + * extension profile. + * @member {array} [extensionProfile.extensions] The virtual machine scale + * set child extension resources. + * @member {string} [licenseType] The license type, which is for bring your + * own license scenario. + */ + constructor() { + } + + /** + * Defines the metadata of VirtualMachineScaleSetUpdateVMProfile + * + * @returns {object} metadata of VirtualMachineScaleSetUpdateVMProfile + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineScaleSetUpdateVMProfile', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetUpdateVMProfile', + modelProperties: { + osProfile: { + required: false, + serializedName: 'osProfile', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetUpdateOSProfile' + } + }, + storageProfile: { + required: false, + serializedName: 'storageProfile', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetUpdateStorageProfile' + } + }, + networkProfile: { + required: false, + serializedName: 'networkProfile', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetUpdateNetworkProfile' + } + }, + diagnosticsProfile: { + required: false, + serializedName: 'diagnosticsProfile', + type: { + name: 'Composite', + className: 'DiagnosticsProfile' + } + }, + extensionProfile: { + required: false, + serializedName: 'extensionProfile', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetExtensionProfile' + } + }, + licenseType: { + required: false, + serializedName: 'licenseType', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VirtualMachineScaleSetUpdateVMProfile; diff --git a/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetVM.js b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetVM.js new file mode 100644 index 0000000000..7b9e19dea1 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetVM.js @@ -0,0 +1,585 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Describes a virtual machine scale set virtual machine. + * + * @extends models['Resource'] + */ +class VirtualMachineScaleSetVM extends models['Resource'] { + /** + * Create a VirtualMachineScaleSetVM. + * @member {string} [instanceId] The virtual machine instance ID. + * @member {object} [sku] The virtual machine SKU. + * @member {string} [sku.name] The sku name. + * @member {string} [sku.tier] Specifies the tier of virtual machines in a + * scale set.

    Possible Values:

    **Standard**

    **Basic** + * @member {number} [sku.capacity] Specifies the number of virtual machines + * in the scale set. + * @member {boolean} [latestModelApplied] Specifies whether the latest model + * has been applied to the virtual machine. + * @member {string} [vmId] Azure VM unique ID. + * @member {object} [instanceView] The virtual machine instance view. + * @member {number} [instanceView.platformUpdateDomain] Specifies the update + * domain of the virtual machine. + * @member {number} [instanceView.platformFaultDomain] Specifies the fault + * domain of the virtual machine. + * @member {string} [instanceView.computerName] The computer name assigned to + * the virtual machine. + * @member {string} [instanceView.osName] The Operating System running on the + * virtual machine. + * @member {string} [instanceView.osVersion] The version of Operating System + * running on the virtual machine. + * @member {string} [instanceView.rdpThumbPrint] The Remote desktop + * certificate thumbprint. + * @member {object} [instanceView.vmAgent] The VM Agent running on the + * virtual machine. + * @member {string} [instanceView.vmAgent.vmAgentVersion] The VM Agent full + * version. + * @member {array} [instanceView.vmAgent.extensionHandlers] The virtual + * machine extension handler instance view. + * @member {array} [instanceView.vmAgent.statuses] The resource status + * information. + * @member {object} [instanceView.maintenanceRedeployStatus] The Maintenance + * Operation status on the virtual machine. + * @member {boolean} + * [instanceView.maintenanceRedeployStatus.isCustomerInitiatedMaintenanceAllowed] + * True, if customer is allowed to perform Maintenance. + * @member {date} + * [instanceView.maintenanceRedeployStatus.preMaintenanceWindowStartTime] + * Start Time for the Pre Maintenance Window. + * @member {date} + * [instanceView.maintenanceRedeployStatus.preMaintenanceWindowEndTime] End + * Time for the Pre Maintenance Window. + * @member {date} + * [instanceView.maintenanceRedeployStatus.maintenanceWindowStartTime] Start + * Time for the Maintenance Window. + * @member {date} + * [instanceView.maintenanceRedeployStatus.maintenanceWindowEndTime] End Time + * for the Maintenance Window. + * @member {string} + * [instanceView.maintenanceRedeployStatus.lastOperationResultCode] The Last + * Maintenance Operation Result Code. Possible values include: 'None', + * 'RetryLater', 'MaintenanceAborted', 'MaintenanceCompleted' + * @member {string} + * [instanceView.maintenanceRedeployStatus.lastOperationMessage] Message + * returned for the last Maintenance Operation. + * @member {array} [instanceView.disks] The virtual machine disk information. + * @member {array} [instanceView.extensions] The extensions information. + * @member {object} [instanceView.bootDiagnostics] Boot Diagnostics is a + * debugging feature which allows you to view Console Output and Screenshot + * to diagnose VM status.

    For Linux Virtual Machines, you can easily + * view the output of your console log.

    For both Windows and Linux + * virtual machines, Azure also enables you to see a screenshot of the VM + * from the hypervisor. + * @member {string} [instanceView.bootDiagnostics.consoleScreenshotBlobUri] + * The console screenshot blob URI. + * @member {string} [instanceView.bootDiagnostics.serialConsoleLogBlobUri] + * The Linux serial console log blob Uri. + * @member {array} [instanceView.statuses] The resource status information. + * @member {object} [hardwareProfile] Specifies the hardware settings for the + * virtual machine. + * @member {string} [hardwareProfile.vmSize] Specifies the size of the + * virtual machine. For more information about virtual machine sizes, see + * [Sizes for virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    The available VM sizes depend on region and availability set. For + * a list of available sizes use these APIs:

    [List all available + * virtual machine sizes in an availability + * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) + *

    [List all available virtual machine sizes in a + * region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) + *

    [List all available virtual machine sizes for + * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). + * Possible values include: '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_B1s', 'Standard_B1ms', + * 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', + * '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_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', + * 'Standard_D16_v3', 'Standard_D32_v3', 'Standard_D64_v3', + * 'Standard_D2s_v3', 'Standard_D4s_v3', 'Standard_D8s_v3', + * 'Standard_D16s_v3', 'Standard_D32s_v3', 'Standard_D64s_v3', + * '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_DS13-4_v2', + * 'Standard_DS13-2_v2', 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', + * 'Standard_E2_v3', 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', + * 'Standard_E32_v3', 'Standard_E64_v3', 'Standard_E2s_v3', + * 'Standard_E4s_v3', 'Standard_E8s_v3', 'Standard_E16s_v3', + * 'Standard_E32s_v3', 'Standard_E64s_v3', 'Standard_E32-16_v3', + * 'Standard_E32-8s_v3', 'Standard_E64-32s_v3', 'Standard_E64-16s_v3', + * 'Standard_F1', 'Standard_F2', 'Standard_F4', 'Standard_F8', + * 'Standard_F16', 'Standard_F1s', 'Standard_F2s', 'Standard_F4s', + * 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2', 'Standard_F4s_v2', + * 'Standard_F8s_v2', 'Standard_F16s_v2', 'Standard_F32s_v2', + * 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1', 'Standard_G2', + * 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', + * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', + * 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8', + * 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m', + * 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', + * 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms', + * 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms', + * 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms', + * 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', + * 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2', + * 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3', + * 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s', + * 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6', + * 'Standard_NV12', 'Standard_NV24' + * @member {object} [storageProfile] Specifies the storage settings for the + * virtual machine disks. + * @member {object} [storageProfile.imageReference] Specifies information + * about the image to use. You can specify information about platform images, + * marketplace images, or virtual machine images. This element is required + * when you want to use a platform image, marketplace image, or virtual + * machine image, but is not used in other creation operations. + * @member {string} [storageProfile.imageReference.publisher] The image + * publisher. + * @member {string} [storageProfile.imageReference.offer] Specifies the offer + * of the platform image or marketplace image used to create the virtual + * machine. + * @member {string} [storageProfile.imageReference.sku] The image SKU. + * @member {string} [storageProfile.imageReference.version] Specifies the + * version of the platform image or marketplace image used to create the + * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the + * latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time + * even if a new version becomes available. + * @member {object} [storageProfile.osDisk] Specifies information about the + * operating system disk used by the virtual machine.

    For more + * information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @member {string} [storageProfile.osDisk.osType] This property allows you + * to specify the type of the OS that is included in the disk if creating a + * VM from user-image or a specialized VHD.

    Possible values are: + *

    **Windows**

    **Linux**. Possible values include: + * 'Windows', 'Linux' + * @member {object} [storageProfile.osDisk.encryptionSettings] Specifies the + * encryption settings for the OS Disk.

    Minimum api-version: + * 2015-06-15 + * @member {object} + * [storageProfile.osDisk.encryptionSettings.diskEncryptionKey] Specifies the + * location of the disk encryption key, which is a Key Vault Secret. + * @member {string} + * [storageProfile.osDisk.encryptionSettings.diskEncryptionKey.secretUrl] The + * URL referencing a secret in a Key Vault. + * @member {object} + * [storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault] + * The relative URL of the Key Vault containing the secret. + * @member {string} + * [storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault.id] + * Resource Id + * @member {object} + * [storageProfile.osDisk.encryptionSettings.keyEncryptionKey] Specifies the + * location of the key encryption key in Key Vault. + * @member {string} + * [storageProfile.osDisk.encryptionSettings.keyEncryptionKey.keyUrl] The URL + * referencing a key encryption key in Key Vault. + * @member {object} + * [storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault] + * The relative URL of the Key Vault containing the key. + * @member {string} + * [storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault.id] + * Resource Id + * @member {boolean} [storageProfile.osDisk.encryptionSettings.enabled] + * Specifies whether disk encryption should be enabled on the virtual + * machine. + * @member {string} [storageProfile.osDisk.name] The disk name. + * @member {object} [storageProfile.osDisk.vhd] The virtual hard disk. + * @member {string} [storageProfile.osDisk.vhd.uri] Specifies the virtual + * hard disk's uri. + * @member {object} [storageProfile.osDisk.image] The source user image + * virtual hard disk. The virtual hard disk will be copied before being + * attached to the virtual machine. If SourceImage is provided, the + * destination virtual hard drive must not exist. + * @member {string} [storageProfile.osDisk.image.uri] Specifies the virtual + * hard disk's uri. + * @member {string} [storageProfile.osDisk.caching] Specifies the caching + * requirements.

    Possible values are:

    **None**

    + * **ReadOnly**

    **ReadWrite**

    Default: **None for Standard + * storage. ReadOnly for Premium storage**. Possible values include: 'None', + * 'ReadOnly', 'ReadWrite' + * @member {boolean} [storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * @member {string} [storageProfile.osDisk.createOption] Specifies how the + * virtual machine should be created.

    Possible values are:

    + * **Attach** \u2013 This value is used when you are using a specialized disk + * to create the virtual machine.

    **FromImage** \u2013 This value is + * used when you are using an image to create the virtual machine. If you are + * using a platform image, you also use the imageReference element described + * above. If you are using a marketplace image, you also use the plan + * element previously described. Possible values include: 'FromImage', + * 'Empty', 'Attach' + * @member {number} [storageProfile.osDisk.diskSizeGB] Specifies the size of + * an empty data disk in gigabytes. This element can be used to overwrite the + * name of the disk in a virtual machine image.

    This value cannot be + * larger than 1023 GB + * @member {object} [storageProfile.osDisk.managedDisk] The managed disk + * parameters. + * @member {string} [storageProfile.osDisk.managedDisk.storageAccountType] + * Specifies the storage account type for the managed disk. Possible values + * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * @member {array} [storageProfile.dataDisks] Specifies the parameters that + * are used to add a data disk to a virtual machine.

    For more + * information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @member {object} [osProfile] Specifies the operating system settings for + * the virtual machine. + * @member {string} [osProfile.computerName] Specifies the host OS name of + * the virtual machine.

    **Max-length (Windows):** 15 characters + *

    **Max-length (Linux):** 64 characters.

    For naming + * conventions and restrictions see [Azure infrastructure services + * implementation + * guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). + * @member {string} [osProfile.adminUsername] Specifies the name of the + * administrator account.

    **Windows-only restriction:** Cannot end + * in "."

    **Disallowed values:** "administrator", "admin", "user", + * "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", + * "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", + * "guest", "john", "owner", "root", "server", "sql", "support", + * "support_388945a0", "sys", "test2", "test3", "user4", "user5".

    + * **Minimum-length (Linux):** 1 character

    **Max-length (Linux):** + * 64 characters

    **Max-length (Windows):** 20 characters + *

  • For root access to the Linux VM, see [Using root privileges + * on Linux virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in + * this field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * @member {string} [osProfile.adminPassword] Specifies the password of the + * administrator account.

    **Minimum-length (Windows):** 8 characters + *

    **Minimum-length (Linux):** 6 characters

    **Max-length + * (Windows):** 123 characters

    **Max-length (Linux):** 72 characters + *

    **Complexity requirements:** 3 out of 4 conditions below need to + * be fulfilled
    Has lower characters
    Has upper characters
    Has a + * digit
    Has a special character (Regex match [\W_])

    + * **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", + * "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", + * "iloveyou!"

    For resetting the password, see [How to reset the + * Remote Desktop service or its login password in a Windows + * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    For resetting root password, see [Manage users, SSH, and check or + * repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + * @member {string} [osProfile.customData] Specifies a base-64 encoded string + * of custom data. The base-64 encoded string is decoded to a binary array + * that is saved as a file on the Virtual Machine. The maximum length of the + * binary array is 65535 bytes.

    For using cloud-init for your VM, + * see [Using cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * @member {object} [osProfile.windowsConfiguration] Specifies Windows + * operating system settings on the virtual machine. + * @member {boolean} [osProfile.windowsConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the + * virtual machine.

    When this property is not specified in the + * request body, default behavior is to set it to true. This will ensure + * that VM Agent is installed on the VM so that extensions can be added to + * the VM later. + * @member {boolean} [osProfile.windowsConfiguration.enableAutomaticUpdates] + * Indicates whether virtual machine is enabled for automatic updates. + * @member {string} [osProfile.windowsConfiguration.timeZone] Specifies the + * time zone of the virtual machine. e.g. "Pacific Standard Time" + * @member {array} [osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * @member {object} [osProfile.windowsConfiguration.winRM] Specifies the + * Windows Remote Management listeners. This enables remote Windows + * PowerShell. + * @member {array} [osProfile.windowsConfiguration.winRM.listeners] The list + * of Windows Remote Management listeners + * @member {object} [osProfile.linuxConfiguration] Specifies the Linux + * operating system settings on the virtual machine.

    For a list of + * supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * @member {boolean} + * [osProfile.linuxConfiguration.disablePasswordAuthentication] Specifies + * whether password authentication should be disabled. + * @member {object} [osProfile.linuxConfiguration.ssh] Specifies the ssh key + * configuration for a Linux OS. + * @member {array} [osProfile.linuxConfiguration.ssh.publicKeys] The list of + * SSH public keys used to authenticate with linux based VMs. + * @member {array} [osProfile.secrets] Specifies set of certificates that + * should be installed onto the virtual machine. + * @member {object} [networkProfile] Specifies the network interfaces of the + * virtual machine. + * @member {array} [networkProfile.networkInterfaces] Specifies the list of + * resource Ids for the network interfaces associated with the virtual + * machine. + * @member {object} [diagnosticsProfile] Specifies the boot diagnostic + * settings state.

    Minimum api-version: 2015-06-15. + * @member {object} [diagnosticsProfile.bootDiagnostics] Boot Diagnostics is + * a debugging feature which allows you to view Console Output and Screenshot + * to diagnose VM status.

    For Linux Virtual Machines, you can easily + * view the output of your console log.

    For both Windows and Linux + * virtual machines, Azure also enables you to see a screenshot of the VM + * from the hypervisor. + * @member {boolean} [diagnosticsProfile.bootDiagnostics.enabled] Whether + * boot diagnostics should be enabled on the Virtual Machine. + * @member {string} [diagnosticsProfile.bootDiagnostics.storageUri] Uri of + * the storage account to use for placing the console output and screenshot. + * @member {object} [availabilitySet] Specifies information about the + * availability set that the virtual machine should be assigned to. Virtual + * machines specified in the same availability set are allocated to different + * nodes to maximize availability. For more information about availability + * sets, see [Manage the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    For more information on Azure planned maintainance, see [Planned + * maintenance for virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Currently, a VM can only be added to availability set at creation + * time. An existing VM cannot be added to an availability set. + * @member {string} [availabilitySet.id] Resource Id + * @member {string} [provisioningState] The provisioning state, which only + * appears in the response. + * @member {string} [licenseType] Specifies that the image or disk that is + * being used was licensed on-premises. This element is only used for images + * that contain the Windows Server operating system.

    Possible values + * are:

    Windows_Client

    Windows_Server

    If this + * element is included in a request for an update, the value must match the + * initial value. This value cannot be updated.

    For more + * information, see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Minimum api-version: 2015-06-15 + * @member {object} [plan] Specifies information about the marketplace image + * used to create the virtual machine. This element is only used for + * marketplace images. Before you can use a marketplace image from an API, + * you must enable the image for programmatic use. In the Azure portal, find + * the marketplace image that you want to use and then click **Want to deploy + * programmatically, Get Started ->**. Enter any required information and + * then click **Save**. + * @member {string} [plan.name] The plan ID. + * @member {string} [plan.publisher] The publisher ID. + * @member {string} [plan.product] Specifies the product of the image from + * the marketplace. This is the same value as Offer under the imageReference + * element. + * @member {string} [plan.promotionCode] The promotion code. + * @member {array} [resources] The virtual machine child extension resources. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VirtualMachineScaleSetVM + * + * @returns {object} metadata of VirtualMachineScaleSetVM + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineScaleSetVM', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetVM', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: true, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + instanceId: { + required: false, + readOnly: true, + serializedName: 'instanceId', + type: { + name: 'String' + } + }, + sku: { + required: false, + readOnly: true, + serializedName: 'sku', + type: { + name: 'Composite', + className: 'Sku' + } + }, + latestModelApplied: { + required: false, + readOnly: true, + serializedName: 'properties.latestModelApplied', + type: { + name: 'Boolean' + } + }, + vmId: { + required: false, + readOnly: true, + serializedName: 'properties.vmId', + type: { + name: 'String' + } + }, + instanceView: { + required: false, + readOnly: true, + serializedName: 'properties.instanceView', + type: { + name: 'Composite', + className: 'VirtualMachineInstanceView' + } + }, + hardwareProfile: { + required: false, + serializedName: 'properties.hardwareProfile', + type: { + name: 'Composite', + className: 'HardwareProfile' + } + }, + storageProfile: { + required: false, + serializedName: 'properties.storageProfile', + type: { + name: 'Composite', + className: 'StorageProfile' + } + }, + osProfile: { + required: false, + serializedName: 'properties.osProfile', + type: { + name: 'Composite', + className: 'OSProfile' + } + }, + networkProfile: { + required: false, + serializedName: 'properties.networkProfile', + type: { + name: 'Composite', + className: 'NetworkProfile' + } + }, + diagnosticsProfile: { + required: false, + serializedName: 'properties.diagnosticsProfile', + type: { + name: 'Composite', + className: 'DiagnosticsProfile' + } + }, + availabilitySet: { + required: false, + serializedName: 'properties.availabilitySet', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + licenseType: { + required: false, + serializedName: 'properties.licenseType', + type: { + name: 'String' + } + }, + plan: { + required: false, + serializedName: 'plan', + type: { + name: 'Composite', + className: 'Plan' + } + }, + resources: { + required: false, + readOnly: true, + serializedName: 'resources', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VirtualMachineExtensionElementType', + type: { + name: 'Composite', + className: 'VirtualMachineExtension' + } + } + } + } + } + } + }; + } +} + +module.exports = VirtualMachineScaleSetVM; diff --git a/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetVMExtensionsSummary.js b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetVMExtensionsSummary.js new file mode 100644 index 0000000000..ec86ebf39d --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetVMExtensionsSummary.js @@ -0,0 +1,72 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Extensions summary for virtual machines of a virtual machine scale set. + * + */ +class VirtualMachineScaleSetVMExtensionsSummary { + /** + * Create a VirtualMachineScaleSetVMExtensionsSummary. + * @member {string} [name] The extension name. + * @member {array} [statusesSummary] The extensions information. + */ + constructor() { + } + + /** + * Defines the metadata of VirtualMachineScaleSetVMExtensionsSummary + * + * @returns {object} metadata of VirtualMachineScaleSetVMExtensionsSummary + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineScaleSetVMExtensionsSummary', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetVMExtensionsSummary', + modelProperties: { + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + statusesSummary: { + required: false, + readOnly: true, + serializedName: 'statusesSummary', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VirtualMachineStatusCodeCountElementType', + type: { + name: 'Composite', + className: 'VirtualMachineStatusCodeCount' + } + } + } + } + } + } + }; + } +} + +module.exports = VirtualMachineScaleSetVMExtensionsSummary; diff --git a/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetVMInstanceIDs.js b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetVMInstanceIDs.js new file mode 100644 index 0000000000..529a4928f7 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetVMInstanceIDs.js @@ -0,0 +1,62 @@ +/* + * 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'; + +/** + * Specifies a list of virtual machine instance IDs from the VM scale set. + * + */ +class VirtualMachineScaleSetVMInstanceIDs { + /** + * Create a VirtualMachineScaleSetVMInstanceIDs. + * @member {array} [instanceIds] The virtual machine scale set instance ids. + * Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + */ + constructor() { + } + + /** + * Defines the metadata of VirtualMachineScaleSetVMInstanceIDs + * + * @returns {object} metadata of VirtualMachineScaleSetVMInstanceIDs + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineScaleSetVMInstanceIDs', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetVMInstanceIDs', + modelProperties: { + instanceIds: { + required: false, + serializedName: 'instanceIds', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = VirtualMachineScaleSetVMInstanceIDs; diff --git a/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetVMInstanceRequiredIDs.js b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetVMInstanceRequiredIDs.js new file mode 100644 index 0000000000..f11c98b3d6 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetVMInstanceRequiredIDs.js @@ -0,0 +1,59 @@ +/* + * 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'; + +/** + * Specifies a list of virtual machine instance IDs from the VM scale set. + * + */ +class VirtualMachineScaleSetVMInstanceRequiredIDs { + /** + * Create a VirtualMachineScaleSetVMInstanceRequiredIDs. + * @member {array} instanceIds The virtual machine scale set instance ids. + */ + constructor() { + } + + /** + * Defines the metadata of VirtualMachineScaleSetVMInstanceRequiredIDs + * + * @returns {object} metadata of VirtualMachineScaleSetVMInstanceRequiredIDs + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineScaleSetVMInstanceRequiredIDs', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetVMInstanceRequiredIDs', + modelProperties: { + instanceIds: { + required: true, + serializedName: 'instanceIds', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = VirtualMachineScaleSetVMInstanceRequiredIDs; diff --git a/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetVMInstanceView.js b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetVMInstanceView.js new file mode 100644 index 0000000000..e408d869b7 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetVMInstanceView.js @@ -0,0 +1,205 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The instance view of a virtual machine scale set VM. + * + */ +class VirtualMachineScaleSetVMInstanceView { + /** + * Create a VirtualMachineScaleSetVMInstanceView. + * @member {number} [platformUpdateDomain] The Update Domain count. + * @member {number} [platformFaultDomain] The Fault Domain count. + * @member {string} [rdpThumbPrint] The Remote desktop certificate + * thumbprint. + * @member {object} [vmAgent] The VM Agent running on the virtual machine. + * @member {string} [vmAgent.vmAgentVersion] The VM Agent full version. + * @member {array} [vmAgent.extensionHandlers] The virtual machine extension + * handler instance view. + * @member {array} [vmAgent.statuses] The resource status information. + * @member {object} [maintenanceRedeployStatus] The Maintenance Operation + * status on the virtual machine. + * @member {boolean} + * [maintenanceRedeployStatus.isCustomerInitiatedMaintenanceAllowed] True, if + * customer is allowed to perform Maintenance. + * @member {date} [maintenanceRedeployStatus.preMaintenanceWindowStartTime] + * Start Time for the Pre Maintenance Window. + * @member {date} [maintenanceRedeployStatus.preMaintenanceWindowEndTime] End + * Time for the Pre Maintenance Window. + * @member {date} [maintenanceRedeployStatus.maintenanceWindowStartTime] + * Start Time for the Maintenance Window. + * @member {date} [maintenanceRedeployStatus.maintenanceWindowEndTime] End + * Time for the Maintenance Window. + * @member {string} [maintenanceRedeployStatus.lastOperationResultCode] The + * Last Maintenance Operation Result Code. Possible values include: 'None', + * 'RetryLater', 'MaintenanceAborted', 'MaintenanceCompleted' + * @member {string} [maintenanceRedeployStatus.lastOperationMessage] Message + * returned for the last Maintenance Operation. + * @member {array} [disks] The disks information. + * @member {array} [extensions] The extensions information. + * @member {object} [vmHealth] The health status for the VM. + * @member {object} [vmHealth.status] The health status information for the + * VM. + * @member {string} [vmHealth.status.code] The status code. + * @member {string} [vmHealth.status.level] The level code. Possible values + * include: 'Info', 'Warning', 'Error' + * @member {string} [vmHealth.status.displayStatus] The short localizable + * label for the status. + * @member {string} [vmHealth.status.message] The detailed status message, + * including for alerts and error messages. + * @member {date} [vmHealth.status.time] The time of the status. + * @member {object} [bootDiagnostics] Boot Diagnostics is a debugging feature + * which allows you to view Console Output and Screenshot to diagnose VM + * status.

    For Linux Virtual Machines, you can easily view the + * output of your console log.

    For both Windows and Linux virtual + * machines, Azure also enables you to see a screenshot of the VM from the + * hypervisor. + * @member {string} [bootDiagnostics.consoleScreenshotBlobUri] The console + * screenshot blob URI. + * @member {string} [bootDiagnostics.serialConsoleLogBlobUri] The Linux + * serial console log blob Uri. + * @member {array} [statuses] The resource status information. + * @member {string} [placementGroupId] The placement group in which the VM is + * running. If the VM is deallocated it will not have a placementGroupId. + */ + constructor() { + } + + /** + * Defines the metadata of VirtualMachineScaleSetVMInstanceView + * + * @returns {object} metadata of VirtualMachineScaleSetVMInstanceView + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineScaleSetVMInstanceView', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetVMInstanceView', + modelProperties: { + platformUpdateDomain: { + required: false, + serializedName: 'platformUpdateDomain', + type: { + name: 'Number' + } + }, + platformFaultDomain: { + required: false, + serializedName: 'platformFaultDomain', + type: { + name: 'Number' + } + }, + rdpThumbPrint: { + required: false, + serializedName: 'rdpThumbPrint', + type: { + name: 'String' + } + }, + vmAgent: { + required: false, + serializedName: 'vmAgent', + type: { + name: 'Composite', + className: 'VirtualMachineAgentInstanceView' + } + }, + maintenanceRedeployStatus: { + required: false, + serializedName: 'maintenanceRedeployStatus', + type: { + name: 'Composite', + className: 'MaintenanceRedeployStatus' + } + }, + disks: { + required: false, + serializedName: 'disks', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DiskInstanceViewElementType', + type: { + name: 'Composite', + className: 'DiskInstanceView' + } + } + } + }, + extensions: { + required: false, + serializedName: 'extensions', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VirtualMachineExtensionInstanceViewElementType', + type: { + name: 'Composite', + className: 'VirtualMachineExtensionInstanceView' + } + } + } + }, + vmHealth: { + required: false, + readOnly: true, + serializedName: 'vmHealth', + type: { + name: 'Composite', + className: 'VirtualMachineHealthStatus' + } + }, + bootDiagnostics: { + required: false, + serializedName: 'bootDiagnostics', + type: { + name: 'Composite', + className: 'BootDiagnosticsInstanceView' + } + }, + statuses: { + required: false, + serializedName: 'statuses', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'InstanceViewStatusElementType', + type: { + name: 'Composite', + className: 'InstanceViewStatus' + } + } + } + }, + placementGroupId: { + required: false, + serializedName: 'placementGroupId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VirtualMachineScaleSetVMInstanceView; diff --git a/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetVMListResult.js b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetVMListResult.js new file mode 100644 index 0000000000..2a5488100e --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetVMListResult.js @@ -0,0 +1,69 @@ +/* + * 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 List Virtual Machine Scale Set VMs operation response. + */ +class VirtualMachineScaleSetVMListResult extends Array { + /** + * Create a VirtualMachineScaleSetVMListResult. + * @member {string} [nextLink] The uri to fetch the next page of Virtual + * Machine Scale Set VMs. Call ListNext() with this to fetch the next page of + * VMSS VMs + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VirtualMachineScaleSetVMListResult + * + * @returns {object} metadata of VirtualMachineScaleSetVMListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineScaleSetVMListResult', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetVMListResult', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VirtualMachineScaleSetVMElementType', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetVM' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VirtualMachineScaleSetVMListResult; diff --git a/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetVMProfile.js b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetVMProfile.js new file mode 100644 index 0000000000..59d202754a --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/virtualMachineScaleSetVMProfile.js @@ -0,0 +1,280 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Describes a virtual machine scale set virtual machine profile. + * + */ +class VirtualMachineScaleSetVMProfile { + /** + * Create a VirtualMachineScaleSetVMProfile. + * @member {object} [osProfile] Specifies the operating system settings for + * the virtual machines in the scale set. + * @member {string} [osProfile.computerNamePrefix] Specifies the computer + * name prefix for all of the virtual machines in the scale set. Computer + * name prefixes must be 1 to 15 characters long. + * @member {string} [osProfile.adminUsername] Specifies the name of the + * administrator account.

    **Windows-only restriction:** Cannot end + * in "."

    **Disallowed values:** "administrator", "admin", "user", + * "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", + * "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", + * "guest", "john", "owner", "root", "server", "sql", "support", + * "support_388945a0", "sys", "test2", "test3", "user4", "user5".

    + * **Minimum-length (Linux):** 1 character

    **Max-length (Linux):** + * 64 characters

    **Max-length (Windows):** 20 characters + *

  • For root access to the Linux VM, see [Using root privileges + * on Linux virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in + * this field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * @member {string} [osProfile.adminPassword] Specifies the password of the + * administrator account.

    **Minimum-length (Windows):** 8 characters + *

    **Minimum-length (Linux):** 6 characters

    **Max-length + * (Windows):** 123 characters

    **Max-length (Linux):** 72 characters + *

    **Complexity requirements:** 3 out of 4 conditions below need to + * be fulfilled
    Has lower characters
    Has upper characters
    Has a + * digit
    Has a special character (Regex match [\W_])

    + * **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", + * "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", + * "iloveyou!"

    For resetting the password, see [How to reset the + * Remote Desktop service or its login password in a Windows + * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    For resetting root password, see [Manage users, SSH, and check or + * repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + * @member {string} [osProfile.customData] Specifies a base-64 encoded string + * of custom data. The base-64 encoded string is decoded to a binary array + * that is saved as a file on the Virtual Machine. The maximum length of the + * binary array is 65535 bytes.

    For using cloud-init for your VM, + * see [Using cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * @member {object} [osProfile.windowsConfiguration] Specifies Windows + * operating system settings on the virtual machine. + * @member {boolean} [osProfile.windowsConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the + * virtual machine.

    When this property is not specified in the + * request body, default behavior is to set it to true. This will ensure + * that VM Agent is installed on the VM so that extensions can be added to + * the VM later. + * @member {boolean} [osProfile.windowsConfiguration.enableAutomaticUpdates] + * Indicates whether virtual machine is enabled for automatic updates. + * @member {string} [osProfile.windowsConfiguration.timeZone] Specifies the + * time zone of the virtual machine. e.g. "Pacific Standard Time" + * @member {array} [osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * @member {object} [osProfile.windowsConfiguration.winRM] Specifies the + * Windows Remote Management listeners. This enables remote Windows + * PowerShell. + * @member {array} [osProfile.windowsConfiguration.winRM.listeners] The list + * of Windows Remote Management listeners + * @member {object} [osProfile.linuxConfiguration] Specifies the Linux + * operating system settings on the virtual machine.

    For a list of + * supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * @member {boolean} + * [osProfile.linuxConfiguration.disablePasswordAuthentication] Specifies + * whether password authentication should be disabled. + * @member {object} [osProfile.linuxConfiguration.ssh] Specifies the ssh key + * configuration for a Linux OS. + * @member {array} [osProfile.linuxConfiguration.ssh.publicKeys] The list of + * SSH public keys used to authenticate with linux based VMs. + * @member {array} [osProfile.secrets] Specifies set of certificates that + * should be installed onto the virtual machines in the scale set. + * @member {object} [storageProfile] Specifies the storage settings for the + * virtual machine disks. + * @member {object} [storageProfile.imageReference] Specifies information + * about the image to use. You can specify information about platform images, + * marketplace images, or virtual machine images. This element is required + * when you want to use a platform image, marketplace image, or virtual + * machine image, but is not used in other creation operations. + * @member {string} [storageProfile.imageReference.publisher] The image + * publisher. + * @member {string} [storageProfile.imageReference.offer] Specifies the offer + * of the platform image or marketplace image used to create the virtual + * machine. + * @member {string} [storageProfile.imageReference.sku] The image SKU. + * @member {string} [storageProfile.imageReference.version] Specifies the + * version of the platform image or marketplace image used to create the + * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the + * latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time + * even if a new version becomes available. + * @member {object} [storageProfile.osDisk] Specifies information about the + * operating system disk used by the virtual machines in the scale set. + *

    For more information about disks, see [About disks and VHDs for + * Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @member {string} [storageProfile.osDisk.name] The disk name. + * @member {string} [storageProfile.osDisk.caching] Specifies the caching + * requirements.

    Possible values are:

    **None**

    + * **ReadOnly**

    **ReadWrite**

    Default: **None for Standard + * storage. ReadOnly for Premium storage**. Possible values include: 'None', + * 'ReadOnly', 'ReadWrite' + * @member {boolean} [storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * @member {string} [storageProfile.osDisk.createOption] Specifies how the + * virtual machines in the scale set should be created.

    The only + * allowed value is: **FromImage** \u2013 This value is used when you are + * using an image to create the virtual machine. If you are using a platform + * image, you also use the imageReference element described above. If you are + * using a marketplace image, you also use the plan element previously + * described. Possible values include: 'FromImage', 'Empty', 'Attach' + * @member {string} [storageProfile.osDisk.osType] This property allows you + * to specify the type of the OS that is included in the disk if creating a + * VM from user-image or a specialized VHD.

    Possible values are: + *

    **Windows**

    **Linux**. Possible values include: + * 'Windows', 'Linux' + * @member {object} [storageProfile.osDisk.image] Specifies information about + * the unmanaged user image to base the scale set on. + * @member {string} [storageProfile.osDisk.image.uri] Specifies the virtual + * hard disk's uri. + * @member {array} [storageProfile.osDisk.vhdContainers] Specifies the + * container urls that are used to store operating system disks for the scale + * set. + * @member {object} [storageProfile.osDisk.managedDisk] The managed disk + * parameters. + * @member {string} [storageProfile.osDisk.managedDisk.storageAccountType] + * Specifies the storage account type for the managed disk. Possible values + * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * @member {array} [storageProfile.dataDisks] Specifies the parameters that + * are used to add data disks to the virtual machines in the scale set. + *

    For more information about disks, see [About disks and VHDs for + * Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @member {object} [networkProfile] Specifies properties of the network + * interfaces of the virtual machines in the scale set. + * @member {object} [networkProfile.healthProbe] A reference to a load + * balancer probe used to determine the health of an instance in the virtual + * machine scale set. The reference will be in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. + * @member {string} [networkProfile.healthProbe.id] The ARM resource id in + * the form of + * /subscriptions/{SubcriptionId}/resourceGroups/{ResourceGroupName}/... + * @member {array} [networkProfile.networkInterfaceConfigurations] The list + * of network configurations. + * @member {object} [diagnosticsProfile] Specifies the boot diagnostic + * settings state.

    Minimum api-version: 2015-06-15. + * @member {object} [diagnosticsProfile.bootDiagnostics] Boot Diagnostics is + * a debugging feature which allows you to view Console Output and Screenshot + * to diagnose VM status.

    For Linux Virtual Machines, you can easily + * view the output of your console log.

    For both Windows and Linux + * virtual machines, Azure also enables you to see a screenshot of the VM + * from the hypervisor. + * @member {boolean} [diagnosticsProfile.bootDiagnostics.enabled] Whether + * boot diagnostics should be enabled on the Virtual Machine. + * @member {string} [diagnosticsProfile.bootDiagnostics.storageUri] Uri of + * the storage account to use for placing the console output and screenshot. + * @member {object} [extensionProfile] Specifies a collection of settings for + * extensions installed on virtual machines in the scale set. + * @member {array} [extensionProfile.extensions] The virtual machine scale + * set child extension resources. + * @member {string} [licenseType] Specifies that the image or disk that is + * being used was licensed on-premises. This element is only used for images + * that contain the Windows Server operating system.

    Possible values + * are:

    Windows_Client

    Windows_Server

    If this + * element is included in a request for an update, the value must match the + * initial value. This value cannot be updated.

    For more + * information, see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Minimum api-version: 2015-06-15 + * @member {string} [priority] Specifies the priority for the virtual + * machines in the scale set.

    Minimum api-version: + * 2017-10-30-preview. Possible values include: 'Regular', 'Low' + */ + constructor() { + } + + /** + * Defines the metadata of VirtualMachineScaleSetVMProfile + * + * @returns {object} metadata of VirtualMachineScaleSetVMProfile + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineScaleSetVMProfile', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetVMProfile', + modelProperties: { + osProfile: { + required: false, + serializedName: 'osProfile', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetOSProfile' + } + }, + storageProfile: { + required: false, + serializedName: 'storageProfile', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetStorageProfile' + } + }, + networkProfile: { + required: false, + serializedName: 'networkProfile', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetNetworkProfile' + } + }, + diagnosticsProfile: { + required: false, + serializedName: 'diagnosticsProfile', + type: { + name: 'Composite', + className: 'DiagnosticsProfile' + } + }, + extensionProfile: { + required: false, + serializedName: 'extensionProfile', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetExtensionProfile' + } + }, + licenseType: { + required: false, + serializedName: 'licenseType', + type: { + name: 'String' + } + }, + priority: { + required: false, + serializedName: 'priority', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VirtualMachineScaleSetVMProfile; diff --git a/lib/services/computeManagement2/lib/lib/models/virtualMachineSize.js b/lib/services/computeManagement2/lib/lib/models/virtualMachineSize.js new file mode 100644 index 0000000000..8d6ccb6b23 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/virtualMachineSize.js @@ -0,0 +1,97 @@ +/* + * 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'; + +/** + * Describes the properties of a VM size. + * + */ +class VirtualMachineSize { + /** + * Create a VirtualMachineSize. + * @member {string} [name] The name of the virtual machine size. + * @member {number} [numberOfCores] The number of cores supported by the + * virtual machine size. + * @member {number} [osDiskSizeInMB] The OS disk size, in MB, allowed by the + * virtual machine size. + * @member {number} [resourceDiskSizeInMB] The resource disk size, in MB, + * allowed by the virtual machine size. + * @member {number} [memoryInMB] The amount of memory, in MB, supported by + * the virtual machine size. + * @member {number} [maxDataDiskCount] The maximum number of data disks that + * can be attached to the virtual machine size. + */ + constructor() { + } + + /** + * Defines the metadata of VirtualMachineSize + * + * @returns {object} metadata of VirtualMachineSize + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineSize', + type: { + name: 'Composite', + className: 'VirtualMachineSize', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + numberOfCores: { + required: false, + serializedName: 'numberOfCores', + type: { + name: 'Number' + } + }, + osDiskSizeInMB: { + required: false, + serializedName: 'osDiskSizeInMB', + type: { + name: 'Number' + } + }, + resourceDiskSizeInMB: { + required: false, + serializedName: 'resourceDiskSizeInMB', + type: { + name: 'Number' + } + }, + memoryInMB: { + required: false, + serializedName: 'memoryInMB', + type: { + name: 'Number' + } + }, + maxDataDiskCount: { + required: false, + serializedName: 'maxDataDiskCount', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = VirtualMachineSize; diff --git a/lib/services/computeManagement2/lib/lib/models/virtualMachineSizeListResult.js b/lib/services/computeManagement2/lib/lib/models/virtualMachineSizeListResult.js new file mode 100644 index 0000000000..b32648559c --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/virtualMachineSizeListResult.js @@ -0,0 +1,59 @@ +/* + * 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 List Virtual Machine operation response. + */ +class VirtualMachineSizeListResult extends Array { + /** + * Create a VirtualMachineSizeListResult. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VirtualMachineSizeListResult + * + * @returns {object} metadata of VirtualMachineSizeListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineSizeListResult', + type: { + name: 'Composite', + className: 'VirtualMachineSizeListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VirtualMachineSizeElementType', + type: { + name: 'Composite', + className: 'VirtualMachineSize' + } + } + } + } + } + } + }; + } +} + +module.exports = VirtualMachineSizeListResult; diff --git a/lib/services/computeManagement2/lib/lib/models/virtualMachineStatusCodeCount.js b/lib/services/computeManagement2/lib/lib/models/virtualMachineStatusCodeCount.js new file mode 100644 index 0000000000..4058991735 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/virtualMachineStatusCodeCount.js @@ -0,0 +1,64 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The status code and count of the virtual machine scale set instance view + * status summary. + * + */ +class VirtualMachineStatusCodeCount { + /** + * Create a VirtualMachineStatusCodeCount. + * @member {string} [code] The instance view status code. + * @member {number} [count] The number of instances having a particular + * status code. + */ + constructor() { + } + + /** + * Defines the metadata of VirtualMachineStatusCodeCount + * + * @returns {object} metadata of VirtualMachineStatusCodeCount + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineStatusCodeCount', + type: { + name: 'Composite', + className: 'VirtualMachineStatusCodeCount', + modelProperties: { + code: { + required: false, + readOnly: true, + serializedName: 'code', + type: { + name: 'String' + } + }, + count: { + required: false, + readOnly: true, + serializedName: 'count', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = VirtualMachineStatusCodeCount; diff --git a/lib/services/computeManagement2/lib/lib/models/virtualMachineUpdate.js b/lib/services/computeManagement2/lib/lib/models/virtualMachineUpdate.js new file mode 100644 index 0000000000..bfc6f87c21 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/virtualMachineUpdate.js @@ -0,0 +1,545 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Describes a Virtual Machine. + * + * @extends models['UpdateResource'] + */ +class VirtualMachineUpdate extends models['UpdateResource'] { + /** + * Create a VirtualMachineUpdate. + * @member {object} [plan] Specifies information about the marketplace image + * used to create the virtual machine. This element is only used for + * marketplace images. Before you can use a marketplace image from an API, + * you must enable the image for programmatic use. In the Azure portal, find + * the marketplace image that you want to use and then click **Want to deploy + * programmatically, Get Started ->**. Enter any required information and + * then click **Save**. + * @member {string} [plan.name] The plan ID. + * @member {string} [plan.publisher] The publisher ID. + * @member {string} [plan.product] Specifies the product of the image from + * the marketplace. This is the same value as Offer under the imageReference + * element. + * @member {string} [plan.promotionCode] The promotion code. + * @member {object} [hardwareProfile] Specifies the hardware settings for the + * virtual machine. + * @member {string} [hardwareProfile.vmSize] Specifies the size of the + * virtual machine. For more information about virtual machine sizes, see + * [Sizes for virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    The available VM sizes depend on region and availability set. For + * a list of available sizes use these APIs:

    [List all available + * virtual machine sizes in an availability + * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) + *

    [List all available virtual machine sizes in a + * region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) + *

    [List all available virtual machine sizes for + * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). + * Possible values include: '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_B1s', 'Standard_B1ms', + * 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', + * '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_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', + * 'Standard_D16_v3', 'Standard_D32_v3', 'Standard_D64_v3', + * 'Standard_D2s_v3', 'Standard_D4s_v3', 'Standard_D8s_v3', + * 'Standard_D16s_v3', 'Standard_D32s_v3', 'Standard_D64s_v3', + * '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_DS13-4_v2', + * 'Standard_DS13-2_v2', 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', + * 'Standard_E2_v3', 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', + * 'Standard_E32_v3', 'Standard_E64_v3', 'Standard_E2s_v3', + * 'Standard_E4s_v3', 'Standard_E8s_v3', 'Standard_E16s_v3', + * 'Standard_E32s_v3', 'Standard_E64s_v3', 'Standard_E32-16_v3', + * 'Standard_E32-8s_v3', 'Standard_E64-32s_v3', 'Standard_E64-16s_v3', + * 'Standard_F1', 'Standard_F2', 'Standard_F4', 'Standard_F8', + * 'Standard_F16', 'Standard_F1s', 'Standard_F2s', 'Standard_F4s', + * 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2', 'Standard_F4s_v2', + * 'Standard_F8s_v2', 'Standard_F16s_v2', 'Standard_F32s_v2', + * 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1', 'Standard_G2', + * 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', + * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', + * 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8', + * 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m', + * 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', + * 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms', + * 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms', + * 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms', + * 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', + * 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2', + * 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3', + * 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s', + * 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6', + * 'Standard_NV12', 'Standard_NV24' + * @member {object} [storageProfile] Specifies the storage settings for the + * virtual machine disks. + * @member {object} [storageProfile.imageReference] Specifies information + * about the image to use. You can specify information about platform images, + * marketplace images, or virtual machine images. This element is required + * when you want to use a platform image, marketplace image, or virtual + * machine image, but is not used in other creation operations. + * @member {string} [storageProfile.imageReference.publisher] The image + * publisher. + * @member {string} [storageProfile.imageReference.offer] Specifies the offer + * of the platform image or marketplace image used to create the virtual + * machine. + * @member {string} [storageProfile.imageReference.sku] The image SKU. + * @member {string} [storageProfile.imageReference.version] Specifies the + * version of the platform image or marketplace image used to create the + * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the + * latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time + * even if a new version becomes available. + * @member {object} [storageProfile.osDisk] Specifies information about the + * operating system disk used by the virtual machine.

    For more + * information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @member {string} [storageProfile.osDisk.osType] This property allows you + * to specify the type of the OS that is included in the disk if creating a + * VM from user-image or a specialized VHD.

    Possible values are: + *

    **Windows**

    **Linux**. Possible values include: + * 'Windows', 'Linux' + * @member {object} [storageProfile.osDisk.encryptionSettings] Specifies the + * encryption settings for the OS Disk.

    Minimum api-version: + * 2015-06-15 + * @member {object} + * [storageProfile.osDisk.encryptionSettings.diskEncryptionKey] Specifies the + * location of the disk encryption key, which is a Key Vault Secret. + * @member {string} + * [storageProfile.osDisk.encryptionSettings.diskEncryptionKey.secretUrl] The + * URL referencing a secret in a Key Vault. + * @member {object} + * [storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault] + * The relative URL of the Key Vault containing the secret. + * @member {string} + * [storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault.id] + * Resource Id + * @member {object} + * [storageProfile.osDisk.encryptionSettings.keyEncryptionKey] Specifies the + * location of the key encryption key in Key Vault. + * @member {string} + * [storageProfile.osDisk.encryptionSettings.keyEncryptionKey.keyUrl] The URL + * referencing a key encryption key in Key Vault. + * @member {object} + * [storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault] + * The relative URL of the Key Vault containing the key. + * @member {string} + * [storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault.id] + * Resource Id + * @member {boolean} [storageProfile.osDisk.encryptionSettings.enabled] + * Specifies whether disk encryption should be enabled on the virtual + * machine. + * @member {string} [storageProfile.osDisk.name] The disk name. + * @member {object} [storageProfile.osDisk.vhd] The virtual hard disk. + * @member {string} [storageProfile.osDisk.vhd.uri] Specifies the virtual + * hard disk's uri. + * @member {object} [storageProfile.osDisk.image] The source user image + * virtual hard disk. The virtual hard disk will be copied before being + * attached to the virtual machine. If SourceImage is provided, the + * destination virtual hard drive must not exist. + * @member {string} [storageProfile.osDisk.image.uri] Specifies the virtual + * hard disk's uri. + * @member {string} [storageProfile.osDisk.caching] Specifies the caching + * requirements.

    Possible values are:

    **None**

    + * **ReadOnly**

    **ReadWrite**

    Default: **None for Standard + * storage. ReadOnly for Premium storage**. Possible values include: 'None', + * 'ReadOnly', 'ReadWrite' + * @member {boolean} [storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * @member {string} [storageProfile.osDisk.createOption] Specifies how the + * virtual machine should be created.

    Possible values are:

    + * **Attach** \u2013 This value is used when you are using a specialized disk + * to create the virtual machine.

    **FromImage** \u2013 This value is + * used when you are using an image to create the virtual machine. If you are + * using a platform image, you also use the imageReference element described + * above. If you are using a marketplace image, you also use the plan + * element previously described. Possible values include: 'FromImage', + * 'Empty', 'Attach' + * @member {number} [storageProfile.osDisk.diskSizeGB] Specifies the size of + * an empty data disk in gigabytes. This element can be used to overwrite the + * name of the disk in a virtual machine image.

    This value cannot be + * larger than 1023 GB + * @member {object} [storageProfile.osDisk.managedDisk] The managed disk + * parameters. + * @member {string} [storageProfile.osDisk.managedDisk.storageAccountType] + * Specifies the storage account type for the managed disk. Possible values + * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * @member {array} [storageProfile.dataDisks] Specifies the parameters that + * are used to add a data disk to a virtual machine.

    For more + * information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @member {object} [osProfile] Specifies the operating system settings for + * the virtual machine. + * @member {string} [osProfile.computerName] Specifies the host OS name of + * the virtual machine.

    **Max-length (Windows):** 15 characters + *

    **Max-length (Linux):** 64 characters.

    For naming + * conventions and restrictions see [Azure infrastructure services + * implementation + * guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). + * @member {string} [osProfile.adminUsername] Specifies the name of the + * administrator account.

    **Windows-only restriction:** Cannot end + * in "."

    **Disallowed values:** "administrator", "admin", "user", + * "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", + * "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", + * "guest", "john", "owner", "root", "server", "sql", "support", + * "support_388945a0", "sys", "test2", "test3", "user4", "user5".

    + * **Minimum-length (Linux):** 1 character

    **Max-length (Linux):** + * 64 characters

    **Max-length (Windows):** 20 characters + *

  • For root access to the Linux VM, see [Using root privileges + * on Linux virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in + * this field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * @member {string} [osProfile.adminPassword] Specifies the password of the + * administrator account.

    **Minimum-length (Windows):** 8 characters + *

    **Minimum-length (Linux):** 6 characters

    **Max-length + * (Windows):** 123 characters

    **Max-length (Linux):** 72 characters + *

    **Complexity requirements:** 3 out of 4 conditions below need to + * be fulfilled
    Has lower characters
    Has upper characters
    Has a + * digit
    Has a special character (Regex match [\W_])

    + * **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", + * "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", + * "iloveyou!"

    For resetting the password, see [How to reset the + * Remote Desktop service or its login password in a Windows + * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    For resetting root password, see [Manage users, SSH, and check or + * repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + * @member {string} [osProfile.customData] Specifies a base-64 encoded string + * of custom data. The base-64 encoded string is decoded to a binary array + * that is saved as a file on the Virtual Machine. The maximum length of the + * binary array is 65535 bytes.

    For using cloud-init for your VM, + * see [Using cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * @member {object} [osProfile.windowsConfiguration] Specifies Windows + * operating system settings on the virtual machine. + * @member {boolean} [osProfile.windowsConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the + * virtual machine.

    When this property is not specified in the + * request body, default behavior is to set it to true. This will ensure + * that VM Agent is installed on the VM so that extensions can be added to + * the VM later. + * @member {boolean} [osProfile.windowsConfiguration.enableAutomaticUpdates] + * Indicates whether virtual machine is enabled for automatic updates. + * @member {string} [osProfile.windowsConfiguration.timeZone] Specifies the + * time zone of the virtual machine. e.g. "Pacific Standard Time" + * @member {array} [osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * @member {object} [osProfile.windowsConfiguration.winRM] Specifies the + * Windows Remote Management listeners. This enables remote Windows + * PowerShell. + * @member {array} [osProfile.windowsConfiguration.winRM.listeners] The list + * of Windows Remote Management listeners + * @member {object} [osProfile.linuxConfiguration] Specifies the Linux + * operating system settings on the virtual machine.

    For a list of + * supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * @member {boolean} + * [osProfile.linuxConfiguration.disablePasswordAuthentication] Specifies + * whether password authentication should be disabled. + * @member {object} [osProfile.linuxConfiguration.ssh] Specifies the ssh key + * configuration for a Linux OS. + * @member {array} [osProfile.linuxConfiguration.ssh.publicKeys] The list of + * SSH public keys used to authenticate with linux based VMs. + * @member {array} [osProfile.secrets] Specifies set of certificates that + * should be installed onto the virtual machine. + * @member {object} [networkProfile] Specifies the network interfaces of the + * virtual machine. + * @member {array} [networkProfile.networkInterfaces] Specifies the list of + * resource Ids for the network interfaces associated with the virtual + * machine. + * @member {object} [diagnosticsProfile] Specifies the boot diagnostic + * settings state.

    Minimum api-version: 2015-06-15. + * @member {object} [diagnosticsProfile.bootDiagnostics] Boot Diagnostics is + * a debugging feature which allows you to view Console Output and Screenshot + * to diagnose VM status.

    For Linux Virtual Machines, you can easily + * view the output of your console log.

    For both Windows and Linux + * virtual machines, Azure also enables you to see a screenshot of the VM + * from the hypervisor. + * @member {boolean} [diagnosticsProfile.bootDiagnostics.enabled] Whether + * boot diagnostics should be enabled on the Virtual Machine. + * @member {string} [diagnosticsProfile.bootDiagnostics.storageUri] Uri of + * the storage account to use for placing the console output and screenshot. + * @member {object} [availabilitySet] Specifies information about the + * availability set that the virtual machine should be assigned to. Virtual + * machines specified in the same availability set are allocated to different + * nodes to maximize availability. For more information about availability + * sets, see [Manage the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    For more information on Azure planned maintainance, see [Planned + * maintenance for virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Currently, a VM can only be added to availability set at creation + * time. An existing VM cannot be added to an availability set. + * @member {string} [availabilitySet.id] Resource Id + * @member {string} [provisioningState] The provisioning state, which only + * appears in the response. + * @member {object} [instanceView] The virtual machine instance view. + * @member {number} [instanceView.platformUpdateDomain] Specifies the update + * domain of the virtual machine. + * @member {number} [instanceView.platformFaultDomain] Specifies the fault + * domain of the virtual machine. + * @member {string} [instanceView.computerName] The computer name assigned to + * the virtual machine. + * @member {string} [instanceView.osName] The Operating System running on the + * virtual machine. + * @member {string} [instanceView.osVersion] The version of Operating System + * running on the virtual machine. + * @member {string} [instanceView.rdpThumbPrint] The Remote desktop + * certificate thumbprint. + * @member {object} [instanceView.vmAgent] The VM Agent running on the + * virtual machine. + * @member {string} [instanceView.vmAgent.vmAgentVersion] The VM Agent full + * version. + * @member {array} [instanceView.vmAgent.extensionHandlers] The virtual + * machine extension handler instance view. + * @member {array} [instanceView.vmAgent.statuses] The resource status + * information. + * @member {object} [instanceView.maintenanceRedeployStatus] The Maintenance + * Operation status on the virtual machine. + * @member {boolean} + * [instanceView.maintenanceRedeployStatus.isCustomerInitiatedMaintenanceAllowed] + * True, if customer is allowed to perform Maintenance. + * @member {date} + * [instanceView.maintenanceRedeployStatus.preMaintenanceWindowStartTime] + * Start Time for the Pre Maintenance Window. + * @member {date} + * [instanceView.maintenanceRedeployStatus.preMaintenanceWindowEndTime] End + * Time for the Pre Maintenance Window. + * @member {date} + * [instanceView.maintenanceRedeployStatus.maintenanceWindowStartTime] Start + * Time for the Maintenance Window. + * @member {date} + * [instanceView.maintenanceRedeployStatus.maintenanceWindowEndTime] End Time + * for the Maintenance Window. + * @member {string} + * [instanceView.maintenanceRedeployStatus.lastOperationResultCode] The Last + * Maintenance Operation Result Code. Possible values include: 'None', + * 'RetryLater', 'MaintenanceAborted', 'MaintenanceCompleted' + * @member {string} + * [instanceView.maintenanceRedeployStatus.lastOperationMessage] Message + * returned for the last Maintenance Operation. + * @member {array} [instanceView.disks] The virtual machine disk information. + * @member {array} [instanceView.extensions] The extensions information. + * @member {object} [instanceView.bootDiagnostics] Boot Diagnostics is a + * debugging feature which allows you to view Console Output and Screenshot + * to diagnose VM status.

    For Linux Virtual Machines, you can easily + * view the output of your console log.

    For both Windows and Linux + * virtual machines, Azure also enables you to see a screenshot of the VM + * from the hypervisor. + * @member {string} [instanceView.bootDiagnostics.consoleScreenshotBlobUri] + * The console screenshot blob URI. + * @member {string} [instanceView.bootDiagnostics.serialConsoleLogBlobUri] + * The Linux serial console log blob Uri. + * @member {array} [instanceView.statuses] The resource status information. + * @member {string} [licenseType] Specifies that the image or disk that is + * being used was licensed on-premises. This element is only used for images + * that contain the Windows Server operating system.

    Possible values + * are:

    Windows_Client

    Windows_Server

    If this + * element is included in a request for an update, the value must match the + * initial value. This value cannot be updated.

    For more + * information, see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Minimum api-version: 2015-06-15 + * @member {string} [vmId] Specifies the VM unique ID which is a 128-bits + * identifier that is encoded and stored in all Azure IaaS VMs SMBIOS and can + * be read using platform BIOS commands. + * @member {object} [identity] The identity of the virtual machine, if + * configured. + * @member {string} [identity.principalId] The principal id of virtual + * machine identity. This property will only be provided for a system + * assigned identity. + * @member {string} [identity.tenantId] The tenant id associated with the + * virtual machine. This property will only be provided for a system assigned + * identity. + * @member {string} [identity.type] The type of identity used for the virtual + * machine. The type 'SystemAssigned, UserAssigned' includes both an + * implicitly created identity and a set of user assigned identities. The + * type 'None' will remove any identities from the virtual machine. Possible + * values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, + * UserAssigned', 'None' + * @member {array} [identity.identityIds] The list of user identities + * associated with the Virtual Machine. The user identity references will be + * ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @member {array} [zones] The virtual machine zones. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VirtualMachineUpdate + * + * @returns {object} metadata of VirtualMachineUpdate + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineUpdate', + type: { + name: 'Composite', + className: 'VirtualMachineUpdate', + modelProperties: { + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + plan: { + required: false, + serializedName: 'plan', + type: { + name: 'Composite', + className: 'Plan' + } + }, + hardwareProfile: { + required: false, + serializedName: 'properties.hardwareProfile', + type: { + name: 'Composite', + className: 'HardwareProfile' + } + }, + storageProfile: { + required: false, + serializedName: 'properties.storageProfile', + type: { + name: 'Composite', + className: 'StorageProfile' + } + }, + osProfile: { + required: false, + serializedName: 'properties.osProfile', + type: { + name: 'Composite', + className: 'OSProfile' + } + }, + networkProfile: { + required: false, + serializedName: 'properties.networkProfile', + type: { + name: 'Composite', + className: 'NetworkProfile' + } + }, + diagnosticsProfile: { + required: false, + serializedName: 'properties.diagnosticsProfile', + type: { + name: 'Composite', + className: 'DiagnosticsProfile' + } + }, + availabilitySet: { + required: false, + serializedName: 'properties.availabilitySet', + type: { + name: 'Composite', + className: 'SubResource' + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + instanceView: { + required: false, + readOnly: true, + serializedName: 'properties.instanceView', + type: { + name: 'Composite', + className: 'VirtualMachineInstanceView' + } + }, + licenseType: { + required: false, + serializedName: 'properties.licenseType', + type: { + name: 'String' + } + }, + vmId: { + required: false, + readOnly: true, + serializedName: 'properties.vmId', + type: { + name: 'String' + } + }, + identity: { + required: false, + serializedName: 'identity', + type: { + name: 'Composite', + className: 'VirtualMachineIdentity' + } + }, + zones: { + required: false, + serializedName: 'zones', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = VirtualMachineUpdate; diff --git a/lib/services/computeManagement2/lib/lib/models/winRMConfiguration.js b/lib/services/computeManagement2/lib/lib/models/winRMConfiguration.js new file mode 100644 index 0000000000..0ce512bfb7 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/winRMConfiguration.js @@ -0,0 +1,63 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Describes Windows Remote Management configuration of the VM + * + */ +class WinRMConfiguration { + /** + * Create a WinRMConfiguration. + * @member {array} [listeners] The list of Windows Remote Management + * listeners + */ + constructor() { + } + + /** + * Defines the metadata of WinRMConfiguration + * + * @returns {object} metadata of WinRMConfiguration + * + */ + mapper() { + return { + required: false, + serializedName: 'WinRMConfiguration', + type: { + name: 'Composite', + className: 'WinRMConfiguration', + modelProperties: { + listeners: { + required: false, + serializedName: 'listeners', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'WinRMListenerElementType', + type: { + name: 'Composite', + className: 'WinRMListener' + } + } + } + } + } + } + }; + } +} + +module.exports = WinRMConfiguration; diff --git a/lib/services/computeManagement2/lib/lib/models/winRMListener.js b/lib/services/computeManagement2/lib/lib/models/winRMListener.js new file mode 100644 index 0000000000..cf839b3671 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/winRMListener.js @@ -0,0 +1,70 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Describes Protocol and thumbprint of Windows Remote Management listener + * + */ +class WinRMListener { + /** + * Create a WinRMListener. + * @member {string} [protocol] Specifies the protocol of listener.

    + * Possible values are:
    **http**

    **https**. Possible values + * include: 'Http', 'Https' + * @member {string} [certificateUrl] This is the URL of a certificate that + * has been uploaded to Key Vault as a secret. For adding a secret to the Key + * Vault, see [Add a key or secret to the key + * vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). + * In this case, your certificate needs to be It is the Base64 encoding of + * the following JSON Object which is encoded in UTF-8:

    {
    + * "data":"",
    "dataType":"pfx",
    + * "password":""
    } + */ + constructor() { + } + + /** + * Defines the metadata of WinRMListener + * + * @returns {object} metadata of WinRMListener + * + */ + mapper() { + return { + required: false, + serializedName: 'WinRMListener', + type: { + name: 'Composite', + className: 'WinRMListener', + modelProperties: { + protocol: { + required: false, + serializedName: 'protocol', + type: { + name: 'Enum', + allowedValues: [ 'Http', 'Https' ] + } + }, + certificateUrl: { + required: false, + serializedName: 'certificateUrl', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = WinRMListener; diff --git a/lib/services/computeManagement2/lib/lib/models/windowsConfiguration.js b/lib/services/computeManagement2/lib/lib/models/windowsConfiguration.js new file mode 100644 index 0000000000..c3cf889c8d --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/models/windowsConfiguration.js @@ -0,0 +1,106 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Specifies Windows operating system settings on the virtual machine. + * + */ +class WindowsConfiguration { + /** + * Create a WindowsConfiguration. + * @member {boolean} [provisionVMAgent] Indicates whether virtual machine + * agent should be provisioned on the virtual machine.

    When this + * property is not specified in the request body, default behavior is to set + * it to true. This will ensure that VM Agent is installed on the VM so that + * extensions can be added to the VM later. + * @member {boolean} [enableAutomaticUpdates] Indicates whether virtual + * machine is enabled for automatic updates. + * @member {string} [timeZone] Specifies the time zone of the virtual + * machine. e.g. "Pacific Standard Time" + * @member {array} [additionalUnattendContent] Specifies additional base-64 + * encoded XML formatted information that can be included in the Unattend.xml + * file, which is used by Windows Setup. + * @member {object} [winRM] Specifies the Windows Remote Management + * listeners. This enables remote Windows PowerShell. + * @member {array} [winRM.listeners] The list of Windows Remote Management + * listeners + */ + constructor() { + } + + /** + * Defines the metadata of WindowsConfiguration + * + * @returns {object} metadata of WindowsConfiguration + * + */ + mapper() { + return { + required: false, + serializedName: 'WindowsConfiguration', + type: { + name: 'Composite', + className: 'WindowsConfiguration', + modelProperties: { + provisionVMAgent: { + required: false, + serializedName: 'provisionVMAgent', + type: { + name: 'Boolean' + } + }, + enableAutomaticUpdates: { + required: false, + serializedName: 'enableAutomaticUpdates', + type: { + name: 'Boolean' + } + }, + timeZone: { + required: false, + serializedName: 'timeZone', + type: { + name: 'String' + } + }, + additionalUnattendContent: { + required: false, + serializedName: 'additionalUnattendContent', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'AdditionalUnattendContentElementType', + type: { + name: 'Composite', + className: 'AdditionalUnattendContent' + } + } + } + }, + winRM: { + required: false, + serializedName: 'winRM', + type: { + name: 'Composite', + className: 'WinRMConfiguration' + } + } + } + } + }; + } +} + +module.exports = WindowsConfiguration; diff --git a/lib/services/computeManagement2/lib/lib/operations/availabilitySets.js b/lib/services/computeManagement2/lib/lib/operations/availabilitySets.js new file mode 100644 index 0000000000..292da5c63a --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/operations/availabilitySets.js @@ -0,0 +1,1586 @@ +/* + * 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; + +/** + * Create or update an availability set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} availabilitySetName The name of the availability set. + * + * @param {object} parameters Parameters supplied to the Create Availability + * Set operation. + * + * @param {number} [parameters.platformUpdateDomainCount] Update Domain count. + * + * @param {number} [parameters.platformFaultDomainCount] Fault Domain count. + * + * @param {array} [parameters.virtualMachines] A list of references to all + * virtual machines in the availability set. + * + * @param {object} [parameters.sku] Sku of the availability set + * + * @param {string} [parameters.sku.name] The sku name. + * + * @param {string} [parameters.sku.tier] Specifies the tier of virtual machines + * in a scale set.

    Possible Values:

    **Standard**

    **Basic** + * + * @param {number} [parameters.sku.capacity] Specifies the number of virtual + * machines in the scale set. + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @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 AvailabilitySet} 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 _createOrUpdate(resourceGroupName, availabilitySetName, 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.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (availabilitySetName === null || availabilitySetName === undefined || typeof availabilitySetName.valueOf() !== 'string') { + throw new Error('availabilitySetName 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.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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{availabilitySetName}', encodeURIComponent(availabilitySetName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['AvailabilitySet']().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['AvailabilitySet']().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); + }); +} + +/** + * Update an availability set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} availabilitySetName The name of the availability set. + * + * @param {object} parameters Parameters supplied to the Update Availability + * Set operation. + * + * @param {number} [parameters.platformUpdateDomainCount] Update Domain count. + * + * @param {number} [parameters.platformFaultDomainCount] Fault Domain count. + * + * @param {array} [parameters.virtualMachines] A list of references to all + * virtual machines in the availability set. + * + * @param {object} [parameters.sku] Sku of the availability set + * + * @param {string} [parameters.sku.name] The sku name. + * + * @param {string} [parameters.sku.tier] Specifies the tier of virtual machines + * in a scale set.

    Possible Values:

    **Standard**

    **Basic** + * + * @param {number} [parameters.sku.capacity] Specifies the number of virtual + * machines in the scale set. + * + * @param {object} [parameters.tags] Resource tags + * + * @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 AvailabilitySet} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _update(resourceGroupName, availabilitySetName, 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.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (availabilitySetName === null || availabilitySetName === undefined || typeof availabilitySetName.valueOf() !== 'string') { + throw new Error('availabilitySetName 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.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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{availabilitySetName}', encodeURIComponent(availabilitySetName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['AvailabilitySetUpdate']().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['AvailabilitySet']().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); + }); +} + +/** + * Delete an availability set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} availabilitySetName The name of the availability set. + * + * @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 OperationStatusResponse} 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 _deleteMethod(resourceGroupName, availabilitySetName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (availabilitySetName === null || availabilitySetName === undefined || typeof availabilitySetName.valueOf() !== 'string') { + throw new Error('availabilitySetName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{availabilitySetName}', encodeURIComponent(availabilitySetName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // 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['OperationStatusResponse']().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); + }); +} + +/** + * Retrieves information about an availability set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} availabilitySetName The name of the availability set. + * + * @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 AvailabilitySet} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, availabilitySetName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (availabilitySetName === null || availabilitySetName === undefined || typeof availabilitySetName.valueOf() !== 'string') { + throw new Error('availabilitySetName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{availabilitySetName}', encodeURIComponent(availabilitySetName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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['AvailabilitySet']().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); + }); +} + +/** + * Lists all availability sets in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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 AvailabilitySetListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(resourceGroupName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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['AvailabilitySetListResult']().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); + }); +} + +/** + * Lists all available virtual machine sizes that can be used to create a new + * virtual machine in an existing availability set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} availabilitySetName The name of the availability set. + * + * @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 VirtualMachineSizeListResult} 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 _listAvailableSizes(resourceGroupName, availabilitySetName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (availabilitySetName === null || availabilitySetName === undefined || typeof availabilitySetName.valueOf() !== 'string') { + throw new Error('availabilitySetName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}/vmSizes'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{availabilitySetName}', encodeURIComponent(availabilitySetName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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['VirtualMachineSizeListResult']().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 AvailabilitySets. */ +class AvailabilitySets { + /** + * Create a AvailabilitySets. + * @param {ComputeManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._createOrUpdate = _createOrUpdate; + this._update = _update; + this._deleteMethod = _deleteMethod; + this._get = _get; + this._list = _list; + this._listAvailableSizes = _listAvailableSizes; + } + + /** + * Create or update an availability set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} availabilitySetName The name of the availability set. + * + * @param {object} parameters Parameters supplied to the Create Availability + * Set operation. + * + * @param {number} [parameters.platformUpdateDomainCount] Update Domain count. + * + * @param {number} [parameters.platformFaultDomainCount] Fault Domain count. + * + * @param {array} [parameters.virtualMachines] A list of references to all + * virtual machines in the availability set. + * + * @param {object} [parameters.sku] Sku of the availability set + * + * @param {string} [parameters.sku.name] The sku name. + * + * @param {string} [parameters.sku.tier] Specifies the tier of virtual machines + * in a scale set.

    Possible Values:

    **Standard**

    **Basic** + * + * @param {number} [parameters.sku.capacity] Specifies the number of virtual + * machines in the scale set. + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @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. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, availabilitySetName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, availabilitySetName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Create or update an availability set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} availabilitySetName The name of the availability set. + * + * @param {object} parameters Parameters supplied to the Create Availability + * Set operation. + * + * @param {number} [parameters.platformUpdateDomainCount] Update Domain count. + * + * @param {number} [parameters.platformFaultDomainCount] Fault Domain count. + * + * @param {array} [parameters.virtualMachines] A list of references to all + * virtual machines in the availability set. + * + * @param {object} [parameters.sku] Sku of the availability set + * + * @param {string} [parameters.sku.name] The sku name. + * + * @param {string} [parameters.sku.tier] Specifies the tier of virtual machines + * in a scale set.

    Possible Values:

    **Standard**

    **Basic** + * + * @param {number} [parameters.sku.capacity] Specifies the number of virtual + * machines in the scale set. + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @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 {AvailabilitySet} - 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 AvailabilitySet} 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. + */ + createOrUpdate(resourceGroupName, availabilitySetName, 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._createOrUpdate(resourceGroupName, availabilitySetName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, availabilitySetName, parameters, options, optionalCallback); + } + } + + /** + * Update an availability set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} availabilitySetName The name of the availability set. + * + * @param {object} parameters Parameters supplied to the Update Availability + * Set operation. + * + * @param {number} [parameters.platformUpdateDomainCount] Update Domain count. + * + * @param {number} [parameters.platformFaultDomainCount] Fault Domain count. + * + * @param {array} [parameters.virtualMachines] A list of references to all + * virtual machines in the availability set. + * + * @param {object} [parameters.sku] Sku of the availability set + * + * @param {string} [parameters.sku.name] The sku name. + * + * @param {string} [parameters.sku.tier] Specifies the tier of virtual machines + * in a scale set.

    Possible Values:

    **Standard**

    **Basic** + * + * @param {number} [parameters.sku.capacity] Specifies the number of virtual + * machines in the scale set. + * + * @param {object} [parameters.tags] Resource tags + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateWithHttpOperationResponse(resourceGroupName, availabilitySetName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._update(resourceGroupName, availabilitySetName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Update an availability set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} availabilitySetName The name of the availability set. + * + * @param {object} parameters Parameters supplied to the Update Availability + * Set operation. + * + * @param {number} [parameters.platformUpdateDomainCount] Update Domain count. + * + * @param {number} [parameters.platformFaultDomainCount] Fault Domain count. + * + * @param {array} [parameters.virtualMachines] A list of references to all + * virtual machines in the availability set. + * + * @param {object} [parameters.sku] Sku of the availability set + * + * @param {string} [parameters.sku.name] The sku name. + * + * @param {string} [parameters.sku.tier] Specifies the tier of virtual machines + * in a scale set.

    Possible Values:

    **Standard**

    **Basic** + * + * @param {number} [parameters.sku.capacity] Specifies the number of virtual + * machines in the scale set. + * + * @param {object} [parameters.tags] Resource tags + * + * @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 {AvailabilitySet} - 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 AvailabilitySet} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + update(resourceGroupName, availabilitySetName, 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._update(resourceGroupName, availabilitySetName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._update(resourceGroupName, availabilitySetName, parameters, options, optionalCallback); + } + } + + /** + * Delete an availability set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} availabilitySetName The name of the availability set. + * + * @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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, availabilitySetName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, availabilitySetName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Delete an availability set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} availabilitySetName The name of the availability set. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + deleteMethod(resourceGroupName, availabilitySetName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, availabilitySetName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, availabilitySetName, options, optionalCallback); + } + } + + /** + * Retrieves information about an availability set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} availabilitySetName The name of the availability set. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, availabilitySetName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, availabilitySetName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Retrieves information about an availability set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} availabilitySetName The name of the availability set. + * + * @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 {AvailabilitySet} - 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 AvailabilitySet} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, availabilitySetName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(resourceGroupName, availabilitySetName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, availabilitySetName, options, optionalCallback); + } + } + + /** + * Lists all availability sets in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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. + */ + listWithHttpOperationResponse(resourceGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(resourceGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all availability sets in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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 {AvailabilitySetListResult} - 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 AvailabilitySetListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + list(resourceGroupName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._list(resourceGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(resourceGroupName, options, optionalCallback); + } + } + + /** + * Lists all available virtual machine sizes that can be used to create a new + * virtual machine in an existing availability set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} availabilitySetName The name of the availability set. + * + * @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. + */ + listAvailableSizesWithHttpOperationResponse(resourceGroupName, availabilitySetName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listAvailableSizes(resourceGroupName, availabilitySetName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all available virtual machine sizes that can be used to create a new + * virtual machine in an existing availability set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} availabilitySetName The name of the availability set. + * + * @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 {VirtualMachineSizeListResult} - 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 VirtualMachineSizeListResult} 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. + */ + listAvailableSizes(resourceGroupName, availabilitySetName, 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._listAvailableSizes(resourceGroupName, availabilitySetName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listAvailableSizes(resourceGroupName, availabilitySetName, options, optionalCallback); + } + } + +} + +module.exports = AvailabilitySets; diff --git a/lib/services/computeManagement2/lib/lib/operations/containerServices.js b/lib/services/computeManagement2/lib/lib/operations/containerServices.js new file mode 100644 index 0000000000..43c1c227e0 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/operations/containerServices.js @@ -0,0 +1,2473 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * @summary Gets a list of container services in the specified subscription. + * + * Gets a list of container services in the specified subscription. The + * operation returns properties of each container service including state, + * orchestrator, number of masters and agents, and FQDNs of masters and agents. + * + * @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 ContainerServiceListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-01-31'; + // 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.ContainerService/containerServices'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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['ContainerServiceListResult']().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 Creates or updates a container service. + * + * Creates or updates a container service with the specified configuration of + * orchestrator, masters, and agents. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} containerServiceName The name of the container service in + * the specified subscription and resource group. + * + * @param {object} parameters Parameters supplied to the Create or Update a + * Container Service operation. + * + * @param {object} [parameters.orchestratorProfile] Properties of the + * orchestrator. + * + * @param {string} parameters.orchestratorProfile.orchestratorType The + * orchestrator to use to manage container service cluster resources. Valid + * values are Swarm, DCOS, and Custom. Possible values include: 'Swarm', + * 'DCOS', 'Custom', 'Kubernetes' + * + * @param {object} [parameters.customProfile] Properties for custom clusters. + * + * @param {string} parameters.customProfile.orchestrator The name of the custom + * orchestrator to use. + * + * @param {object} [parameters.servicePrincipalProfile] Properties for cluster + * service principals. + * + * @param {string} parameters.servicePrincipalProfile.clientId The ID for the + * service principal. + * + * @param {string} parameters.servicePrincipalProfile.secret The secret + * password associated with the service principal. + * + * @param {object} parameters.masterProfile Properties of master agents. + * + * @param {number} [parameters.masterProfile.count] Number of masters (VMs) in + * the container service cluster. Allowed values are 1, 3, and 5. The default + * value is 1. + * + * @param {string} parameters.masterProfile.dnsPrefix DNS prefix to be used to + * create the FQDN for master. + * + * @param {array} parameters.agentPoolProfiles Properties of the agent pool. + * + * @param {object} [parameters.windowsProfile] Properties of Windows VMs. + * + * @param {string} parameters.windowsProfile.adminUsername The administrator + * username to use for Windows VMs. + * + * @param {string} parameters.windowsProfile.adminPassword The administrator + * password to use for Windows VMs. + * + * @param {object} parameters.linuxProfile Properties of Linux VMs. + * + * @param {string} parameters.linuxProfile.adminUsername The administrator + * username to use for Linux VMs. + * + * @param {object} parameters.linuxProfile.ssh The ssh key configuration for + * Linux VMs. + * + * @param {array} parameters.linuxProfile.ssh.publicKeys the list of SSH public + * keys used to authenticate with Linux-based VMs. + * + * @param {object} [parameters.diagnosticsProfile] Properties of the diagnostic + * agent. + * + * @param {object} parameters.diagnosticsProfile.vmDiagnostics Profile for the + * container service VM diagnostic agent. + * + * @param {boolean} parameters.diagnosticsProfile.vmDiagnostics.enabled Whether + * the VM diagnostic agent is provisioned on the VM. + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @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 ContainerService} 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 _createOrUpdate(resourceGroupName, containerServiceName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginCreateOrUpdate(resourceGroupName, containerServiceName, parameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ContainerService']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * @summary Gets the properties of the specified container service. + * + * Gets the properties of the specified container service in the specified + * subscription and resource group. The operation returns the properties + * including state, orchestrator, number of masters and agents, and FQDNs of + * masters and agents. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} containerServiceName The name of the container service in + * the specified subscription and resource group. + * + * @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 ContainerService} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, containerServiceName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-01-31'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (containerServiceName === null || containerServiceName === undefined || typeof containerServiceName.valueOf() !== 'string') { + throw new Error('containerServiceName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{containerServiceName}', encodeURIComponent(containerServiceName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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['ContainerService']().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 Deletes the specified container service. + * + * Deletes the specified container service in the specified subscription and + * resource group. The operation does not delete other resources created as + * part of creating a container service, including storage accounts, VMs, and + * availability sets. All the other resources created with the container + * service are part of the same resource group and can be deleted individually. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} containerServiceName The name of the container service in + * the specified subscription and resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteMethod(resourceGroupName, containerServiceName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginDeleteMethod(resourceGroupName, containerServiceName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * @summary Gets a list of container services in the specified resource group. + * + * Gets a list of container services in the specified subscription and resource + * group. The operation returns properties of each container service including + * state, orchestrator, number of masters and agents, and FQDNs of masters and + * agents. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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 ContainerServiceListResult} 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 _listByResourceGroup(resourceGroupName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-01-31'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (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}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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['ContainerServiceListResult']().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 Creates or updates a container service. + * + * Creates or updates a container service with the specified configuration of + * orchestrator, masters, and agents. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} containerServiceName The name of the container service in + * the specified subscription and resource group. + * + * @param {object} parameters Parameters supplied to the Create or Update a + * Container Service operation. + * + * @param {object} [parameters.orchestratorProfile] Properties of the + * orchestrator. + * + * @param {string} parameters.orchestratorProfile.orchestratorType The + * orchestrator to use to manage container service cluster resources. Valid + * values are Swarm, DCOS, and Custom. Possible values include: 'Swarm', + * 'DCOS', 'Custom', 'Kubernetes' + * + * @param {object} [parameters.customProfile] Properties for custom clusters. + * + * @param {string} parameters.customProfile.orchestrator The name of the custom + * orchestrator to use. + * + * @param {object} [parameters.servicePrincipalProfile] Properties for cluster + * service principals. + * + * @param {string} parameters.servicePrincipalProfile.clientId The ID for the + * service principal. + * + * @param {string} parameters.servicePrincipalProfile.secret The secret + * password associated with the service principal. + * + * @param {object} parameters.masterProfile Properties of master agents. + * + * @param {number} [parameters.masterProfile.count] Number of masters (VMs) in + * the container service cluster. Allowed values are 1, 3, and 5. The default + * value is 1. + * + * @param {string} parameters.masterProfile.dnsPrefix DNS prefix to be used to + * create the FQDN for master. + * + * @param {array} parameters.agentPoolProfiles Properties of the agent pool. + * + * @param {object} [parameters.windowsProfile] Properties of Windows VMs. + * + * @param {string} parameters.windowsProfile.adminUsername The administrator + * username to use for Windows VMs. + * + * @param {string} parameters.windowsProfile.adminPassword The administrator + * password to use for Windows VMs. + * + * @param {object} parameters.linuxProfile Properties of Linux VMs. + * + * @param {string} parameters.linuxProfile.adminUsername The administrator + * username to use for Linux VMs. + * + * @param {object} parameters.linuxProfile.ssh The ssh key configuration for + * Linux VMs. + * + * @param {array} parameters.linuxProfile.ssh.publicKeys the list of SSH public + * keys used to authenticate with Linux-based VMs. + * + * @param {object} [parameters.diagnosticsProfile] Properties of the diagnostic + * agent. + * + * @param {object} parameters.diagnosticsProfile.vmDiagnostics Profile for the + * container service VM diagnostic agent. + * + * @param {boolean} parameters.diagnosticsProfile.vmDiagnostics.enabled Whether + * the VM diagnostic agent is provisioned on the VM. + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @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 ContainerService} 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 _beginCreateOrUpdate(resourceGroupName, containerServiceName, 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.'); + } + let apiVersion = '2017-01-31'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (containerServiceName === null || containerServiceName === undefined || typeof containerServiceName.valueOf() !== 'string') { + throw new Error('containerServiceName 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.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}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{containerServiceName}', encodeURIComponent(containerServiceName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['ContainerService']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ContainerService']().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); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ContainerService']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + // Deserialize Response + if (statusCode === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ContainerService']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError2 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError2.request = msRest.stripRequest(httpRequest); + deserializationError2.response = msRest.stripResponse(response); + return callback(deserializationError2); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Deletes the specified container service. + * + * Deletes the specified container service in the specified subscription and + * resource group. The operation does not delete other resources created as + * part of creating a container service, including storage accounts, VMs, and + * availability sets. All the other resources created with the container + * service are part of the same resource group and can be deleted individually. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} containerServiceName The name of the container service in + * the specified subscription and resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginDeleteMethod(resourceGroupName, containerServiceName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-01-31'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (containerServiceName === null || containerServiceName === undefined || typeof containerServiceName.valueOf() !== 'string') { + throw new Error('containerServiceName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{containerServiceName}', encodeURIComponent(containerServiceName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 202 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Gets a list of container services in the specified subscription. + * + * Gets a list of container services in the specified subscription. The + * operation returns properties of each container service including state, + * orchestrator, number of masters and agents, and FQDNs of masters and agents. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ContainerServiceListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ContainerServiceListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Gets a list of container services in the specified resource group. + * + * Gets a list of container services in the specified subscription and resource + * group. The operation returns properties of each container service including + * state, orchestrator, number of masters and agents, and FQDNs of masters and + * agents. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ContainerServiceListResult} 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 _listByResourceGroupNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ContainerServiceListResult']().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 ContainerServices. */ +class ContainerServices { + /** + * Create a ContainerServices. + * @param {ComputeManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._createOrUpdate = _createOrUpdate; + this._get = _get; + this._deleteMethod = _deleteMethod; + this._listByResourceGroup = _listByResourceGroup; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginDeleteMethod = _beginDeleteMethod; + this._listNext = _listNext; + this._listByResourceGroupNext = _listByResourceGroupNext; + } + + /** + * @summary Gets a list of container services in the specified subscription. + * + * Gets a list of container services in the specified subscription. The + * operation returns properties of each container service including state, + * orchestrator, number of masters and agents, and FQDNs of masters and agents. + * + * @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. + */ + listWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets a list of container services in the specified subscription. + * + * Gets a list of container services in the specified subscription. The + * operation returns properties of each container service including state, + * orchestrator, number of masters and agents, and FQDNs of masters and agents. + * + * @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 {ContainerServiceListResult} - 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 ContainerServiceListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + list(options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._list(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(options, optionalCallback); + } + } + + /** + * @summary Creates or updates a container service. + * + * Creates or updates a container service with the specified configuration of + * orchestrator, masters, and agents. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} containerServiceName The name of the container service in + * the specified subscription and resource group. + * + * @param {object} parameters Parameters supplied to the Create or Update a + * Container Service operation. + * + * @param {object} [parameters.orchestratorProfile] Properties of the + * orchestrator. + * + * @param {string} parameters.orchestratorProfile.orchestratorType The + * orchestrator to use to manage container service cluster resources. Valid + * values are Swarm, DCOS, and Custom. Possible values include: 'Swarm', + * 'DCOS', 'Custom', 'Kubernetes' + * + * @param {object} [parameters.customProfile] Properties for custom clusters. + * + * @param {string} parameters.customProfile.orchestrator The name of the custom + * orchestrator to use. + * + * @param {object} [parameters.servicePrincipalProfile] Properties for cluster + * service principals. + * + * @param {string} parameters.servicePrincipalProfile.clientId The ID for the + * service principal. + * + * @param {string} parameters.servicePrincipalProfile.secret The secret + * password associated with the service principal. + * + * @param {object} parameters.masterProfile Properties of master agents. + * + * @param {number} [parameters.masterProfile.count] Number of masters (VMs) in + * the container service cluster. Allowed values are 1, 3, and 5. The default + * value is 1. + * + * @param {string} parameters.masterProfile.dnsPrefix DNS prefix to be used to + * create the FQDN for master. + * + * @param {array} parameters.agentPoolProfiles Properties of the agent pool. + * + * @param {object} [parameters.windowsProfile] Properties of Windows VMs. + * + * @param {string} parameters.windowsProfile.adminUsername The administrator + * username to use for Windows VMs. + * + * @param {string} parameters.windowsProfile.adminPassword The administrator + * password to use for Windows VMs. + * + * @param {object} parameters.linuxProfile Properties of Linux VMs. + * + * @param {string} parameters.linuxProfile.adminUsername The administrator + * username to use for Linux VMs. + * + * @param {object} parameters.linuxProfile.ssh The ssh key configuration for + * Linux VMs. + * + * @param {array} parameters.linuxProfile.ssh.publicKeys the list of SSH public + * keys used to authenticate with Linux-based VMs. + * + * @param {object} [parameters.diagnosticsProfile] Properties of the diagnostic + * agent. + * + * @param {object} parameters.diagnosticsProfile.vmDiagnostics Profile for the + * container service VM diagnostic agent. + * + * @param {boolean} parameters.diagnosticsProfile.vmDiagnostics.enabled Whether + * the VM diagnostic agent is provisioned on the VM. + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @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. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, containerServiceName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, containerServiceName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates or updates a container service. + * + * Creates or updates a container service with the specified configuration of + * orchestrator, masters, and agents. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} containerServiceName The name of the container service in + * the specified subscription and resource group. + * + * @param {object} parameters Parameters supplied to the Create or Update a + * Container Service operation. + * + * @param {object} [parameters.orchestratorProfile] Properties of the + * orchestrator. + * + * @param {string} parameters.orchestratorProfile.orchestratorType The + * orchestrator to use to manage container service cluster resources. Valid + * values are Swarm, DCOS, and Custom. Possible values include: 'Swarm', + * 'DCOS', 'Custom', 'Kubernetes' + * + * @param {object} [parameters.customProfile] Properties for custom clusters. + * + * @param {string} parameters.customProfile.orchestrator The name of the custom + * orchestrator to use. + * + * @param {object} [parameters.servicePrincipalProfile] Properties for cluster + * service principals. + * + * @param {string} parameters.servicePrincipalProfile.clientId The ID for the + * service principal. + * + * @param {string} parameters.servicePrincipalProfile.secret The secret + * password associated with the service principal. + * + * @param {object} parameters.masterProfile Properties of master agents. + * + * @param {number} [parameters.masterProfile.count] Number of masters (VMs) in + * the container service cluster. Allowed values are 1, 3, and 5. The default + * value is 1. + * + * @param {string} parameters.masterProfile.dnsPrefix DNS prefix to be used to + * create the FQDN for master. + * + * @param {array} parameters.agentPoolProfiles Properties of the agent pool. + * + * @param {object} [parameters.windowsProfile] Properties of Windows VMs. + * + * @param {string} parameters.windowsProfile.adminUsername The administrator + * username to use for Windows VMs. + * + * @param {string} parameters.windowsProfile.adminPassword The administrator + * password to use for Windows VMs. + * + * @param {object} parameters.linuxProfile Properties of Linux VMs. + * + * @param {string} parameters.linuxProfile.adminUsername The administrator + * username to use for Linux VMs. + * + * @param {object} parameters.linuxProfile.ssh The ssh key configuration for + * Linux VMs. + * + * @param {array} parameters.linuxProfile.ssh.publicKeys the list of SSH public + * keys used to authenticate with Linux-based VMs. + * + * @param {object} [parameters.diagnosticsProfile] Properties of the diagnostic + * agent. + * + * @param {object} parameters.diagnosticsProfile.vmDiagnostics Profile for the + * container service VM diagnostic agent. + * + * @param {boolean} parameters.diagnosticsProfile.vmDiagnostics.enabled Whether + * the VM diagnostic agent is provisioned on the VM. + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @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 {ContainerService} - 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 ContainerService} 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. + */ + createOrUpdate(resourceGroupName, containerServiceName, 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._createOrUpdate(resourceGroupName, containerServiceName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, containerServiceName, parameters, options, optionalCallback); + } + } + + /** + * @summary Gets the properties of the specified container service. + * + * Gets the properties of the specified container service in the specified + * subscription and resource group. The operation returns the properties + * including state, orchestrator, number of masters and agents, and FQDNs of + * masters and agents. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} containerServiceName The name of the container service in + * the specified subscription and resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, containerServiceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, containerServiceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets the properties of the specified container service. + * + * Gets the properties of the specified container service in the specified + * subscription and resource group. The operation returns the properties + * including state, orchestrator, number of masters and agents, and FQDNs of + * masters and agents. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} containerServiceName The name of the container service in + * the specified subscription and resource group. + * + * @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 {ContainerService} - 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 ContainerService} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, containerServiceName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(resourceGroupName, containerServiceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, containerServiceName, options, optionalCallback); + } + } + + /** + * @summary Deletes the specified container service. + * + * Deletes the specified container service in the specified subscription and + * resource group. The operation does not delete other resources created as + * part of creating a container service, including storage accounts, VMs, and + * availability sets. All the other resources created with the container + * service are part of the same resource group and can be deleted individually. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} containerServiceName The name of the container service in + * the specified subscription and resource group. + * + * @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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, containerServiceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, containerServiceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Deletes the specified container service. + * + * Deletes the specified container service in the specified subscription and + * resource group. The operation does not delete other resources created as + * part of creating a container service, including storage accounts, VMs, and + * availability sets. All the other resources created with the container + * service are part of the same resource group and can be deleted individually. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} containerServiceName The name of the container service in + * the specified subscription and resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName, containerServiceName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, containerServiceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, containerServiceName, options, optionalCallback); + } + } + + /** + * @summary Gets a list of container services in the specified resource group. + * + * Gets a list of container services in the specified subscription and resource + * group. The operation returns properties of each container service including + * state, orchestrator, number of masters and agents, and FQDNs of masters and + * agents. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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. + */ + listByResourceGroupWithHttpOperationResponse(resourceGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets a list of container services in the specified resource group. + * + * Gets a list of container services in the specified subscription and resource + * group. The operation returns properties of each container service including + * state, orchestrator, number of masters and agents, and FQDNs of masters and + * agents. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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 {ContainerServiceListResult} - 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 ContainerServiceListResult} 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. + */ + listByResourceGroup(resourceGroupName, 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._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByResourceGroup(resourceGroupName, options, optionalCallback); + } + } + + /** + * @summary Creates or updates a container service. + * + * Creates or updates a container service with the specified configuration of + * orchestrator, masters, and agents. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} containerServiceName The name of the container service in + * the specified subscription and resource group. + * + * @param {object} parameters Parameters supplied to the Create or Update a + * Container Service operation. + * + * @param {object} [parameters.orchestratorProfile] Properties of the + * orchestrator. + * + * @param {string} parameters.orchestratorProfile.orchestratorType The + * orchestrator to use to manage container service cluster resources. Valid + * values are Swarm, DCOS, and Custom. Possible values include: 'Swarm', + * 'DCOS', 'Custom', 'Kubernetes' + * + * @param {object} [parameters.customProfile] Properties for custom clusters. + * + * @param {string} parameters.customProfile.orchestrator The name of the custom + * orchestrator to use. + * + * @param {object} [parameters.servicePrincipalProfile] Properties for cluster + * service principals. + * + * @param {string} parameters.servicePrincipalProfile.clientId The ID for the + * service principal. + * + * @param {string} parameters.servicePrincipalProfile.secret The secret + * password associated with the service principal. + * + * @param {object} parameters.masterProfile Properties of master agents. + * + * @param {number} [parameters.masterProfile.count] Number of masters (VMs) in + * the container service cluster. Allowed values are 1, 3, and 5. The default + * value is 1. + * + * @param {string} parameters.masterProfile.dnsPrefix DNS prefix to be used to + * create the FQDN for master. + * + * @param {array} parameters.agentPoolProfiles Properties of the agent pool. + * + * @param {object} [parameters.windowsProfile] Properties of Windows VMs. + * + * @param {string} parameters.windowsProfile.adminUsername The administrator + * username to use for Windows VMs. + * + * @param {string} parameters.windowsProfile.adminPassword The administrator + * password to use for Windows VMs. + * + * @param {object} parameters.linuxProfile Properties of Linux VMs. + * + * @param {string} parameters.linuxProfile.adminUsername The administrator + * username to use for Linux VMs. + * + * @param {object} parameters.linuxProfile.ssh The ssh key configuration for + * Linux VMs. + * + * @param {array} parameters.linuxProfile.ssh.publicKeys the list of SSH public + * keys used to authenticate with Linux-based VMs. + * + * @param {object} [parameters.diagnosticsProfile] Properties of the diagnostic + * agent. + * + * @param {object} parameters.diagnosticsProfile.vmDiagnostics Profile for the + * container service VM diagnostic agent. + * + * @param {boolean} parameters.diagnosticsProfile.vmDiagnostics.enabled Whether + * the VM diagnostic agent is provisioned on the VM. + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @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. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, containerServiceName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, containerServiceName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates or updates a container service. + * + * Creates or updates a container service with the specified configuration of + * orchestrator, masters, and agents. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} containerServiceName The name of the container service in + * the specified subscription and resource group. + * + * @param {object} parameters Parameters supplied to the Create or Update a + * Container Service operation. + * + * @param {object} [parameters.orchestratorProfile] Properties of the + * orchestrator. + * + * @param {string} parameters.orchestratorProfile.orchestratorType The + * orchestrator to use to manage container service cluster resources. Valid + * values are Swarm, DCOS, and Custom. Possible values include: 'Swarm', + * 'DCOS', 'Custom', 'Kubernetes' + * + * @param {object} [parameters.customProfile] Properties for custom clusters. + * + * @param {string} parameters.customProfile.orchestrator The name of the custom + * orchestrator to use. + * + * @param {object} [parameters.servicePrincipalProfile] Properties for cluster + * service principals. + * + * @param {string} parameters.servicePrincipalProfile.clientId The ID for the + * service principal. + * + * @param {string} parameters.servicePrincipalProfile.secret The secret + * password associated with the service principal. + * + * @param {object} parameters.masterProfile Properties of master agents. + * + * @param {number} [parameters.masterProfile.count] Number of masters (VMs) in + * the container service cluster. Allowed values are 1, 3, and 5. The default + * value is 1. + * + * @param {string} parameters.masterProfile.dnsPrefix DNS prefix to be used to + * create the FQDN for master. + * + * @param {array} parameters.agentPoolProfiles Properties of the agent pool. + * + * @param {object} [parameters.windowsProfile] Properties of Windows VMs. + * + * @param {string} parameters.windowsProfile.adminUsername The administrator + * username to use for Windows VMs. + * + * @param {string} parameters.windowsProfile.adminPassword The administrator + * password to use for Windows VMs. + * + * @param {object} parameters.linuxProfile Properties of Linux VMs. + * + * @param {string} parameters.linuxProfile.adminUsername The administrator + * username to use for Linux VMs. + * + * @param {object} parameters.linuxProfile.ssh The ssh key configuration for + * Linux VMs. + * + * @param {array} parameters.linuxProfile.ssh.publicKeys the list of SSH public + * keys used to authenticate with Linux-based VMs. + * + * @param {object} [parameters.diagnosticsProfile] Properties of the diagnostic + * agent. + * + * @param {object} parameters.diagnosticsProfile.vmDiagnostics Profile for the + * container service VM diagnostic agent. + * + * @param {boolean} parameters.diagnosticsProfile.vmDiagnostics.enabled Whether + * the VM diagnostic agent is provisioned on the VM. + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @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 {ContainerService} - 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 ContainerService} 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. + */ + beginCreateOrUpdate(resourceGroupName, containerServiceName, 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._beginCreateOrUpdate(resourceGroupName, containerServiceName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, containerServiceName, parameters, options, optionalCallback); + } + } + + /** + * @summary Deletes the specified container service. + * + * Deletes the specified container service in the specified subscription and + * resource group. The operation does not delete other resources created as + * part of creating a container service, including storage accounts, VMs, and + * availability sets. All the other resources created with the container + * service are part of the same resource group and can be deleted individually. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} containerServiceName The name of the container service in + * the specified subscription and resource group. + * + * @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. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, containerServiceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, containerServiceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Deletes the specified container service. + * + * Deletes the specified container service in the specified subscription and + * resource group. The operation does not delete other resources created as + * part of creating a container service, including storage accounts, VMs, and + * availability sets. All the other resources created with the container + * service are part of the same resource group and can be deleted individually. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} containerServiceName The name of the container service in + * the specified subscription and resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(resourceGroupName, containerServiceName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, containerServiceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, containerServiceName, options, optionalCallback); + } + } + + /** + * @summary Gets a list of container services in the specified subscription. + * + * Gets a list of container services in the specified subscription. The + * operation returns properties of each container service including state, + * orchestrator, number of masters and agents, and FQDNs of masters and agents. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets a list of container services in the specified subscription. + * + * Gets a list of container services in the specified subscription. The + * operation returns properties of each container service including state, + * orchestrator, number of masters and agents, and FQDNs of masters and agents. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ContainerServiceListResult} - 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 ContainerServiceListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Gets a list of container services in the specified resource group. + * + * Gets a list of container services in the specified subscription and resource + * group. The operation returns properties of each container service including + * state, orchestrator, number of masters and agents, and FQDNs of masters and + * agents. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByResourceGroupNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets a list of container services in the specified resource group. + * + * Gets a list of container services in the specified subscription and resource + * group. The operation returns properties of each container service including + * state, orchestrator, number of masters and agents, and FQDNs of masters and + * agents. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ContainerServiceListResult} - 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 ContainerServiceListResult} 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. + */ + listByResourceGroupNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByResourceGroupNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = ContainerServices; diff --git a/lib/services/computeManagement2/lib/lib/operations/disks.js b/lib/services/computeManagement2/lib/lib/operations/disks.js new file mode 100644 index 0000000000..aeb9e01a49 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/operations/disks.js @@ -0,0 +1,4108 @@ +/* + * 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; + + +/** + * Creates or updates a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @param {object} disk Disk object supplied in the body of the Put disk + * operation. + * + * @param {object} [disk.sku] + * + * @param {string} [disk.sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS' + * + * @param {array} [disk.zones] The Logical zone list for Disk. + * + * @param {string} [disk.osType] The Operating System type. Possible values + * include: 'Windows', 'Linux' + * + * @param {object} disk.creationData Disk source information. CreationData + * information cannot be changed after the disk has been created. + * + * @param {string} disk.creationData.createOption This enumerates the possible + * sources of a disk's creation. Possible values include: 'Empty', 'Attach', + * 'FromImage', 'Import', 'Copy', 'Restore' + * + * @param {string} [disk.creationData.storageAccountId] If createOption is + * Import, the Azure Resource Manager identifier of the storage account + * containing the blob to import as a disk. Required only if the blob is in a + * different subscription + * + * @param {object} [disk.creationData.imageReference] Disk source information. + * + * @param {string} disk.creationData.imageReference.id A relative uri + * containing either a Platform Imgage Repository or user image reference. + * + * @param {number} [disk.creationData.imageReference.lun] If the disk is + * created from an image's data disk, this is an index that indicates which of + * the data disks in the image to use. For OS disks, this field is null. + * + * @param {string} [disk.creationData.sourceUri] If createOption is Import, + * this is the URI of a blob to be imported into a managed disk. + * + * @param {string} [disk.creationData.sourceResourceId] If createOption is + * Copy, this is the ARM id of the source snapshot or disk. + * + * @param {number} [disk.diskSizeGB] If creationData.createOption is Empty, + * this field is mandatory and it indicates the size of the VHD to create. If + * this field is present for updates or creation with other options, it + * indicates a resize. Resizes are only allowed if the disk is not attached to + * a running VM, and can only increase the disk's size. + * + * @param {object} [disk.encryptionSettings] Encryption settings for disk or + * snapshot + * + * @param {boolean} [disk.encryptionSettings.enabled] Set this flag to true and + * provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * encryption. Set this flag to false and remove DiskEncryptionKey and + * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the + * request object, the existing settings remain unchanged. + * + * @param {object} [disk.encryptionSettings.diskEncryptionKey] Key Vault Secret + * Url and vault id of the disk encryption key + * + * @param {object} disk.encryptionSettings.diskEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} disk.encryptionSettings.diskEncryptionKey.secretUrl Url + * pointing to a key or secret in KeyVault + * + * @param {object} [disk.encryptionSettings.keyEncryptionKey] Key Vault Key Url + * and vault id of the key encryption key + * + * @param {object} disk.encryptionSettings.keyEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} [disk.encryptionSettings.keyEncryptionKey.sourceVault.id] + * Resource Id + * + * @param {string} disk.encryptionSettings.keyEncryptionKey.keyUrl Url pointing + * to a key or secret in KeyVault + * + * @param {string} disk.location Resource location + * + * @param {object} [disk.tags] Resource tags + * + * @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 Disk} 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 _createOrUpdate(resourceGroupName, diskName, disk, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginCreateOrUpdate(resourceGroupName, diskName, disk, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Disk']().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); + }); + }); +} + + +/** + * Updates (patches) a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @param {object} disk Disk object supplied in the body of the Patch disk + * operation. + * + * @param {string} [disk.osType] the Operating System type. Possible values + * include: 'Windows', 'Linux' + * + * @param {number} [disk.diskSizeGB] If creationData.createOption is Empty, + * this field is mandatory and it indicates the size of the VHD to create. If + * this field is present for updates or creation with other options, it + * indicates a resize. Resizes are only allowed if the disk is not attached to + * a running VM, and can only increase the disk's size. + * + * @param {object} [disk.encryptionSettings] Encryption settings for disk or + * snapshot + * + * @param {boolean} [disk.encryptionSettings.enabled] Set this flag to true and + * provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * encryption. Set this flag to false and remove DiskEncryptionKey and + * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the + * request object, the existing settings remain unchanged. + * + * @param {object} [disk.encryptionSettings.diskEncryptionKey] Key Vault Secret + * Url and vault id of the disk encryption key + * + * @param {object} disk.encryptionSettings.diskEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} disk.encryptionSettings.diskEncryptionKey.secretUrl Url + * pointing to a key or secret in KeyVault + * + * @param {object} [disk.encryptionSettings.keyEncryptionKey] Key Vault Key Url + * and vault id of the key encryption key + * + * @param {object} disk.encryptionSettings.keyEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} [disk.encryptionSettings.keyEncryptionKey.sourceVault.id] + * Resource Id + * + * @param {string} disk.encryptionSettings.keyEncryptionKey.keyUrl Url pointing + * to a key or secret in KeyVault + * + * @param {object} [disk.tags] Resource tags + * + * @param {object} [disk.sku] + * + * @param {string} [disk.sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS' + * + * @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 Disk} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _update(resourceGroupName, diskName, disk, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginUpdate(resourceGroupName, diskName, disk, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Disk']().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); + }); + }); +} + +/** + * Gets information about a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @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 Disk} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, diskName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-04-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (diskName === null || diskName === undefined || typeof diskName.valueOf() !== 'string') { + throw new Error('diskName cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{diskName}', encodeURIComponent(diskName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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['Disk']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Deletes a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @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 OperationStatusResponse} 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 _deleteMethod(resourceGroupName, diskName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginDeleteMethod(resourceGroupName, diskName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().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); + }); + }); +} + +/** + * Lists all the disks under a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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 DiskList} 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 _listByResourceGroup(resourceGroupName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-04-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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['DiskList']().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); + }); +} + +/** + * Lists all the disks under a 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 DiskList} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-04-01'; + // 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.Compute/disks'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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['DiskList']().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); + }); +} + + +/** + * Grants access to a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @param {object} grantAccessData Access data object supplied in the body of + * the get disk access operation. + * + * @param {string} grantAccessData.access Possible values include: 'None', + * 'Read' + * + * @param {number} grantAccessData.durationInSeconds Time duration in seconds + * until the SAS access expires. + * + * @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 AccessUri} 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 _grantAccess(resourceGroupName, diskName, grantAccessData, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginGrantAccess(resourceGroupName, diskName, grantAccessData, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['AccessUri']().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); + }); + }); +} + + +/** + * Revokes access to a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @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 OperationStatusResponse} 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 _revokeAccess(resourceGroupName, diskName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginRevokeAccess(resourceGroupName, diskName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().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); + }); + }); +} + +/** + * Creates or updates a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @param {object} disk Disk object supplied in the body of the Put disk + * operation. + * + * @param {object} [disk.sku] + * + * @param {string} [disk.sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS' + * + * @param {array} [disk.zones] The Logical zone list for Disk. + * + * @param {string} [disk.osType] The Operating System type. Possible values + * include: 'Windows', 'Linux' + * + * @param {object} disk.creationData Disk source information. CreationData + * information cannot be changed after the disk has been created. + * + * @param {string} disk.creationData.createOption This enumerates the possible + * sources of a disk's creation. Possible values include: 'Empty', 'Attach', + * 'FromImage', 'Import', 'Copy', 'Restore' + * + * @param {string} [disk.creationData.storageAccountId] If createOption is + * Import, the Azure Resource Manager identifier of the storage account + * containing the blob to import as a disk. Required only if the blob is in a + * different subscription + * + * @param {object} [disk.creationData.imageReference] Disk source information. + * + * @param {string} disk.creationData.imageReference.id A relative uri + * containing either a Platform Imgage Repository or user image reference. + * + * @param {number} [disk.creationData.imageReference.lun] If the disk is + * created from an image's data disk, this is an index that indicates which of + * the data disks in the image to use. For OS disks, this field is null. + * + * @param {string} [disk.creationData.sourceUri] If createOption is Import, + * this is the URI of a blob to be imported into a managed disk. + * + * @param {string} [disk.creationData.sourceResourceId] If createOption is + * Copy, this is the ARM id of the source snapshot or disk. + * + * @param {number} [disk.diskSizeGB] If creationData.createOption is Empty, + * this field is mandatory and it indicates the size of the VHD to create. If + * this field is present for updates or creation with other options, it + * indicates a resize. Resizes are only allowed if the disk is not attached to + * a running VM, and can only increase the disk's size. + * + * @param {object} [disk.encryptionSettings] Encryption settings for disk or + * snapshot + * + * @param {boolean} [disk.encryptionSettings.enabled] Set this flag to true and + * provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * encryption. Set this flag to false and remove DiskEncryptionKey and + * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the + * request object, the existing settings remain unchanged. + * + * @param {object} [disk.encryptionSettings.diskEncryptionKey] Key Vault Secret + * Url and vault id of the disk encryption key + * + * @param {object} disk.encryptionSettings.diskEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} disk.encryptionSettings.diskEncryptionKey.secretUrl Url + * pointing to a key or secret in KeyVault + * + * @param {object} [disk.encryptionSettings.keyEncryptionKey] Key Vault Key Url + * and vault id of the key encryption key + * + * @param {object} disk.encryptionSettings.keyEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} [disk.encryptionSettings.keyEncryptionKey.sourceVault.id] + * Resource Id + * + * @param {string} disk.encryptionSettings.keyEncryptionKey.keyUrl Url pointing + * to a key or secret in KeyVault + * + * @param {string} disk.location Resource location + * + * @param {object} [disk.tags] Resource tags + * + * @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 Disk} 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 _beginCreateOrUpdate(resourceGroupName, diskName, disk, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-04-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (diskName === null || diskName === undefined || typeof diskName.valueOf() !== 'string') { + throw new Error('diskName cannot be null or undefined and it must be of type string.'); + } + if (disk === null || disk === undefined) { + throw new Error('disk cannot be null or undefined.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{diskName}', encodeURIComponent(diskName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (disk !== null && disk !== undefined) { + let requestModelMapper = new client.models['Disk']().mapper(); + requestModel = client.serialize(requestModelMapper, disk, 'disk'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(disk, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Disk']().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); + } + } + // Deserialize Response + if (statusCode === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Disk']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Updates (patches) a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @param {object} disk Disk object supplied in the body of the Patch disk + * operation. + * + * @param {string} [disk.osType] the Operating System type. Possible values + * include: 'Windows', 'Linux' + * + * @param {number} [disk.diskSizeGB] If creationData.createOption is Empty, + * this field is mandatory and it indicates the size of the VHD to create. If + * this field is present for updates or creation with other options, it + * indicates a resize. Resizes are only allowed if the disk is not attached to + * a running VM, and can only increase the disk's size. + * + * @param {object} [disk.encryptionSettings] Encryption settings for disk or + * snapshot + * + * @param {boolean} [disk.encryptionSettings.enabled] Set this flag to true and + * provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * encryption. Set this flag to false and remove DiskEncryptionKey and + * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the + * request object, the existing settings remain unchanged. + * + * @param {object} [disk.encryptionSettings.diskEncryptionKey] Key Vault Secret + * Url and vault id of the disk encryption key + * + * @param {object} disk.encryptionSettings.diskEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} disk.encryptionSettings.diskEncryptionKey.secretUrl Url + * pointing to a key or secret in KeyVault + * + * @param {object} [disk.encryptionSettings.keyEncryptionKey] Key Vault Key Url + * and vault id of the key encryption key + * + * @param {object} disk.encryptionSettings.keyEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} [disk.encryptionSettings.keyEncryptionKey.sourceVault.id] + * Resource Id + * + * @param {string} disk.encryptionSettings.keyEncryptionKey.keyUrl Url pointing + * to a key or secret in KeyVault + * + * @param {object} [disk.tags] Resource tags + * + * @param {object} [disk.sku] + * + * @param {string} [disk.sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS' + * + * @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 Disk} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginUpdate(resourceGroupName, diskName, disk, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-04-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (diskName === null || diskName === undefined || typeof diskName.valueOf() !== 'string') { + throw new Error('diskName cannot be null or undefined and it must be of type string.'); + } + if (disk === null || disk === undefined) { + throw new Error('disk cannot be null or undefined.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{diskName}', encodeURIComponent(diskName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (disk !== null && disk !== undefined) { + let requestModelMapper = new client.models['DiskUpdate']().mapper(); + requestModel = client.serialize(requestModelMapper, disk, 'disk'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(disk, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Disk']().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); + } + } + // Deserialize Response + if (statusCode === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Disk']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Deletes a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @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 OperationStatusResponse} 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 _beginDeleteMethod(resourceGroupName, diskName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-04-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (diskName === null || diskName === undefined || typeof diskName.valueOf() !== 'string') { + throw new Error('diskName cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{diskName}', encodeURIComponent(diskName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // 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['OperationStatusResponse']().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); + }); +} + +/** + * Grants access to a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @param {object} grantAccessData Access data object supplied in the body of + * the get disk access operation. + * + * @param {string} grantAccessData.access Possible values include: 'None', + * 'Read' + * + * @param {number} grantAccessData.durationInSeconds Time duration in seconds + * until the SAS access expires. + * + * @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 AccessUri} 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 _beginGrantAccess(resourceGroupName, diskName, grantAccessData, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-04-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (diskName === null || diskName === undefined || typeof diskName.valueOf() !== 'string') { + throw new Error('diskName cannot be null or undefined and it must be of type string.'); + } + if (grantAccessData === null || grantAccessData === undefined) { + throw new Error('grantAccessData cannot be null or undefined.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/beginGetAccess'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{diskName}', encodeURIComponent(diskName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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 (grantAccessData !== null && grantAccessData !== undefined) { + let requestModelMapper = new client.models['GrantAccessData']().mapper(); + requestModel = client.serialize(requestModelMapper, grantAccessData, 'grantAccessData'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(grantAccessData, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['AccessUri']().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); + }); +} + +/** + * Revokes access to a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @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 OperationStatusResponse} 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 _beginRevokeAccess(resourceGroupName, diskName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-04-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (diskName === null || diskName === undefined || typeof diskName.valueOf() !== 'string') { + throw new Error('diskName cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/endGetAccess'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{diskName}', encodeURIComponent(diskName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().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); + }); +} + +/** + * Lists all the disks under a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DiskList} 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 _listByResourceGroupNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DiskList']().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); + }); +} + +/** + * Lists all the disks under a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DiskList} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DiskList']().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 Disks. */ +class Disks { + /** + * Create a Disks. + * @param {ComputeManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._createOrUpdate = _createOrUpdate; + this._update = _update; + this._get = _get; + this._deleteMethod = _deleteMethod; + this._listByResourceGroup = _listByResourceGroup; + this._list = _list; + this._grantAccess = _grantAccess; + this._revokeAccess = _revokeAccess; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginUpdate = _beginUpdate; + this._beginDeleteMethod = _beginDeleteMethod; + this._beginGrantAccess = _beginGrantAccess; + this._beginRevokeAccess = _beginRevokeAccess; + this._listByResourceGroupNext = _listByResourceGroupNext; + this._listNext = _listNext; + } + + /** + * Creates or updates a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @param {object} disk Disk object supplied in the body of the Put disk + * operation. + * + * @param {object} [disk.sku] + * + * @param {string} [disk.sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS' + * + * @param {array} [disk.zones] The Logical zone list for Disk. + * + * @param {string} [disk.osType] The Operating System type. Possible values + * include: 'Windows', 'Linux' + * + * @param {object} disk.creationData Disk source information. CreationData + * information cannot be changed after the disk has been created. + * + * @param {string} disk.creationData.createOption This enumerates the possible + * sources of a disk's creation. Possible values include: 'Empty', 'Attach', + * 'FromImage', 'Import', 'Copy', 'Restore' + * + * @param {string} [disk.creationData.storageAccountId] If createOption is + * Import, the Azure Resource Manager identifier of the storage account + * containing the blob to import as a disk. Required only if the blob is in a + * different subscription + * + * @param {object} [disk.creationData.imageReference] Disk source information. + * + * @param {string} disk.creationData.imageReference.id A relative uri + * containing either a Platform Imgage Repository or user image reference. + * + * @param {number} [disk.creationData.imageReference.lun] If the disk is + * created from an image's data disk, this is an index that indicates which of + * the data disks in the image to use. For OS disks, this field is null. + * + * @param {string} [disk.creationData.sourceUri] If createOption is Import, + * this is the URI of a blob to be imported into a managed disk. + * + * @param {string} [disk.creationData.sourceResourceId] If createOption is + * Copy, this is the ARM id of the source snapshot or disk. + * + * @param {number} [disk.diskSizeGB] If creationData.createOption is Empty, + * this field is mandatory and it indicates the size of the VHD to create. If + * this field is present for updates or creation with other options, it + * indicates a resize. Resizes are only allowed if the disk is not attached to + * a running VM, and can only increase the disk's size. + * + * @param {object} [disk.encryptionSettings] Encryption settings for disk or + * snapshot + * + * @param {boolean} [disk.encryptionSettings.enabled] Set this flag to true and + * provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * encryption. Set this flag to false and remove DiskEncryptionKey and + * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the + * request object, the existing settings remain unchanged. + * + * @param {object} [disk.encryptionSettings.diskEncryptionKey] Key Vault Secret + * Url and vault id of the disk encryption key + * + * @param {object} disk.encryptionSettings.diskEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} disk.encryptionSettings.diskEncryptionKey.secretUrl Url + * pointing to a key or secret in KeyVault + * + * @param {object} [disk.encryptionSettings.keyEncryptionKey] Key Vault Key Url + * and vault id of the key encryption key + * + * @param {object} disk.encryptionSettings.keyEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} [disk.encryptionSettings.keyEncryptionKey.sourceVault.id] + * Resource Id + * + * @param {string} disk.encryptionSettings.keyEncryptionKey.keyUrl Url pointing + * to a key or secret in KeyVault + * + * @param {string} disk.location Resource location + * + * @param {object} [disk.tags] Resource tags + * + * @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. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, diskName, disk, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, diskName, disk, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @param {object} disk Disk object supplied in the body of the Put disk + * operation. + * + * @param {object} [disk.sku] + * + * @param {string} [disk.sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS' + * + * @param {array} [disk.zones] The Logical zone list for Disk. + * + * @param {string} [disk.osType] The Operating System type. Possible values + * include: 'Windows', 'Linux' + * + * @param {object} disk.creationData Disk source information. CreationData + * information cannot be changed after the disk has been created. + * + * @param {string} disk.creationData.createOption This enumerates the possible + * sources of a disk's creation. Possible values include: 'Empty', 'Attach', + * 'FromImage', 'Import', 'Copy', 'Restore' + * + * @param {string} [disk.creationData.storageAccountId] If createOption is + * Import, the Azure Resource Manager identifier of the storage account + * containing the blob to import as a disk. Required only if the blob is in a + * different subscription + * + * @param {object} [disk.creationData.imageReference] Disk source information. + * + * @param {string} disk.creationData.imageReference.id A relative uri + * containing either a Platform Imgage Repository or user image reference. + * + * @param {number} [disk.creationData.imageReference.lun] If the disk is + * created from an image's data disk, this is an index that indicates which of + * the data disks in the image to use. For OS disks, this field is null. + * + * @param {string} [disk.creationData.sourceUri] If createOption is Import, + * this is the URI of a blob to be imported into a managed disk. + * + * @param {string} [disk.creationData.sourceResourceId] If createOption is + * Copy, this is the ARM id of the source snapshot or disk. + * + * @param {number} [disk.diskSizeGB] If creationData.createOption is Empty, + * this field is mandatory and it indicates the size of the VHD to create. If + * this field is present for updates or creation with other options, it + * indicates a resize. Resizes are only allowed if the disk is not attached to + * a running VM, and can only increase the disk's size. + * + * @param {object} [disk.encryptionSettings] Encryption settings for disk or + * snapshot + * + * @param {boolean} [disk.encryptionSettings.enabled] Set this flag to true and + * provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * encryption. Set this flag to false and remove DiskEncryptionKey and + * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the + * request object, the existing settings remain unchanged. + * + * @param {object} [disk.encryptionSettings.diskEncryptionKey] Key Vault Secret + * Url and vault id of the disk encryption key + * + * @param {object} disk.encryptionSettings.diskEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} disk.encryptionSettings.diskEncryptionKey.secretUrl Url + * pointing to a key or secret in KeyVault + * + * @param {object} [disk.encryptionSettings.keyEncryptionKey] Key Vault Key Url + * and vault id of the key encryption key + * + * @param {object} disk.encryptionSettings.keyEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} [disk.encryptionSettings.keyEncryptionKey.sourceVault.id] + * Resource Id + * + * @param {string} disk.encryptionSettings.keyEncryptionKey.keyUrl Url pointing + * to a key or secret in KeyVault + * + * @param {string} disk.location Resource location + * + * @param {object} [disk.tags] Resource tags + * + * @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 {Disk} - 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 Disk} 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. + */ + createOrUpdate(resourceGroupName, diskName, disk, 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._createOrUpdate(resourceGroupName, diskName, disk, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, diskName, disk, options, optionalCallback); + } + } + + /** + * Updates (patches) a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @param {object} disk Disk object supplied in the body of the Patch disk + * operation. + * + * @param {string} [disk.osType] the Operating System type. Possible values + * include: 'Windows', 'Linux' + * + * @param {number} [disk.diskSizeGB] If creationData.createOption is Empty, + * this field is mandatory and it indicates the size of the VHD to create. If + * this field is present for updates or creation with other options, it + * indicates a resize. Resizes are only allowed if the disk is not attached to + * a running VM, and can only increase the disk's size. + * + * @param {object} [disk.encryptionSettings] Encryption settings for disk or + * snapshot + * + * @param {boolean} [disk.encryptionSettings.enabled] Set this flag to true and + * provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * encryption. Set this flag to false and remove DiskEncryptionKey and + * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the + * request object, the existing settings remain unchanged. + * + * @param {object} [disk.encryptionSettings.diskEncryptionKey] Key Vault Secret + * Url and vault id of the disk encryption key + * + * @param {object} disk.encryptionSettings.diskEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} disk.encryptionSettings.diskEncryptionKey.secretUrl Url + * pointing to a key or secret in KeyVault + * + * @param {object} [disk.encryptionSettings.keyEncryptionKey] Key Vault Key Url + * and vault id of the key encryption key + * + * @param {object} disk.encryptionSettings.keyEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} [disk.encryptionSettings.keyEncryptionKey.sourceVault.id] + * Resource Id + * + * @param {string} disk.encryptionSettings.keyEncryptionKey.keyUrl Url pointing + * to a key or secret in KeyVault + * + * @param {object} [disk.tags] Resource tags + * + * @param {object} [disk.sku] + * + * @param {string} [disk.sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateWithHttpOperationResponse(resourceGroupName, diskName, disk, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._update(resourceGroupName, diskName, disk, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates (patches) a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @param {object} disk Disk object supplied in the body of the Patch disk + * operation. + * + * @param {string} [disk.osType] the Operating System type. Possible values + * include: 'Windows', 'Linux' + * + * @param {number} [disk.diskSizeGB] If creationData.createOption is Empty, + * this field is mandatory and it indicates the size of the VHD to create. If + * this field is present for updates or creation with other options, it + * indicates a resize. Resizes are only allowed if the disk is not attached to + * a running VM, and can only increase the disk's size. + * + * @param {object} [disk.encryptionSettings] Encryption settings for disk or + * snapshot + * + * @param {boolean} [disk.encryptionSettings.enabled] Set this flag to true and + * provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * encryption. Set this flag to false and remove DiskEncryptionKey and + * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the + * request object, the existing settings remain unchanged. + * + * @param {object} [disk.encryptionSettings.diskEncryptionKey] Key Vault Secret + * Url and vault id of the disk encryption key + * + * @param {object} disk.encryptionSettings.diskEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} disk.encryptionSettings.diskEncryptionKey.secretUrl Url + * pointing to a key or secret in KeyVault + * + * @param {object} [disk.encryptionSettings.keyEncryptionKey] Key Vault Key Url + * and vault id of the key encryption key + * + * @param {object} disk.encryptionSettings.keyEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} [disk.encryptionSettings.keyEncryptionKey.sourceVault.id] + * Resource Id + * + * @param {string} disk.encryptionSettings.keyEncryptionKey.keyUrl Url pointing + * to a key or secret in KeyVault + * + * @param {object} [disk.tags] Resource tags + * + * @param {object} [disk.sku] + * + * @param {string} [disk.sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS' + * + * @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 {Disk} - 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 Disk} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + update(resourceGroupName, diskName, disk, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._update(resourceGroupName, diskName, disk, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._update(resourceGroupName, diskName, disk, options, optionalCallback); + } + } + + /** + * Gets information about a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, diskName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, diskName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets information about a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @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 {Disk} - 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 Disk} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, diskName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(resourceGroupName, diskName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, diskName, options, optionalCallback); + } + } + + /** + * Deletes a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, diskName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, diskName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + deleteMethod(resourceGroupName, diskName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, diskName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, diskName, options, optionalCallback); + } + } + + /** + * Lists all the disks under a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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. + */ + listByResourceGroupWithHttpOperationResponse(resourceGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all the disks under a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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 {DiskList} - 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 DiskList} 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. + */ + listByResourceGroup(resourceGroupName, 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._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByResourceGroup(resourceGroupName, options, optionalCallback); + } + } + + /** + * Lists all the disks under a 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. + */ + listWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all the disks under a 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 {DiskList} - 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 DiskList} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + list(options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._list(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(options, optionalCallback); + } + } + + /** + * Grants access to a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @param {object} grantAccessData Access data object supplied in the body of + * the get disk access operation. + * + * @param {string} grantAccessData.access Possible values include: 'None', + * 'Read' + * + * @param {number} grantAccessData.durationInSeconds Time duration in seconds + * until the SAS access expires. + * + * @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. + */ + grantAccessWithHttpOperationResponse(resourceGroupName, diskName, grantAccessData, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._grantAccess(resourceGroupName, diskName, grantAccessData, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Grants access to a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @param {object} grantAccessData Access data object supplied in the body of + * the get disk access operation. + * + * @param {string} grantAccessData.access Possible values include: 'None', + * 'Read' + * + * @param {number} grantAccessData.durationInSeconds Time duration in seconds + * until the SAS access expires. + * + * @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 {AccessUri} - 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 AccessUri} 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. + */ + grantAccess(resourceGroupName, diskName, grantAccessData, 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._grantAccess(resourceGroupName, diskName, grantAccessData, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._grantAccess(resourceGroupName, diskName, grantAccessData, options, optionalCallback); + } + } + + /** + * Revokes access to a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @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. + */ + revokeAccessWithHttpOperationResponse(resourceGroupName, diskName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._revokeAccess(resourceGroupName, diskName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Revokes access to a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + revokeAccess(resourceGroupName, diskName, 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._revokeAccess(resourceGroupName, diskName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._revokeAccess(resourceGroupName, diskName, options, optionalCallback); + } + } + + /** + * Creates or updates a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @param {object} disk Disk object supplied in the body of the Put disk + * operation. + * + * @param {object} [disk.sku] + * + * @param {string} [disk.sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS' + * + * @param {array} [disk.zones] The Logical zone list for Disk. + * + * @param {string} [disk.osType] The Operating System type. Possible values + * include: 'Windows', 'Linux' + * + * @param {object} disk.creationData Disk source information. CreationData + * information cannot be changed after the disk has been created. + * + * @param {string} disk.creationData.createOption This enumerates the possible + * sources of a disk's creation. Possible values include: 'Empty', 'Attach', + * 'FromImage', 'Import', 'Copy', 'Restore' + * + * @param {string} [disk.creationData.storageAccountId] If createOption is + * Import, the Azure Resource Manager identifier of the storage account + * containing the blob to import as a disk. Required only if the blob is in a + * different subscription + * + * @param {object} [disk.creationData.imageReference] Disk source information. + * + * @param {string} disk.creationData.imageReference.id A relative uri + * containing either a Platform Imgage Repository or user image reference. + * + * @param {number} [disk.creationData.imageReference.lun] If the disk is + * created from an image's data disk, this is an index that indicates which of + * the data disks in the image to use. For OS disks, this field is null. + * + * @param {string} [disk.creationData.sourceUri] If createOption is Import, + * this is the URI of a blob to be imported into a managed disk. + * + * @param {string} [disk.creationData.sourceResourceId] If createOption is + * Copy, this is the ARM id of the source snapshot or disk. + * + * @param {number} [disk.diskSizeGB] If creationData.createOption is Empty, + * this field is mandatory and it indicates the size of the VHD to create. If + * this field is present for updates or creation with other options, it + * indicates a resize. Resizes are only allowed if the disk is not attached to + * a running VM, and can only increase the disk's size. + * + * @param {object} [disk.encryptionSettings] Encryption settings for disk or + * snapshot + * + * @param {boolean} [disk.encryptionSettings.enabled] Set this flag to true and + * provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * encryption. Set this flag to false and remove DiskEncryptionKey and + * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the + * request object, the existing settings remain unchanged. + * + * @param {object} [disk.encryptionSettings.diskEncryptionKey] Key Vault Secret + * Url and vault id of the disk encryption key + * + * @param {object} disk.encryptionSettings.diskEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} disk.encryptionSettings.diskEncryptionKey.secretUrl Url + * pointing to a key or secret in KeyVault + * + * @param {object} [disk.encryptionSettings.keyEncryptionKey] Key Vault Key Url + * and vault id of the key encryption key + * + * @param {object} disk.encryptionSettings.keyEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} [disk.encryptionSettings.keyEncryptionKey.sourceVault.id] + * Resource Id + * + * @param {string} disk.encryptionSettings.keyEncryptionKey.keyUrl Url pointing + * to a key or secret in KeyVault + * + * @param {string} disk.location Resource location + * + * @param {object} [disk.tags] Resource tags + * + * @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. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, diskName, disk, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, diskName, disk, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @param {object} disk Disk object supplied in the body of the Put disk + * operation. + * + * @param {object} [disk.sku] + * + * @param {string} [disk.sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS' + * + * @param {array} [disk.zones] The Logical zone list for Disk. + * + * @param {string} [disk.osType] The Operating System type. Possible values + * include: 'Windows', 'Linux' + * + * @param {object} disk.creationData Disk source information. CreationData + * information cannot be changed after the disk has been created. + * + * @param {string} disk.creationData.createOption This enumerates the possible + * sources of a disk's creation. Possible values include: 'Empty', 'Attach', + * 'FromImage', 'Import', 'Copy', 'Restore' + * + * @param {string} [disk.creationData.storageAccountId] If createOption is + * Import, the Azure Resource Manager identifier of the storage account + * containing the blob to import as a disk. Required only if the blob is in a + * different subscription + * + * @param {object} [disk.creationData.imageReference] Disk source information. + * + * @param {string} disk.creationData.imageReference.id A relative uri + * containing either a Platform Imgage Repository or user image reference. + * + * @param {number} [disk.creationData.imageReference.lun] If the disk is + * created from an image's data disk, this is an index that indicates which of + * the data disks in the image to use. For OS disks, this field is null. + * + * @param {string} [disk.creationData.sourceUri] If createOption is Import, + * this is the URI of a blob to be imported into a managed disk. + * + * @param {string} [disk.creationData.sourceResourceId] If createOption is + * Copy, this is the ARM id of the source snapshot or disk. + * + * @param {number} [disk.diskSizeGB] If creationData.createOption is Empty, + * this field is mandatory and it indicates the size of the VHD to create. If + * this field is present for updates or creation with other options, it + * indicates a resize. Resizes are only allowed if the disk is not attached to + * a running VM, and can only increase the disk's size. + * + * @param {object} [disk.encryptionSettings] Encryption settings for disk or + * snapshot + * + * @param {boolean} [disk.encryptionSettings.enabled] Set this flag to true and + * provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * encryption. Set this flag to false and remove DiskEncryptionKey and + * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the + * request object, the existing settings remain unchanged. + * + * @param {object} [disk.encryptionSettings.diskEncryptionKey] Key Vault Secret + * Url and vault id of the disk encryption key + * + * @param {object} disk.encryptionSettings.diskEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} disk.encryptionSettings.diskEncryptionKey.secretUrl Url + * pointing to a key or secret in KeyVault + * + * @param {object} [disk.encryptionSettings.keyEncryptionKey] Key Vault Key Url + * and vault id of the key encryption key + * + * @param {object} disk.encryptionSettings.keyEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} [disk.encryptionSettings.keyEncryptionKey.sourceVault.id] + * Resource Id + * + * @param {string} disk.encryptionSettings.keyEncryptionKey.keyUrl Url pointing + * to a key or secret in KeyVault + * + * @param {string} disk.location Resource location + * + * @param {object} [disk.tags] Resource tags + * + * @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 {Disk} - 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 Disk} 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. + */ + beginCreateOrUpdate(resourceGroupName, diskName, disk, 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._beginCreateOrUpdate(resourceGroupName, diskName, disk, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, diskName, disk, options, optionalCallback); + } + } + + /** + * Updates (patches) a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @param {object} disk Disk object supplied in the body of the Patch disk + * operation. + * + * @param {string} [disk.osType] the Operating System type. Possible values + * include: 'Windows', 'Linux' + * + * @param {number} [disk.diskSizeGB] If creationData.createOption is Empty, + * this field is mandatory and it indicates the size of the VHD to create. If + * this field is present for updates or creation with other options, it + * indicates a resize. Resizes are only allowed if the disk is not attached to + * a running VM, and can only increase the disk's size. + * + * @param {object} [disk.encryptionSettings] Encryption settings for disk or + * snapshot + * + * @param {boolean} [disk.encryptionSettings.enabled] Set this flag to true and + * provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * encryption. Set this flag to false and remove DiskEncryptionKey and + * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the + * request object, the existing settings remain unchanged. + * + * @param {object} [disk.encryptionSettings.diskEncryptionKey] Key Vault Secret + * Url and vault id of the disk encryption key + * + * @param {object} disk.encryptionSettings.diskEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} disk.encryptionSettings.diskEncryptionKey.secretUrl Url + * pointing to a key or secret in KeyVault + * + * @param {object} [disk.encryptionSettings.keyEncryptionKey] Key Vault Key Url + * and vault id of the key encryption key + * + * @param {object} disk.encryptionSettings.keyEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} [disk.encryptionSettings.keyEncryptionKey.sourceVault.id] + * Resource Id + * + * @param {string} disk.encryptionSettings.keyEncryptionKey.keyUrl Url pointing + * to a key or secret in KeyVault + * + * @param {object} [disk.tags] Resource tags + * + * @param {object} [disk.sku] + * + * @param {string} [disk.sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginUpdateWithHttpOperationResponse(resourceGroupName, diskName, disk, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginUpdate(resourceGroupName, diskName, disk, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates (patches) a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @param {object} disk Disk object supplied in the body of the Patch disk + * operation. + * + * @param {string} [disk.osType] the Operating System type. Possible values + * include: 'Windows', 'Linux' + * + * @param {number} [disk.diskSizeGB] If creationData.createOption is Empty, + * this field is mandatory and it indicates the size of the VHD to create. If + * this field is present for updates or creation with other options, it + * indicates a resize. Resizes are only allowed if the disk is not attached to + * a running VM, and can only increase the disk's size. + * + * @param {object} [disk.encryptionSettings] Encryption settings for disk or + * snapshot + * + * @param {boolean} [disk.encryptionSettings.enabled] Set this flag to true and + * provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * encryption. Set this flag to false and remove DiskEncryptionKey and + * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the + * request object, the existing settings remain unchanged. + * + * @param {object} [disk.encryptionSettings.diskEncryptionKey] Key Vault Secret + * Url and vault id of the disk encryption key + * + * @param {object} disk.encryptionSettings.diskEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} disk.encryptionSettings.diskEncryptionKey.secretUrl Url + * pointing to a key or secret in KeyVault + * + * @param {object} [disk.encryptionSettings.keyEncryptionKey] Key Vault Key Url + * and vault id of the key encryption key + * + * @param {object} disk.encryptionSettings.keyEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} [disk.encryptionSettings.keyEncryptionKey.sourceVault.id] + * Resource Id + * + * @param {string} disk.encryptionSettings.keyEncryptionKey.keyUrl Url pointing + * to a key or secret in KeyVault + * + * @param {object} [disk.tags] Resource tags + * + * @param {object} [disk.sku] + * + * @param {string} [disk.sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS' + * + * @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 {Disk} - 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 Disk} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginUpdate(resourceGroupName, diskName, disk, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginUpdate(resourceGroupName, diskName, disk, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginUpdate(resourceGroupName, diskName, disk, options, optionalCallback); + } + } + + /** + * Deletes a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @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. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, diskName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, diskName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + beginDeleteMethod(resourceGroupName, diskName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, diskName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, diskName, options, optionalCallback); + } + } + + /** + * Grants access to a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @param {object} grantAccessData Access data object supplied in the body of + * the get disk access operation. + * + * @param {string} grantAccessData.access Possible values include: 'None', + * 'Read' + * + * @param {number} grantAccessData.durationInSeconds Time duration in seconds + * until the SAS access expires. + * + * @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. + */ + beginGrantAccessWithHttpOperationResponse(resourceGroupName, diskName, grantAccessData, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginGrantAccess(resourceGroupName, diskName, grantAccessData, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Grants access to a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @param {object} grantAccessData Access data object supplied in the body of + * the get disk access operation. + * + * @param {string} grantAccessData.access Possible values include: 'None', + * 'Read' + * + * @param {number} grantAccessData.durationInSeconds Time duration in seconds + * until the SAS access expires. + * + * @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 {AccessUri} - 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 AccessUri} 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. + */ + beginGrantAccess(resourceGroupName, diskName, grantAccessData, 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._beginGrantAccess(resourceGroupName, diskName, grantAccessData, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginGrantAccess(resourceGroupName, diskName, grantAccessData, options, optionalCallback); + } + } + + /** + * Revokes access to a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @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. + */ + beginRevokeAccessWithHttpOperationResponse(resourceGroupName, diskName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginRevokeAccess(resourceGroupName, diskName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Revokes access to a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + beginRevokeAccess(resourceGroupName, diskName, 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._beginRevokeAccess(resourceGroupName, diskName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginRevokeAccess(resourceGroupName, diskName, options, optionalCallback); + } + } + + /** + * Lists all the disks under a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByResourceGroupNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all the disks under a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DiskList} - 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 DiskList} 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. + */ + listByResourceGroupNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByResourceGroupNext(nextPageLink, options, optionalCallback); + } + } + + /** + * Lists all the disks under a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all the disks under a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DiskList} - 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 DiskList} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = Disks; diff --git a/lib/services/computeManagement2/lib/lib/operations/images.js b/lib/services/computeManagement2/lib/lib/operations/images.js new file mode 100644 index 0000000000..27ee1a0181 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/operations/images.js @@ -0,0 +1,3142 @@ +/* + * 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; + + +/** + * Create or update an image. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} imageName The name of the image. + * + * @param {object} parameters Parameters supplied to the Create Image + * operation. + * + * @param {object} [parameters.sourceVirtualMachine] The source virtual machine + * from which Image is created. + * + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. + * + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} parameters.storageProfile.osDisk.osType This property allows + * you to specify the type of the OS that is included in the disk if creating a + * VM from a custom image.

    Possible values are:

    **Windows** + *

    **Linux**. Possible values include: 'Windows', 'Linux' + * + * @param {string} parameters.storageProfile.osDisk.osState The OS State. + * Possible values include: 'Generalized', 'Specialized' + * + * @param {object} [parameters.storageProfile.osDisk.snapshot] The snapshot. + * + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The + * managedDisk. + * + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id + * + * @param {string} [parameters.storageProfile.osDisk.blobUri] The Virtual Hard + * Disk. + * + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of empty data disks in gigabytes. This element can be used to overwrite + * the name of the disk in a virtual machine image.

    This value cannot + * be larger than 1023 GB + * + * @param {string} [parameters.storageProfile.osDisk.storageAccountType] + * Specifies the storage account type for the managed disk. Possible values + * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {boolean} [parameters.storageProfile.zoneResilient] Specifies whether + * an image is zone resilient or not. Default is false. Zone resilient images + * can be created only in regions that provide Zone Redundant Storage (ZRS). + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @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 Image} 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 _createOrUpdate(resourceGroupName, imageName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginCreateOrUpdate(resourceGroupName, imageName, parameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Image']().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); + }); + }); +} + + +/** + * Update an image. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} imageName The name of the image. + * + * @param {object} parameters Parameters supplied to the Update Image + * operation. + * + * @param {object} [parameters.sourceVirtualMachine] The source virtual machine + * from which Image is created. + * + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. + * + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} parameters.storageProfile.osDisk.osType This property allows + * you to specify the type of the OS that is included in the disk if creating a + * VM from a custom image.

    Possible values are:

    **Windows** + *

    **Linux**. Possible values include: 'Windows', 'Linux' + * + * @param {string} parameters.storageProfile.osDisk.osState The OS State. + * Possible values include: 'Generalized', 'Specialized' + * + * @param {object} [parameters.storageProfile.osDisk.snapshot] The snapshot. + * + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The + * managedDisk. + * + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id + * + * @param {string} [parameters.storageProfile.osDisk.blobUri] The Virtual Hard + * Disk. + * + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of empty data disks in gigabytes. This element can be used to overwrite + * the name of the disk in a virtual machine image.

    This value cannot + * be larger than 1023 GB + * + * @param {string} [parameters.storageProfile.osDisk.storageAccountType] + * Specifies the storage account type for the managed disk. Possible values + * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {boolean} [parameters.storageProfile.zoneResilient] Specifies whether + * an image is zone resilient or not. Default is false. Zone resilient images + * can be created only in regions that provide Zone Redundant Storage (ZRS). + * + * @param {object} [parameters.tags] Resource tags + * + * @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 Image} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _update(resourceGroupName, imageName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginUpdate(resourceGroupName, imageName, parameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Image']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Deletes an Image. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} imageName The name of the image. + * + * @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 OperationStatusResponse} 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 _deleteMethod(resourceGroupName, imageName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginDeleteMethod(resourceGroupName, imageName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().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); + }); + }); +} + +/** + * Gets an image. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} imageName The name of the image. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] The expand expression to apply on the + * operation. + * + * @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 Image} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, imageName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let expand = (options && options.expand !== undefined) ? options.expand : undefined; + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (imageName === null || imageName === undefined || typeof imageName.valueOf() !== 'string') { + throw new Error('imageName cannot be null or undefined and it must be of type string.'); + } + if (expand !== null && expand !== undefined && typeof expand.valueOf() !== 'string') { + throw new Error('expand must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{imageName}', encodeURIComponent(imageName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (expand !== null && expand !== undefined) { + queryParameters.push('$expand=' + encodeURIComponent(expand)); + } + queryParameters.push('api-version=' + encodeURIComponent(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['Image']().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); + }); +} + +/** + * Gets the list of images under a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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 ImageListResult} 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 _listByResourceGroup(resourceGroupName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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['ImageListResult']().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); + }); +} + +/** + * Gets the list of Images in the subscription. Use nextLink property in the + * response to get the next page of Images. Do this till nextLink is null to + * fetch all the Images. + * + * @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 ImageListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // 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.Compute/images'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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['ImageListResult']().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); + }); +} + +/** + * Create or update an image. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} imageName The name of the image. + * + * @param {object} parameters Parameters supplied to the Create Image + * operation. + * + * @param {object} [parameters.sourceVirtualMachine] The source virtual machine + * from which Image is created. + * + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. + * + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} parameters.storageProfile.osDisk.osType This property allows + * you to specify the type of the OS that is included in the disk if creating a + * VM from a custom image.

    Possible values are:

    **Windows** + *

    **Linux**. Possible values include: 'Windows', 'Linux' + * + * @param {string} parameters.storageProfile.osDisk.osState The OS State. + * Possible values include: 'Generalized', 'Specialized' + * + * @param {object} [parameters.storageProfile.osDisk.snapshot] The snapshot. + * + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The + * managedDisk. + * + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id + * + * @param {string} [parameters.storageProfile.osDisk.blobUri] The Virtual Hard + * Disk. + * + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of empty data disks in gigabytes. This element can be used to overwrite + * the name of the disk in a virtual machine image.

    This value cannot + * be larger than 1023 GB + * + * @param {string} [parameters.storageProfile.osDisk.storageAccountType] + * Specifies the storage account type for the managed disk. Possible values + * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {boolean} [parameters.storageProfile.zoneResilient] Specifies whether + * an image is zone resilient or not. Default is false. Zone resilient images + * can be created only in regions that provide Zone Redundant Storage (ZRS). + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @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 Image} 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 _beginCreateOrUpdate(resourceGroupName, imageName, 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.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (imageName === null || imageName === undefined || typeof imageName.valueOf() !== 'string') { + throw new Error('imageName 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.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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{imageName}', encodeURIComponent(imageName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['Image']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + 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['Image']().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); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Image']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Update an image. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} imageName The name of the image. + * + * @param {object} parameters Parameters supplied to the Update Image + * operation. + * + * @param {object} [parameters.sourceVirtualMachine] The source virtual machine + * from which Image is created. + * + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. + * + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} parameters.storageProfile.osDisk.osType This property allows + * you to specify the type of the OS that is included in the disk if creating a + * VM from a custom image.

    Possible values are:

    **Windows** + *

    **Linux**. Possible values include: 'Windows', 'Linux' + * + * @param {string} parameters.storageProfile.osDisk.osState The OS State. + * Possible values include: 'Generalized', 'Specialized' + * + * @param {object} [parameters.storageProfile.osDisk.snapshot] The snapshot. + * + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The + * managedDisk. + * + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id + * + * @param {string} [parameters.storageProfile.osDisk.blobUri] The Virtual Hard + * Disk. + * + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of empty data disks in gigabytes. This element can be used to overwrite + * the name of the disk in a virtual machine image.

    This value cannot + * be larger than 1023 GB + * + * @param {string} [parameters.storageProfile.osDisk.storageAccountType] + * Specifies the storage account type for the managed disk. Possible values + * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {boolean} [parameters.storageProfile.zoneResilient] Specifies whether + * an image is zone resilient or not. Default is false. Zone resilient images + * can be created only in regions that provide Zone Redundant Storage (ZRS). + * + * @param {object} [parameters.tags] Resource tags + * + * @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 Image} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginUpdate(resourceGroupName, imageName, 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.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (imageName === null || imageName === undefined || typeof imageName.valueOf() !== 'string') { + throw new Error('imageName 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.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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{imageName}', encodeURIComponent(imageName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['ImageUpdate']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + 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['Image']().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); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Image']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Deletes an Image. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} imageName The name of the image. + * + * @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 OperationStatusResponse} 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 _beginDeleteMethod(resourceGroupName, imageName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (imageName === null || imageName === undefined || typeof imageName.valueOf() !== 'string') { + throw new Error('imageName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{imageName}', encodeURIComponent(imageName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // 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['OperationStatusResponse']().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); + }); +} + +/** + * Gets the list of images under a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ImageListResult} 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 _listByResourceGroupNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ImageListResult']().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); + }); +} + +/** + * Gets the list of Images in the subscription. Use nextLink property in the + * response to get the next page of Images. Do this till nextLink is null to + * fetch all the Images. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ImageListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ImageListResult']().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 Images. */ +class Images { + /** + * Create a Images. + * @param {ComputeManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._createOrUpdate = _createOrUpdate; + this._update = _update; + this._deleteMethod = _deleteMethod; + this._get = _get; + this._listByResourceGroup = _listByResourceGroup; + this._list = _list; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginUpdate = _beginUpdate; + this._beginDeleteMethod = _beginDeleteMethod; + this._listByResourceGroupNext = _listByResourceGroupNext; + this._listNext = _listNext; + } + + /** + * Create or update an image. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} imageName The name of the image. + * + * @param {object} parameters Parameters supplied to the Create Image + * operation. + * + * @param {object} [parameters.sourceVirtualMachine] The source virtual machine + * from which Image is created. + * + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. + * + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} parameters.storageProfile.osDisk.osType This property allows + * you to specify the type of the OS that is included in the disk if creating a + * VM from a custom image.

    Possible values are:

    **Windows** + *

    **Linux**. Possible values include: 'Windows', 'Linux' + * + * @param {string} parameters.storageProfile.osDisk.osState The OS State. + * Possible values include: 'Generalized', 'Specialized' + * + * @param {object} [parameters.storageProfile.osDisk.snapshot] The snapshot. + * + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The + * managedDisk. + * + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id + * + * @param {string} [parameters.storageProfile.osDisk.blobUri] The Virtual Hard + * Disk. + * + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of empty data disks in gigabytes. This element can be used to overwrite + * the name of the disk in a virtual machine image.

    This value cannot + * be larger than 1023 GB + * + * @param {string} [parameters.storageProfile.osDisk.storageAccountType] + * Specifies the storage account type for the managed disk. Possible values + * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {boolean} [parameters.storageProfile.zoneResilient] Specifies whether + * an image is zone resilient or not. Default is false. Zone resilient images + * can be created only in regions that provide Zone Redundant Storage (ZRS). + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @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. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, imageName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, imageName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Create or update an image. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} imageName The name of the image. + * + * @param {object} parameters Parameters supplied to the Create Image + * operation. + * + * @param {object} [parameters.sourceVirtualMachine] The source virtual machine + * from which Image is created. + * + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. + * + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} parameters.storageProfile.osDisk.osType This property allows + * you to specify the type of the OS that is included in the disk if creating a + * VM from a custom image.

    Possible values are:

    **Windows** + *

    **Linux**. Possible values include: 'Windows', 'Linux' + * + * @param {string} parameters.storageProfile.osDisk.osState The OS State. + * Possible values include: 'Generalized', 'Specialized' + * + * @param {object} [parameters.storageProfile.osDisk.snapshot] The snapshot. + * + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The + * managedDisk. + * + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id + * + * @param {string} [parameters.storageProfile.osDisk.blobUri] The Virtual Hard + * Disk. + * + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of empty data disks in gigabytes. This element can be used to overwrite + * the name of the disk in a virtual machine image.

    This value cannot + * be larger than 1023 GB + * + * @param {string} [parameters.storageProfile.osDisk.storageAccountType] + * Specifies the storage account type for the managed disk. Possible values + * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {boolean} [parameters.storageProfile.zoneResilient] Specifies whether + * an image is zone resilient or not. Default is false. Zone resilient images + * can be created only in regions that provide Zone Redundant Storage (ZRS). + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @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 {Image} - 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 Image} 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. + */ + createOrUpdate(resourceGroupName, imageName, 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._createOrUpdate(resourceGroupName, imageName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, imageName, parameters, options, optionalCallback); + } + } + + /** + * Update an image. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} imageName The name of the image. + * + * @param {object} parameters Parameters supplied to the Update Image + * operation. + * + * @param {object} [parameters.sourceVirtualMachine] The source virtual machine + * from which Image is created. + * + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. + * + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} parameters.storageProfile.osDisk.osType This property allows + * you to specify the type of the OS that is included in the disk if creating a + * VM from a custom image.

    Possible values are:

    **Windows** + *

    **Linux**. Possible values include: 'Windows', 'Linux' + * + * @param {string} parameters.storageProfile.osDisk.osState The OS State. + * Possible values include: 'Generalized', 'Specialized' + * + * @param {object} [parameters.storageProfile.osDisk.snapshot] The snapshot. + * + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The + * managedDisk. + * + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id + * + * @param {string} [parameters.storageProfile.osDisk.blobUri] The Virtual Hard + * Disk. + * + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of empty data disks in gigabytes. This element can be used to overwrite + * the name of the disk in a virtual machine image.

    This value cannot + * be larger than 1023 GB + * + * @param {string} [parameters.storageProfile.osDisk.storageAccountType] + * Specifies the storage account type for the managed disk. Possible values + * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {boolean} [parameters.storageProfile.zoneResilient] Specifies whether + * an image is zone resilient or not. Default is false. Zone resilient images + * can be created only in regions that provide Zone Redundant Storage (ZRS). + * + * @param {object} [parameters.tags] Resource tags + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateWithHttpOperationResponse(resourceGroupName, imageName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._update(resourceGroupName, imageName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Update an image. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} imageName The name of the image. + * + * @param {object} parameters Parameters supplied to the Update Image + * operation. + * + * @param {object} [parameters.sourceVirtualMachine] The source virtual machine + * from which Image is created. + * + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. + * + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} parameters.storageProfile.osDisk.osType This property allows + * you to specify the type of the OS that is included in the disk if creating a + * VM from a custom image.

    Possible values are:

    **Windows** + *

    **Linux**. Possible values include: 'Windows', 'Linux' + * + * @param {string} parameters.storageProfile.osDisk.osState The OS State. + * Possible values include: 'Generalized', 'Specialized' + * + * @param {object} [parameters.storageProfile.osDisk.snapshot] The snapshot. + * + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The + * managedDisk. + * + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id + * + * @param {string} [parameters.storageProfile.osDisk.blobUri] The Virtual Hard + * Disk. + * + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of empty data disks in gigabytes. This element can be used to overwrite + * the name of the disk in a virtual machine image.

    This value cannot + * be larger than 1023 GB + * + * @param {string} [parameters.storageProfile.osDisk.storageAccountType] + * Specifies the storage account type for the managed disk. Possible values + * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {boolean} [parameters.storageProfile.zoneResilient] Specifies whether + * an image is zone resilient or not. Default is false. Zone resilient images + * can be created only in regions that provide Zone Redundant Storage (ZRS). + * + * @param {object} [parameters.tags] Resource tags + * + * @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 {Image} - 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 Image} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + update(resourceGroupName, imageName, 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._update(resourceGroupName, imageName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._update(resourceGroupName, imageName, parameters, options, optionalCallback); + } + } + + /** + * Deletes an Image. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} imageName The name of the image. + * + * @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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, imageName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, imageName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes an Image. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} imageName The name of the image. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + deleteMethod(resourceGroupName, imageName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, imageName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, imageName, options, optionalCallback); + } + } + + /** + * Gets an image. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} imageName The name of the image. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] The expand expression to apply on the + * operation. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, imageName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, imageName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets an image. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} imageName The name of the image. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] The expand expression to apply on the + * operation. + * + * @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 {Image} - 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 Image} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, imageName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(resourceGroupName, imageName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, imageName, options, optionalCallback); + } + } + + /** + * Gets the list of images under a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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. + */ + listByResourceGroupWithHttpOperationResponse(resourceGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the list of images under a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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 {ImageListResult} - 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 ImageListResult} 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. + */ + listByResourceGroup(resourceGroupName, 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._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByResourceGroup(resourceGroupName, options, optionalCallback); + } + } + + /** + * Gets the list of Images in the subscription. Use nextLink property in the + * response to get the next page of Images. Do this till nextLink is null to + * fetch all the Images. + * + * @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. + */ + listWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the list of Images in the subscription. Use nextLink property in the + * response to get the next page of Images. Do this till nextLink is null to + * fetch all the Images. + * + * @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 {ImageListResult} - 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 ImageListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + list(options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._list(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(options, optionalCallback); + } + } + + /** + * Create or update an image. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} imageName The name of the image. + * + * @param {object} parameters Parameters supplied to the Create Image + * operation. + * + * @param {object} [parameters.sourceVirtualMachine] The source virtual machine + * from which Image is created. + * + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. + * + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} parameters.storageProfile.osDisk.osType This property allows + * you to specify the type of the OS that is included in the disk if creating a + * VM from a custom image.

    Possible values are:

    **Windows** + *

    **Linux**. Possible values include: 'Windows', 'Linux' + * + * @param {string} parameters.storageProfile.osDisk.osState The OS State. + * Possible values include: 'Generalized', 'Specialized' + * + * @param {object} [parameters.storageProfile.osDisk.snapshot] The snapshot. + * + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The + * managedDisk. + * + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id + * + * @param {string} [parameters.storageProfile.osDisk.blobUri] The Virtual Hard + * Disk. + * + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of empty data disks in gigabytes. This element can be used to overwrite + * the name of the disk in a virtual machine image.

    This value cannot + * be larger than 1023 GB + * + * @param {string} [parameters.storageProfile.osDisk.storageAccountType] + * Specifies the storage account type for the managed disk. Possible values + * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {boolean} [parameters.storageProfile.zoneResilient] Specifies whether + * an image is zone resilient or not. Default is false. Zone resilient images + * can be created only in regions that provide Zone Redundant Storage (ZRS). + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @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. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, imageName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, imageName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Create or update an image. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} imageName The name of the image. + * + * @param {object} parameters Parameters supplied to the Create Image + * operation. + * + * @param {object} [parameters.sourceVirtualMachine] The source virtual machine + * from which Image is created. + * + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. + * + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} parameters.storageProfile.osDisk.osType This property allows + * you to specify the type of the OS that is included in the disk if creating a + * VM from a custom image.

    Possible values are:

    **Windows** + *

    **Linux**. Possible values include: 'Windows', 'Linux' + * + * @param {string} parameters.storageProfile.osDisk.osState The OS State. + * Possible values include: 'Generalized', 'Specialized' + * + * @param {object} [parameters.storageProfile.osDisk.snapshot] The snapshot. + * + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The + * managedDisk. + * + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id + * + * @param {string} [parameters.storageProfile.osDisk.blobUri] The Virtual Hard + * Disk. + * + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of empty data disks in gigabytes. This element can be used to overwrite + * the name of the disk in a virtual machine image.

    This value cannot + * be larger than 1023 GB + * + * @param {string} [parameters.storageProfile.osDisk.storageAccountType] + * Specifies the storage account type for the managed disk. Possible values + * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {boolean} [parameters.storageProfile.zoneResilient] Specifies whether + * an image is zone resilient or not. Default is false. Zone resilient images + * can be created only in regions that provide Zone Redundant Storage (ZRS). + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @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 {Image} - 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 Image} 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. + */ + beginCreateOrUpdate(resourceGroupName, imageName, 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._beginCreateOrUpdate(resourceGroupName, imageName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, imageName, parameters, options, optionalCallback); + } + } + + /** + * Update an image. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} imageName The name of the image. + * + * @param {object} parameters Parameters supplied to the Update Image + * operation. + * + * @param {object} [parameters.sourceVirtualMachine] The source virtual machine + * from which Image is created. + * + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. + * + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} parameters.storageProfile.osDisk.osType This property allows + * you to specify the type of the OS that is included in the disk if creating a + * VM from a custom image.

    Possible values are:

    **Windows** + *

    **Linux**. Possible values include: 'Windows', 'Linux' + * + * @param {string} parameters.storageProfile.osDisk.osState The OS State. + * Possible values include: 'Generalized', 'Specialized' + * + * @param {object} [parameters.storageProfile.osDisk.snapshot] The snapshot. + * + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The + * managedDisk. + * + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id + * + * @param {string} [parameters.storageProfile.osDisk.blobUri] The Virtual Hard + * Disk. + * + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of empty data disks in gigabytes. This element can be used to overwrite + * the name of the disk in a virtual machine image.

    This value cannot + * be larger than 1023 GB + * + * @param {string} [parameters.storageProfile.osDisk.storageAccountType] + * Specifies the storage account type for the managed disk. Possible values + * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {boolean} [parameters.storageProfile.zoneResilient] Specifies whether + * an image is zone resilient or not. Default is false. Zone resilient images + * can be created only in regions that provide Zone Redundant Storage (ZRS). + * + * @param {object} [parameters.tags] Resource tags + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginUpdateWithHttpOperationResponse(resourceGroupName, imageName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginUpdate(resourceGroupName, imageName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Update an image. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} imageName The name of the image. + * + * @param {object} parameters Parameters supplied to the Update Image + * operation. + * + * @param {object} [parameters.sourceVirtualMachine] The source virtual machine + * from which Image is created. + * + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. + * + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} parameters.storageProfile.osDisk.osType This property allows + * you to specify the type of the OS that is included in the disk if creating a + * VM from a custom image.

    Possible values are:

    **Windows** + *

    **Linux**. Possible values include: 'Windows', 'Linux' + * + * @param {string} parameters.storageProfile.osDisk.osState The OS State. + * Possible values include: 'Generalized', 'Specialized' + * + * @param {object} [parameters.storageProfile.osDisk.snapshot] The snapshot. + * + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The + * managedDisk. + * + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id + * + * @param {string} [parameters.storageProfile.osDisk.blobUri] The Virtual Hard + * Disk. + * + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of empty data disks in gigabytes. This element can be used to overwrite + * the name of the disk in a virtual machine image.

    This value cannot + * be larger than 1023 GB + * + * @param {string} [parameters.storageProfile.osDisk.storageAccountType] + * Specifies the storage account type for the managed disk. Possible values + * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {boolean} [parameters.storageProfile.zoneResilient] Specifies whether + * an image is zone resilient or not. Default is false. Zone resilient images + * can be created only in regions that provide Zone Redundant Storage (ZRS). + * + * @param {object} [parameters.tags] Resource tags + * + * @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 {Image} - 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 Image} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginUpdate(resourceGroupName, imageName, 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._beginUpdate(resourceGroupName, imageName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginUpdate(resourceGroupName, imageName, parameters, options, optionalCallback); + } + } + + /** + * Deletes an Image. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} imageName The name of the image. + * + * @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. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, imageName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, imageName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes an Image. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} imageName The name of the image. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + beginDeleteMethod(resourceGroupName, imageName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, imageName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, imageName, options, optionalCallback); + } + } + + /** + * Gets the list of images under a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByResourceGroupNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the list of images under a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ImageListResult} - 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 ImageListResult} 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. + */ + listByResourceGroupNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByResourceGroupNext(nextPageLink, options, optionalCallback); + } + } + + /** + * Gets the list of Images in the subscription. Use nextLink property in the + * response to get the next page of Images. Do this till nextLink is null to + * fetch all the Images. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the list of Images in the subscription. Use nextLink property in the + * response to get the next page of Images. Do this till nextLink is null to + * fetch all the Images. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ImageListResult} - 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 ImageListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = Images; diff --git a/lib/services/computeManagement2/lib/lib/operations/index.d.ts b/lib/services/computeManagement2/lib/lib/operations/index.d.ts new file mode 100644 index 0000000000..2c94ab8bae --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/operations/index.d.ts @@ -0,0 +1,21609 @@ +/* + * 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. +*/ + +import { ServiceClientOptions, RequestOptions, ServiceCallback, HttpOperationResponse } from 'ms-rest'; +import * as models from '../models'; + + +/** + * @class + * Operations + * __NOTE__: An instance of this class is automatically created for an + * instance of the ComputeManagementClient. + */ +export interface Operations { + + + /** + * Gets a list of compute operations. + * + * @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. + */ + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a list of compute operations. + * + * @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 {ComputeOperationListResult} - 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. + * + * {ComputeOperationListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ComputeOperationListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * AvailabilitySets + * __NOTE__: An instance of this class is automatically created for an + * instance of the ComputeManagementClient. + */ +export interface AvailabilitySets { + + + /** + * Create or update an availability set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} availabilitySetName The name of the availability set. + * + * @param {object} parameters Parameters supplied to the Create Availability + * Set operation. + * + * @param {number} [parameters.platformUpdateDomainCount] Update Domain count. + * + * @param {number} [parameters.platformFaultDomainCount] Fault Domain count. + * + * @param {array} [parameters.virtualMachines] A list of references to all + * virtual machines in the availability set. + * + * @param {object} [parameters.sku] Sku of the availability set + * + * @param {string} [parameters.sku.name] The sku name. + * + * @param {string} [parameters.sku.tier] Specifies the tier of virtual machines + * in a scale set.

    Possible Values:

    **Standard**

    **Basic** + * + * @param {number} [parameters.sku.capacity] Specifies the number of virtual + * machines in the scale set. + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @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. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, availabilitySetName: string, parameters: models.AvailabilitySet, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Create or update an availability set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} availabilitySetName The name of the availability set. + * + * @param {object} parameters Parameters supplied to the Create Availability + * Set operation. + * + * @param {number} [parameters.platformUpdateDomainCount] Update Domain count. + * + * @param {number} [parameters.platformFaultDomainCount] Fault Domain count. + * + * @param {array} [parameters.virtualMachines] A list of references to all + * virtual machines in the availability set. + * + * @param {object} [parameters.sku] Sku of the availability set + * + * @param {string} [parameters.sku.name] The sku name. + * + * @param {string} [parameters.sku.tier] Specifies the tier of virtual machines + * in a scale set.

    Possible Values:

    **Standard**

    **Basic** + * + * @param {number} [parameters.sku.capacity] Specifies the number of virtual + * machines in the scale set. + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @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 {AvailabilitySet} - 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. + * + * {AvailabilitySet} [result] - The deserialized result object if an error did not occur. + * See {@link AvailabilitySet} 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. + */ + createOrUpdate(resourceGroupName: string, availabilitySetName: string, parameters: models.AvailabilitySet, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, availabilitySetName: string, parameters: models.AvailabilitySet, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, availabilitySetName: string, parameters: models.AvailabilitySet, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Update an availability set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} availabilitySetName The name of the availability set. + * + * @param {object} parameters Parameters supplied to the Update Availability + * Set operation. + * + * @param {number} [parameters.platformUpdateDomainCount] Update Domain count. + * + * @param {number} [parameters.platformFaultDomainCount] Fault Domain count. + * + * @param {array} [parameters.virtualMachines] A list of references to all + * virtual machines in the availability set. + * + * @param {object} [parameters.sku] Sku of the availability set + * + * @param {string} [parameters.sku.name] The sku name. + * + * @param {string} [parameters.sku.tier] Specifies the tier of virtual machines + * in a scale set.

    Possible Values:

    **Standard**

    **Basic** + * + * @param {number} [parameters.sku.capacity] Specifies the number of virtual + * machines in the scale set. + * + * @param {object} [parameters.tags] Resource tags + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + updateWithHttpOperationResponse(resourceGroupName: string, availabilitySetName: string, parameters: models.AvailabilitySetUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Update an availability set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} availabilitySetName The name of the availability set. + * + * @param {object} parameters Parameters supplied to the Update Availability + * Set operation. + * + * @param {number} [parameters.platformUpdateDomainCount] Update Domain count. + * + * @param {number} [parameters.platformFaultDomainCount] Fault Domain count. + * + * @param {array} [parameters.virtualMachines] A list of references to all + * virtual machines in the availability set. + * + * @param {object} [parameters.sku] Sku of the availability set + * + * @param {string} [parameters.sku.name] The sku name. + * + * @param {string} [parameters.sku.tier] Specifies the tier of virtual machines + * in a scale set.

    Possible Values:

    **Standard**

    **Basic** + * + * @param {number} [parameters.sku.capacity] Specifies the number of virtual + * machines in the scale set. + * + * @param {object} [parameters.tags] Resource tags + * + * @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 {AvailabilitySet} - 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. + * + * {AvailabilitySet} [result] - The deserialized result object if an error did not occur. + * See {@link AvailabilitySet} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + update(resourceGroupName: string, availabilitySetName: string, parameters: models.AvailabilitySetUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, availabilitySetName: string, parameters: models.AvailabilitySetUpdate, callback: ServiceCallback): void; + update(resourceGroupName: string, availabilitySetName: string, parameters: models.AvailabilitySetUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Delete an availability set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} availabilitySetName The name of the availability set. + * + * @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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, availabilitySetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Delete an availability set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} availabilitySetName The name of the availability set. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + deleteMethod(resourceGroupName: string, availabilitySetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, availabilitySetName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, availabilitySetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Retrieves information about an availability set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} availabilitySetName The name of the availability set. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, availabilitySetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Retrieves information about an availability set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} availabilitySetName The name of the availability set. + * + * @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 {AvailabilitySet} - 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. + * + * {AvailabilitySet} [result] - The deserialized result object if an error did not occur. + * See {@link AvailabilitySet} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, availabilitySetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, availabilitySetName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, availabilitySetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists all availability sets in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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. + */ + listWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all availability sets in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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 {AvailabilitySetListResult} - 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. + * + * {AvailabilitySetListResult} [result] - The deserialized result object if an error did not occur. + * See {@link AvailabilitySetListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(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; + + + /** + * Lists all available virtual machine sizes that can be used to create a new + * virtual machine in an existing availability set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} availabilitySetName The name of the availability set. + * + * @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. + */ + listAvailableSizesWithHttpOperationResponse(resourceGroupName: string, availabilitySetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all available virtual machine sizes that can be used to create a new + * virtual machine in an existing availability set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} availabilitySetName The name of the availability set. + * + * @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 {VirtualMachineSizeListResult} - 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. + * + * {VirtualMachineSizeListResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineSizeListResult} 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. + */ + listAvailableSizes(resourceGroupName: string, availabilitySetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAvailableSizes(resourceGroupName: string, availabilitySetName: string, callback: ServiceCallback): void; + listAvailableSizes(resourceGroupName: string, availabilitySetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * VirtualMachineExtensionImages + * __NOTE__: An instance of this class is automatically created for an + * instance of the ComputeManagementClient. + */ +export interface VirtualMachineExtensionImages { + + + /** + * Gets a virtual machine extension image. + * + * @param {string} location The name of a supported Azure region. + * + * @param {string} publisherName + * + * @param {string} type + * + * @param {string} version + * + * @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(location: string, publisherName: string, type: string, version: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a virtual machine extension image. + * + * @param {string} location The name of a supported Azure region. + * + * @param {string} publisherName + * + * @param {string} type + * + * @param {string} version + * + * @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 {VirtualMachineExtensionImage} - 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. + * + * {VirtualMachineExtensionImage} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineExtensionImage} 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(location: string, publisherName: string, type: string, version: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(location: string, publisherName: string, type: string, version: string, callback: ServiceCallback): void; + get(location: string, publisherName: string, type: string, version: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a list of virtual machine extension image types. + * + * @param {string} location The name of a supported Azure region. + * + * @param {string} publisherName + * + * @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. + */ + listTypesWithHttpOperationResponse(location: string, publisherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a list of virtual machine extension image types. + * + * @param {string} location The name of a supported Azure region. + * + * @param {string} publisherName + * + * @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 {Array} - 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. + * + * {Array} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listTypes(location: string, publisherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listTypes(location: string, publisherName: string, callback: ServiceCallback): void; + listTypes(location: string, publisherName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a list of virtual machine extension image versions. + * + * @param {string} location The name of a supported Azure region. + * + * @param {string} publisherName + * + * @param {string} type + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. + * + * @param {number} [options.top] + * + * @param {string} [options.orderby] + * + * @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. + */ + listVersionsWithHttpOperationResponse(location: string, publisherName: string, type: string, options?: { filter? : string, top? : number, orderby? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a list of virtual machine extension image versions. + * + * @param {string} location The name of a supported Azure region. + * + * @param {string} publisherName + * + * @param {string} type + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. + * + * @param {number} [options.top] + * + * @param {string} [options.orderby] + * + * @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 {Array} - 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. + * + * {Array} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listVersions(location: string, publisherName: string, type: string, options?: { filter? : string, top? : number, orderby? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listVersions(location: string, publisherName: string, type: string, callback: ServiceCallback): void; + listVersions(location: string, publisherName: string, type: string, options: { filter? : string, top? : number, orderby? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * VirtualMachineExtensions + * __NOTE__: An instance of this class is automatically created for an + * instance of the ComputeManagementClient. + */ +export interface VirtualMachineExtensions { + + + /** + * The operation to create or update the extension. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine where the extension + * should be create or updated. + * + * @param {string} vmExtensionName The name of the virtual machine extension. + * + * @param {object} extensionParameters Parameters supplied to the Create + * Virtual Machine Extension operation. + * + * @param {string} [extensionParameters.forceUpdateTag] How the extension + * handler should be forced to update even if the extension configuration has + * not changed. + * + * @param {string} [extensionParameters.publisher] The name of the extension + * handler publisher. + * + * @param {string} [extensionParameters.virtualMachineExtensionType] Specifies + * the type of the extension; an example is "CustomScriptExtension". + * + * @param {string} [extensionParameters.typeHandlerVersion] Specifies the + * version of the script handler. + * + * @param {boolean} [extensionParameters.autoUpgradeMinorVersion] Indicates + * whether the extension should use a newer minor version if one is available + * at deployment time. Once deployed, however, the extension will not upgrade + * minor versions unless redeployed, even with this property set to true. + * + * @param {object} [extensionParameters.settings] Json formatted public + * settings for the extension. + * + * @param {object} [extensionParameters.protectedSettings] The extension can + * contain either protectedSettings or protectedSettingsFromKeyVault or no + * protected settings at all. + * + * @param {object} [extensionParameters.instanceView] The virtual machine + * extension instance view. + * + * @param {string} [extensionParameters.instanceView.name] The virtual machine + * extension name. + * + * @param {string} [extensionParameters.instanceView.type] Specifies the type + * of the extension; an example is "CustomScriptExtension". + * + * @param {string} [extensionParameters.instanceView.typeHandlerVersion] + * Specifies the version of the script handler. + * + * @param {array} [extensionParameters.instanceView.substatuses] The resource + * status information. + * + * @param {array} [extensionParameters.instanceView.statuses] The resource + * status information. + * + * @param {string} extensionParameters.location Resource location + * + * @param {object} [extensionParameters.tags] Resource tags + * + * @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. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, vmName: string, vmExtensionName: string, extensionParameters: models.VirtualMachineExtension, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * The operation to create or update the extension. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine where the extension + * should be create or updated. + * + * @param {string} vmExtensionName The name of the virtual machine extension. + * + * @param {object} extensionParameters Parameters supplied to the Create + * Virtual Machine Extension operation. + * + * @param {string} [extensionParameters.forceUpdateTag] How the extension + * handler should be forced to update even if the extension configuration has + * not changed. + * + * @param {string} [extensionParameters.publisher] The name of the extension + * handler publisher. + * + * @param {string} [extensionParameters.virtualMachineExtensionType] Specifies + * the type of the extension; an example is "CustomScriptExtension". + * + * @param {string} [extensionParameters.typeHandlerVersion] Specifies the + * version of the script handler. + * + * @param {boolean} [extensionParameters.autoUpgradeMinorVersion] Indicates + * whether the extension should use a newer minor version if one is available + * at deployment time. Once deployed, however, the extension will not upgrade + * minor versions unless redeployed, even with this property set to true. + * + * @param {object} [extensionParameters.settings] Json formatted public + * settings for the extension. + * + * @param {object} [extensionParameters.protectedSettings] The extension can + * contain either protectedSettings or protectedSettingsFromKeyVault or no + * protected settings at all. + * + * @param {object} [extensionParameters.instanceView] The virtual machine + * extension instance view. + * + * @param {string} [extensionParameters.instanceView.name] The virtual machine + * extension name. + * + * @param {string} [extensionParameters.instanceView.type] Specifies the type + * of the extension; an example is "CustomScriptExtension". + * + * @param {string} [extensionParameters.instanceView.typeHandlerVersion] + * Specifies the version of the script handler. + * + * @param {array} [extensionParameters.instanceView.substatuses] The resource + * status information. + * + * @param {array} [extensionParameters.instanceView.statuses] The resource + * status information. + * + * @param {string} extensionParameters.location Resource location + * + * @param {object} [extensionParameters.tags] Resource tags + * + * @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 {VirtualMachineExtension} - 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. + * + * {VirtualMachineExtension} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineExtension} 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. + */ + createOrUpdate(resourceGroupName: string, vmName: string, vmExtensionName: string, extensionParameters: models.VirtualMachineExtension, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, vmName: string, vmExtensionName: string, extensionParameters: models.VirtualMachineExtension, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, vmName: string, vmExtensionName: string, extensionParameters: models.VirtualMachineExtension, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * The operation to delete the extension. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine where the extension + * should be deleted. + * + * @param {string} vmExtensionName The name of the virtual machine extension. + * + * @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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, vmName: string, vmExtensionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * The operation to delete the extension. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine where the extension + * should be deleted. + * + * @param {string} vmExtensionName The name of the virtual machine extension. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + deleteMethod(resourceGroupName: string, vmName: string, vmExtensionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, vmName: string, vmExtensionName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, vmName: string, vmExtensionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * The operation to get the extension. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine containing the + * extension. + * + * @param {string} vmExtensionName The name of the virtual machine extension. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] The expand expression to apply on the + * operation. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, vmName: string, vmExtensionName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * The operation to get the extension. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine containing the + * extension. + * + * @param {string} vmExtensionName The name of the virtual machine extension. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] The expand expression to apply on the + * operation. + * + * @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 {VirtualMachineExtension} - 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. + * + * {VirtualMachineExtension} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineExtension} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, vmName: string, vmExtensionName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, vmName: string, vmExtensionName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, vmName: string, vmExtensionName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * The operation to create or update the extension. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine where the extension + * should be create or updated. + * + * @param {string} vmExtensionName The name of the virtual machine extension. + * + * @param {object} extensionParameters Parameters supplied to the Create + * Virtual Machine Extension operation. + * + * @param {string} [extensionParameters.forceUpdateTag] How the extension + * handler should be forced to update even if the extension configuration has + * not changed. + * + * @param {string} [extensionParameters.publisher] The name of the extension + * handler publisher. + * + * @param {string} [extensionParameters.virtualMachineExtensionType] Specifies + * the type of the extension; an example is "CustomScriptExtension". + * + * @param {string} [extensionParameters.typeHandlerVersion] Specifies the + * version of the script handler. + * + * @param {boolean} [extensionParameters.autoUpgradeMinorVersion] Indicates + * whether the extension should use a newer minor version if one is available + * at deployment time. Once deployed, however, the extension will not upgrade + * minor versions unless redeployed, even with this property set to true. + * + * @param {object} [extensionParameters.settings] Json formatted public + * settings for the extension. + * + * @param {object} [extensionParameters.protectedSettings] The extension can + * contain either protectedSettings or protectedSettingsFromKeyVault or no + * protected settings at all. + * + * @param {object} [extensionParameters.instanceView] The virtual machine + * extension instance view. + * + * @param {string} [extensionParameters.instanceView.name] The virtual machine + * extension name. + * + * @param {string} [extensionParameters.instanceView.type] Specifies the type + * of the extension; an example is "CustomScriptExtension". + * + * @param {string} [extensionParameters.instanceView.typeHandlerVersion] + * Specifies the version of the script handler. + * + * @param {array} [extensionParameters.instanceView.substatuses] The resource + * status information. + * + * @param {array} [extensionParameters.instanceView.statuses] The resource + * status information. + * + * @param {string} extensionParameters.location Resource location + * + * @param {object} [extensionParameters.tags] Resource tags + * + * @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. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, vmName: string, vmExtensionName: string, extensionParameters: models.VirtualMachineExtension, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * The operation to create or update the extension. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine where the extension + * should be create or updated. + * + * @param {string} vmExtensionName The name of the virtual machine extension. + * + * @param {object} extensionParameters Parameters supplied to the Create + * Virtual Machine Extension operation. + * + * @param {string} [extensionParameters.forceUpdateTag] How the extension + * handler should be forced to update even if the extension configuration has + * not changed. + * + * @param {string} [extensionParameters.publisher] The name of the extension + * handler publisher. + * + * @param {string} [extensionParameters.virtualMachineExtensionType] Specifies + * the type of the extension; an example is "CustomScriptExtension". + * + * @param {string} [extensionParameters.typeHandlerVersion] Specifies the + * version of the script handler. + * + * @param {boolean} [extensionParameters.autoUpgradeMinorVersion] Indicates + * whether the extension should use a newer minor version if one is available + * at deployment time. Once deployed, however, the extension will not upgrade + * minor versions unless redeployed, even with this property set to true. + * + * @param {object} [extensionParameters.settings] Json formatted public + * settings for the extension. + * + * @param {object} [extensionParameters.protectedSettings] The extension can + * contain either protectedSettings or protectedSettingsFromKeyVault or no + * protected settings at all. + * + * @param {object} [extensionParameters.instanceView] The virtual machine + * extension instance view. + * + * @param {string} [extensionParameters.instanceView.name] The virtual machine + * extension name. + * + * @param {string} [extensionParameters.instanceView.type] Specifies the type + * of the extension; an example is "CustomScriptExtension". + * + * @param {string} [extensionParameters.instanceView.typeHandlerVersion] + * Specifies the version of the script handler. + * + * @param {array} [extensionParameters.instanceView.substatuses] The resource + * status information. + * + * @param {array} [extensionParameters.instanceView.statuses] The resource + * status information. + * + * @param {string} extensionParameters.location Resource location + * + * @param {object} [extensionParameters.tags] Resource tags + * + * @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 {VirtualMachineExtension} - 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. + * + * {VirtualMachineExtension} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineExtension} 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. + */ + beginCreateOrUpdate(resourceGroupName: string, vmName: string, vmExtensionName: string, extensionParameters: models.VirtualMachineExtension, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, vmName: string, vmExtensionName: string, extensionParameters: models.VirtualMachineExtension, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, vmName: string, vmExtensionName: string, extensionParameters: models.VirtualMachineExtension, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * The operation to delete the extension. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine where the extension + * should be deleted. + * + * @param {string} vmExtensionName The name of the virtual machine extension. + * + * @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. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, vmName: string, vmExtensionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * The operation to delete the extension. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine where the extension + * should be deleted. + * + * @param {string} vmExtensionName The name of the virtual machine extension. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + beginDeleteMethod(resourceGroupName: string, vmName: string, vmExtensionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, vmName: string, vmExtensionName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, vmName: string, vmExtensionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * VirtualMachineImages + * __NOTE__: An instance of this class is automatically created for an + * instance of the ComputeManagementClient. + */ +export interface VirtualMachineImages { + + + /** + * Gets a virtual machine image. + * + * @param {string} location The name of a supported Azure region. + * + * @param {string} publisherName A valid image publisher. + * + * @param {string} offer A valid image publisher offer. + * + * @param {string} skus A valid image SKU. + * + * @param {string} version A valid image SKU version. + * + * @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(location: string, publisherName: string, offer: string, skus: string, version: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a virtual machine image. + * + * @param {string} location The name of a supported Azure region. + * + * @param {string} publisherName A valid image publisher. + * + * @param {string} offer A valid image publisher offer. + * + * @param {string} skus A valid image SKU. + * + * @param {string} version A valid image SKU version. + * + * @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 {VirtualMachineImage} - 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. + * + * {VirtualMachineImage} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineImage} 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(location: string, publisherName: string, offer: string, skus: string, version: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(location: string, publisherName: string, offer: string, skus: string, version: string, callback: ServiceCallback): void; + get(location: string, publisherName: string, offer: string, skus: string, version: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a list of all virtual machine image versions for the specified + * location, publisher, offer, and SKU. + * + * @param {string} location The name of a supported Azure region. + * + * @param {string} publisherName A valid image publisher. + * + * @param {string} offer A valid image publisher offer. + * + * @param {string} skus A valid image SKU. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. + * + * @param {number} [options.top] + * + * @param {string} [options.orderby] + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(location: string, publisherName: string, offer: string, skus: string, options?: { filter? : string, top? : number, orderby? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a list of all virtual machine image versions for the specified + * location, publisher, offer, and SKU. + * + * @param {string} location The name of a supported Azure region. + * + * @param {string} publisherName A valid image publisher. + * + * @param {string} offer A valid image publisher offer. + * + * @param {string} skus A valid image SKU. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. + * + * @param {number} [options.top] + * + * @param {string} [options.orderby] + * + * @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 {Array} - 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. + * + * {Array} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(location: string, publisherName: string, offer: string, skus: string, options?: { filter? : string, top? : number, orderby? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + list(location: string, publisherName: string, offer: string, skus: string, callback: ServiceCallback): void; + list(location: string, publisherName: string, offer: string, skus: string, options: { filter? : string, top? : number, orderby? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a list of virtual machine image offers for the specified location and + * publisher. + * + * @param {string} location The name of a supported Azure region. + * + * @param {string} publisherName A valid image publisher. + * + * @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. + */ + listOffersWithHttpOperationResponse(location: string, publisherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a list of virtual machine image offers for the specified location and + * publisher. + * + * @param {string} location The name of a supported Azure region. + * + * @param {string} publisherName A valid image publisher. + * + * @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 {Array} - 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. + * + * {Array} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listOffers(location: string, publisherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listOffers(location: string, publisherName: string, callback: ServiceCallback): void; + listOffers(location: string, publisherName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a list of virtual machine image publishers for the specified Azure + * location. + * + * @param {string} location The name of a supported Azure region. + * + * @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. + */ + listPublishersWithHttpOperationResponse(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a list of virtual machine image publishers for the specified Azure + * location. + * + * @param {string} location The name of a supported Azure region. + * + * @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 {Array} - 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. + * + * {Array} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listPublishers(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listPublishers(location: string, callback: ServiceCallback): void; + listPublishers(location: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a list of virtual machine image SKUs for the specified location, + * publisher, and offer. + * + * @param {string} location The name of a supported Azure region. + * + * @param {string} publisherName A valid image publisher. + * + * @param {string} offer A valid image publisher offer. + * + * @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. + */ + listSkusWithHttpOperationResponse(location: string, publisherName: string, offer: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a list of virtual machine image SKUs for the specified location, + * publisher, and offer. + * + * @param {string} location The name of a supported Azure region. + * + * @param {string} publisherName A valid image publisher. + * + * @param {string} offer A valid image publisher offer. + * + * @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 {Array} - 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. + * + * {Array} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listSkus(location: string, publisherName: string, offer: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSkus(location: string, publisherName: string, offer: string, callback: ServiceCallback): void; + listSkus(location: string, publisherName: string, offer: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * UsageOperations + * __NOTE__: An instance of this class is automatically created for an + * instance of the ComputeManagementClient. + */ +export interface UsageOperations { + + + /** + * Gets, for the specified location, the current compute resource usage + * information as well as the limits for compute resources under the + * subscription. + * + * @param {string} location The location for which resource usage is queried. + * + * @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. + */ + listWithHttpOperationResponse(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets, for the specified location, the current compute resource usage + * information as well as the limits for compute resources under the + * subscription. + * + * @param {string} location The location for which resource usage is queried. + * + * @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 {ListUsagesResult} - 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. + * + * {ListUsagesResult} [result] - The deserialized result object if an error did not occur. + * See {@link ListUsagesResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(location: string, callback: ServiceCallback): void; + list(location: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets, for the specified location, the current compute resource usage + * information as well as the limits for compute resources under the + * subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets, for the specified location, the current compute resource usage + * information as well as the limits for compute resources under the + * subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ListUsagesResult} - 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. + * + * {ListUsagesResult} [result] - The deserialized result object if an error did not occur. + * See {@link ListUsagesResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * VirtualMachineSizes + * __NOTE__: An instance of this class is automatically created for an + * instance of the ComputeManagementClient. + */ +export interface VirtualMachineSizes { + + + /** + * Lists all available virtual machine sizes for a subscription in a location. + * + * @param {string} location The location upon which virtual-machine-sizes is + * queried. + * + * @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. + */ + listWithHttpOperationResponse(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all available virtual machine sizes for a subscription in a location. + * + * @param {string} location The location upon which virtual-machine-sizes is + * queried. + * + * @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 {VirtualMachineSizeListResult} - 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. + * + * {VirtualMachineSizeListResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineSizeListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(location: string, callback: ServiceCallback): void; + list(location: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * Images + * __NOTE__: An instance of this class is automatically created for an + * instance of the ComputeManagementClient. + */ +export interface Images { + + + /** + * Create or update an image. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} imageName The name of the image. + * + * @param {object} parameters Parameters supplied to the Create Image + * operation. + * + * @param {object} [parameters.sourceVirtualMachine] The source virtual machine + * from which Image is created. + * + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. + * + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} parameters.storageProfile.osDisk.osType This property allows + * you to specify the type of the OS that is included in the disk if creating a + * VM from a custom image.

    Possible values are:

    **Windows** + *

    **Linux**. Possible values include: 'Windows', 'Linux' + * + * @param {string} parameters.storageProfile.osDisk.osState The OS State. + * Possible values include: 'Generalized', 'Specialized' + * + * @param {object} [parameters.storageProfile.osDisk.snapshot] The snapshot. + * + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The + * managedDisk. + * + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id + * + * @param {string} [parameters.storageProfile.osDisk.blobUri] The Virtual Hard + * Disk. + * + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of empty data disks in gigabytes. This element can be used to overwrite + * the name of the disk in a virtual machine image.

    This value cannot + * be larger than 1023 GB + * + * @param {string} [parameters.storageProfile.osDisk.storageAccountType] + * Specifies the storage account type for the managed disk. Possible values + * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {boolean} [parameters.storageProfile.zoneResilient] Specifies whether + * an image is zone resilient or not. Default is false. Zone resilient images + * can be created only in regions that provide Zone Redundant Storage (ZRS). + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @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. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, imageName: string, parameters: models.Image, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Create or update an image. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} imageName The name of the image. + * + * @param {object} parameters Parameters supplied to the Create Image + * operation. + * + * @param {object} [parameters.sourceVirtualMachine] The source virtual machine + * from which Image is created. + * + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. + * + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} parameters.storageProfile.osDisk.osType This property allows + * you to specify the type of the OS that is included in the disk if creating a + * VM from a custom image.

    Possible values are:

    **Windows** + *

    **Linux**. Possible values include: 'Windows', 'Linux' + * + * @param {string} parameters.storageProfile.osDisk.osState The OS State. + * Possible values include: 'Generalized', 'Specialized' + * + * @param {object} [parameters.storageProfile.osDisk.snapshot] The snapshot. + * + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The + * managedDisk. + * + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id + * + * @param {string} [parameters.storageProfile.osDisk.blobUri] The Virtual Hard + * Disk. + * + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of empty data disks in gigabytes. This element can be used to overwrite + * the name of the disk in a virtual machine image.

    This value cannot + * be larger than 1023 GB + * + * @param {string} [parameters.storageProfile.osDisk.storageAccountType] + * Specifies the storage account type for the managed disk. Possible values + * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {boolean} [parameters.storageProfile.zoneResilient] Specifies whether + * an image is zone resilient or not. Default is false. Zone resilient images + * can be created only in regions that provide Zone Redundant Storage (ZRS). + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @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 {Image} - 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. + * + * {Image} [result] - The deserialized result object if an error did not occur. + * See {@link Image} 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. + */ + createOrUpdate(resourceGroupName: string, imageName: string, parameters: models.Image, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, imageName: string, parameters: models.Image, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, imageName: string, parameters: models.Image, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Update an image. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} imageName The name of the image. + * + * @param {object} parameters Parameters supplied to the Update Image + * operation. + * + * @param {object} [parameters.sourceVirtualMachine] The source virtual machine + * from which Image is created. + * + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. + * + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} parameters.storageProfile.osDisk.osType This property allows + * you to specify the type of the OS that is included in the disk if creating a + * VM from a custom image.

    Possible values are:

    **Windows** + *

    **Linux**. Possible values include: 'Windows', 'Linux' + * + * @param {string} parameters.storageProfile.osDisk.osState The OS State. + * Possible values include: 'Generalized', 'Specialized' + * + * @param {object} [parameters.storageProfile.osDisk.snapshot] The snapshot. + * + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The + * managedDisk. + * + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id + * + * @param {string} [parameters.storageProfile.osDisk.blobUri] The Virtual Hard + * Disk. + * + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of empty data disks in gigabytes. This element can be used to overwrite + * the name of the disk in a virtual machine image.

    This value cannot + * be larger than 1023 GB + * + * @param {string} [parameters.storageProfile.osDisk.storageAccountType] + * Specifies the storage account type for the managed disk. Possible values + * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {boolean} [parameters.storageProfile.zoneResilient] Specifies whether + * an image is zone resilient or not. Default is false. Zone resilient images + * can be created only in regions that provide Zone Redundant Storage (ZRS). + * + * @param {object} [parameters.tags] Resource tags + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + updateWithHttpOperationResponse(resourceGroupName: string, imageName: string, parameters: models.ImageUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Update an image. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} imageName The name of the image. + * + * @param {object} parameters Parameters supplied to the Update Image + * operation. + * + * @param {object} [parameters.sourceVirtualMachine] The source virtual machine + * from which Image is created. + * + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. + * + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} parameters.storageProfile.osDisk.osType This property allows + * you to specify the type of the OS that is included in the disk if creating a + * VM from a custom image.

    Possible values are:

    **Windows** + *

    **Linux**. Possible values include: 'Windows', 'Linux' + * + * @param {string} parameters.storageProfile.osDisk.osState The OS State. + * Possible values include: 'Generalized', 'Specialized' + * + * @param {object} [parameters.storageProfile.osDisk.snapshot] The snapshot. + * + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The + * managedDisk. + * + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id + * + * @param {string} [parameters.storageProfile.osDisk.blobUri] The Virtual Hard + * Disk. + * + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of empty data disks in gigabytes. This element can be used to overwrite + * the name of the disk in a virtual machine image.

    This value cannot + * be larger than 1023 GB + * + * @param {string} [parameters.storageProfile.osDisk.storageAccountType] + * Specifies the storage account type for the managed disk. Possible values + * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {boolean} [parameters.storageProfile.zoneResilient] Specifies whether + * an image is zone resilient or not. Default is false. Zone resilient images + * can be created only in regions that provide Zone Redundant Storage (ZRS). + * + * @param {object} [parameters.tags] Resource tags + * + * @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 {Image} - 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. + * + * {Image} [result] - The deserialized result object if an error did not occur. + * See {@link Image} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + update(resourceGroupName: string, imageName: string, parameters: models.ImageUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, imageName: string, parameters: models.ImageUpdate, callback: ServiceCallback): void; + update(resourceGroupName: string, imageName: string, parameters: models.ImageUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes an Image. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} imageName The name of the image. + * + * @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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, imageName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes an Image. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} imageName The name of the image. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + deleteMethod(resourceGroupName: string, imageName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, imageName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, imageName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets an image. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} imageName The name of the image. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] The expand expression to apply on the + * operation. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, imageName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets an image. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} imageName The name of the image. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] The expand expression to apply on the + * operation. + * + * @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 {Image} - 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. + * + * {Image} [result] - The deserialized result object if an error did not occur. + * See {@link Image} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, imageName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, imageName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, imageName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the list of images under a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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. + */ + listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the list of images under a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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 {ImageListResult} - 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. + * + * {ImageListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ImageListResult} 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. + */ + 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; + + + /** + * Gets the list of Images in the subscription. Use nextLink property in the + * response to get the next page of Images. Do this till nextLink is null to + * fetch all the Images. + * + * @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. + */ + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the list of Images in the subscription. Use nextLink property in the + * response to get the next page of Images. Do this till nextLink is null to + * fetch all the Images. + * + * @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 {ImageListResult} - 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. + * + * {ImageListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ImageListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Create or update an image. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} imageName The name of the image. + * + * @param {object} parameters Parameters supplied to the Create Image + * operation. + * + * @param {object} [parameters.sourceVirtualMachine] The source virtual machine + * from which Image is created. + * + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. + * + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} parameters.storageProfile.osDisk.osType This property allows + * you to specify the type of the OS that is included in the disk if creating a + * VM from a custom image.

    Possible values are:

    **Windows** + *

    **Linux**. Possible values include: 'Windows', 'Linux' + * + * @param {string} parameters.storageProfile.osDisk.osState The OS State. + * Possible values include: 'Generalized', 'Specialized' + * + * @param {object} [parameters.storageProfile.osDisk.snapshot] The snapshot. + * + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The + * managedDisk. + * + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id + * + * @param {string} [parameters.storageProfile.osDisk.blobUri] The Virtual Hard + * Disk. + * + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of empty data disks in gigabytes. This element can be used to overwrite + * the name of the disk in a virtual machine image.

    This value cannot + * be larger than 1023 GB + * + * @param {string} [parameters.storageProfile.osDisk.storageAccountType] + * Specifies the storage account type for the managed disk. Possible values + * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {boolean} [parameters.storageProfile.zoneResilient] Specifies whether + * an image is zone resilient or not. Default is false. Zone resilient images + * can be created only in regions that provide Zone Redundant Storage (ZRS). + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @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. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, imageName: string, parameters: models.Image, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Create or update an image. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} imageName The name of the image. + * + * @param {object} parameters Parameters supplied to the Create Image + * operation. + * + * @param {object} [parameters.sourceVirtualMachine] The source virtual machine + * from which Image is created. + * + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. + * + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} parameters.storageProfile.osDisk.osType This property allows + * you to specify the type of the OS that is included in the disk if creating a + * VM from a custom image.

    Possible values are:

    **Windows** + *

    **Linux**. Possible values include: 'Windows', 'Linux' + * + * @param {string} parameters.storageProfile.osDisk.osState The OS State. + * Possible values include: 'Generalized', 'Specialized' + * + * @param {object} [parameters.storageProfile.osDisk.snapshot] The snapshot. + * + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The + * managedDisk. + * + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id + * + * @param {string} [parameters.storageProfile.osDisk.blobUri] The Virtual Hard + * Disk. + * + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of empty data disks in gigabytes. This element can be used to overwrite + * the name of the disk in a virtual machine image.

    This value cannot + * be larger than 1023 GB + * + * @param {string} [parameters.storageProfile.osDisk.storageAccountType] + * Specifies the storage account type for the managed disk. Possible values + * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {boolean} [parameters.storageProfile.zoneResilient] Specifies whether + * an image is zone resilient or not. Default is false. Zone resilient images + * can be created only in regions that provide Zone Redundant Storage (ZRS). + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @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 {Image} - 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. + * + * {Image} [result] - The deserialized result object if an error did not occur. + * See {@link Image} 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. + */ + beginCreateOrUpdate(resourceGroupName: string, imageName: string, parameters: models.Image, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, imageName: string, parameters: models.Image, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, imageName: string, parameters: models.Image, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Update an image. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} imageName The name of the image. + * + * @param {object} parameters Parameters supplied to the Update Image + * operation. + * + * @param {object} [parameters.sourceVirtualMachine] The source virtual machine + * from which Image is created. + * + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. + * + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} parameters.storageProfile.osDisk.osType This property allows + * you to specify the type of the OS that is included in the disk if creating a + * VM from a custom image.

    Possible values are:

    **Windows** + *

    **Linux**. Possible values include: 'Windows', 'Linux' + * + * @param {string} parameters.storageProfile.osDisk.osState The OS State. + * Possible values include: 'Generalized', 'Specialized' + * + * @param {object} [parameters.storageProfile.osDisk.snapshot] The snapshot. + * + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The + * managedDisk. + * + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id + * + * @param {string} [parameters.storageProfile.osDisk.blobUri] The Virtual Hard + * Disk. + * + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of empty data disks in gigabytes. This element can be used to overwrite + * the name of the disk in a virtual machine image.

    This value cannot + * be larger than 1023 GB + * + * @param {string} [parameters.storageProfile.osDisk.storageAccountType] + * Specifies the storage account type for the managed disk. Possible values + * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {boolean} [parameters.storageProfile.zoneResilient] Specifies whether + * an image is zone resilient or not. Default is false. Zone resilient images + * can be created only in regions that provide Zone Redundant Storage (ZRS). + * + * @param {object} [parameters.tags] Resource tags + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginUpdateWithHttpOperationResponse(resourceGroupName: string, imageName: string, parameters: models.ImageUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Update an image. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} imageName The name of the image. + * + * @param {object} parameters Parameters supplied to the Update Image + * operation. + * + * @param {object} [parameters.sourceVirtualMachine] The source virtual machine + * from which Image is created. + * + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. + * + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} parameters.storageProfile.osDisk.osType This property allows + * you to specify the type of the OS that is included in the disk if creating a + * VM from a custom image.

    Possible values are:

    **Windows** + *

    **Linux**. Possible values include: 'Windows', 'Linux' + * + * @param {string} parameters.storageProfile.osDisk.osState The OS State. + * Possible values include: 'Generalized', 'Specialized' + * + * @param {object} [parameters.storageProfile.osDisk.snapshot] The snapshot. + * + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The + * managedDisk. + * + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id + * + * @param {string} [parameters.storageProfile.osDisk.blobUri] The Virtual Hard + * Disk. + * + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of empty data disks in gigabytes. This element can be used to overwrite + * the name of the disk in a virtual machine image.

    This value cannot + * be larger than 1023 GB + * + * @param {string} [parameters.storageProfile.osDisk.storageAccountType] + * Specifies the storage account type for the managed disk. Possible values + * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {boolean} [parameters.storageProfile.zoneResilient] Specifies whether + * an image is zone resilient or not. Default is false. Zone resilient images + * can be created only in regions that provide Zone Redundant Storage (ZRS). + * + * @param {object} [parameters.tags] Resource tags + * + * @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 {Image} - 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. + * + * {Image} [result] - The deserialized result object if an error did not occur. + * See {@link Image} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginUpdate(resourceGroupName: string, imageName: string, parameters: models.ImageUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdate(resourceGroupName: string, imageName: string, parameters: models.ImageUpdate, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, imageName: string, parameters: models.ImageUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes an Image. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} imageName The name of the image. + * + * @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. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, imageName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes an Image. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} imageName The name of the image. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + beginDeleteMethod(resourceGroupName: string, imageName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, imageName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, imageName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the list of images under a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the list of images under a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ImageListResult} - 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. + * + * {ImageListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ImageListResult} 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. + */ + listByResourceGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the list of Images in the subscription. Use nextLink property in the + * response to get the next page of Images. Do this till nextLink is null to + * fetch all the Images. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the list of Images in the subscription. Use nextLink property in the + * response to get the next page of Images. Do this till nextLink is null to + * fetch all the Images. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ImageListResult} - 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. + * + * {ImageListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ImageListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * VirtualMachines + * __NOTE__: An instance of this class is automatically created for an + * instance of the ComputeManagementClient. + */ +export interface VirtualMachines { + + + /** + * Captures the VM by copying virtual hard disks of the VM and outputs a + * template that can be used to create similar VMs. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Capture Virtual + * Machine operation. + * + * @param {string} parameters.vhdPrefix The captured virtual hard disk's name + * prefix. + * + * @param {string} parameters.destinationContainerName The destination + * container name. + * + * @param {boolean} parameters.overwriteVhds Specifies whether to overwrite the + * destination virtual hard disk, in case of conflict. + * + * @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. + */ + captureWithHttpOperationResponse(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineCaptureParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Captures the VM by copying virtual hard disks of the VM and outputs a + * template that can be used to create similar VMs. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Capture Virtual + * Machine operation. + * + * @param {string} parameters.vhdPrefix The captured virtual hard disk's name + * prefix. + * + * @param {string} parameters.destinationContainerName The destination + * container name. + * + * @param {boolean} parameters.overwriteVhds Specifies whether to overwrite the + * destination virtual hard disk, in case of conflict. + * + * @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 {VirtualMachineCaptureResult} - 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. + * + * {VirtualMachineCaptureResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineCaptureResult} 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. + */ + capture(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineCaptureParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + capture(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineCaptureParameters, callback: ServiceCallback): void; + capture(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineCaptureParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * The operation to create or update a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Create Virtual Machine + * operation. + * + * @param {object} [parameters.plan] Specifies information about the + * marketplace image used to create the virtual machine. This element is only + * used for marketplace images. Before you can use a marketplace image from an + * API, you must enable the image for programmatic use. In the Azure portal, + * find the marketplace image that you want to use and then click **Want to + * deploy programmatically, Get Started ->**. Enter any required information + * and then click **Save**. + * + * @param {string} [parameters.plan.name] The plan ID. + * + * @param {string} [parameters.plan.publisher] The publisher ID. + * + * @param {string} [parameters.plan.product] Specifies the product of the image + * from the marketplace. This is the same value as Offer under the + * imageReference element. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {object} [parameters.hardwareProfile] Specifies the hardware settings + * for the virtual machine. + * + * @param {string} [parameters.hardwareProfile.vmSize] Specifies the size of + * the virtual machine. For more information about virtual machine sizes, see + * [Sizes for virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    The available VM sizes depend on region and availability set. For a + * list of available sizes use these APIs:

    [List all available + * virtual machine sizes in an availability + * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) + *

    [List all available virtual machine sizes in a + * region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) + *

    [List all available virtual machine sizes for + * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). + * Possible values include: '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_B1s', 'Standard_B1ms', + * 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', + * '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_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', + * 'Standard_D32_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', + * 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', + * 'Standard_D64s_v3', '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_DS13-4_v2', 'Standard_DS13-2_v2', + * 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', 'Standard_E2_v3', + * 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', 'Standard_E32_v3', + * 'Standard_E64_v3', 'Standard_E2s_v3', 'Standard_E4s_v3', 'Standard_E8s_v3', + * 'Standard_E16s_v3', 'Standard_E32s_v3', 'Standard_E64s_v3', + * 'Standard_E32-16_v3', 'Standard_E32-8s_v3', 'Standard_E64-32s_v3', + * 'Standard_E64-16s_v3', 'Standard_F1', 'Standard_F2', 'Standard_F4', + * 'Standard_F8', 'Standard_F16', 'Standard_F1s', 'Standard_F2s', + * 'Standard_F4s', 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2', + * 'Standard_F4s_v2', 'Standard_F8s_v2', 'Standard_F16s_v2', + * 'Standard_F32s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1', + * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', + * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', + * 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8', + * 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m', + * 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', + * 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms', + * 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms', + * 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms', + * 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', + * 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2', + * 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3', + * 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s', + * 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6', + * 'Standard_NV12', 'Standard_NV24' + * + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. + * + * @param {object} [parameters.storageProfile.imageReference] Specifies + * information about the image to use. You can specify information about + * platform images, marketplace images, or virtual machine images. This element + * is required when you want to use a platform image, marketplace image, or + * virtual machine image, but is not used in other creation operations. + * + * @param {string} [parameters.storageProfile.imageReference.publisher] The + * image publisher. + * + * @param {string} [parameters.storageProfile.imageReference.offer] Specifies + * the offer of the platform image or marketplace image used to create the + * virtual machine. + * + * @param {string} [parameters.storageProfile.imageReference.sku] The image + * SKU. + * + * @param {string} [parameters.storageProfile.imageReference.version] Specifies + * the version of the platform image or marketplace image used to create the + * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the + * latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. + * + * @param {string} [parameters.storageProfile.imageReference.id] Resource Id + * + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} [parameters.storageProfile.osDisk.osType] This property + * allows you to specify the type of the OS that is included in the disk if + * creating a VM from user-image or a specialized VHD.

    Possible values + * are:

    **Windows**

    **Linux**. Possible values include: + * 'Windows', 'Linux' + * + * @param {object} [parameters.storageProfile.osDisk.encryptionSettings] + * Specifies the encryption settings for the OS Disk.

    Minimum + * api-version: 2015-06-15 + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey] + * Specifies the location of the disk encryption key, which is a Key Vault + * Secret. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.secretUrl + * The URL referencing a secret in a Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the secret. + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey] + * Specifies the location of the key encryption key in Key Vault. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.keyUrl + * The URL referencing a key encryption key in Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the key. + * + * @param {boolean} + * [parameters.storageProfile.osDisk.encryptionSettings.enabled] Specifies + * whether disk encryption should be enabled on the virtual machine. + * + * @param {string} [parameters.storageProfile.osDisk.name] The disk name. + * + * @param {object} [parameters.storageProfile.osDisk.vhd] The virtual hard + * disk. + * + * @param {object} [parameters.storageProfile.osDisk.image] The source user + * image virtual hard disk. The virtual hard disk will be copied before being + * attached to the virtual machine. If SourceImage is provided, the destination + * virtual hard drive must not exist. + * + * @param {string} [parameters.storageProfile.osDisk.image.uri] Specifies the + * virtual hard disk's uri. + * + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {boolean} [parameters.storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @param {string} parameters.storageProfile.osDisk.createOption Specifies how + * the virtual machine should be created.

    Possible values are:

    + * **Attach** \u2013 This value is used when you are using a specialized disk + * to create the virtual machine.

    **FromImage** \u2013 This value is + * used when you are using an image to create the virtual machine. If you are + * using a platform image, you also use the imageReference element described + * above. If you are using a marketplace image, you also use the plan element + * previously described. Possible values include: 'FromImage', 'Empty', + * 'Attach' + * + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of an empty data disk in gigabytes. This element can be used to + * overwrite the name of the disk in a virtual machine image.

    This + * value cannot be larger than 1023 GB + * + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed + * disk parameters. + * + * @param {string} + * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies + * the storage account type for the managed disk. Possible values are: + * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id + * + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {object} [parameters.osProfile] Specifies the operating system + * settings for the virtual machine. + * + * @param {string} [parameters.osProfile.computerName] Specifies the host OS + * name of the virtual machine.

    **Max-length (Windows):** 15 + * characters

    **Max-length (Linux):** 64 characters.

    For + * naming conventions and restrictions see [Azure infrastructure services + * implementation + * guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). + * + * @param {string} [parameters.osProfile.adminUsername] Specifies the name of + * the administrator account.

    **Windows-only restriction:** Cannot end + * in "."

    **Disallowed values:** "administrator", "admin", "user", + * "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", + * "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", + * "john", "owner", "root", "server", "sql", "support", "support_388945a0", + * "sys", "test2", "test3", "user4", "user5".

    **Minimum-length + * (Linux):** 1 character

    **Max-length (Linux):** 64 characters + *

    **Max-length (Windows):** 20 characters

  • For root + * access to the Linux VM, see [Using root privileges on Linux virtual machines + * in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in this + * field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {string} [parameters.osProfile.adminPassword] Specifies the password + * of the administrator account.

    **Minimum-length (Windows):** 8 + * characters

    **Minimum-length (Linux):** 6 characters

    + * **Max-length (Windows):** 123 characters

    **Max-length (Linux):** 72 + * characters

    **Complexity requirements:** 3 out of 4 conditions below + * need to be fulfilled
    Has lower characters
    Has upper characters
    + * Has a digit
    Has a special character (Regex match [\W_])

    + * **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", + * "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", + * "iloveyou!"

    For resetting the password, see [How to reset the + * Remote Desktop service or its login password in a Windows + * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    For resetting root password, see [Manage users, SSH, and check or + * repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + * + * @param {string} [parameters.osProfile.customData] Specifies a base-64 + * encoded string of custom data. The base-64 encoded string is decoded to a + * binary array that is saved as a file on the Virtual Machine. The maximum + * length of the binary array is 65535 bytes.

    For using cloud-init for + * your VM, see [Using cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {object} [parameters.osProfile.windowsConfiguration] Specifies + * Windows operating system settings on the virtual machine. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.provisionVMAgent] Indicates + * whether virtual machine agent should be provisioned on the virtual machine. + *

    When this property is not specified in the request body, default + * behavior is to set it to true. This will ensure that VM Agent is installed + * on the VM so that extensions can be added to the VM later. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.enableAutomaticUpdates] Indicates + * whether virtual machine is enabled for automatic updates. + * + * @param {string} [parameters.osProfile.windowsConfiguration.timeZone] + * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" + * + * @param {array} + * [parameters.osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * + * @param {object} [parameters.osProfile.windowsConfiguration.winRM] Specifies + * the Windows Remote Management listeners. This enables remote Windows + * PowerShell. + * + * @param {array} [parameters.osProfile.windowsConfiguration.winRM.listeners] + * The list of Windows Remote Management listeners + * + * @param {object} [parameters.osProfile.linuxConfiguration] Specifies the + * Linux operating system settings on the virtual machine.

    For a list + * of supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @param {boolean} + * [parameters.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * + * @param {object} [parameters.osProfile.linuxConfiguration.ssh] Specifies the + * ssh key configuration for a Linux OS. + * + * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The + * list of SSH public keys used to authenticate with linux based VMs. + * + * @param {array} [parameters.osProfile.secrets] Specifies set of certificates + * that should be installed onto the virtual machine. + * + * @param {object} [parameters.networkProfile] Specifies the network interfaces + * of the virtual machine. + * + * @param {array} [parameters.networkProfile.networkInterfaces] Specifies the + * list of resource Ids for the network interfaces associated with the virtual + * machine. + * + * @param {object} [parameters.diagnosticsProfile] Specifies the boot + * diagnostic settings state.

    Minimum api-version: 2015-06-15. + * + * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, + * you can easily view the output of your console log.

    For both + * Windows and Linux virtual machines, Azure also enables you to see a + * screenshot of the VM from the hypervisor. + * + * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] + * Whether boot diagnostics should be enabled on the Virtual Machine. + * + * @param {string} [parameters.diagnosticsProfile.bootDiagnostics.storageUri] + * Uri of the storage account to use for placing the console output and + * screenshot. + * + * @param {object} [parameters.availabilitySet] Specifies information about the + * availability set that the virtual machine should be assigned to. Virtual + * machines specified in the same availability set are allocated to different + * nodes to maximize availability. For more information about availability + * sets, see [Manage the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    For more information on Azure planned maintainance, see [Planned + * maintenance for virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Currently, a VM can only be added to availability set at creation + * time. An existing VM cannot be added to an availability set. + * + * @param {string} [parameters.availabilitySet.id] Resource Id + * + * @param {string} [parameters.licenseType] Specifies that the image or disk + * that is being used was licensed on-premises. This element is only used for + * images that contain the Windows Server operating system.

    Possible + * values are:

    Windows_Client

    Windows_Server

    If this + * element is included in a request for an update, the value must match the + * initial value. This value cannot be updated.

    For more information, + * see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Minimum api-version: 2015-06-15 + * + * @param {object} [parameters.identity] The identity of the virtual machine, + * if configured. + * + * @param {string} [parameters.identity.type] The type of identity used for the + * virtual machine. The type 'SystemAssigned, UserAssigned' includes both an + * implicitly created identity and a set of user assigned identities. The type + * 'None' will remove any identities from the virtual machine. Possible values + * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', + * 'None' + * + * @param {array} [parameters.identity.identityIds] The list of user identities + * associated with the Virtual Machine. The user identity references will be + * ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * + * @param {array} [parameters.zones] The virtual machine zones. + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @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. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, vmName: string, parameters: models.VirtualMachine, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * The operation to create or update a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Create Virtual Machine + * operation. + * + * @param {object} [parameters.plan] Specifies information about the + * marketplace image used to create the virtual machine. This element is only + * used for marketplace images. Before you can use a marketplace image from an + * API, you must enable the image for programmatic use. In the Azure portal, + * find the marketplace image that you want to use and then click **Want to + * deploy programmatically, Get Started ->**. Enter any required information + * and then click **Save**. + * + * @param {string} [parameters.plan.name] The plan ID. + * + * @param {string} [parameters.plan.publisher] The publisher ID. + * + * @param {string} [parameters.plan.product] Specifies the product of the image + * from the marketplace. This is the same value as Offer under the + * imageReference element. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {object} [parameters.hardwareProfile] Specifies the hardware settings + * for the virtual machine. + * + * @param {string} [parameters.hardwareProfile.vmSize] Specifies the size of + * the virtual machine. For more information about virtual machine sizes, see + * [Sizes for virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    The available VM sizes depend on region and availability set. For a + * list of available sizes use these APIs:

    [List all available + * virtual machine sizes in an availability + * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) + *

    [List all available virtual machine sizes in a + * region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) + *

    [List all available virtual machine sizes for + * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). + * Possible values include: '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_B1s', 'Standard_B1ms', + * 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', + * '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_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', + * 'Standard_D32_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', + * 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', + * 'Standard_D64s_v3', '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_DS13-4_v2', 'Standard_DS13-2_v2', + * 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', 'Standard_E2_v3', + * 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', 'Standard_E32_v3', + * 'Standard_E64_v3', 'Standard_E2s_v3', 'Standard_E4s_v3', 'Standard_E8s_v3', + * 'Standard_E16s_v3', 'Standard_E32s_v3', 'Standard_E64s_v3', + * 'Standard_E32-16_v3', 'Standard_E32-8s_v3', 'Standard_E64-32s_v3', + * 'Standard_E64-16s_v3', 'Standard_F1', 'Standard_F2', 'Standard_F4', + * 'Standard_F8', 'Standard_F16', 'Standard_F1s', 'Standard_F2s', + * 'Standard_F4s', 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2', + * 'Standard_F4s_v2', 'Standard_F8s_v2', 'Standard_F16s_v2', + * 'Standard_F32s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1', + * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', + * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', + * 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8', + * 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m', + * 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', + * 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms', + * 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms', + * 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms', + * 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', + * 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2', + * 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3', + * 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s', + * 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6', + * 'Standard_NV12', 'Standard_NV24' + * + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. + * + * @param {object} [parameters.storageProfile.imageReference] Specifies + * information about the image to use. You can specify information about + * platform images, marketplace images, or virtual machine images. This element + * is required when you want to use a platform image, marketplace image, or + * virtual machine image, but is not used in other creation operations. + * + * @param {string} [parameters.storageProfile.imageReference.publisher] The + * image publisher. + * + * @param {string} [parameters.storageProfile.imageReference.offer] Specifies + * the offer of the platform image or marketplace image used to create the + * virtual machine. + * + * @param {string} [parameters.storageProfile.imageReference.sku] The image + * SKU. + * + * @param {string} [parameters.storageProfile.imageReference.version] Specifies + * the version of the platform image or marketplace image used to create the + * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the + * latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. + * + * @param {string} [parameters.storageProfile.imageReference.id] Resource Id + * + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} [parameters.storageProfile.osDisk.osType] This property + * allows you to specify the type of the OS that is included in the disk if + * creating a VM from user-image or a specialized VHD.

    Possible values + * are:

    **Windows**

    **Linux**. Possible values include: + * 'Windows', 'Linux' + * + * @param {object} [parameters.storageProfile.osDisk.encryptionSettings] + * Specifies the encryption settings for the OS Disk.

    Minimum + * api-version: 2015-06-15 + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey] + * Specifies the location of the disk encryption key, which is a Key Vault + * Secret. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.secretUrl + * The URL referencing a secret in a Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the secret. + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey] + * Specifies the location of the key encryption key in Key Vault. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.keyUrl + * The URL referencing a key encryption key in Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the key. + * + * @param {boolean} + * [parameters.storageProfile.osDisk.encryptionSettings.enabled] Specifies + * whether disk encryption should be enabled on the virtual machine. + * + * @param {string} [parameters.storageProfile.osDisk.name] The disk name. + * + * @param {object} [parameters.storageProfile.osDisk.vhd] The virtual hard + * disk. + * + * @param {object} [parameters.storageProfile.osDisk.image] The source user + * image virtual hard disk. The virtual hard disk will be copied before being + * attached to the virtual machine. If SourceImage is provided, the destination + * virtual hard drive must not exist. + * + * @param {string} [parameters.storageProfile.osDisk.image.uri] Specifies the + * virtual hard disk's uri. + * + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {boolean} [parameters.storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @param {string} parameters.storageProfile.osDisk.createOption Specifies how + * the virtual machine should be created.

    Possible values are:

    + * **Attach** \u2013 This value is used when you are using a specialized disk + * to create the virtual machine.

    **FromImage** \u2013 This value is + * used when you are using an image to create the virtual machine. If you are + * using a platform image, you also use the imageReference element described + * above. If you are using a marketplace image, you also use the plan element + * previously described. Possible values include: 'FromImage', 'Empty', + * 'Attach' + * + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of an empty data disk in gigabytes. This element can be used to + * overwrite the name of the disk in a virtual machine image.

    This + * value cannot be larger than 1023 GB + * + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed + * disk parameters. + * + * @param {string} + * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies + * the storage account type for the managed disk. Possible values are: + * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id + * + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {object} [parameters.osProfile] Specifies the operating system + * settings for the virtual machine. + * + * @param {string} [parameters.osProfile.computerName] Specifies the host OS + * name of the virtual machine.

    **Max-length (Windows):** 15 + * characters

    **Max-length (Linux):** 64 characters.

    For + * naming conventions and restrictions see [Azure infrastructure services + * implementation + * guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). + * + * @param {string} [parameters.osProfile.adminUsername] Specifies the name of + * the administrator account.

    **Windows-only restriction:** Cannot end + * in "."

    **Disallowed values:** "administrator", "admin", "user", + * "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", + * "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", + * "john", "owner", "root", "server", "sql", "support", "support_388945a0", + * "sys", "test2", "test3", "user4", "user5".

    **Minimum-length + * (Linux):** 1 character

    **Max-length (Linux):** 64 characters + *

    **Max-length (Windows):** 20 characters

  • For root + * access to the Linux VM, see [Using root privileges on Linux virtual machines + * in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in this + * field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {string} [parameters.osProfile.adminPassword] Specifies the password + * of the administrator account.

    **Minimum-length (Windows):** 8 + * characters

    **Minimum-length (Linux):** 6 characters

    + * **Max-length (Windows):** 123 characters

    **Max-length (Linux):** 72 + * characters

    **Complexity requirements:** 3 out of 4 conditions below + * need to be fulfilled
    Has lower characters
    Has upper characters
    + * Has a digit
    Has a special character (Regex match [\W_])

    + * **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", + * "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", + * "iloveyou!"

    For resetting the password, see [How to reset the + * Remote Desktop service or its login password in a Windows + * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    For resetting root password, see [Manage users, SSH, and check or + * repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + * + * @param {string} [parameters.osProfile.customData] Specifies a base-64 + * encoded string of custom data. The base-64 encoded string is decoded to a + * binary array that is saved as a file on the Virtual Machine. The maximum + * length of the binary array is 65535 bytes.

    For using cloud-init for + * your VM, see [Using cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {object} [parameters.osProfile.windowsConfiguration] Specifies + * Windows operating system settings on the virtual machine. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.provisionVMAgent] Indicates + * whether virtual machine agent should be provisioned on the virtual machine. + *

    When this property is not specified in the request body, default + * behavior is to set it to true. This will ensure that VM Agent is installed + * on the VM so that extensions can be added to the VM later. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.enableAutomaticUpdates] Indicates + * whether virtual machine is enabled for automatic updates. + * + * @param {string} [parameters.osProfile.windowsConfiguration.timeZone] + * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" + * + * @param {array} + * [parameters.osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * + * @param {object} [parameters.osProfile.windowsConfiguration.winRM] Specifies + * the Windows Remote Management listeners. This enables remote Windows + * PowerShell. + * + * @param {array} [parameters.osProfile.windowsConfiguration.winRM.listeners] + * The list of Windows Remote Management listeners + * + * @param {object} [parameters.osProfile.linuxConfiguration] Specifies the + * Linux operating system settings on the virtual machine.

    For a list + * of supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @param {boolean} + * [parameters.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * + * @param {object} [parameters.osProfile.linuxConfiguration.ssh] Specifies the + * ssh key configuration for a Linux OS. + * + * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The + * list of SSH public keys used to authenticate with linux based VMs. + * + * @param {array} [parameters.osProfile.secrets] Specifies set of certificates + * that should be installed onto the virtual machine. + * + * @param {object} [parameters.networkProfile] Specifies the network interfaces + * of the virtual machine. + * + * @param {array} [parameters.networkProfile.networkInterfaces] Specifies the + * list of resource Ids for the network interfaces associated with the virtual + * machine. + * + * @param {object} [parameters.diagnosticsProfile] Specifies the boot + * diagnostic settings state.

    Minimum api-version: 2015-06-15. + * + * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, + * you can easily view the output of your console log.

    For both + * Windows and Linux virtual machines, Azure also enables you to see a + * screenshot of the VM from the hypervisor. + * + * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] + * Whether boot diagnostics should be enabled on the Virtual Machine. + * + * @param {string} [parameters.diagnosticsProfile.bootDiagnostics.storageUri] + * Uri of the storage account to use for placing the console output and + * screenshot. + * + * @param {object} [parameters.availabilitySet] Specifies information about the + * availability set that the virtual machine should be assigned to. Virtual + * machines specified in the same availability set are allocated to different + * nodes to maximize availability. For more information about availability + * sets, see [Manage the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    For more information on Azure planned maintainance, see [Planned + * maintenance for virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Currently, a VM can only be added to availability set at creation + * time. An existing VM cannot be added to an availability set. + * + * @param {string} [parameters.availabilitySet.id] Resource Id + * + * @param {string} [parameters.licenseType] Specifies that the image or disk + * that is being used was licensed on-premises. This element is only used for + * images that contain the Windows Server operating system.

    Possible + * values are:

    Windows_Client

    Windows_Server

    If this + * element is included in a request for an update, the value must match the + * initial value. This value cannot be updated.

    For more information, + * see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Minimum api-version: 2015-06-15 + * + * @param {object} [parameters.identity] The identity of the virtual machine, + * if configured. + * + * @param {string} [parameters.identity.type] The type of identity used for the + * virtual machine. The type 'SystemAssigned, UserAssigned' includes both an + * implicitly created identity and a set of user assigned identities. The type + * 'None' will remove any identities from the virtual machine. Possible values + * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', + * 'None' + * + * @param {array} [parameters.identity.identityIds] The list of user identities + * associated with the Virtual Machine. The user identity references will be + * ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * + * @param {array} [parameters.zones] The virtual machine zones. + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @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 {VirtualMachine} - 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. + * + * {VirtualMachine} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachine} 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. + */ + createOrUpdate(resourceGroupName: string, vmName: string, parameters: models.VirtualMachine, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, vmName: string, parameters: models.VirtualMachine, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, vmName: string, parameters: models.VirtualMachine, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * The operation to update a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Update Virtual Machine + * operation. + * + * @param {object} [parameters.plan] Specifies information about the + * marketplace image used to create the virtual machine. This element is only + * used for marketplace images. Before you can use a marketplace image from an + * API, you must enable the image for programmatic use. In the Azure portal, + * find the marketplace image that you want to use and then click **Want to + * deploy programmatically, Get Started ->**. Enter any required information + * and then click **Save**. + * + * @param {string} [parameters.plan.name] The plan ID. + * + * @param {string} [parameters.plan.publisher] The publisher ID. + * + * @param {string} [parameters.plan.product] Specifies the product of the image + * from the marketplace. This is the same value as Offer under the + * imageReference element. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {object} [parameters.hardwareProfile] Specifies the hardware settings + * for the virtual machine. + * + * @param {string} [parameters.hardwareProfile.vmSize] Specifies the size of + * the virtual machine. For more information about virtual machine sizes, see + * [Sizes for virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    The available VM sizes depend on region and availability set. For a + * list of available sizes use these APIs:

    [List all available + * virtual machine sizes in an availability + * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) + *

    [List all available virtual machine sizes in a + * region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) + *

    [List all available virtual machine sizes for + * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). + * Possible values include: '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_B1s', 'Standard_B1ms', + * 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', + * '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_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', + * 'Standard_D32_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', + * 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', + * 'Standard_D64s_v3', '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_DS13-4_v2', 'Standard_DS13-2_v2', + * 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', 'Standard_E2_v3', + * 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', 'Standard_E32_v3', + * 'Standard_E64_v3', 'Standard_E2s_v3', 'Standard_E4s_v3', 'Standard_E8s_v3', + * 'Standard_E16s_v3', 'Standard_E32s_v3', 'Standard_E64s_v3', + * 'Standard_E32-16_v3', 'Standard_E32-8s_v3', 'Standard_E64-32s_v3', + * 'Standard_E64-16s_v3', 'Standard_F1', 'Standard_F2', 'Standard_F4', + * 'Standard_F8', 'Standard_F16', 'Standard_F1s', 'Standard_F2s', + * 'Standard_F4s', 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2', + * 'Standard_F4s_v2', 'Standard_F8s_v2', 'Standard_F16s_v2', + * 'Standard_F32s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1', + * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', + * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', + * 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8', + * 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m', + * 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', + * 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms', + * 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms', + * 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms', + * 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', + * 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2', + * 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3', + * 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s', + * 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6', + * 'Standard_NV12', 'Standard_NV24' + * + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. + * + * @param {object} [parameters.storageProfile.imageReference] Specifies + * information about the image to use. You can specify information about + * platform images, marketplace images, or virtual machine images. This element + * is required when you want to use a platform image, marketplace image, or + * virtual machine image, but is not used in other creation operations. + * + * @param {string} [parameters.storageProfile.imageReference.publisher] The + * image publisher. + * + * @param {string} [parameters.storageProfile.imageReference.offer] Specifies + * the offer of the platform image or marketplace image used to create the + * virtual machine. + * + * @param {string} [parameters.storageProfile.imageReference.sku] The image + * SKU. + * + * @param {string} [parameters.storageProfile.imageReference.version] Specifies + * the version of the platform image or marketplace image used to create the + * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the + * latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. + * + * @param {string} [parameters.storageProfile.imageReference.id] Resource Id + * + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} [parameters.storageProfile.osDisk.osType] This property + * allows you to specify the type of the OS that is included in the disk if + * creating a VM from user-image or a specialized VHD.

    Possible values + * are:

    **Windows**

    **Linux**. Possible values include: + * 'Windows', 'Linux' + * + * @param {object} [parameters.storageProfile.osDisk.encryptionSettings] + * Specifies the encryption settings for the OS Disk.

    Minimum + * api-version: 2015-06-15 + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey] + * Specifies the location of the disk encryption key, which is a Key Vault + * Secret. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.secretUrl + * The URL referencing a secret in a Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the secret. + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey] + * Specifies the location of the key encryption key in Key Vault. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.keyUrl + * The URL referencing a key encryption key in Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the key. + * + * @param {boolean} + * [parameters.storageProfile.osDisk.encryptionSettings.enabled] Specifies + * whether disk encryption should be enabled on the virtual machine. + * + * @param {string} [parameters.storageProfile.osDisk.name] The disk name. + * + * @param {object} [parameters.storageProfile.osDisk.vhd] The virtual hard + * disk. + * + * @param {object} [parameters.storageProfile.osDisk.image] The source user + * image virtual hard disk. The virtual hard disk will be copied before being + * attached to the virtual machine. If SourceImage is provided, the destination + * virtual hard drive must not exist. + * + * @param {string} [parameters.storageProfile.osDisk.image.uri] Specifies the + * virtual hard disk's uri. + * + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {boolean} [parameters.storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @param {string} parameters.storageProfile.osDisk.createOption Specifies how + * the virtual machine should be created.

    Possible values are:

    + * **Attach** \u2013 This value is used when you are using a specialized disk + * to create the virtual machine.

    **FromImage** \u2013 This value is + * used when you are using an image to create the virtual machine. If you are + * using a platform image, you also use the imageReference element described + * above. If you are using a marketplace image, you also use the plan element + * previously described. Possible values include: 'FromImage', 'Empty', + * 'Attach' + * + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of an empty data disk in gigabytes. This element can be used to + * overwrite the name of the disk in a virtual machine image.

    This + * value cannot be larger than 1023 GB + * + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed + * disk parameters. + * + * @param {string} + * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies + * the storage account type for the managed disk. Possible values are: + * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id + * + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {object} [parameters.osProfile] Specifies the operating system + * settings for the virtual machine. + * + * @param {string} [parameters.osProfile.computerName] Specifies the host OS + * name of the virtual machine.

    **Max-length (Windows):** 15 + * characters

    **Max-length (Linux):** 64 characters.

    For + * naming conventions and restrictions see [Azure infrastructure services + * implementation + * guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). + * + * @param {string} [parameters.osProfile.adminUsername] Specifies the name of + * the administrator account.

    **Windows-only restriction:** Cannot end + * in "."

    **Disallowed values:** "administrator", "admin", "user", + * "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", + * "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", + * "john", "owner", "root", "server", "sql", "support", "support_388945a0", + * "sys", "test2", "test3", "user4", "user5".

    **Minimum-length + * (Linux):** 1 character

    **Max-length (Linux):** 64 characters + *

    **Max-length (Windows):** 20 characters

  • For root + * access to the Linux VM, see [Using root privileges on Linux virtual machines + * in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in this + * field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {string} [parameters.osProfile.adminPassword] Specifies the password + * of the administrator account.

    **Minimum-length (Windows):** 8 + * characters

    **Minimum-length (Linux):** 6 characters

    + * **Max-length (Windows):** 123 characters

    **Max-length (Linux):** 72 + * characters

    **Complexity requirements:** 3 out of 4 conditions below + * need to be fulfilled
    Has lower characters
    Has upper characters
    + * Has a digit
    Has a special character (Regex match [\W_])

    + * **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", + * "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", + * "iloveyou!"

    For resetting the password, see [How to reset the + * Remote Desktop service or its login password in a Windows + * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    For resetting root password, see [Manage users, SSH, and check or + * repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + * + * @param {string} [parameters.osProfile.customData] Specifies a base-64 + * encoded string of custom data. The base-64 encoded string is decoded to a + * binary array that is saved as a file on the Virtual Machine. The maximum + * length of the binary array is 65535 bytes.

    For using cloud-init for + * your VM, see [Using cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {object} [parameters.osProfile.windowsConfiguration] Specifies + * Windows operating system settings on the virtual machine. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.provisionVMAgent] Indicates + * whether virtual machine agent should be provisioned on the virtual machine. + *

    When this property is not specified in the request body, default + * behavior is to set it to true. This will ensure that VM Agent is installed + * on the VM so that extensions can be added to the VM later. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.enableAutomaticUpdates] Indicates + * whether virtual machine is enabled for automatic updates. + * + * @param {string} [parameters.osProfile.windowsConfiguration.timeZone] + * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" + * + * @param {array} + * [parameters.osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * + * @param {object} [parameters.osProfile.windowsConfiguration.winRM] Specifies + * the Windows Remote Management listeners. This enables remote Windows + * PowerShell. + * + * @param {array} [parameters.osProfile.windowsConfiguration.winRM.listeners] + * The list of Windows Remote Management listeners + * + * @param {object} [parameters.osProfile.linuxConfiguration] Specifies the + * Linux operating system settings on the virtual machine.

    For a list + * of supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @param {boolean} + * [parameters.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * + * @param {object} [parameters.osProfile.linuxConfiguration.ssh] Specifies the + * ssh key configuration for a Linux OS. + * + * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The + * list of SSH public keys used to authenticate with linux based VMs. + * + * @param {array} [parameters.osProfile.secrets] Specifies set of certificates + * that should be installed onto the virtual machine. + * + * @param {object} [parameters.networkProfile] Specifies the network interfaces + * of the virtual machine. + * + * @param {array} [parameters.networkProfile.networkInterfaces] Specifies the + * list of resource Ids for the network interfaces associated with the virtual + * machine. + * + * @param {object} [parameters.diagnosticsProfile] Specifies the boot + * diagnostic settings state.

    Minimum api-version: 2015-06-15. + * + * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, + * you can easily view the output of your console log.

    For both + * Windows and Linux virtual machines, Azure also enables you to see a + * screenshot of the VM from the hypervisor. + * + * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] + * Whether boot diagnostics should be enabled on the Virtual Machine. + * + * @param {string} [parameters.diagnosticsProfile.bootDiagnostics.storageUri] + * Uri of the storage account to use for placing the console output and + * screenshot. + * + * @param {object} [parameters.availabilitySet] Specifies information about the + * availability set that the virtual machine should be assigned to. Virtual + * machines specified in the same availability set are allocated to different + * nodes to maximize availability. For more information about availability + * sets, see [Manage the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    For more information on Azure planned maintainance, see [Planned + * maintenance for virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Currently, a VM can only be added to availability set at creation + * time. An existing VM cannot be added to an availability set. + * + * @param {string} [parameters.availabilitySet.id] Resource Id + * + * @param {string} [parameters.licenseType] Specifies that the image or disk + * that is being used was licensed on-premises. This element is only used for + * images that contain the Windows Server operating system.

    Possible + * values are:

    Windows_Client

    Windows_Server

    If this + * element is included in a request for an update, the value must match the + * initial value. This value cannot be updated.

    For more information, + * see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Minimum api-version: 2015-06-15 + * + * @param {object} [parameters.identity] The identity of the virtual machine, + * if configured. + * + * @param {string} [parameters.identity.type] The type of identity used for the + * virtual machine. The type 'SystemAssigned, UserAssigned' includes both an + * implicitly created identity and a set of user assigned identities. The type + * 'None' will remove any identities from the virtual machine. Possible values + * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', + * 'None' + * + * @param {array} [parameters.identity.identityIds] The list of user identities + * associated with the Virtual Machine. The user identity references will be + * ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * + * @param {array} [parameters.zones] The virtual machine zones. + * + * @param {object} [parameters.tags] Resource tags + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + updateWithHttpOperationResponse(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * The operation to update a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Update Virtual Machine + * operation. + * + * @param {object} [parameters.plan] Specifies information about the + * marketplace image used to create the virtual machine. This element is only + * used for marketplace images. Before you can use a marketplace image from an + * API, you must enable the image for programmatic use. In the Azure portal, + * find the marketplace image that you want to use and then click **Want to + * deploy programmatically, Get Started ->**. Enter any required information + * and then click **Save**. + * + * @param {string} [parameters.plan.name] The plan ID. + * + * @param {string} [parameters.plan.publisher] The publisher ID. + * + * @param {string} [parameters.plan.product] Specifies the product of the image + * from the marketplace. This is the same value as Offer under the + * imageReference element. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {object} [parameters.hardwareProfile] Specifies the hardware settings + * for the virtual machine. + * + * @param {string} [parameters.hardwareProfile.vmSize] Specifies the size of + * the virtual machine. For more information about virtual machine sizes, see + * [Sizes for virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    The available VM sizes depend on region and availability set. For a + * list of available sizes use these APIs:

    [List all available + * virtual machine sizes in an availability + * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) + *

    [List all available virtual machine sizes in a + * region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) + *

    [List all available virtual machine sizes for + * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). + * Possible values include: '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_B1s', 'Standard_B1ms', + * 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', + * '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_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', + * 'Standard_D32_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', + * 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', + * 'Standard_D64s_v3', '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_DS13-4_v2', 'Standard_DS13-2_v2', + * 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', 'Standard_E2_v3', + * 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', 'Standard_E32_v3', + * 'Standard_E64_v3', 'Standard_E2s_v3', 'Standard_E4s_v3', 'Standard_E8s_v3', + * 'Standard_E16s_v3', 'Standard_E32s_v3', 'Standard_E64s_v3', + * 'Standard_E32-16_v3', 'Standard_E32-8s_v3', 'Standard_E64-32s_v3', + * 'Standard_E64-16s_v3', 'Standard_F1', 'Standard_F2', 'Standard_F4', + * 'Standard_F8', 'Standard_F16', 'Standard_F1s', 'Standard_F2s', + * 'Standard_F4s', 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2', + * 'Standard_F4s_v2', 'Standard_F8s_v2', 'Standard_F16s_v2', + * 'Standard_F32s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1', + * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', + * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', + * 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8', + * 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m', + * 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', + * 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms', + * 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms', + * 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms', + * 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', + * 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2', + * 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3', + * 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s', + * 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6', + * 'Standard_NV12', 'Standard_NV24' + * + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. + * + * @param {object} [parameters.storageProfile.imageReference] Specifies + * information about the image to use. You can specify information about + * platform images, marketplace images, or virtual machine images. This element + * is required when you want to use a platform image, marketplace image, or + * virtual machine image, but is not used in other creation operations. + * + * @param {string} [parameters.storageProfile.imageReference.publisher] The + * image publisher. + * + * @param {string} [parameters.storageProfile.imageReference.offer] Specifies + * the offer of the platform image or marketplace image used to create the + * virtual machine. + * + * @param {string} [parameters.storageProfile.imageReference.sku] The image + * SKU. + * + * @param {string} [parameters.storageProfile.imageReference.version] Specifies + * the version of the platform image or marketplace image used to create the + * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the + * latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. + * + * @param {string} [parameters.storageProfile.imageReference.id] Resource Id + * + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} [parameters.storageProfile.osDisk.osType] This property + * allows you to specify the type of the OS that is included in the disk if + * creating a VM from user-image or a specialized VHD.

    Possible values + * are:

    **Windows**

    **Linux**. Possible values include: + * 'Windows', 'Linux' + * + * @param {object} [parameters.storageProfile.osDisk.encryptionSettings] + * Specifies the encryption settings for the OS Disk.

    Minimum + * api-version: 2015-06-15 + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey] + * Specifies the location of the disk encryption key, which is a Key Vault + * Secret. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.secretUrl + * The URL referencing a secret in a Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the secret. + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey] + * Specifies the location of the key encryption key in Key Vault. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.keyUrl + * The URL referencing a key encryption key in Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the key. + * + * @param {boolean} + * [parameters.storageProfile.osDisk.encryptionSettings.enabled] Specifies + * whether disk encryption should be enabled on the virtual machine. + * + * @param {string} [parameters.storageProfile.osDisk.name] The disk name. + * + * @param {object} [parameters.storageProfile.osDisk.vhd] The virtual hard + * disk. + * + * @param {object} [parameters.storageProfile.osDisk.image] The source user + * image virtual hard disk. The virtual hard disk will be copied before being + * attached to the virtual machine. If SourceImage is provided, the destination + * virtual hard drive must not exist. + * + * @param {string} [parameters.storageProfile.osDisk.image.uri] Specifies the + * virtual hard disk's uri. + * + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {boolean} [parameters.storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @param {string} parameters.storageProfile.osDisk.createOption Specifies how + * the virtual machine should be created.

    Possible values are:

    + * **Attach** \u2013 This value is used when you are using a specialized disk + * to create the virtual machine.

    **FromImage** \u2013 This value is + * used when you are using an image to create the virtual machine. If you are + * using a platform image, you also use the imageReference element described + * above. If you are using a marketplace image, you also use the plan element + * previously described. Possible values include: 'FromImage', 'Empty', + * 'Attach' + * + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of an empty data disk in gigabytes. This element can be used to + * overwrite the name of the disk in a virtual machine image.

    This + * value cannot be larger than 1023 GB + * + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed + * disk parameters. + * + * @param {string} + * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies + * the storage account type for the managed disk. Possible values are: + * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id + * + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {object} [parameters.osProfile] Specifies the operating system + * settings for the virtual machine. + * + * @param {string} [parameters.osProfile.computerName] Specifies the host OS + * name of the virtual machine.

    **Max-length (Windows):** 15 + * characters

    **Max-length (Linux):** 64 characters.

    For + * naming conventions and restrictions see [Azure infrastructure services + * implementation + * guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). + * + * @param {string} [parameters.osProfile.adminUsername] Specifies the name of + * the administrator account.

    **Windows-only restriction:** Cannot end + * in "."

    **Disallowed values:** "administrator", "admin", "user", + * "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", + * "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", + * "john", "owner", "root", "server", "sql", "support", "support_388945a0", + * "sys", "test2", "test3", "user4", "user5".

    **Minimum-length + * (Linux):** 1 character

    **Max-length (Linux):** 64 characters + *

    **Max-length (Windows):** 20 characters

  • For root + * access to the Linux VM, see [Using root privileges on Linux virtual machines + * in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in this + * field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {string} [parameters.osProfile.adminPassword] Specifies the password + * of the administrator account.

    **Minimum-length (Windows):** 8 + * characters

    **Minimum-length (Linux):** 6 characters

    + * **Max-length (Windows):** 123 characters

    **Max-length (Linux):** 72 + * characters

    **Complexity requirements:** 3 out of 4 conditions below + * need to be fulfilled
    Has lower characters
    Has upper characters
    + * Has a digit
    Has a special character (Regex match [\W_])

    + * **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", + * "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", + * "iloveyou!"

    For resetting the password, see [How to reset the + * Remote Desktop service or its login password in a Windows + * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    For resetting root password, see [Manage users, SSH, and check or + * repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + * + * @param {string} [parameters.osProfile.customData] Specifies a base-64 + * encoded string of custom data. The base-64 encoded string is decoded to a + * binary array that is saved as a file on the Virtual Machine. The maximum + * length of the binary array is 65535 bytes.

    For using cloud-init for + * your VM, see [Using cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {object} [parameters.osProfile.windowsConfiguration] Specifies + * Windows operating system settings on the virtual machine. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.provisionVMAgent] Indicates + * whether virtual machine agent should be provisioned on the virtual machine. + *

    When this property is not specified in the request body, default + * behavior is to set it to true. This will ensure that VM Agent is installed + * on the VM so that extensions can be added to the VM later. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.enableAutomaticUpdates] Indicates + * whether virtual machine is enabled for automatic updates. + * + * @param {string} [parameters.osProfile.windowsConfiguration.timeZone] + * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" + * + * @param {array} + * [parameters.osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * + * @param {object} [parameters.osProfile.windowsConfiguration.winRM] Specifies + * the Windows Remote Management listeners. This enables remote Windows + * PowerShell. + * + * @param {array} [parameters.osProfile.windowsConfiguration.winRM.listeners] + * The list of Windows Remote Management listeners + * + * @param {object} [parameters.osProfile.linuxConfiguration] Specifies the + * Linux operating system settings on the virtual machine.

    For a list + * of supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @param {boolean} + * [parameters.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * + * @param {object} [parameters.osProfile.linuxConfiguration.ssh] Specifies the + * ssh key configuration for a Linux OS. + * + * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The + * list of SSH public keys used to authenticate with linux based VMs. + * + * @param {array} [parameters.osProfile.secrets] Specifies set of certificates + * that should be installed onto the virtual machine. + * + * @param {object} [parameters.networkProfile] Specifies the network interfaces + * of the virtual machine. + * + * @param {array} [parameters.networkProfile.networkInterfaces] Specifies the + * list of resource Ids for the network interfaces associated with the virtual + * machine. + * + * @param {object} [parameters.diagnosticsProfile] Specifies the boot + * diagnostic settings state.

    Minimum api-version: 2015-06-15. + * + * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, + * you can easily view the output of your console log.

    For both + * Windows and Linux virtual machines, Azure also enables you to see a + * screenshot of the VM from the hypervisor. + * + * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] + * Whether boot diagnostics should be enabled on the Virtual Machine. + * + * @param {string} [parameters.diagnosticsProfile.bootDiagnostics.storageUri] + * Uri of the storage account to use for placing the console output and + * screenshot. + * + * @param {object} [parameters.availabilitySet] Specifies information about the + * availability set that the virtual machine should be assigned to. Virtual + * machines specified in the same availability set are allocated to different + * nodes to maximize availability. For more information about availability + * sets, see [Manage the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    For more information on Azure planned maintainance, see [Planned + * maintenance for virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Currently, a VM can only be added to availability set at creation + * time. An existing VM cannot be added to an availability set. + * + * @param {string} [parameters.availabilitySet.id] Resource Id + * + * @param {string} [parameters.licenseType] Specifies that the image or disk + * that is being used was licensed on-premises. This element is only used for + * images that contain the Windows Server operating system.

    Possible + * values are:

    Windows_Client

    Windows_Server

    If this + * element is included in a request for an update, the value must match the + * initial value. This value cannot be updated.

    For more information, + * see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Minimum api-version: 2015-06-15 + * + * @param {object} [parameters.identity] The identity of the virtual machine, + * if configured. + * + * @param {string} [parameters.identity.type] The type of identity used for the + * virtual machine. The type 'SystemAssigned, UserAssigned' includes both an + * implicitly created identity and a set of user assigned identities. The type + * 'None' will remove any identities from the virtual machine. Possible values + * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', + * 'None' + * + * @param {array} [parameters.identity.identityIds] The list of user identities + * associated with the Virtual Machine. The user identity references will be + * ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * + * @param {array} [parameters.zones] The virtual machine zones. + * + * @param {object} [parameters.tags] Resource tags + * + * @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 {VirtualMachine} - 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. + * + * {VirtualMachine} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachine} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + update(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineUpdate, callback: ServiceCallback): void; + update(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * The operation to delete a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * The operation to delete a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + deleteMethod(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Retrieves information about the model view or the instance view of a virtual + * machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] The expand expression to apply on the + * operation. Possible values include: 'instanceView' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Retrieves information about the model view or the instance view of a virtual + * machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] The expand expression to apply on the + * operation. Possible values include: 'instanceView' + * + * @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 {VirtualMachine} - 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. + * + * {VirtualMachine} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachine} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, vmName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, vmName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Retrieves information about the run-time state of a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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. + */ + instanceViewWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Retrieves information about the run-time state of a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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 {VirtualMachineInstanceView} - 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. + * + * {VirtualMachineInstanceView} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineInstanceView} 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. + */ + instanceView(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + instanceView(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + instanceView(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Converts virtual machine disks from blob-based to managed disks. Virtual + * machine must be stop-deallocated before invoking this operation. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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. + */ + convertToManagedDisksWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Converts virtual machine disks from blob-based to managed disks. Virtual + * machine must be stop-deallocated before invoking this operation. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + convertToManagedDisks(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + convertToManagedDisks(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + convertToManagedDisks(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Shuts down the virtual machine and releases the compute resources. You are + * not billed for the compute resources that this virtual machine uses. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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. + */ + deallocateWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Shuts down the virtual machine and releases the compute resources. You are + * not billed for the compute resources that this virtual machine uses. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + deallocate(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deallocate(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + deallocate(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Sets the state of the virtual machine to generalized. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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. + */ + generalizeWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Sets the state of the virtual machine to generalized. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + generalize(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + generalize(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + generalize(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists all of the virtual machines in the specified resource group. Use the + * nextLink property in the response to get the next page of virtual machines. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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. + */ + listWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all of the virtual machines in the specified resource group. Use the + * nextLink property in the response to get the next page of virtual machines. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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 {VirtualMachineListResult} - 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. + * + * {VirtualMachineListResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(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; + + + /** + * Lists all of the virtual machines in the specified subscription. Use the + * nextLink property in the response to get the next page of virtual machines. + * + * @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. + */ + listAllWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all of the virtual machines in the specified subscription. Use the + * nextLink property in the response to get the next page of virtual machines. + * + * @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 {VirtualMachineListResult} - 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. + * + * {VirtualMachineListResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineListResult} 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. + */ + listAll(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAll(callback: ServiceCallback): void; + listAll(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists all available virtual machine sizes to which the specified virtual + * machine can be resized. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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. + */ + listAvailableSizesWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all available virtual machine sizes to which the specified virtual + * machine can be resized. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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 {VirtualMachineSizeListResult} - 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. + * + * {VirtualMachineSizeListResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineSizeListResult} 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. + */ + listAvailableSizes(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAvailableSizes(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + listAvailableSizes(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * The operation to power off (stop) a virtual machine. The virtual machine can + * be restarted with the same provisioned resources. You are still charged for + * this virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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. + */ + powerOffWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * The operation to power off (stop) a virtual machine. The virtual machine can + * be restarted with the same provisioned resources. You are still charged for + * this virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + powerOff(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + powerOff(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + powerOff(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * The operation to restart a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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. + */ + restartWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * The operation to restart a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + restart(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + restart(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + restart(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * The operation to start a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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. + */ + startWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * The operation to start a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + start(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + start(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + start(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * The operation to redeploy a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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. + */ + redeployWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * The operation to redeploy a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + redeploy(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + redeploy(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + redeploy(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * The operation to perform maintenance on a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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. + */ + performMaintenanceWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * The operation to perform maintenance on a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + performMaintenance(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + performMaintenance(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + performMaintenance(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Run command on the VM. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Run command operation. + * + * @param {string} parameters.commandId The run command id. + * + * @param {array} [parameters.script] Optional. The script to be executed. + * When this value is given, the given script will override the default script + * of the command. + * + * @param {array} [parameters.parameters] The run command parameters. + * + * @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. + */ + runCommandWithHttpOperationResponse(resourceGroupName: string, vmName: string, parameters: models.RunCommandInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Run command on the VM. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Run command operation. + * + * @param {string} parameters.commandId The run command id. + * + * @param {array} [parameters.script] Optional. The script to be executed. + * When this value is given, the given script will override the default script + * of the command. + * + * @param {array} [parameters.parameters] The run command parameters. + * + * @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 {RunCommandResult} - 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. + * + * {RunCommandResult} [result] - The deserialized result object if an error did not occur. + * See {@link RunCommandResult} 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. + */ + runCommand(resourceGroupName: string, vmName: string, parameters: models.RunCommandInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + runCommand(resourceGroupName: string, vmName: string, parameters: models.RunCommandInput, callback: ServiceCallback): void; + runCommand(resourceGroupName: string, vmName: string, parameters: models.RunCommandInput, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Captures the VM by copying virtual hard disks of the VM and outputs a + * template that can be used to create similar VMs. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Capture Virtual + * Machine operation. + * + * @param {string} parameters.vhdPrefix The captured virtual hard disk's name + * prefix. + * + * @param {string} parameters.destinationContainerName The destination + * container name. + * + * @param {boolean} parameters.overwriteVhds Specifies whether to overwrite the + * destination virtual hard disk, in case of conflict. + * + * @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. + */ + beginCaptureWithHttpOperationResponse(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineCaptureParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Captures the VM by copying virtual hard disks of the VM and outputs a + * template that can be used to create similar VMs. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Capture Virtual + * Machine operation. + * + * @param {string} parameters.vhdPrefix The captured virtual hard disk's name + * prefix. + * + * @param {string} parameters.destinationContainerName The destination + * container name. + * + * @param {boolean} parameters.overwriteVhds Specifies whether to overwrite the + * destination virtual hard disk, in case of conflict. + * + * @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 {VirtualMachineCaptureResult} - 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. + * + * {VirtualMachineCaptureResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineCaptureResult} 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. + */ + beginCapture(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineCaptureParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCapture(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineCaptureParameters, callback: ServiceCallback): void; + beginCapture(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineCaptureParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * The operation to create or update a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Create Virtual Machine + * operation. + * + * @param {object} [parameters.plan] Specifies information about the + * marketplace image used to create the virtual machine. This element is only + * used for marketplace images. Before you can use a marketplace image from an + * API, you must enable the image for programmatic use. In the Azure portal, + * find the marketplace image that you want to use and then click **Want to + * deploy programmatically, Get Started ->**. Enter any required information + * and then click **Save**. + * + * @param {string} [parameters.plan.name] The plan ID. + * + * @param {string} [parameters.plan.publisher] The publisher ID. + * + * @param {string} [parameters.plan.product] Specifies the product of the image + * from the marketplace. This is the same value as Offer under the + * imageReference element. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {object} [parameters.hardwareProfile] Specifies the hardware settings + * for the virtual machine. + * + * @param {string} [parameters.hardwareProfile.vmSize] Specifies the size of + * the virtual machine. For more information about virtual machine sizes, see + * [Sizes for virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    The available VM sizes depend on region and availability set. For a + * list of available sizes use these APIs:

    [List all available + * virtual machine sizes in an availability + * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) + *

    [List all available virtual machine sizes in a + * region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) + *

    [List all available virtual machine sizes for + * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). + * Possible values include: '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_B1s', 'Standard_B1ms', + * 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', + * '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_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', + * 'Standard_D32_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', + * 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', + * 'Standard_D64s_v3', '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_DS13-4_v2', 'Standard_DS13-2_v2', + * 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', 'Standard_E2_v3', + * 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', 'Standard_E32_v3', + * 'Standard_E64_v3', 'Standard_E2s_v3', 'Standard_E4s_v3', 'Standard_E8s_v3', + * 'Standard_E16s_v3', 'Standard_E32s_v3', 'Standard_E64s_v3', + * 'Standard_E32-16_v3', 'Standard_E32-8s_v3', 'Standard_E64-32s_v3', + * 'Standard_E64-16s_v3', 'Standard_F1', 'Standard_F2', 'Standard_F4', + * 'Standard_F8', 'Standard_F16', 'Standard_F1s', 'Standard_F2s', + * 'Standard_F4s', 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2', + * 'Standard_F4s_v2', 'Standard_F8s_v2', 'Standard_F16s_v2', + * 'Standard_F32s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1', + * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', + * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', + * 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8', + * 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m', + * 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', + * 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms', + * 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms', + * 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms', + * 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', + * 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2', + * 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3', + * 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s', + * 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6', + * 'Standard_NV12', 'Standard_NV24' + * + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. + * + * @param {object} [parameters.storageProfile.imageReference] Specifies + * information about the image to use. You can specify information about + * platform images, marketplace images, or virtual machine images. This element + * is required when you want to use a platform image, marketplace image, or + * virtual machine image, but is not used in other creation operations. + * + * @param {string} [parameters.storageProfile.imageReference.publisher] The + * image publisher. + * + * @param {string} [parameters.storageProfile.imageReference.offer] Specifies + * the offer of the platform image or marketplace image used to create the + * virtual machine. + * + * @param {string} [parameters.storageProfile.imageReference.sku] The image + * SKU. + * + * @param {string} [parameters.storageProfile.imageReference.version] Specifies + * the version of the platform image or marketplace image used to create the + * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the + * latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. + * + * @param {string} [parameters.storageProfile.imageReference.id] Resource Id + * + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} [parameters.storageProfile.osDisk.osType] This property + * allows you to specify the type of the OS that is included in the disk if + * creating a VM from user-image or a specialized VHD.

    Possible values + * are:

    **Windows**

    **Linux**. Possible values include: + * 'Windows', 'Linux' + * + * @param {object} [parameters.storageProfile.osDisk.encryptionSettings] + * Specifies the encryption settings for the OS Disk.

    Minimum + * api-version: 2015-06-15 + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey] + * Specifies the location of the disk encryption key, which is a Key Vault + * Secret. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.secretUrl + * The URL referencing a secret in a Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the secret. + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey] + * Specifies the location of the key encryption key in Key Vault. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.keyUrl + * The URL referencing a key encryption key in Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the key. + * + * @param {boolean} + * [parameters.storageProfile.osDisk.encryptionSettings.enabled] Specifies + * whether disk encryption should be enabled on the virtual machine. + * + * @param {string} [parameters.storageProfile.osDisk.name] The disk name. + * + * @param {object} [parameters.storageProfile.osDisk.vhd] The virtual hard + * disk. + * + * @param {object} [parameters.storageProfile.osDisk.image] The source user + * image virtual hard disk. The virtual hard disk will be copied before being + * attached to the virtual machine. If SourceImage is provided, the destination + * virtual hard drive must not exist. + * + * @param {string} [parameters.storageProfile.osDisk.image.uri] Specifies the + * virtual hard disk's uri. + * + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {boolean} [parameters.storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @param {string} parameters.storageProfile.osDisk.createOption Specifies how + * the virtual machine should be created.

    Possible values are:

    + * **Attach** \u2013 This value is used when you are using a specialized disk + * to create the virtual machine.

    **FromImage** \u2013 This value is + * used when you are using an image to create the virtual machine. If you are + * using a platform image, you also use the imageReference element described + * above. If you are using a marketplace image, you also use the plan element + * previously described. Possible values include: 'FromImage', 'Empty', + * 'Attach' + * + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of an empty data disk in gigabytes. This element can be used to + * overwrite the name of the disk in a virtual machine image.

    This + * value cannot be larger than 1023 GB + * + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed + * disk parameters. + * + * @param {string} + * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies + * the storage account type for the managed disk. Possible values are: + * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id + * + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {object} [parameters.osProfile] Specifies the operating system + * settings for the virtual machine. + * + * @param {string} [parameters.osProfile.computerName] Specifies the host OS + * name of the virtual machine.

    **Max-length (Windows):** 15 + * characters

    **Max-length (Linux):** 64 characters.

    For + * naming conventions and restrictions see [Azure infrastructure services + * implementation + * guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). + * + * @param {string} [parameters.osProfile.adminUsername] Specifies the name of + * the administrator account.

    **Windows-only restriction:** Cannot end + * in "."

    **Disallowed values:** "administrator", "admin", "user", + * "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", + * "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", + * "john", "owner", "root", "server", "sql", "support", "support_388945a0", + * "sys", "test2", "test3", "user4", "user5".

    **Minimum-length + * (Linux):** 1 character

    **Max-length (Linux):** 64 characters + *

    **Max-length (Windows):** 20 characters

  • For root + * access to the Linux VM, see [Using root privileges on Linux virtual machines + * in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in this + * field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {string} [parameters.osProfile.adminPassword] Specifies the password + * of the administrator account.

    **Minimum-length (Windows):** 8 + * characters

    **Minimum-length (Linux):** 6 characters

    + * **Max-length (Windows):** 123 characters

    **Max-length (Linux):** 72 + * characters

    **Complexity requirements:** 3 out of 4 conditions below + * need to be fulfilled
    Has lower characters
    Has upper characters
    + * Has a digit
    Has a special character (Regex match [\W_])

    + * **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", + * "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", + * "iloveyou!"

    For resetting the password, see [How to reset the + * Remote Desktop service or its login password in a Windows + * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    For resetting root password, see [Manage users, SSH, and check or + * repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + * + * @param {string} [parameters.osProfile.customData] Specifies a base-64 + * encoded string of custom data. The base-64 encoded string is decoded to a + * binary array that is saved as a file on the Virtual Machine. The maximum + * length of the binary array is 65535 bytes.

    For using cloud-init for + * your VM, see [Using cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {object} [parameters.osProfile.windowsConfiguration] Specifies + * Windows operating system settings on the virtual machine. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.provisionVMAgent] Indicates + * whether virtual machine agent should be provisioned on the virtual machine. + *

    When this property is not specified in the request body, default + * behavior is to set it to true. This will ensure that VM Agent is installed + * on the VM so that extensions can be added to the VM later. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.enableAutomaticUpdates] Indicates + * whether virtual machine is enabled for automatic updates. + * + * @param {string} [parameters.osProfile.windowsConfiguration.timeZone] + * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" + * + * @param {array} + * [parameters.osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * + * @param {object} [parameters.osProfile.windowsConfiguration.winRM] Specifies + * the Windows Remote Management listeners. This enables remote Windows + * PowerShell. + * + * @param {array} [parameters.osProfile.windowsConfiguration.winRM.listeners] + * The list of Windows Remote Management listeners + * + * @param {object} [parameters.osProfile.linuxConfiguration] Specifies the + * Linux operating system settings on the virtual machine.

    For a list + * of supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @param {boolean} + * [parameters.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * + * @param {object} [parameters.osProfile.linuxConfiguration.ssh] Specifies the + * ssh key configuration for a Linux OS. + * + * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The + * list of SSH public keys used to authenticate with linux based VMs. + * + * @param {array} [parameters.osProfile.secrets] Specifies set of certificates + * that should be installed onto the virtual machine. + * + * @param {object} [parameters.networkProfile] Specifies the network interfaces + * of the virtual machine. + * + * @param {array} [parameters.networkProfile.networkInterfaces] Specifies the + * list of resource Ids for the network interfaces associated with the virtual + * machine. + * + * @param {object} [parameters.diagnosticsProfile] Specifies the boot + * diagnostic settings state.

    Minimum api-version: 2015-06-15. + * + * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, + * you can easily view the output of your console log.

    For both + * Windows and Linux virtual machines, Azure also enables you to see a + * screenshot of the VM from the hypervisor. + * + * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] + * Whether boot diagnostics should be enabled on the Virtual Machine. + * + * @param {string} [parameters.diagnosticsProfile.bootDiagnostics.storageUri] + * Uri of the storage account to use for placing the console output and + * screenshot. + * + * @param {object} [parameters.availabilitySet] Specifies information about the + * availability set that the virtual machine should be assigned to. Virtual + * machines specified in the same availability set are allocated to different + * nodes to maximize availability. For more information about availability + * sets, see [Manage the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    For more information on Azure planned maintainance, see [Planned + * maintenance for virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Currently, a VM can only be added to availability set at creation + * time. An existing VM cannot be added to an availability set. + * + * @param {string} [parameters.availabilitySet.id] Resource Id + * + * @param {string} [parameters.licenseType] Specifies that the image or disk + * that is being used was licensed on-premises. This element is only used for + * images that contain the Windows Server operating system.

    Possible + * values are:

    Windows_Client

    Windows_Server

    If this + * element is included in a request for an update, the value must match the + * initial value. This value cannot be updated.

    For more information, + * see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Minimum api-version: 2015-06-15 + * + * @param {object} [parameters.identity] The identity of the virtual machine, + * if configured. + * + * @param {string} [parameters.identity.type] The type of identity used for the + * virtual machine. The type 'SystemAssigned, UserAssigned' includes both an + * implicitly created identity and a set of user assigned identities. The type + * 'None' will remove any identities from the virtual machine. Possible values + * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', + * 'None' + * + * @param {array} [parameters.identity.identityIds] The list of user identities + * associated with the Virtual Machine. The user identity references will be + * ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * + * @param {array} [parameters.zones] The virtual machine zones. + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @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. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, vmName: string, parameters: models.VirtualMachine, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * The operation to create or update a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Create Virtual Machine + * operation. + * + * @param {object} [parameters.plan] Specifies information about the + * marketplace image used to create the virtual machine. This element is only + * used for marketplace images. Before you can use a marketplace image from an + * API, you must enable the image for programmatic use. In the Azure portal, + * find the marketplace image that you want to use and then click **Want to + * deploy programmatically, Get Started ->**. Enter any required information + * and then click **Save**. + * + * @param {string} [parameters.plan.name] The plan ID. + * + * @param {string} [parameters.plan.publisher] The publisher ID. + * + * @param {string} [parameters.plan.product] Specifies the product of the image + * from the marketplace. This is the same value as Offer under the + * imageReference element. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {object} [parameters.hardwareProfile] Specifies the hardware settings + * for the virtual machine. + * + * @param {string} [parameters.hardwareProfile.vmSize] Specifies the size of + * the virtual machine. For more information about virtual machine sizes, see + * [Sizes for virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    The available VM sizes depend on region and availability set. For a + * list of available sizes use these APIs:

    [List all available + * virtual machine sizes in an availability + * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) + *

    [List all available virtual machine sizes in a + * region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) + *

    [List all available virtual machine sizes for + * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). + * Possible values include: '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_B1s', 'Standard_B1ms', + * 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', + * '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_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', + * 'Standard_D32_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', + * 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', + * 'Standard_D64s_v3', '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_DS13-4_v2', 'Standard_DS13-2_v2', + * 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', 'Standard_E2_v3', + * 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', 'Standard_E32_v3', + * 'Standard_E64_v3', 'Standard_E2s_v3', 'Standard_E4s_v3', 'Standard_E8s_v3', + * 'Standard_E16s_v3', 'Standard_E32s_v3', 'Standard_E64s_v3', + * 'Standard_E32-16_v3', 'Standard_E32-8s_v3', 'Standard_E64-32s_v3', + * 'Standard_E64-16s_v3', 'Standard_F1', 'Standard_F2', 'Standard_F4', + * 'Standard_F8', 'Standard_F16', 'Standard_F1s', 'Standard_F2s', + * 'Standard_F4s', 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2', + * 'Standard_F4s_v2', 'Standard_F8s_v2', 'Standard_F16s_v2', + * 'Standard_F32s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1', + * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', + * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', + * 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8', + * 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m', + * 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', + * 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms', + * 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms', + * 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms', + * 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', + * 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2', + * 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3', + * 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s', + * 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6', + * 'Standard_NV12', 'Standard_NV24' + * + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. + * + * @param {object} [parameters.storageProfile.imageReference] Specifies + * information about the image to use. You can specify information about + * platform images, marketplace images, or virtual machine images. This element + * is required when you want to use a platform image, marketplace image, or + * virtual machine image, but is not used in other creation operations. + * + * @param {string} [parameters.storageProfile.imageReference.publisher] The + * image publisher. + * + * @param {string} [parameters.storageProfile.imageReference.offer] Specifies + * the offer of the platform image or marketplace image used to create the + * virtual machine. + * + * @param {string} [parameters.storageProfile.imageReference.sku] The image + * SKU. + * + * @param {string} [parameters.storageProfile.imageReference.version] Specifies + * the version of the platform image or marketplace image used to create the + * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the + * latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. + * + * @param {string} [parameters.storageProfile.imageReference.id] Resource Id + * + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} [parameters.storageProfile.osDisk.osType] This property + * allows you to specify the type of the OS that is included in the disk if + * creating a VM from user-image or a specialized VHD.

    Possible values + * are:

    **Windows**

    **Linux**. Possible values include: + * 'Windows', 'Linux' + * + * @param {object} [parameters.storageProfile.osDisk.encryptionSettings] + * Specifies the encryption settings for the OS Disk.

    Minimum + * api-version: 2015-06-15 + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey] + * Specifies the location of the disk encryption key, which is a Key Vault + * Secret. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.secretUrl + * The URL referencing a secret in a Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the secret. + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey] + * Specifies the location of the key encryption key in Key Vault. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.keyUrl + * The URL referencing a key encryption key in Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the key. + * + * @param {boolean} + * [parameters.storageProfile.osDisk.encryptionSettings.enabled] Specifies + * whether disk encryption should be enabled on the virtual machine. + * + * @param {string} [parameters.storageProfile.osDisk.name] The disk name. + * + * @param {object} [parameters.storageProfile.osDisk.vhd] The virtual hard + * disk. + * + * @param {object} [parameters.storageProfile.osDisk.image] The source user + * image virtual hard disk. The virtual hard disk will be copied before being + * attached to the virtual machine. If SourceImage is provided, the destination + * virtual hard drive must not exist. + * + * @param {string} [parameters.storageProfile.osDisk.image.uri] Specifies the + * virtual hard disk's uri. + * + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {boolean} [parameters.storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @param {string} parameters.storageProfile.osDisk.createOption Specifies how + * the virtual machine should be created.

    Possible values are:

    + * **Attach** \u2013 This value is used when you are using a specialized disk + * to create the virtual machine.

    **FromImage** \u2013 This value is + * used when you are using an image to create the virtual machine. If you are + * using a platform image, you also use the imageReference element described + * above. If you are using a marketplace image, you also use the plan element + * previously described. Possible values include: 'FromImage', 'Empty', + * 'Attach' + * + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of an empty data disk in gigabytes. This element can be used to + * overwrite the name of the disk in a virtual machine image.

    This + * value cannot be larger than 1023 GB + * + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed + * disk parameters. + * + * @param {string} + * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies + * the storage account type for the managed disk. Possible values are: + * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id + * + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {object} [parameters.osProfile] Specifies the operating system + * settings for the virtual machine. + * + * @param {string} [parameters.osProfile.computerName] Specifies the host OS + * name of the virtual machine.

    **Max-length (Windows):** 15 + * characters

    **Max-length (Linux):** 64 characters.

    For + * naming conventions and restrictions see [Azure infrastructure services + * implementation + * guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). + * + * @param {string} [parameters.osProfile.adminUsername] Specifies the name of + * the administrator account.

    **Windows-only restriction:** Cannot end + * in "."

    **Disallowed values:** "administrator", "admin", "user", + * "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", + * "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", + * "john", "owner", "root", "server", "sql", "support", "support_388945a0", + * "sys", "test2", "test3", "user4", "user5".

    **Minimum-length + * (Linux):** 1 character

    **Max-length (Linux):** 64 characters + *

    **Max-length (Windows):** 20 characters

  • For root + * access to the Linux VM, see [Using root privileges on Linux virtual machines + * in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in this + * field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {string} [parameters.osProfile.adminPassword] Specifies the password + * of the administrator account.

    **Minimum-length (Windows):** 8 + * characters

    **Minimum-length (Linux):** 6 characters

    + * **Max-length (Windows):** 123 characters

    **Max-length (Linux):** 72 + * characters

    **Complexity requirements:** 3 out of 4 conditions below + * need to be fulfilled
    Has lower characters
    Has upper characters
    + * Has a digit
    Has a special character (Regex match [\W_])

    + * **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", + * "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", + * "iloveyou!"

    For resetting the password, see [How to reset the + * Remote Desktop service or its login password in a Windows + * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    For resetting root password, see [Manage users, SSH, and check or + * repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + * + * @param {string} [parameters.osProfile.customData] Specifies a base-64 + * encoded string of custom data. The base-64 encoded string is decoded to a + * binary array that is saved as a file on the Virtual Machine. The maximum + * length of the binary array is 65535 bytes.

    For using cloud-init for + * your VM, see [Using cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {object} [parameters.osProfile.windowsConfiguration] Specifies + * Windows operating system settings on the virtual machine. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.provisionVMAgent] Indicates + * whether virtual machine agent should be provisioned on the virtual machine. + *

    When this property is not specified in the request body, default + * behavior is to set it to true. This will ensure that VM Agent is installed + * on the VM so that extensions can be added to the VM later. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.enableAutomaticUpdates] Indicates + * whether virtual machine is enabled for automatic updates. + * + * @param {string} [parameters.osProfile.windowsConfiguration.timeZone] + * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" + * + * @param {array} + * [parameters.osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * + * @param {object} [parameters.osProfile.windowsConfiguration.winRM] Specifies + * the Windows Remote Management listeners. This enables remote Windows + * PowerShell. + * + * @param {array} [parameters.osProfile.windowsConfiguration.winRM.listeners] + * The list of Windows Remote Management listeners + * + * @param {object} [parameters.osProfile.linuxConfiguration] Specifies the + * Linux operating system settings on the virtual machine.

    For a list + * of supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @param {boolean} + * [parameters.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * + * @param {object} [parameters.osProfile.linuxConfiguration.ssh] Specifies the + * ssh key configuration for a Linux OS. + * + * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The + * list of SSH public keys used to authenticate with linux based VMs. + * + * @param {array} [parameters.osProfile.secrets] Specifies set of certificates + * that should be installed onto the virtual machine. + * + * @param {object} [parameters.networkProfile] Specifies the network interfaces + * of the virtual machine. + * + * @param {array} [parameters.networkProfile.networkInterfaces] Specifies the + * list of resource Ids for the network interfaces associated with the virtual + * machine. + * + * @param {object} [parameters.diagnosticsProfile] Specifies the boot + * diagnostic settings state.

    Minimum api-version: 2015-06-15. + * + * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, + * you can easily view the output of your console log.

    For both + * Windows and Linux virtual machines, Azure also enables you to see a + * screenshot of the VM from the hypervisor. + * + * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] + * Whether boot diagnostics should be enabled on the Virtual Machine. + * + * @param {string} [parameters.diagnosticsProfile.bootDiagnostics.storageUri] + * Uri of the storage account to use for placing the console output and + * screenshot. + * + * @param {object} [parameters.availabilitySet] Specifies information about the + * availability set that the virtual machine should be assigned to. Virtual + * machines specified in the same availability set are allocated to different + * nodes to maximize availability. For more information about availability + * sets, see [Manage the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    For more information on Azure planned maintainance, see [Planned + * maintenance for virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Currently, a VM can only be added to availability set at creation + * time. An existing VM cannot be added to an availability set. + * + * @param {string} [parameters.availabilitySet.id] Resource Id + * + * @param {string} [parameters.licenseType] Specifies that the image or disk + * that is being used was licensed on-premises. This element is only used for + * images that contain the Windows Server operating system.

    Possible + * values are:

    Windows_Client

    Windows_Server

    If this + * element is included in a request for an update, the value must match the + * initial value. This value cannot be updated.

    For more information, + * see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Minimum api-version: 2015-06-15 + * + * @param {object} [parameters.identity] The identity of the virtual machine, + * if configured. + * + * @param {string} [parameters.identity.type] The type of identity used for the + * virtual machine. The type 'SystemAssigned, UserAssigned' includes both an + * implicitly created identity and a set of user assigned identities. The type + * 'None' will remove any identities from the virtual machine. Possible values + * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', + * 'None' + * + * @param {array} [parameters.identity.identityIds] The list of user identities + * associated with the Virtual Machine. The user identity references will be + * ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * + * @param {array} [parameters.zones] The virtual machine zones. + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @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 {VirtualMachine} - 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. + * + * {VirtualMachine} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachine} 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. + */ + beginCreateOrUpdate(resourceGroupName: string, vmName: string, parameters: models.VirtualMachine, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, vmName: string, parameters: models.VirtualMachine, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, vmName: string, parameters: models.VirtualMachine, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * The operation to update a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Update Virtual Machine + * operation. + * + * @param {object} [parameters.plan] Specifies information about the + * marketplace image used to create the virtual machine. This element is only + * used for marketplace images. Before you can use a marketplace image from an + * API, you must enable the image for programmatic use. In the Azure portal, + * find the marketplace image that you want to use and then click **Want to + * deploy programmatically, Get Started ->**. Enter any required information + * and then click **Save**. + * + * @param {string} [parameters.plan.name] The plan ID. + * + * @param {string} [parameters.plan.publisher] The publisher ID. + * + * @param {string} [parameters.plan.product] Specifies the product of the image + * from the marketplace. This is the same value as Offer under the + * imageReference element. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {object} [parameters.hardwareProfile] Specifies the hardware settings + * for the virtual machine. + * + * @param {string} [parameters.hardwareProfile.vmSize] Specifies the size of + * the virtual machine. For more information about virtual machine sizes, see + * [Sizes for virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    The available VM sizes depend on region and availability set. For a + * list of available sizes use these APIs:

    [List all available + * virtual machine sizes in an availability + * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) + *

    [List all available virtual machine sizes in a + * region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) + *

    [List all available virtual machine sizes for + * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). + * Possible values include: '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_B1s', 'Standard_B1ms', + * 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', + * '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_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', + * 'Standard_D32_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', + * 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', + * 'Standard_D64s_v3', '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_DS13-4_v2', 'Standard_DS13-2_v2', + * 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', 'Standard_E2_v3', + * 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', 'Standard_E32_v3', + * 'Standard_E64_v3', 'Standard_E2s_v3', 'Standard_E4s_v3', 'Standard_E8s_v3', + * 'Standard_E16s_v3', 'Standard_E32s_v3', 'Standard_E64s_v3', + * 'Standard_E32-16_v3', 'Standard_E32-8s_v3', 'Standard_E64-32s_v3', + * 'Standard_E64-16s_v3', 'Standard_F1', 'Standard_F2', 'Standard_F4', + * 'Standard_F8', 'Standard_F16', 'Standard_F1s', 'Standard_F2s', + * 'Standard_F4s', 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2', + * 'Standard_F4s_v2', 'Standard_F8s_v2', 'Standard_F16s_v2', + * 'Standard_F32s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1', + * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', + * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', + * 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8', + * 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m', + * 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', + * 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms', + * 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms', + * 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms', + * 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', + * 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2', + * 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3', + * 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s', + * 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6', + * 'Standard_NV12', 'Standard_NV24' + * + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. + * + * @param {object} [parameters.storageProfile.imageReference] Specifies + * information about the image to use. You can specify information about + * platform images, marketplace images, or virtual machine images. This element + * is required when you want to use a platform image, marketplace image, or + * virtual machine image, but is not used in other creation operations. + * + * @param {string} [parameters.storageProfile.imageReference.publisher] The + * image publisher. + * + * @param {string} [parameters.storageProfile.imageReference.offer] Specifies + * the offer of the platform image or marketplace image used to create the + * virtual machine. + * + * @param {string} [parameters.storageProfile.imageReference.sku] The image + * SKU. + * + * @param {string} [parameters.storageProfile.imageReference.version] Specifies + * the version of the platform image or marketplace image used to create the + * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the + * latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. + * + * @param {string} [parameters.storageProfile.imageReference.id] Resource Id + * + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} [parameters.storageProfile.osDisk.osType] This property + * allows you to specify the type of the OS that is included in the disk if + * creating a VM from user-image or a specialized VHD.

    Possible values + * are:

    **Windows**

    **Linux**. Possible values include: + * 'Windows', 'Linux' + * + * @param {object} [parameters.storageProfile.osDisk.encryptionSettings] + * Specifies the encryption settings for the OS Disk.

    Minimum + * api-version: 2015-06-15 + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey] + * Specifies the location of the disk encryption key, which is a Key Vault + * Secret. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.secretUrl + * The URL referencing a secret in a Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the secret. + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey] + * Specifies the location of the key encryption key in Key Vault. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.keyUrl + * The URL referencing a key encryption key in Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the key. + * + * @param {boolean} + * [parameters.storageProfile.osDisk.encryptionSettings.enabled] Specifies + * whether disk encryption should be enabled on the virtual machine. + * + * @param {string} [parameters.storageProfile.osDisk.name] The disk name. + * + * @param {object} [parameters.storageProfile.osDisk.vhd] The virtual hard + * disk. + * + * @param {object} [parameters.storageProfile.osDisk.image] The source user + * image virtual hard disk. The virtual hard disk will be copied before being + * attached to the virtual machine. If SourceImage is provided, the destination + * virtual hard drive must not exist. + * + * @param {string} [parameters.storageProfile.osDisk.image.uri] Specifies the + * virtual hard disk's uri. + * + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {boolean} [parameters.storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @param {string} parameters.storageProfile.osDisk.createOption Specifies how + * the virtual machine should be created.

    Possible values are:

    + * **Attach** \u2013 This value is used when you are using a specialized disk + * to create the virtual machine.

    **FromImage** \u2013 This value is + * used when you are using an image to create the virtual machine. If you are + * using a platform image, you also use the imageReference element described + * above. If you are using a marketplace image, you also use the plan element + * previously described. Possible values include: 'FromImage', 'Empty', + * 'Attach' + * + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of an empty data disk in gigabytes. This element can be used to + * overwrite the name of the disk in a virtual machine image.

    This + * value cannot be larger than 1023 GB + * + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed + * disk parameters. + * + * @param {string} + * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies + * the storage account type for the managed disk. Possible values are: + * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id + * + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {object} [parameters.osProfile] Specifies the operating system + * settings for the virtual machine. + * + * @param {string} [parameters.osProfile.computerName] Specifies the host OS + * name of the virtual machine.

    **Max-length (Windows):** 15 + * characters

    **Max-length (Linux):** 64 characters.

    For + * naming conventions and restrictions see [Azure infrastructure services + * implementation + * guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). + * + * @param {string} [parameters.osProfile.adminUsername] Specifies the name of + * the administrator account.

    **Windows-only restriction:** Cannot end + * in "."

    **Disallowed values:** "administrator", "admin", "user", + * "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", + * "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", + * "john", "owner", "root", "server", "sql", "support", "support_388945a0", + * "sys", "test2", "test3", "user4", "user5".

    **Minimum-length + * (Linux):** 1 character

    **Max-length (Linux):** 64 characters + *

    **Max-length (Windows):** 20 characters

  • For root + * access to the Linux VM, see [Using root privileges on Linux virtual machines + * in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in this + * field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {string} [parameters.osProfile.adminPassword] Specifies the password + * of the administrator account.

    **Minimum-length (Windows):** 8 + * characters

    **Minimum-length (Linux):** 6 characters

    + * **Max-length (Windows):** 123 characters

    **Max-length (Linux):** 72 + * characters

    **Complexity requirements:** 3 out of 4 conditions below + * need to be fulfilled
    Has lower characters
    Has upper characters
    + * Has a digit
    Has a special character (Regex match [\W_])

    + * **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", + * "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", + * "iloveyou!"

    For resetting the password, see [How to reset the + * Remote Desktop service or its login password in a Windows + * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    For resetting root password, see [Manage users, SSH, and check or + * repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + * + * @param {string} [parameters.osProfile.customData] Specifies a base-64 + * encoded string of custom data. The base-64 encoded string is decoded to a + * binary array that is saved as a file on the Virtual Machine. The maximum + * length of the binary array is 65535 bytes.

    For using cloud-init for + * your VM, see [Using cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {object} [parameters.osProfile.windowsConfiguration] Specifies + * Windows operating system settings on the virtual machine. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.provisionVMAgent] Indicates + * whether virtual machine agent should be provisioned on the virtual machine. + *

    When this property is not specified in the request body, default + * behavior is to set it to true. This will ensure that VM Agent is installed + * on the VM so that extensions can be added to the VM later. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.enableAutomaticUpdates] Indicates + * whether virtual machine is enabled for automatic updates. + * + * @param {string} [parameters.osProfile.windowsConfiguration.timeZone] + * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" + * + * @param {array} + * [parameters.osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * + * @param {object} [parameters.osProfile.windowsConfiguration.winRM] Specifies + * the Windows Remote Management listeners. This enables remote Windows + * PowerShell. + * + * @param {array} [parameters.osProfile.windowsConfiguration.winRM.listeners] + * The list of Windows Remote Management listeners + * + * @param {object} [parameters.osProfile.linuxConfiguration] Specifies the + * Linux operating system settings on the virtual machine.

    For a list + * of supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @param {boolean} + * [parameters.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * + * @param {object} [parameters.osProfile.linuxConfiguration.ssh] Specifies the + * ssh key configuration for a Linux OS. + * + * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The + * list of SSH public keys used to authenticate with linux based VMs. + * + * @param {array} [parameters.osProfile.secrets] Specifies set of certificates + * that should be installed onto the virtual machine. + * + * @param {object} [parameters.networkProfile] Specifies the network interfaces + * of the virtual machine. + * + * @param {array} [parameters.networkProfile.networkInterfaces] Specifies the + * list of resource Ids for the network interfaces associated with the virtual + * machine. + * + * @param {object} [parameters.diagnosticsProfile] Specifies the boot + * diagnostic settings state.

    Minimum api-version: 2015-06-15. + * + * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, + * you can easily view the output of your console log.

    For both + * Windows and Linux virtual machines, Azure also enables you to see a + * screenshot of the VM from the hypervisor. + * + * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] + * Whether boot diagnostics should be enabled on the Virtual Machine. + * + * @param {string} [parameters.diagnosticsProfile.bootDiagnostics.storageUri] + * Uri of the storage account to use for placing the console output and + * screenshot. + * + * @param {object} [parameters.availabilitySet] Specifies information about the + * availability set that the virtual machine should be assigned to. Virtual + * machines specified in the same availability set are allocated to different + * nodes to maximize availability. For more information about availability + * sets, see [Manage the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    For more information on Azure planned maintainance, see [Planned + * maintenance for virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Currently, a VM can only be added to availability set at creation + * time. An existing VM cannot be added to an availability set. + * + * @param {string} [parameters.availabilitySet.id] Resource Id + * + * @param {string} [parameters.licenseType] Specifies that the image or disk + * that is being used was licensed on-premises. This element is only used for + * images that contain the Windows Server operating system.

    Possible + * values are:

    Windows_Client

    Windows_Server

    If this + * element is included in a request for an update, the value must match the + * initial value. This value cannot be updated.

    For more information, + * see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Minimum api-version: 2015-06-15 + * + * @param {object} [parameters.identity] The identity of the virtual machine, + * if configured. + * + * @param {string} [parameters.identity.type] The type of identity used for the + * virtual machine. The type 'SystemAssigned, UserAssigned' includes both an + * implicitly created identity and a set of user assigned identities. The type + * 'None' will remove any identities from the virtual machine. Possible values + * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', + * 'None' + * + * @param {array} [parameters.identity.identityIds] The list of user identities + * associated with the Virtual Machine. The user identity references will be + * ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * + * @param {array} [parameters.zones] The virtual machine zones. + * + * @param {object} [parameters.tags] Resource tags + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginUpdateWithHttpOperationResponse(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * The operation to update a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Update Virtual Machine + * operation. + * + * @param {object} [parameters.plan] Specifies information about the + * marketplace image used to create the virtual machine. This element is only + * used for marketplace images. Before you can use a marketplace image from an + * API, you must enable the image for programmatic use. In the Azure portal, + * find the marketplace image that you want to use and then click **Want to + * deploy programmatically, Get Started ->**. Enter any required information + * and then click **Save**. + * + * @param {string} [parameters.plan.name] The plan ID. + * + * @param {string} [parameters.plan.publisher] The publisher ID. + * + * @param {string} [parameters.plan.product] Specifies the product of the image + * from the marketplace. This is the same value as Offer under the + * imageReference element. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {object} [parameters.hardwareProfile] Specifies the hardware settings + * for the virtual machine. + * + * @param {string} [parameters.hardwareProfile.vmSize] Specifies the size of + * the virtual machine. For more information about virtual machine sizes, see + * [Sizes for virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    The available VM sizes depend on region and availability set. For a + * list of available sizes use these APIs:

    [List all available + * virtual machine sizes in an availability + * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) + *

    [List all available virtual machine sizes in a + * region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) + *

    [List all available virtual machine sizes for + * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). + * Possible values include: '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_B1s', 'Standard_B1ms', + * 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', + * '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_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', + * 'Standard_D32_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', + * 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', + * 'Standard_D64s_v3', '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_DS13-4_v2', 'Standard_DS13-2_v2', + * 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', 'Standard_E2_v3', + * 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', 'Standard_E32_v3', + * 'Standard_E64_v3', 'Standard_E2s_v3', 'Standard_E4s_v3', 'Standard_E8s_v3', + * 'Standard_E16s_v3', 'Standard_E32s_v3', 'Standard_E64s_v3', + * 'Standard_E32-16_v3', 'Standard_E32-8s_v3', 'Standard_E64-32s_v3', + * 'Standard_E64-16s_v3', 'Standard_F1', 'Standard_F2', 'Standard_F4', + * 'Standard_F8', 'Standard_F16', 'Standard_F1s', 'Standard_F2s', + * 'Standard_F4s', 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2', + * 'Standard_F4s_v2', 'Standard_F8s_v2', 'Standard_F16s_v2', + * 'Standard_F32s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1', + * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', + * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', + * 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8', + * 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m', + * 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', + * 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms', + * 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms', + * 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms', + * 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', + * 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2', + * 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3', + * 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s', + * 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6', + * 'Standard_NV12', 'Standard_NV24' + * + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. + * + * @param {object} [parameters.storageProfile.imageReference] Specifies + * information about the image to use. You can specify information about + * platform images, marketplace images, or virtual machine images. This element + * is required when you want to use a platform image, marketplace image, or + * virtual machine image, but is not used in other creation operations. + * + * @param {string} [parameters.storageProfile.imageReference.publisher] The + * image publisher. + * + * @param {string} [parameters.storageProfile.imageReference.offer] Specifies + * the offer of the platform image or marketplace image used to create the + * virtual machine. + * + * @param {string} [parameters.storageProfile.imageReference.sku] The image + * SKU. + * + * @param {string} [parameters.storageProfile.imageReference.version] Specifies + * the version of the platform image or marketplace image used to create the + * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the + * latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. + * + * @param {string} [parameters.storageProfile.imageReference.id] Resource Id + * + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} [parameters.storageProfile.osDisk.osType] This property + * allows you to specify the type of the OS that is included in the disk if + * creating a VM from user-image or a specialized VHD.

    Possible values + * are:

    **Windows**

    **Linux**. Possible values include: + * 'Windows', 'Linux' + * + * @param {object} [parameters.storageProfile.osDisk.encryptionSettings] + * Specifies the encryption settings for the OS Disk.

    Minimum + * api-version: 2015-06-15 + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey] + * Specifies the location of the disk encryption key, which is a Key Vault + * Secret. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.secretUrl + * The URL referencing a secret in a Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the secret. + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey] + * Specifies the location of the key encryption key in Key Vault. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.keyUrl + * The URL referencing a key encryption key in Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the key. + * + * @param {boolean} + * [parameters.storageProfile.osDisk.encryptionSettings.enabled] Specifies + * whether disk encryption should be enabled on the virtual machine. + * + * @param {string} [parameters.storageProfile.osDisk.name] The disk name. + * + * @param {object} [parameters.storageProfile.osDisk.vhd] The virtual hard + * disk. + * + * @param {object} [parameters.storageProfile.osDisk.image] The source user + * image virtual hard disk. The virtual hard disk will be copied before being + * attached to the virtual machine. If SourceImage is provided, the destination + * virtual hard drive must not exist. + * + * @param {string} [parameters.storageProfile.osDisk.image.uri] Specifies the + * virtual hard disk's uri. + * + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {boolean} [parameters.storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @param {string} parameters.storageProfile.osDisk.createOption Specifies how + * the virtual machine should be created.

    Possible values are:

    + * **Attach** \u2013 This value is used when you are using a specialized disk + * to create the virtual machine.

    **FromImage** \u2013 This value is + * used when you are using an image to create the virtual machine. If you are + * using a platform image, you also use the imageReference element described + * above. If you are using a marketplace image, you also use the plan element + * previously described. Possible values include: 'FromImage', 'Empty', + * 'Attach' + * + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of an empty data disk in gigabytes. This element can be used to + * overwrite the name of the disk in a virtual machine image.

    This + * value cannot be larger than 1023 GB + * + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed + * disk parameters. + * + * @param {string} + * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies + * the storage account type for the managed disk. Possible values are: + * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id + * + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {object} [parameters.osProfile] Specifies the operating system + * settings for the virtual machine. + * + * @param {string} [parameters.osProfile.computerName] Specifies the host OS + * name of the virtual machine.

    **Max-length (Windows):** 15 + * characters

    **Max-length (Linux):** 64 characters.

    For + * naming conventions and restrictions see [Azure infrastructure services + * implementation + * guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). + * + * @param {string} [parameters.osProfile.adminUsername] Specifies the name of + * the administrator account.

    **Windows-only restriction:** Cannot end + * in "."

    **Disallowed values:** "administrator", "admin", "user", + * "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", + * "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", + * "john", "owner", "root", "server", "sql", "support", "support_388945a0", + * "sys", "test2", "test3", "user4", "user5".

    **Minimum-length + * (Linux):** 1 character

    **Max-length (Linux):** 64 characters + *

    **Max-length (Windows):** 20 characters

  • For root + * access to the Linux VM, see [Using root privileges on Linux virtual machines + * in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in this + * field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {string} [parameters.osProfile.adminPassword] Specifies the password + * of the administrator account.

    **Minimum-length (Windows):** 8 + * characters

    **Minimum-length (Linux):** 6 characters

    + * **Max-length (Windows):** 123 characters

    **Max-length (Linux):** 72 + * characters

    **Complexity requirements:** 3 out of 4 conditions below + * need to be fulfilled
    Has lower characters
    Has upper characters
    + * Has a digit
    Has a special character (Regex match [\W_])

    + * **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", + * "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", + * "iloveyou!"

    For resetting the password, see [How to reset the + * Remote Desktop service or its login password in a Windows + * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    For resetting root password, see [Manage users, SSH, and check or + * repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + * + * @param {string} [parameters.osProfile.customData] Specifies a base-64 + * encoded string of custom data. The base-64 encoded string is decoded to a + * binary array that is saved as a file on the Virtual Machine. The maximum + * length of the binary array is 65535 bytes.

    For using cloud-init for + * your VM, see [Using cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {object} [parameters.osProfile.windowsConfiguration] Specifies + * Windows operating system settings on the virtual machine. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.provisionVMAgent] Indicates + * whether virtual machine agent should be provisioned on the virtual machine. + *

    When this property is not specified in the request body, default + * behavior is to set it to true. This will ensure that VM Agent is installed + * on the VM so that extensions can be added to the VM later. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.enableAutomaticUpdates] Indicates + * whether virtual machine is enabled for automatic updates. + * + * @param {string} [parameters.osProfile.windowsConfiguration.timeZone] + * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" + * + * @param {array} + * [parameters.osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * + * @param {object} [parameters.osProfile.windowsConfiguration.winRM] Specifies + * the Windows Remote Management listeners. This enables remote Windows + * PowerShell. + * + * @param {array} [parameters.osProfile.windowsConfiguration.winRM.listeners] + * The list of Windows Remote Management listeners + * + * @param {object} [parameters.osProfile.linuxConfiguration] Specifies the + * Linux operating system settings on the virtual machine.

    For a list + * of supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @param {boolean} + * [parameters.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * + * @param {object} [parameters.osProfile.linuxConfiguration.ssh] Specifies the + * ssh key configuration for a Linux OS. + * + * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The + * list of SSH public keys used to authenticate with linux based VMs. + * + * @param {array} [parameters.osProfile.secrets] Specifies set of certificates + * that should be installed onto the virtual machine. + * + * @param {object} [parameters.networkProfile] Specifies the network interfaces + * of the virtual machine. + * + * @param {array} [parameters.networkProfile.networkInterfaces] Specifies the + * list of resource Ids for the network interfaces associated with the virtual + * machine. + * + * @param {object} [parameters.diagnosticsProfile] Specifies the boot + * diagnostic settings state.

    Minimum api-version: 2015-06-15. + * + * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, + * you can easily view the output of your console log.

    For both + * Windows and Linux virtual machines, Azure also enables you to see a + * screenshot of the VM from the hypervisor. + * + * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] + * Whether boot diagnostics should be enabled on the Virtual Machine. + * + * @param {string} [parameters.diagnosticsProfile.bootDiagnostics.storageUri] + * Uri of the storage account to use for placing the console output and + * screenshot. + * + * @param {object} [parameters.availabilitySet] Specifies information about the + * availability set that the virtual machine should be assigned to. Virtual + * machines specified in the same availability set are allocated to different + * nodes to maximize availability. For more information about availability + * sets, see [Manage the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    For more information on Azure planned maintainance, see [Planned + * maintenance for virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Currently, a VM can only be added to availability set at creation + * time. An existing VM cannot be added to an availability set. + * + * @param {string} [parameters.availabilitySet.id] Resource Id + * + * @param {string} [parameters.licenseType] Specifies that the image or disk + * that is being used was licensed on-premises. This element is only used for + * images that contain the Windows Server operating system.

    Possible + * values are:

    Windows_Client

    Windows_Server

    If this + * element is included in a request for an update, the value must match the + * initial value. This value cannot be updated.

    For more information, + * see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Minimum api-version: 2015-06-15 + * + * @param {object} [parameters.identity] The identity of the virtual machine, + * if configured. + * + * @param {string} [parameters.identity.type] The type of identity used for the + * virtual machine. The type 'SystemAssigned, UserAssigned' includes both an + * implicitly created identity and a set of user assigned identities. The type + * 'None' will remove any identities from the virtual machine. Possible values + * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', + * 'None' + * + * @param {array} [parameters.identity.identityIds] The list of user identities + * associated with the Virtual Machine. The user identity references will be + * ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * + * @param {array} [parameters.zones] The virtual machine zones. + * + * @param {object} [parameters.tags] Resource tags + * + * @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 {VirtualMachine} - 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. + * + * {VirtualMachine} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachine} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginUpdate(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdate(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineUpdate, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * The operation to delete a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * The operation to delete a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + beginDeleteMethod(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Converts virtual machine disks from blob-based to managed disks. Virtual + * machine must be stop-deallocated before invoking this operation. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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. + */ + beginConvertToManagedDisksWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Converts virtual machine disks from blob-based to managed disks. Virtual + * machine must be stop-deallocated before invoking this operation. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + beginConvertToManagedDisks(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginConvertToManagedDisks(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + beginConvertToManagedDisks(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Shuts down the virtual machine and releases the compute resources. You are + * not billed for the compute resources that this virtual machine uses. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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. + */ + beginDeallocateWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Shuts down the virtual machine and releases the compute resources. You are + * not billed for the compute resources that this virtual machine uses. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + beginDeallocate(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeallocate(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + beginDeallocate(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * The operation to power off (stop) a virtual machine. The virtual machine can + * be restarted with the same provisioned resources. You are still charged for + * this virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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. + */ + beginPowerOffWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * The operation to power off (stop) a virtual machine. The virtual machine can + * be restarted with the same provisioned resources. You are still charged for + * this virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + beginPowerOff(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginPowerOff(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + beginPowerOff(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * The operation to restart a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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. + */ + beginRestartWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * The operation to restart a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + beginRestart(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginRestart(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + beginRestart(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * The operation to start a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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. + */ + beginStartWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * The operation to start a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + beginStart(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginStart(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + beginStart(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * The operation to redeploy a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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. + */ + beginRedeployWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * The operation to redeploy a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + beginRedeploy(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginRedeploy(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + beginRedeploy(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * The operation to perform maintenance on a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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. + */ + beginPerformMaintenanceWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * The operation to perform maintenance on a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + beginPerformMaintenance(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginPerformMaintenance(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + beginPerformMaintenance(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Run command on the VM. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Run command operation. + * + * @param {string} parameters.commandId The run command id. + * + * @param {array} [parameters.script] Optional. The script to be executed. + * When this value is given, the given script will override the default script + * of the command. + * + * @param {array} [parameters.parameters] The run command parameters. + * + * @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. + */ + beginRunCommandWithHttpOperationResponse(resourceGroupName: string, vmName: string, parameters: models.RunCommandInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Run command on the VM. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Run command operation. + * + * @param {string} parameters.commandId The run command id. + * + * @param {array} [parameters.script] Optional. The script to be executed. + * When this value is given, the given script will override the default script + * of the command. + * + * @param {array} [parameters.parameters] The run command parameters. + * + * @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 {RunCommandResult} - 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. + * + * {RunCommandResult} [result] - The deserialized result object if an error did not occur. + * See {@link RunCommandResult} 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. + */ + beginRunCommand(resourceGroupName: string, vmName: string, parameters: models.RunCommandInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginRunCommand(resourceGroupName: string, vmName: string, parameters: models.RunCommandInput, callback: ServiceCallback): void; + beginRunCommand(resourceGroupName: string, vmName: string, parameters: models.RunCommandInput, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists all of the virtual machines in the specified resource group. Use the + * nextLink property in the response to get the next page of virtual machines. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all of the virtual machines in the specified resource group. Use the + * nextLink property in the response to get the next page of virtual machines. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {VirtualMachineListResult} - 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. + * + * {VirtualMachineListResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists all of the virtual machines in the specified subscription. Use the + * nextLink property in the response to get the next page of virtual machines. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listAllNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all of the virtual machines in the specified subscription. Use the + * nextLink property in the response to get the next page of virtual machines. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {VirtualMachineListResult} - 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. + * + * {VirtualMachineListResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineListResult} 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. + */ + listAllNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAllNext(nextPageLink: string, callback: ServiceCallback): void; + listAllNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * VirtualMachineScaleSets + * __NOTE__: An instance of this class is automatically created for an + * instance of the ComputeManagementClient. + */ +export interface VirtualMachineScaleSets { + + + /** + * Create or update a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set to create or + * update. + * + * @param {object} parameters The scale set object. + * + * @param {object} [parameters.sku] The virtual machine scale set sku. + * + * @param {string} [parameters.sku.name] The sku name. + * + * @param {string} [parameters.sku.tier] Specifies the tier of virtual machines + * in a scale set.

    Possible Values:

    **Standard**

    **Basic** + * + * @param {number} [parameters.sku.capacity] Specifies the number of virtual + * machines in the scale set. + * + * @param {object} [parameters.plan] Specifies information about the + * marketplace image used to create the virtual machine. This element is only + * used for marketplace images. Before you can use a marketplace image from an + * API, you must enable the image for programmatic use. In the Azure portal, + * find the marketplace image that you want to use and then click **Want to + * deploy programmatically, Get Started ->**. Enter any required information + * and then click **Save**. + * + * @param {string} [parameters.plan.name] The plan ID. + * + * @param {string} [parameters.plan.publisher] The publisher ID. + * + * @param {string} [parameters.plan.product] Specifies the product of the image + * from the marketplace. This is the same value as Offer under the + * imageReference element. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {object} [parameters.upgradePolicy] The upgrade policy. + * + * @param {string} [parameters.upgradePolicy.mode] Specifies the mode of an + * upgrade to virtual machines in the scale set.

    Possible values + * are:

    **Manual** - You control the application of updates to + * virtual machines in the scale set. You do this by using the manualUpgrade + * action.

    **Automatic** - All virtual machines in the scale set + * are automatically updated at the same time. Possible values include: + * 'Automatic', 'Manual', 'Rolling' + * + * @param {object} [parameters.upgradePolicy.rollingUpgradePolicy] The + * configuration parameters used while performing a rolling upgrade. + * + * @param {number} + * [parameters.upgradePolicy.rollingUpgradePolicy.maxBatchInstancePercent] The + * maximum percent of total virtual machine instances that will be upgraded + * simultaneously by the rolling upgrade in one batch. As this is a maximum, + * unhealthy instances in previous or future batches can cause the percentage + * of instances in a batch to decrease to ensure higher reliability. The + * default value for this parameter is 20%. + * + * @param {number} + * [parameters.upgradePolicy.rollingUpgradePolicy.maxUnhealthyInstancePercent] + * The maximum percentage of the total virtual machine instances in the scale + * set that can be simultaneously unhealthy, either as a result of being + * upgraded, or by being found in an unhealthy state by the virtual machine + * health checks before the rolling upgrade aborts. This constraint will be + * checked prior to starting any batch. The default value for this parameter is + * 20%. + * + * @param {number} + * [parameters.upgradePolicy.rollingUpgradePolicy.maxUnhealthyUpgradedInstancePercent] + * The maximum percentage of upgraded virtual machine instances that can be + * found to be in an unhealthy state. This check will happen after each batch + * is upgraded. If this percentage is ever exceeded, the rolling update aborts. + * The default value for this parameter is 20%. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradePolicy.pauseTimeBetweenBatches] The + * wait time between completing the update for all virtual machines in one + * batch and starting the next batch. The time duration should be specified in + * ISO 8601 format. The default value is 0 seconds (PT0S). + * + * @param {boolean} [parameters.upgradePolicy.automaticOSUpgrade] Whether OS + * upgrades should automatically be applied to scale set instances in a rolling + * fashion when a newer version of the image becomes available. + * + * @param {object} [parameters.virtualMachineProfile] The virtual machine + * profile. + * + * @param {object} [parameters.virtualMachineProfile.osProfile] Specifies the + * operating system settings for the virtual machines in the scale set. + * + * @param {string} + * [parameters.virtualMachineProfile.osProfile.computerNamePrefix] Specifies + * the computer name prefix for all of the virtual machines in the scale set. + * Computer name prefixes must be 1 to 15 characters long. + * + * @param {string} [parameters.virtualMachineProfile.osProfile.adminUsername] + * Specifies the name of the administrator account.

    **Windows-only + * restriction:** Cannot end in "."

    **Disallowed values:** + * "administrator", "admin", "user", "user1", "test", "user2", "test1", + * "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", + * "backup", "console", "david", "guest", "john", "owner", "root", "server", + * "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", + * "user5".

    **Minimum-length (Linux):** 1 character

    + * **Max-length (Linux):** 64 characters

    **Max-length (Windows):** 20 + * characters

  • For root access to the Linux VM, see [Using root + * privileges on Linux virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in this + * field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {string} [parameters.virtualMachineProfile.osProfile.adminPassword] + * Specifies the password of the administrator account.

    + * **Minimum-length (Windows):** 8 characters

    **Minimum-length + * (Linux):** 6 characters

    **Max-length (Windows):** 123 characters + *

    **Max-length (Linux):** 72 characters

    **Complexity + * requirements:** 3 out of 4 conditions below need to be fulfilled
    Has + * lower characters
    Has upper characters
    Has a digit
    Has a + * special character (Regex match [\W_])

    **Disallowed values:** + * "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", + * "Password!", "Password1", "Password22", "iloveyou!"

    For resetting + * the password, see [How to reset the Remote Desktop service or its login + * password in a Windows + * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    For resetting root password, see [Manage users, SSH, and check or + * repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + * + * @param {string} [parameters.virtualMachineProfile.osProfile.customData] + * Specifies a base-64 encoded string of custom data. The base-64 encoded + * string is decoded to a binary array that is saved as a file on the Virtual + * Machine. The maximum length of the binary array is 65535 bytes.

    For + * using cloud-init for your VM, see [Using cloud-init to customize a Linux VM + * during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration] Specifies + * Windows operating system settings on the virtual machine. + * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.enableAutomaticUpdates] + * Indicates whether virtual machine is enabled for automatic updates. + * + * @param {string} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.timeZone] + * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.winRM] + * Specifies the Windows Remote Management listeners. This enables remote + * Windows PowerShell. + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.winRM.listeners] + * The list of Windows Remote Management listeners + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration] Specifies + * the Linux operating system settings on the virtual machine.

    For a + * list of supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh] + * Specifies the ssh key configuration for a Linux OS. + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh.publicKeys] + * The list of SSH public keys used to authenticate with linux based VMs. + * + * @param {array} [parameters.virtualMachineProfile.osProfile.secrets] + * Specifies set of certificates that should be installed onto the virtual + * machines in the scale set. + * + * @param {object} [parameters.virtualMachineProfile.storageProfile] Specifies + * the storage settings for the virtual machine disks. + * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.imageReference] Specifies + * information about the image to use. You can specify information about + * platform images, marketplace images, or virtual machine images. This element + * is required when you want to use a platform image, marketplace image, or + * virtual machine image, but is not used in other creation operations. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.publisher] + * The image publisher. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.offer] + * Specifies the offer of the platform image or marketplace image used to + * create the virtual machine. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.sku] The + * image SKU. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.version] + * Specifies the version of the platform image or marketplace image used to + * create the virtual machine. The allowed formats are Major.Minor.Build or + * 'latest'. Major, Minor, and Build are decimal numbers. Specify 'latest' to + * use the latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.id] Resource + * Id + * + * @param {object} [parameters.virtualMachineProfile.storageProfile.osDisk] + * Specifies information about the operating system disk used by the virtual + * machines in the scale set.

    For more information about disks, see + * [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.name] The disk name. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.caching] Specifies + * the caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {boolean} + * [parameters.virtualMachineProfile.storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @param {string} + * parameters.virtualMachineProfile.storageProfile.osDisk.createOption + * Specifies how the virtual machines in the scale set should be + * created.

    The only allowed value is: **FromImage** \u2013 This value + * is used when you are using an image to create the virtual machine. If you + * are using a platform image, you also use the imageReference element + * described above. If you are using a marketplace image, you also use the + * plan element previously described. Possible values include: 'FromImage', + * 'Empty', 'Attach' + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.osType] This + * property allows you to specify the type of the OS that is included in the + * disk if creating a VM from user-image or a specialized VHD.

    + * Possible values are:

    **Windows**

    **Linux**. Possible + * values include: 'Windows', 'Linux' + * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.osDisk.image] Specifies + * information about the unmanaged user image to base the scale set on. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.image.uri] Specifies + * the virtual hard disk's uri. + * + * @param {array} + * [parameters.virtualMachineProfile.storageProfile.osDisk.vhdContainers] + * Specifies the container urls that are used to store operating system disks + * for the scale set. + * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.osDisk.managedDisk] The + * managed disk parameters. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.managedDisk.storageAccountType] + * Specifies the storage account type for the managed disk. Possible values + * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {array} [parameters.virtualMachineProfile.storageProfile.dataDisks] + * Specifies the parameters that are used to add data disks to the virtual + * machines in the scale set.

    For more information about disks, see + * [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {object} [parameters.virtualMachineProfile.networkProfile] Specifies + * properties of the network interfaces of the virtual machines in the scale + * set. + * + * @param {object} + * [parameters.virtualMachineProfile.networkProfile.healthProbe] A reference to + * a load balancer probe used to determine the health of an instance in the + * virtual machine scale set. The reference will be in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. + * + * @param {string} + * [parameters.virtualMachineProfile.networkProfile.healthProbe.id] The ARM + * resource id in the form of + * /subscriptions/{SubcriptionId}/resourceGroups/{ResourceGroupName}/... + * + * @param {array} + * [parameters.virtualMachineProfile.networkProfile.networkInterfaceConfigurations] + * The list of network configurations. + * + * @param {object} [parameters.virtualMachineProfile.diagnosticsProfile] + * Specifies the boot diagnostic settings state.

    Minimum api-version: + * 2015-06-15. + * + * @param {object} + * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, + * you can easily view the output of your console log.

    For both + * Windows and Linux virtual machines, Azure also enables you to see a + * screenshot of the VM from the hypervisor. + * + * @param {boolean} + * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics.enabled] + * Whether boot diagnostics should be enabled on the Virtual Machine. + * + * @param {string} + * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics.storageUri] + * Uri of the storage account to use for placing the console output and + * screenshot. + * + * @param {object} [parameters.virtualMachineProfile.extensionProfile] + * Specifies a collection of settings for extensions installed on virtual + * machines in the scale set. + * + * @param {array} + * [parameters.virtualMachineProfile.extensionProfile.extensions] The virtual + * machine scale set child extension resources. + * + * @param {string} [parameters.virtualMachineProfile.licenseType] Specifies + * that the image or disk that is being used was licensed on-premises. This + * element is only used for images that contain the Windows Server operating + * system.

    Possible values are:

    Windows_Client

    + * Windows_Server

    If this element is included in a request for an + * update, the value must match the initial value. This value cannot be + * updated.

    For more information, see [Azure Hybrid Use Benefit for + * Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Minimum api-version: 2015-06-15 + * + * @param {string} [parameters.virtualMachineProfile.priority] Specifies the + * priority for the virtual machines in the scale set.

    Minimum + * api-version: 2017-10-30-preview. Possible values include: 'Regular', 'Low' + * + * @param {boolean} [parameters.overprovision] Specifies whether the Virtual + * Machine Scale Set should be overprovisioned. + * + * @param {boolean} [parameters.singlePlacementGroup] When true this limits the + * scale set to a single placement group, of max size 100 virtual machines. + * + * @param {boolean} [parameters.zoneBalance] Whether to force stictly even + * Virtual Machine distribution cross x-zones in case there is zone outage. + * + * @param {number} [parameters.platformFaultDomainCount] Fault Domain count for + * each placement group. + * + * @param {object} [parameters.identity] The identity of the virtual machine + * scale set, if configured. + * + * @param {string} [parameters.identity.type] The type of identity used for the + * virtual machine scale set. The type 'SystemAssigned, UserAssigned' includes + * both an implicitly created identity and a set of user assigned identities. + * The type 'None' will remove any identities from the virtual machine scale + * set. Possible values include: 'SystemAssigned', 'UserAssigned', + * 'SystemAssigned, UserAssigned', 'None' + * + * @param {array} [parameters.identity.identityIds] The list of user identities + * associated with the virtual machine scale set. The user identity references + * will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * + * @param {array} [parameters.zones] The virtual machine scale set zones. + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @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. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, parameters: models.VirtualMachineScaleSet, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Create or update a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set to create or + * update. + * + * @param {object} parameters The scale set object. + * + * @param {object} [parameters.sku] The virtual machine scale set sku. + * + * @param {string} [parameters.sku.name] The sku name. + * + * @param {string} [parameters.sku.tier] Specifies the tier of virtual machines + * in a scale set.

    Possible Values:

    **Standard**

    **Basic** + * + * @param {number} [parameters.sku.capacity] Specifies the number of virtual + * machines in the scale set. + * + * @param {object} [parameters.plan] Specifies information about the + * marketplace image used to create the virtual machine. This element is only + * used for marketplace images. Before you can use a marketplace image from an + * API, you must enable the image for programmatic use. In the Azure portal, + * find the marketplace image that you want to use and then click **Want to + * deploy programmatically, Get Started ->**. Enter any required information + * and then click **Save**. + * + * @param {string} [parameters.plan.name] The plan ID. + * + * @param {string} [parameters.plan.publisher] The publisher ID. + * + * @param {string} [parameters.plan.product] Specifies the product of the image + * from the marketplace. This is the same value as Offer under the + * imageReference element. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {object} [parameters.upgradePolicy] The upgrade policy. + * + * @param {string} [parameters.upgradePolicy.mode] Specifies the mode of an + * upgrade to virtual machines in the scale set.

    Possible values + * are:

    **Manual** - You control the application of updates to + * virtual machines in the scale set. You do this by using the manualUpgrade + * action.

    **Automatic** - All virtual machines in the scale set + * are automatically updated at the same time. Possible values include: + * 'Automatic', 'Manual', 'Rolling' + * + * @param {object} [parameters.upgradePolicy.rollingUpgradePolicy] The + * configuration parameters used while performing a rolling upgrade. + * + * @param {number} + * [parameters.upgradePolicy.rollingUpgradePolicy.maxBatchInstancePercent] The + * maximum percent of total virtual machine instances that will be upgraded + * simultaneously by the rolling upgrade in one batch. As this is a maximum, + * unhealthy instances in previous or future batches can cause the percentage + * of instances in a batch to decrease to ensure higher reliability. The + * default value for this parameter is 20%. + * + * @param {number} + * [parameters.upgradePolicy.rollingUpgradePolicy.maxUnhealthyInstancePercent] + * The maximum percentage of the total virtual machine instances in the scale + * set that can be simultaneously unhealthy, either as a result of being + * upgraded, or by being found in an unhealthy state by the virtual machine + * health checks before the rolling upgrade aborts. This constraint will be + * checked prior to starting any batch. The default value for this parameter is + * 20%. + * + * @param {number} + * [parameters.upgradePolicy.rollingUpgradePolicy.maxUnhealthyUpgradedInstancePercent] + * The maximum percentage of upgraded virtual machine instances that can be + * found to be in an unhealthy state. This check will happen after each batch + * is upgraded. If this percentage is ever exceeded, the rolling update aborts. + * The default value for this parameter is 20%. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradePolicy.pauseTimeBetweenBatches] The + * wait time between completing the update for all virtual machines in one + * batch and starting the next batch. The time duration should be specified in + * ISO 8601 format. The default value is 0 seconds (PT0S). + * + * @param {boolean} [parameters.upgradePolicy.automaticOSUpgrade] Whether OS + * upgrades should automatically be applied to scale set instances in a rolling + * fashion when a newer version of the image becomes available. + * + * @param {object} [parameters.virtualMachineProfile] The virtual machine + * profile. + * + * @param {object} [parameters.virtualMachineProfile.osProfile] Specifies the + * operating system settings for the virtual machines in the scale set. + * + * @param {string} + * [parameters.virtualMachineProfile.osProfile.computerNamePrefix] Specifies + * the computer name prefix for all of the virtual machines in the scale set. + * Computer name prefixes must be 1 to 15 characters long. + * + * @param {string} [parameters.virtualMachineProfile.osProfile.adminUsername] + * Specifies the name of the administrator account.

    **Windows-only + * restriction:** Cannot end in "."

    **Disallowed values:** + * "administrator", "admin", "user", "user1", "test", "user2", "test1", + * "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", + * "backup", "console", "david", "guest", "john", "owner", "root", "server", + * "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", + * "user5".

    **Minimum-length (Linux):** 1 character

    + * **Max-length (Linux):** 64 characters

    **Max-length (Windows):** 20 + * characters

  • For root access to the Linux VM, see [Using root + * privileges on Linux virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in this + * field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {string} [parameters.virtualMachineProfile.osProfile.adminPassword] + * Specifies the password of the administrator account.

    + * **Minimum-length (Windows):** 8 characters

    **Minimum-length + * (Linux):** 6 characters

    **Max-length (Windows):** 123 characters + *

    **Max-length (Linux):** 72 characters

    **Complexity + * requirements:** 3 out of 4 conditions below need to be fulfilled
    Has + * lower characters
    Has upper characters
    Has a digit
    Has a + * special character (Regex match [\W_])

    **Disallowed values:** + * "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", + * "Password!", "Password1", "Password22", "iloveyou!"

    For resetting + * the password, see [How to reset the Remote Desktop service or its login + * password in a Windows + * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    For resetting root password, see [Manage users, SSH, and check or + * repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + * + * @param {string} [parameters.virtualMachineProfile.osProfile.customData] + * Specifies a base-64 encoded string of custom data. The base-64 encoded + * string is decoded to a binary array that is saved as a file on the Virtual + * Machine. The maximum length of the binary array is 65535 bytes.

    For + * using cloud-init for your VM, see [Using cloud-init to customize a Linux VM + * during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration] Specifies + * Windows operating system settings on the virtual machine. + * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.enableAutomaticUpdates] + * Indicates whether virtual machine is enabled for automatic updates. + * + * @param {string} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.timeZone] + * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.winRM] + * Specifies the Windows Remote Management listeners. This enables remote + * Windows PowerShell. + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.winRM.listeners] + * The list of Windows Remote Management listeners + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration] Specifies + * the Linux operating system settings on the virtual machine.

    For a + * list of supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh] + * Specifies the ssh key configuration for a Linux OS. + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh.publicKeys] + * The list of SSH public keys used to authenticate with linux based VMs. + * + * @param {array} [parameters.virtualMachineProfile.osProfile.secrets] + * Specifies set of certificates that should be installed onto the virtual + * machines in the scale set. + * + * @param {object} [parameters.virtualMachineProfile.storageProfile] Specifies + * the storage settings for the virtual machine disks. + * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.imageReference] Specifies + * information about the image to use. You can specify information about + * platform images, marketplace images, or virtual machine images. This element + * is required when you want to use a platform image, marketplace image, or + * virtual machine image, but is not used in other creation operations. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.publisher] + * The image publisher. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.offer] + * Specifies the offer of the platform image or marketplace image used to + * create the virtual machine. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.sku] The + * image SKU. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.version] + * Specifies the version of the platform image or marketplace image used to + * create the virtual machine. The allowed formats are Major.Minor.Build or + * 'latest'. Major, Minor, and Build are decimal numbers. Specify 'latest' to + * use the latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.id] Resource + * Id + * + * @param {object} [parameters.virtualMachineProfile.storageProfile.osDisk] + * Specifies information about the operating system disk used by the virtual + * machines in the scale set.

    For more information about disks, see + * [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.name] The disk name. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.caching] Specifies + * the caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {boolean} + * [parameters.virtualMachineProfile.storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @param {string} + * parameters.virtualMachineProfile.storageProfile.osDisk.createOption + * Specifies how the virtual machines in the scale set should be + * created.

    The only allowed value is: **FromImage** \u2013 This value + * is used when you are using an image to create the virtual machine. If you + * are using a platform image, you also use the imageReference element + * described above. If you are using a marketplace image, you also use the + * plan element previously described. Possible values include: 'FromImage', + * 'Empty', 'Attach' + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.osType] This + * property allows you to specify the type of the OS that is included in the + * disk if creating a VM from user-image or a specialized VHD.

    + * Possible values are:

    **Windows**

    **Linux**. Possible + * values include: 'Windows', 'Linux' + * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.osDisk.image] Specifies + * information about the unmanaged user image to base the scale set on. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.image.uri] Specifies + * the virtual hard disk's uri. + * + * @param {array} + * [parameters.virtualMachineProfile.storageProfile.osDisk.vhdContainers] + * Specifies the container urls that are used to store operating system disks + * for the scale set. + * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.osDisk.managedDisk] The + * managed disk parameters. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.managedDisk.storageAccountType] + * Specifies the storage account type for the managed disk. Possible values + * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {array} [parameters.virtualMachineProfile.storageProfile.dataDisks] + * Specifies the parameters that are used to add data disks to the virtual + * machines in the scale set.

    For more information about disks, see + * [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {object} [parameters.virtualMachineProfile.networkProfile] Specifies + * properties of the network interfaces of the virtual machines in the scale + * set. + * + * @param {object} + * [parameters.virtualMachineProfile.networkProfile.healthProbe] A reference to + * a load balancer probe used to determine the health of an instance in the + * virtual machine scale set. The reference will be in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. + * + * @param {string} + * [parameters.virtualMachineProfile.networkProfile.healthProbe.id] The ARM + * resource id in the form of + * /subscriptions/{SubcriptionId}/resourceGroups/{ResourceGroupName}/... + * + * @param {array} + * [parameters.virtualMachineProfile.networkProfile.networkInterfaceConfigurations] + * The list of network configurations. + * + * @param {object} [parameters.virtualMachineProfile.diagnosticsProfile] + * Specifies the boot diagnostic settings state.

    Minimum api-version: + * 2015-06-15. + * + * @param {object} + * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, + * you can easily view the output of your console log.

    For both + * Windows and Linux virtual machines, Azure also enables you to see a + * screenshot of the VM from the hypervisor. + * + * @param {boolean} + * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics.enabled] + * Whether boot diagnostics should be enabled on the Virtual Machine. + * + * @param {string} + * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics.storageUri] + * Uri of the storage account to use for placing the console output and + * screenshot. + * + * @param {object} [parameters.virtualMachineProfile.extensionProfile] + * Specifies a collection of settings for extensions installed on virtual + * machines in the scale set. + * + * @param {array} + * [parameters.virtualMachineProfile.extensionProfile.extensions] The virtual + * machine scale set child extension resources. + * + * @param {string} [parameters.virtualMachineProfile.licenseType] Specifies + * that the image or disk that is being used was licensed on-premises. This + * element is only used for images that contain the Windows Server operating + * system.

    Possible values are:

    Windows_Client

    + * Windows_Server

    If this element is included in a request for an + * update, the value must match the initial value. This value cannot be + * updated.

    For more information, see [Azure Hybrid Use Benefit for + * Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Minimum api-version: 2015-06-15 + * + * @param {string} [parameters.virtualMachineProfile.priority] Specifies the + * priority for the virtual machines in the scale set.

    Minimum + * api-version: 2017-10-30-preview. Possible values include: 'Regular', 'Low' + * + * @param {boolean} [parameters.overprovision] Specifies whether the Virtual + * Machine Scale Set should be overprovisioned. + * + * @param {boolean} [parameters.singlePlacementGroup] When true this limits the + * scale set to a single placement group, of max size 100 virtual machines. + * + * @param {boolean} [parameters.zoneBalance] Whether to force stictly even + * Virtual Machine distribution cross x-zones in case there is zone outage. + * + * @param {number} [parameters.platformFaultDomainCount] Fault Domain count for + * each placement group. + * + * @param {object} [parameters.identity] The identity of the virtual machine + * scale set, if configured. + * + * @param {string} [parameters.identity.type] The type of identity used for the + * virtual machine scale set. The type 'SystemAssigned, UserAssigned' includes + * both an implicitly created identity and a set of user assigned identities. + * The type 'None' will remove any identities from the virtual machine scale + * set. Possible values include: 'SystemAssigned', 'UserAssigned', + * 'SystemAssigned, UserAssigned', 'None' + * + * @param {array} [parameters.identity.identityIds] The list of user identities + * associated with the virtual machine scale set. The user identity references + * will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * + * @param {array} [parameters.zones] The virtual machine scale set zones. + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @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 {VirtualMachineScaleSet} - 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. + * + * {VirtualMachineScaleSet} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineScaleSet} 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. + */ + createOrUpdate(resourceGroupName: string, vmScaleSetName: string, parameters: models.VirtualMachineScaleSet, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, vmScaleSetName: string, parameters: models.VirtualMachineScaleSet, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, vmScaleSetName: string, parameters: models.VirtualMachineScaleSet, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Update a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set to create or + * update. + * + * @param {object} parameters The scale set object. + * + * @param {object} [parameters.sku] The virtual machine scale set sku. + * + * @param {string} [parameters.sku.name] The sku name. + * + * @param {string} [parameters.sku.tier] Specifies the tier of virtual machines + * in a scale set.

    Possible Values:

    **Standard**

    **Basic** + * + * @param {number} [parameters.sku.capacity] Specifies the number of virtual + * machines in the scale set. + * + * @param {object} [parameters.plan] The purchase plan when deploying a virtual + * machine scale set from VM Marketplace images. + * + * @param {string} [parameters.plan.name] The plan ID. + * + * @param {string} [parameters.plan.publisher] The publisher ID. + * + * @param {string} [parameters.plan.product] Specifies the product of the image + * from the marketplace. This is the same value as Offer under the + * imageReference element. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {object} [parameters.upgradePolicy] The upgrade policy. + * + * @param {string} [parameters.upgradePolicy.mode] Specifies the mode of an + * upgrade to virtual machines in the scale set.

    Possible values + * are:

    **Manual** - You control the application of updates to + * virtual machines in the scale set. You do this by using the manualUpgrade + * action.

    **Automatic** - All virtual machines in the scale set + * are automatically updated at the same time. Possible values include: + * 'Automatic', 'Manual', 'Rolling' + * + * @param {object} [parameters.upgradePolicy.rollingUpgradePolicy] The + * configuration parameters used while performing a rolling upgrade. + * + * @param {number} + * [parameters.upgradePolicy.rollingUpgradePolicy.maxBatchInstancePercent] The + * maximum percent of total virtual machine instances that will be upgraded + * simultaneously by the rolling upgrade in one batch. As this is a maximum, + * unhealthy instances in previous or future batches can cause the percentage + * of instances in a batch to decrease to ensure higher reliability. The + * default value for this parameter is 20%. + * + * @param {number} + * [parameters.upgradePolicy.rollingUpgradePolicy.maxUnhealthyInstancePercent] + * The maximum percentage of the total virtual machine instances in the scale + * set that can be simultaneously unhealthy, either as a result of being + * upgraded, or by being found in an unhealthy state by the virtual machine + * health checks before the rolling upgrade aborts. This constraint will be + * checked prior to starting any batch. The default value for this parameter is + * 20%. + * + * @param {number} + * [parameters.upgradePolicy.rollingUpgradePolicy.maxUnhealthyUpgradedInstancePercent] + * The maximum percentage of upgraded virtual machine instances that can be + * found to be in an unhealthy state. This check will happen after each batch + * is upgraded. If this percentage is ever exceeded, the rolling update aborts. + * The default value for this parameter is 20%. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradePolicy.pauseTimeBetweenBatches] The + * wait time between completing the update for all virtual machines in one + * batch and starting the next batch. The time duration should be specified in + * ISO 8601 format. The default value is 0 seconds (PT0S). + * + * @param {boolean} [parameters.upgradePolicy.automaticOSUpgrade] Whether OS + * upgrades should automatically be applied to scale set instances in a rolling + * fashion when a newer version of the image becomes available. + * + * @param {object} [parameters.virtualMachineProfile] The virtual machine + * profile. + * + * @param {object} [parameters.virtualMachineProfile.osProfile] The virtual + * machine scale set OS profile. + * + * @param {string} [parameters.virtualMachineProfile.osProfile.customData] A + * base-64 encoded string of custom data. + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration] The + * Windows Configuration of the OS profile. + * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.enableAutomaticUpdates] + * Indicates whether virtual machine is enabled for automatic updates. + * + * @param {string} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.timeZone] + * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.winRM] + * Specifies the Windows Remote Management listeners. This enables remote + * Windows PowerShell. + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.winRM.listeners] + * The list of Windows Remote Management listeners + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration] The Linux + * Configuration of the OS profile. + * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh] + * Specifies the ssh key configuration for a Linux OS. + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh.publicKeys] + * The list of SSH public keys used to authenticate with linux based VMs. + * + * @param {array} [parameters.virtualMachineProfile.osProfile.secrets] The List + * of certificates for addition to the VM. + * + * @param {object} [parameters.virtualMachineProfile.storageProfile] The + * virtual machine scale set storage profile. + * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.imageReference] The image + * reference. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.publisher] + * The image publisher. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.offer] + * Specifies the offer of the platform image or marketplace image used to + * create the virtual machine. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.sku] The + * image SKU. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.version] + * Specifies the version of the platform image or marketplace image used to + * create the virtual machine. The allowed formats are Major.Minor.Build or + * 'latest'. Major, Minor, and Build are decimal numbers. Specify 'latest' to + * use the latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.id] Resource + * Id + * + * @param {object} [parameters.virtualMachineProfile.storageProfile.osDisk] The + * OS disk. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.caching] The caching + * type. Possible values include: 'None', 'ReadOnly', 'ReadWrite' + * + * @param {boolean} + * [parameters.virtualMachineProfile.storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.osDisk.image] The Source + * User Image VirtualHardDisk. This VirtualHardDisk will be copied before using + * it to attach to the Virtual Machine. If SourceImage is provided, the + * destination VirtualHardDisk should not exist. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.image.uri] Specifies + * the virtual hard disk's uri. + * + * @param {array} + * [parameters.virtualMachineProfile.storageProfile.osDisk.vhdContainers] The + * list of virtual hard disk container uris. + * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.osDisk.managedDisk] The + * managed disk parameters. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.managedDisk.storageAccountType] + * Specifies the storage account type for the managed disk. Possible values + * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {array} [parameters.virtualMachineProfile.storageProfile.dataDisks] + * The data disks. + * + * @param {object} [parameters.virtualMachineProfile.networkProfile] The + * virtual machine scale set network profile. + * + * @param {array} + * [parameters.virtualMachineProfile.networkProfile.networkInterfaceConfigurations] + * The list of network configurations. + * + * @param {object} [parameters.virtualMachineProfile.diagnosticsProfile] The + * virtual machine scale set diagnostics profile. + * + * @param {object} + * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, + * you can easily view the output of your console log.

    For both + * Windows and Linux virtual machines, Azure also enables you to see a + * screenshot of the VM from the hypervisor. + * + * @param {boolean} + * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics.enabled] + * Whether boot diagnostics should be enabled on the Virtual Machine. + * + * @param {string} + * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics.storageUri] + * Uri of the storage account to use for placing the console output and + * screenshot. + * + * @param {object} [parameters.virtualMachineProfile.extensionProfile] The + * virtual machine scale set extension profile. + * + * @param {array} + * [parameters.virtualMachineProfile.extensionProfile.extensions] The virtual + * machine scale set child extension resources. + * + * @param {string} [parameters.virtualMachineProfile.licenseType] The license + * type, which is for bring your own license scenario. + * + * @param {boolean} [parameters.overprovision] Specifies whether the Virtual + * Machine Scale Set should be overprovisioned. + * + * @param {boolean} [parameters.singlePlacementGroup] When true this limits the + * scale set to a single placement group, of max size 100 virtual machines. + * + * @param {object} [parameters.identity] The identity of the virtual machine + * scale set, if configured. + * + * @param {string} [parameters.identity.type] The type of identity used for the + * virtual machine scale set. The type 'SystemAssigned, UserAssigned' includes + * both an implicitly created identity and a set of user assigned identities. + * The type 'None' will remove any identities from the virtual machine scale + * set. Possible values include: 'SystemAssigned', 'UserAssigned', + * 'SystemAssigned, UserAssigned', 'None' + * + * @param {array} [parameters.identity.identityIds] The list of user identities + * associated with the virtual machine scale set. The user identity references + * will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * + * @param {object} [parameters.tags] Resource tags + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + updateWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, parameters: models.VirtualMachineScaleSetUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Update a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set to create or + * update. + * + * @param {object} parameters The scale set object. + * + * @param {object} [parameters.sku] The virtual machine scale set sku. + * + * @param {string} [parameters.sku.name] The sku name. + * + * @param {string} [parameters.sku.tier] Specifies the tier of virtual machines + * in a scale set.

    Possible Values:

    **Standard**

    **Basic** + * + * @param {number} [parameters.sku.capacity] Specifies the number of virtual + * machines in the scale set. + * + * @param {object} [parameters.plan] The purchase plan when deploying a virtual + * machine scale set from VM Marketplace images. + * + * @param {string} [parameters.plan.name] The plan ID. + * + * @param {string} [parameters.plan.publisher] The publisher ID. + * + * @param {string} [parameters.plan.product] Specifies the product of the image + * from the marketplace. This is the same value as Offer under the + * imageReference element. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {object} [parameters.upgradePolicy] The upgrade policy. + * + * @param {string} [parameters.upgradePolicy.mode] Specifies the mode of an + * upgrade to virtual machines in the scale set.

    Possible values + * are:

    **Manual** - You control the application of updates to + * virtual machines in the scale set. You do this by using the manualUpgrade + * action.

    **Automatic** - All virtual machines in the scale set + * are automatically updated at the same time. Possible values include: + * 'Automatic', 'Manual', 'Rolling' + * + * @param {object} [parameters.upgradePolicy.rollingUpgradePolicy] The + * configuration parameters used while performing a rolling upgrade. + * + * @param {number} + * [parameters.upgradePolicy.rollingUpgradePolicy.maxBatchInstancePercent] The + * maximum percent of total virtual machine instances that will be upgraded + * simultaneously by the rolling upgrade in one batch. As this is a maximum, + * unhealthy instances in previous or future batches can cause the percentage + * of instances in a batch to decrease to ensure higher reliability. The + * default value for this parameter is 20%. + * + * @param {number} + * [parameters.upgradePolicy.rollingUpgradePolicy.maxUnhealthyInstancePercent] + * The maximum percentage of the total virtual machine instances in the scale + * set that can be simultaneously unhealthy, either as a result of being + * upgraded, or by being found in an unhealthy state by the virtual machine + * health checks before the rolling upgrade aborts. This constraint will be + * checked prior to starting any batch. The default value for this parameter is + * 20%. + * + * @param {number} + * [parameters.upgradePolicy.rollingUpgradePolicy.maxUnhealthyUpgradedInstancePercent] + * The maximum percentage of upgraded virtual machine instances that can be + * found to be in an unhealthy state. This check will happen after each batch + * is upgraded. If this percentage is ever exceeded, the rolling update aborts. + * The default value for this parameter is 20%. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradePolicy.pauseTimeBetweenBatches] The + * wait time between completing the update for all virtual machines in one + * batch and starting the next batch. The time duration should be specified in + * ISO 8601 format. The default value is 0 seconds (PT0S). + * + * @param {boolean} [parameters.upgradePolicy.automaticOSUpgrade] Whether OS + * upgrades should automatically be applied to scale set instances in a rolling + * fashion when a newer version of the image becomes available. + * + * @param {object} [parameters.virtualMachineProfile] The virtual machine + * profile. + * + * @param {object} [parameters.virtualMachineProfile.osProfile] The virtual + * machine scale set OS profile. + * + * @param {string} [parameters.virtualMachineProfile.osProfile.customData] A + * base-64 encoded string of custom data. + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration] The + * Windows Configuration of the OS profile. + * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.enableAutomaticUpdates] + * Indicates whether virtual machine is enabled for automatic updates. + * + * @param {string} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.timeZone] + * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.winRM] + * Specifies the Windows Remote Management listeners. This enables remote + * Windows PowerShell. + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.winRM.listeners] + * The list of Windows Remote Management listeners + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration] The Linux + * Configuration of the OS profile. + * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh] + * Specifies the ssh key configuration for a Linux OS. + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh.publicKeys] + * The list of SSH public keys used to authenticate with linux based VMs. + * + * @param {array} [parameters.virtualMachineProfile.osProfile.secrets] The List + * of certificates for addition to the VM. + * + * @param {object} [parameters.virtualMachineProfile.storageProfile] The + * virtual machine scale set storage profile. + * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.imageReference] The image + * reference. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.publisher] + * The image publisher. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.offer] + * Specifies the offer of the platform image or marketplace image used to + * create the virtual machine. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.sku] The + * image SKU. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.version] + * Specifies the version of the platform image or marketplace image used to + * create the virtual machine. The allowed formats are Major.Minor.Build or + * 'latest'. Major, Minor, and Build are decimal numbers. Specify 'latest' to + * use the latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.id] Resource + * Id + * + * @param {object} [parameters.virtualMachineProfile.storageProfile.osDisk] The + * OS disk. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.caching] The caching + * type. Possible values include: 'None', 'ReadOnly', 'ReadWrite' + * + * @param {boolean} + * [parameters.virtualMachineProfile.storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.osDisk.image] The Source + * User Image VirtualHardDisk. This VirtualHardDisk will be copied before using + * it to attach to the Virtual Machine. If SourceImage is provided, the + * destination VirtualHardDisk should not exist. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.image.uri] Specifies + * the virtual hard disk's uri. + * + * @param {array} + * [parameters.virtualMachineProfile.storageProfile.osDisk.vhdContainers] The + * list of virtual hard disk container uris. + * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.osDisk.managedDisk] The + * managed disk parameters. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.managedDisk.storageAccountType] + * Specifies the storage account type for the managed disk. Possible values + * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {array} [parameters.virtualMachineProfile.storageProfile.dataDisks] + * The data disks. + * + * @param {object} [parameters.virtualMachineProfile.networkProfile] The + * virtual machine scale set network profile. + * + * @param {array} + * [parameters.virtualMachineProfile.networkProfile.networkInterfaceConfigurations] + * The list of network configurations. + * + * @param {object} [parameters.virtualMachineProfile.diagnosticsProfile] The + * virtual machine scale set diagnostics profile. + * + * @param {object} + * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, + * you can easily view the output of your console log.

    For both + * Windows and Linux virtual machines, Azure also enables you to see a + * screenshot of the VM from the hypervisor. + * + * @param {boolean} + * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics.enabled] + * Whether boot diagnostics should be enabled on the Virtual Machine. + * + * @param {string} + * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics.storageUri] + * Uri of the storage account to use for placing the console output and + * screenshot. + * + * @param {object} [parameters.virtualMachineProfile.extensionProfile] The + * virtual machine scale set extension profile. + * + * @param {array} + * [parameters.virtualMachineProfile.extensionProfile.extensions] The virtual + * machine scale set child extension resources. + * + * @param {string} [parameters.virtualMachineProfile.licenseType] The license + * type, which is for bring your own license scenario. + * + * @param {boolean} [parameters.overprovision] Specifies whether the Virtual + * Machine Scale Set should be overprovisioned. + * + * @param {boolean} [parameters.singlePlacementGroup] When true this limits the + * scale set to a single placement group, of max size 100 virtual machines. + * + * @param {object} [parameters.identity] The identity of the virtual machine + * scale set, if configured. + * + * @param {string} [parameters.identity.type] The type of identity used for the + * virtual machine scale set. The type 'SystemAssigned, UserAssigned' includes + * both an implicitly created identity and a set of user assigned identities. + * The type 'None' will remove any identities from the virtual machine scale + * set. Possible values include: 'SystemAssigned', 'UserAssigned', + * 'SystemAssigned, UserAssigned', 'None' + * + * @param {array} [parameters.identity.identityIds] The list of user identities + * associated with the virtual machine scale set. The user identity references + * will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * + * @param {object} [parameters.tags] Resource tags + * + * @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 {VirtualMachineScaleSet} - 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. + * + * {VirtualMachineScaleSet} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineScaleSet} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + update(resourceGroupName: string, vmScaleSetName: string, parameters: models.VirtualMachineScaleSetUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, vmScaleSetName: string, parameters: models.VirtualMachineScaleSetUpdate, callback: ServiceCallback): void; + update(resourceGroupName: string, vmScaleSetName: string, parameters: models.VirtualMachineScaleSetUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + deleteMethod(resourceGroupName: string, vmScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, vmScaleSetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Display information about a virtual machine scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Display information about a virtual machine scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @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 {VirtualMachineScaleSet} - 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. + * + * {VirtualMachineScaleSet} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineScaleSet} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, vmScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, vmScaleSetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deallocates specific virtual machines in a VM scale set. Shuts down the + * virtual machines and releases the compute resources. You are not billed for + * the compute resources that this virtual machine scale set deallocates. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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. + */ + deallocateWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deallocates specific virtual machines in a VM scale set. Shuts down the + * virtual machines and releases the compute resources. You are not billed for + * the compute resources that this virtual machine scale set deallocates. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + deallocate(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise; + deallocate(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + deallocate(resourceGroupName: string, vmScaleSetName: string, options: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes virtual machines in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {array} instanceIds The virtual machine scale set instance ids. + * + * @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. + */ + deleteInstancesWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceIds: string[], options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes virtual machines in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {array} instanceIds The virtual machine scale set instance ids. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + deleteInstances(resourceGroupName: string, vmScaleSetName: string, instanceIds: string[], options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteInstances(resourceGroupName: string, vmScaleSetName: string, instanceIds: string[], callback: ServiceCallback): void; + deleteInstances(resourceGroupName: string, vmScaleSetName: string, instanceIds: string[], options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the status of a VM scale set instance. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @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. + */ + getInstanceViewWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the status of a VM scale set instance. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @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 {VirtualMachineScaleSetInstanceView} - 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. + * + * {VirtualMachineScaleSetInstanceView} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineScaleSetInstanceView} 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. + */ + getInstanceView(resourceGroupName: string, vmScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getInstanceView(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + getInstanceView(resourceGroupName: string, vmScaleSetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a list of all VM scale sets under a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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. + */ + listWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a list of all VM scale sets under a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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 {VirtualMachineScaleSetListResult} - 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. + * + * {VirtualMachineScaleSetListResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineScaleSetListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(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; + + + /** + * Gets a list of all VM Scale Sets in the subscription, regardless of the + * associated resource group. Use nextLink property in the response to get the + * next page of VM Scale Sets. Do this till nextLink is null to fetch all the + * VM Scale Sets. + * + * @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. + */ + listAllWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a list of all VM Scale Sets in the subscription, regardless of the + * associated resource group. Use nextLink property in the response to get the + * next page of VM Scale Sets. Do this till nextLink is null to fetch all the + * VM Scale Sets. + * + * @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 {VirtualMachineScaleSetListWithLinkResult} - 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. + * + * {VirtualMachineScaleSetListWithLinkResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineScaleSetListWithLinkResult} + * 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. + */ + listAll(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAll(callback: ServiceCallback): void; + listAll(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a list of SKUs available for your VM scale set, including the minimum + * and maximum VM instances allowed for each SKU. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @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. + */ + listSkusWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a list of SKUs available for your VM scale set, including the minimum + * and maximum VM instances allowed for each SKU. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @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 {VirtualMachineScaleSetListSkusResult} - 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. + * + * {VirtualMachineScaleSetListSkusResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineScaleSetListSkusResult} 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. + */ + listSkus(resourceGroupName: string, vmScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSkus(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + listSkus(resourceGroupName: string, vmScaleSetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets list of OS upgrades on a VM scale set instance. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @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. + */ + getOSUpgradeHistoryWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets list of OS upgrades on a VM scale set instance. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @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 {VirtualMachineScaleSetListOSUpgradeHistory} - 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. + * + * {VirtualMachineScaleSetListOSUpgradeHistory} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineScaleSetListOSUpgradeHistory} + * 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. + */ + getOSUpgradeHistory(resourceGroupName: string, vmScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getOSUpgradeHistory(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + getOSUpgradeHistory(resourceGroupName: string, vmScaleSetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Power off (stop) one or more virtual machines in a VM scale set. Note that + * resources are still attached and you are getting charged for the resources. + * Instead, use deallocate to release resources and avoid charges. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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. + */ + powerOffWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Power off (stop) one or more virtual machines in a VM scale set. Note that + * resources are still attached and you are getting charged for the resources. + * Instead, use deallocate to release resources and avoid charges. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + powerOff(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise; + powerOff(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + powerOff(resourceGroupName: string, vmScaleSetName: string, options: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Restarts one or more virtual machines in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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. + */ + restartWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Restarts one or more virtual machines in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + restart(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise; + restart(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + restart(resourceGroupName: string, vmScaleSetName: string, options: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Starts one or more virtual machines in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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. + */ + startWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Starts one or more virtual machines in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + start(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise; + start(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + start(resourceGroupName: string, vmScaleSetName: string, options: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Redeploy one or more virtual machines in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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. + */ + redeployWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Redeploy one or more virtual machines in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + redeploy(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise; + redeploy(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + redeploy(resourceGroupName: string, vmScaleSetName: string, options: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Perform maintenance on one or more virtual machines in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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. + */ + performMaintenanceWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Perform maintenance on one or more virtual machines in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + performMaintenance(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise; + performMaintenance(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + performMaintenance(resourceGroupName: string, vmScaleSetName: string, options: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Upgrades one or more virtual machines to the latest SKU set in the VM scale + * set model. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {array} instanceIds The virtual machine scale set instance ids. + * + * @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. + */ + updateInstancesWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceIds: string[], options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Upgrades one or more virtual machines to the latest SKU set in the VM scale + * set model. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {array} instanceIds The virtual machine scale set instance ids. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + updateInstances(resourceGroupName: string, vmScaleSetName: string, instanceIds: string[], options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateInstances(resourceGroupName: string, vmScaleSetName: string, instanceIds: string[], callback: ServiceCallback): void; + updateInstances(resourceGroupName: string, vmScaleSetName: string, instanceIds: string[], options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Reimages (upgrade the operating system) one or more virtual machines in a VM + * scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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. + */ + reimageWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Reimages (upgrade the operating system) one or more virtual machines in a VM + * scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + reimage(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise; + reimage(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + reimage(resourceGroupName: string, vmScaleSetName: string, options: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Reimages all the disks ( including data disks ) in the virtual machines in a + * VM scale set. This operation is only supported for managed disks. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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. + */ + reimageAllWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Reimages all the disks ( including data disks ) in the virtual machines in a + * VM scale set. This operation is only supported for managed disks. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + reimageAll(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise; + reimageAll(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + reimageAll(resourceGroupName: string, vmScaleSetName: string, options: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Manual platform update domain walk to update virtual machines in a service + * fabric virtual machine scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {number} platformUpdateDomain The platform update domain for which a + * manual recovery walk is requested + * + * @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. + */ + forceRecoveryServiceFabricPlatformUpdateDomainWalkWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, platformUpdateDomain: number, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Manual platform update domain walk to update virtual machines in a service + * fabric virtual machine scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {number} platformUpdateDomain The platform update domain for which a + * manual recovery walk is requested + * + * @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 {RecoveryWalkResponse} - 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. + * + * {RecoveryWalkResponse} [result] - The deserialized result object if an error did not occur. + * See {@link RecoveryWalkResponse} 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. + */ + forceRecoveryServiceFabricPlatformUpdateDomainWalk(resourceGroupName: string, vmScaleSetName: string, platformUpdateDomain: number, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + forceRecoveryServiceFabricPlatformUpdateDomainWalk(resourceGroupName: string, vmScaleSetName: string, platformUpdateDomain: number, callback: ServiceCallback): void; + forceRecoveryServiceFabricPlatformUpdateDomainWalk(resourceGroupName: string, vmScaleSetName: string, platformUpdateDomain: number, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Create or update a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set to create or + * update. + * + * @param {object} parameters The scale set object. + * + * @param {object} [parameters.sku] The virtual machine scale set sku. + * + * @param {string} [parameters.sku.name] The sku name. + * + * @param {string} [parameters.sku.tier] Specifies the tier of virtual machines + * in a scale set.

    Possible Values:

    **Standard**

    **Basic** + * + * @param {number} [parameters.sku.capacity] Specifies the number of virtual + * machines in the scale set. + * + * @param {object} [parameters.plan] Specifies information about the + * marketplace image used to create the virtual machine. This element is only + * used for marketplace images. Before you can use a marketplace image from an + * API, you must enable the image for programmatic use. In the Azure portal, + * find the marketplace image that you want to use and then click **Want to + * deploy programmatically, Get Started ->**. Enter any required information + * and then click **Save**. + * + * @param {string} [parameters.plan.name] The plan ID. + * + * @param {string} [parameters.plan.publisher] The publisher ID. + * + * @param {string} [parameters.plan.product] Specifies the product of the image + * from the marketplace. This is the same value as Offer under the + * imageReference element. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {object} [parameters.upgradePolicy] The upgrade policy. + * + * @param {string} [parameters.upgradePolicy.mode] Specifies the mode of an + * upgrade to virtual machines in the scale set.

    Possible values + * are:

    **Manual** - You control the application of updates to + * virtual machines in the scale set. You do this by using the manualUpgrade + * action.

    **Automatic** - All virtual machines in the scale set + * are automatically updated at the same time. Possible values include: + * 'Automatic', 'Manual', 'Rolling' + * + * @param {object} [parameters.upgradePolicy.rollingUpgradePolicy] The + * configuration parameters used while performing a rolling upgrade. + * + * @param {number} + * [parameters.upgradePolicy.rollingUpgradePolicy.maxBatchInstancePercent] The + * maximum percent of total virtual machine instances that will be upgraded + * simultaneously by the rolling upgrade in one batch. As this is a maximum, + * unhealthy instances in previous or future batches can cause the percentage + * of instances in a batch to decrease to ensure higher reliability. The + * default value for this parameter is 20%. + * + * @param {number} + * [parameters.upgradePolicy.rollingUpgradePolicy.maxUnhealthyInstancePercent] + * The maximum percentage of the total virtual machine instances in the scale + * set that can be simultaneously unhealthy, either as a result of being + * upgraded, or by being found in an unhealthy state by the virtual machine + * health checks before the rolling upgrade aborts. This constraint will be + * checked prior to starting any batch. The default value for this parameter is + * 20%. + * + * @param {number} + * [parameters.upgradePolicy.rollingUpgradePolicy.maxUnhealthyUpgradedInstancePercent] + * The maximum percentage of upgraded virtual machine instances that can be + * found to be in an unhealthy state. This check will happen after each batch + * is upgraded. If this percentage is ever exceeded, the rolling update aborts. + * The default value for this parameter is 20%. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradePolicy.pauseTimeBetweenBatches] The + * wait time between completing the update for all virtual machines in one + * batch and starting the next batch. The time duration should be specified in + * ISO 8601 format. The default value is 0 seconds (PT0S). + * + * @param {boolean} [parameters.upgradePolicy.automaticOSUpgrade] Whether OS + * upgrades should automatically be applied to scale set instances in a rolling + * fashion when a newer version of the image becomes available. + * + * @param {object} [parameters.virtualMachineProfile] The virtual machine + * profile. + * + * @param {object} [parameters.virtualMachineProfile.osProfile] Specifies the + * operating system settings for the virtual machines in the scale set. + * + * @param {string} + * [parameters.virtualMachineProfile.osProfile.computerNamePrefix] Specifies + * the computer name prefix for all of the virtual machines in the scale set. + * Computer name prefixes must be 1 to 15 characters long. + * + * @param {string} [parameters.virtualMachineProfile.osProfile.adminUsername] + * Specifies the name of the administrator account.

    **Windows-only + * restriction:** Cannot end in "."

    **Disallowed values:** + * "administrator", "admin", "user", "user1", "test", "user2", "test1", + * "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", + * "backup", "console", "david", "guest", "john", "owner", "root", "server", + * "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", + * "user5".

    **Minimum-length (Linux):** 1 character

    + * **Max-length (Linux):** 64 characters

    **Max-length (Windows):** 20 + * characters

  • For root access to the Linux VM, see [Using root + * privileges on Linux virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in this + * field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {string} [parameters.virtualMachineProfile.osProfile.adminPassword] + * Specifies the password of the administrator account.

    + * **Minimum-length (Windows):** 8 characters

    **Minimum-length + * (Linux):** 6 characters

    **Max-length (Windows):** 123 characters + *

    **Max-length (Linux):** 72 characters

    **Complexity + * requirements:** 3 out of 4 conditions below need to be fulfilled
    Has + * lower characters
    Has upper characters
    Has a digit
    Has a + * special character (Regex match [\W_])

    **Disallowed values:** + * "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", + * "Password!", "Password1", "Password22", "iloveyou!"

    For resetting + * the password, see [How to reset the Remote Desktop service or its login + * password in a Windows + * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    For resetting root password, see [Manage users, SSH, and check or + * repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + * + * @param {string} [parameters.virtualMachineProfile.osProfile.customData] + * Specifies a base-64 encoded string of custom data. The base-64 encoded + * string is decoded to a binary array that is saved as a file on the Virtual + * Machine. The maximum length of the binary array is 65535 bytes.

    For + * using cloud-init for your VM, see [Using cloud-init to customize a Linux VM + * during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration] Specifies + * Windows operating system settings on the virtual machine. + * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.enableAutomaticUpdates] + * Indicates whether virtual machine is enabled for automatic updates. + * + * @param {string} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.timeZone] + * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.winRM] + * Specifies the Windows Remote Management listeners. This enables remote + * Windows PowerShell. + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.winRM.listeners] + * The list of Windows Remote Management listeners + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration] Specifies + * the Linux operating system settings on the virtual machine.

    For a + * list of supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh] + * Specifies the ssh key configuration for a Linux OS. + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh.publicKeys] + * The list of SSH public keys used to authenticate with linux based VMs. + * + * @param {array} [parameters.virtualMachineProfile.osProfile.secrets] + * Specifies set of certificates that should be installed onto the virtual + * machines in the scale set. + * + * @param {object} [parameters.virtualMachineProfile.storageProfile] Specifies + * the storage settings for the virtual machine disks. + * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.imageReference] Specifies + * information about the image to use. You can specify information about + * platform images, marketplace images, or virtual machine images. This element + * is required when you want to use a platform image, marketplace image, or + * virtual machine image, but is not used in other creation operations. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.publisher] + * The image publisher. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.offer] + * Specifies the offer of the platform image or marketplace image used to + * create the virtual machine. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.sku] The + * image SKU. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.version] + * Specifies the version of the platform image or marketplace image used to + * create the virtual machine. The allowed formats are Major.Minor.Build or + * 'latest'. Major, Minor, and Build are decimal numbers. Specify 'latest' to + * use the latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.id] Resource + * Id + * + * @param {object} [parameters.virtualMachineProfile.storageProfile.osDisk] + * Specifies information about the operating system disk used by the virtual + * machines in the scale set.

    For more information about disks, see + * [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.name] The disk name. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.caching] Specifies + * the caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {boolean} + * [parameters.virtualMachineProfile.storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @param {string} + * parameters.virtualMachineProfile.storageProfile.osDisk.createOption + * Specifies how the virtual machines in the scale set should be + * created.

    The only allowed value is: **FromImage** \u2013 This value + * is used when you are using an image to create the virtual machine. If you + * are using a platform image, you also use the imageReference element + * described above. If you are using a marketplace image, you also use the + * plan element previously described. Possible values include: 'FromImage', + * 'Empty', 'Attach' + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.osType] This + * property allows you to specify the type of the OS that is included in the + * disk if creating a VM from user-image or a specialized VHD.

    + * Possible values are:

    **Windows**

    **Linux**. Possible + * values include: 'Windows', 'Linux' + * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.osDisk.image] Specifies + * information about the unmanaged user image to base the scale set on. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.image.uri] Specifies + * the virtual hard disk's uri. + * + * @param {array} + * [parameters.virtualMachineProfile.storageProfile.osDisk.vhdContainers] + * Specifies the container urls that are used to store operating system disks + * for the scale set. + * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.osDisk.managedDisk] The + * managed disk parameters. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.managedDisk.storageAccountType] + * Specifies the storage account type for the managed disk. Possible values + * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {array} [parameters.virtualMachineProfile.storageProfile.dataDisks] + * Specifies the parameters that are used to add data disks to the virtual + * machines in the scale set.

    For more information about disks, see + * [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {object} [parameters.virtualMachineProfile.networkProfile] Specifies + * properties of the network interfaces of the virtual machines in the scale + * set. + * + * @param {object} + * [parameters.virtualMachineProfile.networkProfile.healthProbe] A reference to + * a load balancer probe used to determine the health of an instance in the + * virtual machine scale set. The reference will be in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. + * + * @param {string} + * [parameters.virtualMachineProfile.networkProfile.healthProbe.id] The ARM + * resource id in the form of + * /subscriptions/{SubcriptionId}/resourceGroups/{ResourceGroupName}/... + * + * @param {array} + * [parameters.virtualMachineProfile.networkProfile.networkInterfaceConfigurations] + * The list of network configurations. + * + * @param {object} [parameters.virtualMachineProfile.diagnosticsProfile] + * Specifies the boot diagnostic settings state.

    Minimum api-version: + * 2015-06-15. + * + * @param {object} + * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, + * you can easily view the output of your console log.

    For both + * Windows and Linux virtual machines, Azure also enables you to see a + * screenshot of the VM from the hypervisor. + * + * @param {boolean} + * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics.enabled] + * Whether boot diagnostics should be enabled on the Virtual Machine. + * + * @param {string} + * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics.storageUri] + * Uri of the storage account to use for placing the console output and + * screenshot. + * + * @param {object} [parameters.virtualMachineProfile.extensionProfile] + * Specifies a collection of settings for extensions installed on virtual + * machines in the scale set. + * + * @param {array} + * [parameters.virtualMachineProfile.extensionProfile.extensions] The virtual + * machine scale set child extension resources. + * + * @param {string} [parameters.virtualMachineProfile.licenseType] Specifies + * that the image or disk that is being used was licensed on-premises. This + * element is only used for images that contain the Windows Server operating + * system.

    Possible values are:

    Windows_Client

    + * Windows_Server

    If this element is included in a request for an + * update, the value must match the initial value. This value cannot be + * updated.

    For more information, see [Azure Hybrid Use Benefit for + * Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Minimum api-version: 2015-06-15 + * + * @param {string} [parameters.virtualMachineProfile.priority] Specifies the + * priority for the virtual machines in the scale set.

    Minimum + * api-version: 2017-10-30-preview. Possible values include: 'Regular', 'Low' + * + * @param {boolean} [parameters.overprovision] Specifies whether the Virtual + * Machine Scale Set should be overprovisioned. + * + * @param {boolean} [parameters.singlePlacementGroup] When true this limits the + * scale set to a single placement group, of max size 100 virtual machines. + * + * @param {boolean} [parameters.zoneBalance] Whether to force stictly even + * Virtual Machine distribution cross x-zones in case there is zone outage. + * + * @param {number} [parameters.platformFaultDomainCount] Fault Domain count for + * each placement group. + * + * @param {object} [parameters.identity] The identity of the virtual machine + * scale set, if configured. + * + * @param {string} [parameters.identity.type] The type of identity used for the + * virtual machine scale set. The type 'SystemAssigned, UserAssigned' includes + * both an implicitly created identity and a set of user assigned identities. + * The type 'None' will remove any identities from the virtual machine scale + * set. Possible values include: 'SystemAssigned', 'UserAssigned', + * 'SystemAssigned, UserAssigned', 'None' + * + * @param {array} [parameters.identity.identityIds] The list of user identities + * associated with the virtual machine scale set. The user identity references + * will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * + * @param {array} [parameters.zones] The virtual machine scale set zones. + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @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. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, parameters: models.VirtualMachineScaleSet, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Create or update a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set to create or + * update. + * + * @param {object} parameters The scale set object. + * + * @param {object} [parameters.sku] The virtual machine scale set sku. + * + * @param {string} [parameters.sku.name] The sku name. + * + * @param {string} [parameters.sku.tier] Specifies the tier of virtual machines + * in a scale set.

    Possible Values:

    **Standard**

    **Basic** + * + * @param {number} [parameters.sku.capacity] Specifies the number of virtual + * machines in the scale set. + * + * @param {object} [parameters.plan] Specifies information about the + * marketplace image used to create the virtual machine. This element is only + * used for marketplace images. Before you can use a marketplace image from an + * API, you must enable the image for programmatic use. In the Azure portal, + * find the marketplace image that you want to use and then click **Want to + * deploy programmatically, Get Started ->**. Enter any required information + * and then click **Save**. + * + * @param {string} [parameters.plan.name] The plan ID. + * + * @param {string} [parameters.plan.publisher] The publisher ID. + * + * @param {string} [parameters.plan.product] Specifies the product of the image + * from the marketplace. This is the same value as Offer under the + * imageReference element. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {object} [parameters.upgradePolicy] The upgrade policy. + * + * @param {string} [parameters.upgradePolicy.mode] Specifies the mode of an + * upgrade to virtual machines in the scale set.

    Possible values + * are:

    **Manual** - You control the application of updates to + * virtual machines in the scale set. You do this by using the manualUpgrade + * action.

    **Automatic** - All virtual machines in the scale set + * are automatically updated at the same time. Possible values include: + * 'Automatic', 'Manual', 'Rolling' + * + * @param {object} [parameters.upgradePolicy.rollingUpgradePolicy] The + * configuration parameters used while performing a rolling upgrade. + * + * @param {number} + * [parameters.upgradePolicy.rollingUpgradePolicy.maxBatchInstancePercent] The + * maximum percent of total virtual machine instances that will be upgraded + * simultaneously by the rolling upgrade in one batch. As this is a maximum, + * unhealthy instances in previous or future batches can cause the percentage + * of instances in a batch to decrease to ensure higher reliability. The + * default value for this parameter is 20%. + * + * @param {number} + * [parameters.upgradePolicy.rollingUpgradePolicy.maxUnhealthyInstancePercent] + * The maximum percentage of the total virtual machine instances in the scale + * set that can be simultaneously unhealthy, either as a result of being + * upgraded, or by being found in an unhealthy state by the virtual machine + * health checks before the rolling upgrade aborts. This constraint will be + * checked prior to starting any batch. The default value for this parameter is + * 20%. + * + * @param {number} + * [parameters.upgradePolicy.rollingUpgradePolicy.maxUnhealthyUpgradedInstancePercent] + * The maximum percentage of upgraded virtual machine instances that can be + * found to be in an unhealthy state. This check will happen after each batch + * is upgraded. If this percentage is ever exceeded, the rolling update aborts. + * The default value for this parameter is 20%. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradePolicy.pauseTimeBetweenBatches] The + * wait time between completing the update for all virtual machines in one + * batch and starting the next batch. The time duration should be specified in + * ISO 8601 format. The default value is 0 seconds (PT0S). + * + * @param {boolean} [parameters.upgradePolicy.automaticOSUpgrade] Whether OS + * upgrades should automatically be applied to scale set instances in a rolling + * fashion when a newer version of the image becomes available. + * + * @param {object} [parameters.virtualMachineProfile] The virtual machine + * profile. + * + * @param {object} [parameters.virtualMachineProfile.osProfile] Specifies the + * operating system settings for the virtual machines in the scale set. + * + * @param {string} + * [parameters.virtualMachineProfile.osProfile.computerNamePrefix] Specifies + * the computer name prefix for all of the virtual machines in the scale set. + * Computer name prefixes must be 1 to 15 characters long. + * + * @param {string} [parameters.virtualMachineProfile.osProfile.adminUsername] + * Specifies the name of the administrator account.

    **Windows-only + * restriction:** Cannot end in "."

    **Disallowed values:** + * "administrator", "admin", "user", "user1", "test", "user2", "test1", + * "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", + * "backup", "console", "david", "guest", "john", "owner", "root", "server", + * "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", + * "user5".

    **Minimum-length (Linux):** 1 character

    + * **Max-length (Linux):** 64 characters

    **Max-length (Windows):** 20 + * characters

  • For root access to the Linux VM, see [Using root + * privileges on Linux virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in this + * field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {string} [parameters.virtualMachineProfile.osProfile.adminPassword] + * Specifies the password of the administrator account.

    + * **Minimum-length (Windows):** 8 characters

    **Minimum-length + * (Linux):** 6 characters

    **Max-length (Windows):** 123 characters + *

    **Max-length (Linux):** 72 characters

    **Complexity + * requirements:** 3 out of 4 conditions below need to be fulfilled
    Has + * lower characters
    Has upper characters
    Has a digit
    Has a + * special character (Regex match [\W_])

    **Disallowed values:** + * "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", + * "Password!", "Password1", "Password22", "iloveyou!"

    For resetting + * the password, see [How to reset the Remote Desktop service or its login + * password in a Windows + * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    For resetting root password, see [Manage users, SSH, and check or + * repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + * + * @param {string} [parameters.virtualMachineProfile.osProfile.customData] + * Specifies a base-64 encoded string of custom data. The base-64 encoded + * string is decoded to a binary array that is saved as a file on the Virtual + * Machine. The maximum length of the binary array is 65535 bytes.

    For + * using cloud-init for your VM, see [Using cloud-init to customize a Linux VM + * during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration] Specifies + * Windows operating system settings on the virtual machine. + * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.enableAutomaticUpdates] + * Indicates whether virtual machine is enabled for automatic updates. + * + * @param {string} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.timeZone] + * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.winRM] + * Specifies the Windows Remote Management listeners. This enables remote + * Windows PowerShell. + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.winRM.listeners] + * The list of Windows Remote Management listeners + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration] Specifies + * the Linux operating system settings on the virtual machine.

    For a + * list of supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh] + * Specifies the ssh key configuration for a Linux OS. + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh.publicKeys] + * The list of SSH public keys used to authenticate with linux based VMs. + * + * @param {array} [parameters.virtualMachineProfile.osProfile.secrets] + * Specifies set of certificates that should be installed onto the virtual + * machines in the scale set. + * + * @param {object} [parameters.virtualMachineProfile.storageProfile] Specifies + * the storage settings for the virtual machine disks. + * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.imageReference] Specifies + * information about the image to use. You can specify information about + * platform images, marketplace images, or virtual machine images. This element + * is required when you want to use a platform image, marketplace image, or + * virtual machine image, but is not used in other creation operations. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.publisher] + * The image publisher. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.offer] + * Specifies the offer of the platform image or marketplace image used to + * create the virtual machine. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.sku] The + * image SKU. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.version] + * Specifies the version of the platform image or marketplace image used to + * create the virtual machine. The allowed formats are Major.Minor.Build or + * 'latest'. Major, Minor, and Build are decimal numbers. Specify 'latest' to + * use the latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.id] Resource + * Id + * + * @param {object} [parameters.virtualMachineProfile.storageProfile.osDisk] + * Specifies information about the operating system disk used by the virtual + * machines in the scale set.

    For more information about disks, see + * [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.name] The disk name. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.caching] Specifies + * the caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {boolean} + * [parameters.virtualMachineProfile.storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @param {string} + * parameters.virtualMachineProfile.storageProfile.osDisk.createOption + * Specifies how the virtual machines in the scale set should be + * created.

    The only allowed value is: **FromImage** \u2013 This value + * is used when you are using an image to create the virtual machine. If you + * are using a platform image, you also use the imageReference element + * described above. If you are using a marketplace image, you also use the + * plan element previously described. Possible values include: 'FromImage', + * 'Empty', 'Attach' + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.osType] This + * property allows you to specify the type of the OS that is included in the + * disk if creating a VM from user-image or a specialized VHD.

    + * Possible values are:

    **Windows**

    **Linux**. Possible + * values include: 'Windows', 'Linux' + * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.osDisk.image] Specifies + * information about the unmanaged user image to base the scale set on. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.image.uri] Specifies + * the virtual hard disk's uri. + * + * @param {array} + * [parameters.virtualMachineProfile.storageProfile.osDisk.vhdContainers] + * Specifies the container urls that are used to store operating system disks + * for the scale set. + * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.osDisk.managedDisk] The + * managed disk parameters. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.managedDisk.storageAccountType] + * Specifies the storage account type for the managed disk. Possible values + * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {array} [parameters.virtualMachineProfile.storageProfile.dataDisks] + * Specifies the parameters that are used to add data disks to the virtual + * machines in the scale set.

    For more information about disks, see + * [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {object} [parameters.virtualMachineProfile.networkProfile] Specifies + * properties of the network interfaces of the virtual machines in the scale + * set. + * + * @param {object} + * [parameters.virtualMachineProfile.networkProfile.healthProbe] A reference to + * a load balancer probe used to determine the health of an instance in the + * virtual machine scale set. The reference will be in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. + * + * @param {string} + * [parameters.virtualMachineProfile.networkProfile.healthProbe.id] The ARM + * resource id in the form of + * /subscriptions/{SubcriptionId}/resourceGroups/{ResourceGroupName}/... + * + * @param {array} + * [parameters.virtualMachineProfile.networkProfile.networkInterfaceConfigurations] + * The list of network configurations. + * + * @param {object} [parameters.virtualMachineProfile.diagnosticsProfile] + * Specifies the boot diagnostic settings state.

    Minimum api-version: + * 2015-06-15. + * + * @param {object} + * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, + * you can easily view the output of your console log.

    For both + * Windows and Linux virtual machines, Azure also enables you to see a + * screenshot of the VM from the hypervisor. + * + * @param {boolean} + * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics.enabled] + * Whether boot diagnostics should be enabled on the Virtual Machine. + * + * @param {string} + * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics.storageUri] + * Uri of the storage account to use for placing the console output and + * screenshot. + * + * @param {object} [parameters.virtualMachineProfile.extensionProfile] + * Specifies a collection of settings for extensions installed on virtual + * machines in the scale set. + * + * @param {array} + * [parameters.virtualMachineProfile.extensionProfile.extensions] The virtual + * machine scale set child extension resources. + * + * @param {string} [parameters.virtualMachineProfile.licenseType] Specifies + * that the image or disk that is being used was licensed on-premises. This + * element is only used for images that contain the Windows Server operating + * system.

    Possible values are:

    Windows_Client

    + * Windows_Server

    If this element is included in a request for an + * update, the value must match the initial value. This value cannot be + * updated.

    For more information, see [Azure Hybrid Use Benefit for + * Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Minimum api-version: 2015-06-15 + * + * @param {string} [parameters.virtualMachineProfile.priority] Specifies the + * priority for the virtual machines in the scale set.

    Minimum + * api-version: 2017-10-30-preview. Possible values include: 'Regular', 'Low' + * + * @param {boolean} [parameters.overprovision] Specifies whether the Virtual + * Machine Scale Set should be overprovisioned. + * + * @param {boolean} [parameters.singlePlacementGroup] When true this limits the + * scale set to a single placement group, of max size 100 virtual machines. + * + * @param {boolean} [parameters.zoneBalance] Whether to force stictly even + * Virtual Machine distribution cross x-zones in case there is zone outage. + * + * @param {number} [parameters.platformFaultDomainCount] Fault Domain count for + * each placement group. + * + * @param {object} [parameters.identity] The identity of the virtual machine + * scale set, if configured. + * + * @param {string} [parameters.identity.type] The type of identity used for the + * virtual machine scale set. The type 'SystemAssigned, UserAssigned' includes + * both an implicitly created identity and a set of user assigned identities. + * The type 'None' will remove any identities from the virtual machine scale + * set. Possible values include: 'SystemAssigned', 'UserAssigned', + * 'SystemAssigned, UserAssigned', 'None' + * + * @param {array} [parameters.identity.identityIds] The list of user identities + * associated with the virtual machine scale set. The user identity references + * will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * + * @param {array} [parameters.zones] The virtual machine scale set zones. + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @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 {VirtualMachineScaleSet} - 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. + * + * {VirtualMachineScaleSet} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineScaleSet} 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. + */ + beginCreateOrUpdate(resourceGroupName: string, vmScaleSetName: string, parameters: models.VirtualMachineScaleSet, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, vmScaleSetName: string, parameters: models.VirtualMachineScaleSet, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, vmScaleSetName: string, parameters: models.VirtualMachineScaleSet, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Update a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set to create or + * update. + * + * @param {object} parameters The scale set object. + * + * @param {object} [parameters.sku] The virtual machine scale set sku. + * + * @param {string} [parameters.sku.name] The sku name. + * + * @param {string} [parameters.sku.tier] Specifies the tier of virtual machines + * in a scale set.

    Possible Values:

    **Standard**

    **Basic** + * + * @param {number} [parameters.sku.capacity] Specifies the number of virtual + * machines in the scale set. + * + * @param {object} [parameters.plan] The purchase plan when deploying a virtual + * machine scale set from VM Marketplace images. + * + * @param {string} [parameters.plan.name] The plan ID. + * + * @param {string} [parameters.plan.publisher] The publisher ID. + * + * @param {string} [parameters.plan.product] Specifies the product of the image + * from the marketplace. This is the same value as Offer under the + * imageReference element. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {object} [parameters.upgradePolicy] The upgrade policy. + * + * @param {string} [parameters.upgradePolicy.mode] Specifies the mode of an + * upgrade to virtual machines in the scale set.

    Possible values + * are:

    **Manual** - You control the application of updates to + * virtual machines in the scale set. You do this by using the manualUpgrade + * action.

    **Automatic** - All virtual machines in the scale set + * are automatically updated at the same time. Possible values include: + * 'Automatic', 'Manual', 'Rolling' + * + * @param {object} [parameters.upgradePolicy.rollingUpgradePolicy] The + * configuration parameters used while performing a rolling upgrade. + * + * @param {number} + * [parameters.upgradePolicy.rollingUpgradePolicy.maxBatchInstancePercent] The + * maximum percent of total virtual machine instances that will be upgraded + * simultaneously by the rolling upgrade in one batch. As this is a maximum, + * unhealthy instances in previous or future batches can cause the percentage + * of instances in a batch to decrease to ensure higher reliability. The + * default value for this parameter is 20%. + * + * @param {number} + * [parameters.upgradePolicy.rollingUpgradePolicy.maxUnhealthyInstancePercent] + * The maximum percentage of the total virtual machine instances in the scale + * set that can be simultaneously unhealthy, either as a result of being + * upgraded, or by being found in an unhealthy state by the virtual machine + * health checks before the rolling upgrade aborts. This constraint will be + * checked prior to starting any batch. The default value for this parameter is + * 20%. + * + * @param {number} + * [parameters.upgradePolicy.rollingUpgradePolicy.maxUnhealthyUpgradedInstancePercent] + * The maximum percentage of upgraded virtual machine instances that can be + * found to be in an unhealthy state. This check will happen after each batch + * is upgraded. If this percentage is ever exceeded, the rolling update aborts. + * The default value for this parameter is 20%. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradePolicy.pauseTimeBetweenBatches] The + * wait time between completing the update for all virtual machines in one + * batch and starting the next batch. The time duration should be specified in + * ISO 8601 format. The default value is 0 seconds (PT0S). + * + * @param {boolean} [parameters.upgradePolicy.automaticOSUpgrade] Whether OS + * upgrades should automatically be applied to scale set instances in a rolling + * fashion when a newer version of the image becomes available. + * + * @param {object} [parameters.virtualMachineProfile] The virtual machine + * profile. + * + * @param {object} [parameters.virtualMachineProfile.osProfile] The virtual + * machine scale set OS profile. + * + * @param {string} [parameters.virtualMachineProfile.osProfile.customData] A + * base-64 encoded string of custom data. + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration] The + * Windows Configuration of the OS profile. + * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.enableAutomaticUpdates] + * Indicates whether virtual machine is enabled for automatic updates. + * + * @param {string} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.timeZone] + * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.winRM] + * Specifies the Windows Remote Management listeners. This enables remote + * Windows PowerShell. + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.winRM.listeners] + * The list of Windows Remote Management listeners + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration] The Linux + * Configuration of the OS profile. + * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh] + * Specifies the ssh key configuration for a Linux OS. + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh.publicKeys] + * The list of SSH public keys used to authenticate with linux based VMs. + * + * @param {array} [parameters.virtualMachineProfile.osProfile.secrets] The List + * of certificates for addition to the VM. + * + * @param {object} [parameters.virtualMachineProfile.storageProfile] The + * virtual machine scale set storage profile. + * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.imageReference] The image + * reference. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.publisher] + * The image publisher. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.offer] + * Specifies the offer of the platform image or marketplace image used to + * create the virtual machine. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.sku] The + * image SKU. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.version] + * Specifies the version of the platform image or marketplace image used to + * create the virtual machine. The allowed formats are Major.Minor.Build or + * 'latest'. Major, Minor, and Build are decimal numbers. Specify 'latest' to + * use the latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.id] Resource + * Id + * + * @param {object} [parameters.virtualMachineProfile.storageProfile.osDisk] The + * OS disk. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.caching] The caching + * type. Possible values include: 'None', 'ReadOnly', 'ReadWrite' + * + * @param {boolean} + * [parameters.virtualMachineProfile.storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.osDisk.image] The Source + * User Image VirtualHardDisk. This VirtualHardDisk will be copied before using + * it to attach to the Virtual Machine. If SourceImage is provided, the + * destination VirtualHardDisk should not exist. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.image.uri] Specifies + * the virtual hard disk's uri. + * + * @param {array} + * [parameters.virtualMachineProfile.storageProfile.osDisk.vhdContainers] The + * list of virtual hard disk container uris. + * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.osDisk.managedDisk] The + * managed disk parameters. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.managedDisk.storageAccountType] + * Specifies the storage account type for the managed disk. Possible values + * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {array} [parameters.virtualMachineProfile.storageProfile.dataDisks] + * The data disks. + * + * @param {object} [parameters.virtualMachineProfile.networkProfile] The + * virtual machine scale set network profile. + * + * @param {array} + * [parameters.virtualMachineProfile.networkProfile.networkInterfaceConfigurations] + * The list of network configurations. + * + * @param {object} [parameters.virtualMachineProfile.diagnosticsProfile] The + * virtual machine scale set diagnostics profile. + * + * @param {object} + * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, + * you can easily view the output of your console log.

    For both + * Windows and Linux virtual machines, Azure also enables you to see a + * screenshot of the VM from the hypervisor. + * + * @param {boolean} + * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics.enabled] + * Whether boot diagnostics should be enabled on the Virtual Machine. + * + * @param {string} + * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics.storageUri] + * Uri of the storage account to use for placing the console output and + * screenshot. + * + * @param {object} [parameters.virtualMachineProfile.extensionProfile] The + * virtual machine scale set extension profile. + * + * @param {array} + * [parameters.virtualMachineProfile.extensionProfile.extensions] The virtual + * machine scale set child extension resources. + * + * @param {string} [parameters.virtualMachineProfile.licenseType] The license + * type, which is for bring your own license scenario. + * + * @param {boolean} [parameters.overprovision] Specifies whether the Virtual + * Machine Scale Set should be overprovisioned. + * + * @param {boolean} [parameters.singlePlacementGroup] When true this limits the + * scale set to a single placement group, of max size 100 virtual machines. + * + * @param {object} [parameters.identity] The identity of the virtual machine + * scale set, if configured. + * + * @param {string} [parameters.identity.type] The type of identity used for the + * virtual machine scale set. The type 'SystemAssigned, UserAssigned' includes + * both an implicitly created identity and a set of user assigned identities. + * The type 'None' will remove any identities from the virtual machine scale + * set. Possible values include: 'SystemAssigned', 'UserAssigned', + * 'SystemAssigned, UserAssigned', 'None' + * + * @param {array} [parameters.identity.identityIds] The list of user identities + * associated with the virtual machine scale set. The user identity references + * will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * + * @param {object} [parameters.tags] Resource tags + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginUpdateWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, parameters: models.VirtualMachineScaleSetUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Update a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set to create or + * update. + * + * @param {object} parameters The scale set object. + * + * @param {object} [parameters.sku] The virtual machine scale set sku. + * + * @param {string} [parameters.sku.name] The sku name. + * + * @param {string} [parameters.sku.tier] Specifies the tier of virtual machines + * in a scale set.

    Possible Values:

    **Standard**

    **Basic** + * + * @param {number} [parameters.sku.capacity] Specifies the number of virtual + * machines in the scale set. + * + * @param {object} [parameters.plan] The purchase plan when deploying a virtual + * machine scale set from VM Marketplace images. + * + * @param {string} [parameters.plan.name] The plan ID. + * + * @param {string} [parameters.plan.publisher] The publisher ID. + * + * @param {string} [parameters.plan.product] Specifies the product of the image + * from the marketplace. This is the same value as Offer under the + * imageReference element. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {object} [parameters.upgradePolicy] The upgrade policy. + * + * @param {string} [parameters.upgradePolicy.mode] Specifies the mode of an + * upgrade to virtual machines in the scale set.

    Possible values + * are:

    **Manual** - You control the application of updates to + * virtual machines in the scale set. You do this by using the manualUpgrade + * action.

    **Automatic** - All virtual machines in the scale set + * are automatically updated at the same time. Possible values include: + * 'Automatic', 'Manual', 'Rolling' + * + * @param {object} [parameters.upgradePolicy.rollingUpgradePolicy] The + * configuration parameters used while performing a rolling upgrade. + * + * @param {number} + * [parameters.upgradePolicy.rollingUpgradePolicy.maxBatchInstancePercent] The + * maximum percent of total virtual machine instances that will be upgraded + * simultaneously by the rolling upgrade in one batch. As this is a maximum, + * unhealthy instances in previous or future batches can cause the percentage + * of instances in a batch to decrease to ensure higher reliability. The + * default value for this parameter is 20%. + * + * @param {number} + * [parameters.upgradePolicy.rollingUpgradePolicy.maxUnhealthyInstancePercent] + * The maximum percentage of the total virtual machine instances in the scale + * set that can be simultaneously unhealthy, either as a result of being + * upgraded, or by being found in an unhealthy state by the virtual machine + * health checks before the rolling upgrade aborts. This constraint will be + * checked prior to starting any batch. The default value for this parameter is + * 20%. + * + * @param {number} + * [parameters.upgradePolicy.rollingUpgradePolicy.maxUnhealthyUpgradedInstancePercent] + * The maximum percentage of upgraded virtual machine instances that can be + * found to be in an unhealthy state. This check will happen after each batch + * is upgraded. If this percentage is ever exceeded, the rolling update aborts. + * The default value for this parameter is 20%. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradePolicy.pauseTimeBetweenBatches] The + * wait time between completing the update for all virtual machines in one + * batch and starting the next batch. The time duration should be specified in + * ISO 8601 format. The default value is 0 seconds (PT0S). + * + * @param {boolean} [parameters.upgradePolicy.automaticOSUpgrade] Whether OS + * upgrades should automatically be applied to scale set instances in a rolling + * fashion when a newer version of the image becomes available. + * + * @param {object} [parameters.virtualMachineProfile] The virtual machine + * profile. + * + * @param {object} [parameters.virtualMachineProfile.osProfile] The virtual + * machine scale set OS profile. + * + * @param {string} [parameters.virtualMachineProfile.osProfile.customData] A + * base-64 encoded string of custom data. + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration] The + * Windows Configuration of the OS profile. + * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.enableAutomaticUpdates] + * Indicates whether virtual machine is enabled for automatic updates. + * + * @param {string} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.timeZone] + * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.winRM] + * Specifies the Windows Remote Management listeners. This enables remote + * Windows PowerShell. + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.winRM.listeners] + * The list of Windows Remote Management listeners + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration] The Linux + * Configuration of the OS profile. + * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh] + * Specifies the ssh key configuration for a Linux OS. + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh.publicKeys] + * The list of SSH public keys used to authenticate with linux based VMs. + * + * @param {array} [parameters.virtualMachineProfile.osProfile.secrets] The List + * of certificates for addition to the VM. + * + * @param {object} [parameters.virtualMachineProfile.storageProfile] The + * virtual machine scale set storage profile. + * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.imageReference] The image + * reference. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.publisher] + * The image publisher. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.offer] + * Specifies the offer of the platform image or marketplace image used to + * create the virtual machine. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.sku] The + * image SKU. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.version] + * Specifies the version of the platform image or marketplace image used to + * create the virtual machine. The allowed formats are Major.Minor.Build or + * 'latest'. Major, Minor, and Build are decimal numbers. Specify 'latest' to + * use the latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.id] Resource + * Id + * + * @param {object} [parameters.virtualMachineProfile.storageProfile.osDisk] The + * OS disk. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.caching] The caching + * type. Possible values include: 'None', 'ReadOnly', 'ReadWrite' + * + * @param {boolean} + * [parameters.virtualMachineProfile.storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.osDisk.image] The Source + * User Image VirtualHardDisk. This VirtualHardDisk will be copied before using + * it to attach to the Virtual Machine. If SourceImage is provided, the + * destination VirtualHardDisk should not exist. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.image.uri] Specifies + * the virtual hard disk's uri. + * + * @param {array} + * [parameters.virtualMachineProfile.storageProfile.osDisk.vhdContainers] The + * list of virtual hard disk container uris. + * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.osDisk.managedDisk] The + * managed disk parameters. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.managedDisk.storageAccountType] + * Specifies the storage account type for the managed disk. Possible values + * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {array} [parameters.virtualMachineProfile.storageProfile.dataDisks] + * The data disks. + * + * @param {object} [parameters.virtualMachineProfile.networkProfile] The + * virtual machine scale set network profile. + * + * @param {array} + * [parameters.virtualMachineProfile.networkProfile.networkInterfaceConfigurations] + * The list of network configurations. + * + * @param {object} [parameters.virtualMachineProfile.diagnosticsProfile] The + * virtual machine scale set diagnostics profile. + * + * @param {object} + * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, + * you can easily view the output of your console log.

    For both + * Windows and Linux virtual machines, Azure also enables you to see a + * screenshot of the VM from the hypervisor. + * + * @param {boolean} + * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics.enabled] + * Whether boot diagnostics should be enabled on the Virtual Machine. + * + * @param {string} + * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics.storageUri] + * Uri of the storage account to use for placing the console output and + * screenshot. + * + * @param {object} [parameters.virtualMachineProfile.extensionProfile] The + * virtual machine scale set extension profile. + * + * @param {array} + * [parameters.virtualMachineProfile.extensionProfile.extensions] The virtual + * machine scale set child extension resources. + * + * @param {string} [parameters.virtualMachineProfile.licenseType] The license + * type, which is for bring your own license scenario. + * + * @param {boolean} [parameters.overprovision] Specifies whether the Virtual + * Machine Scale Set should be overprovisioned. + * + * @param {boolean} [parameters.singlePlacementGroup] When true this limits the + * scale set to a single placement group, of max size 100 virtual machines. + * + * @param {object} [parameters.identity] The identity of the virtual machine + * scale set, if configured. + * + * @param {string} [parameters.identity.type] The type of identity used for the + * virtual machine scale set. The type 'SystemAssigned, UserAssigned' includes + * both an implicitly created identity and a set of user assigned identities. + * The type 'None' will remove any identities from the virtual machine scale + * set. Possible values include: 'SystemAssigned', 'UserAssigned', + * 'SystemAssigned, UserAssigned', 'None' + * + * @param {array} [parameters.identity.identityIds] The list of user identities + * associated with the virtual machine scale set. The user identity references + * will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * + * @param {object} [parameters.tags] Resource tags + * + * @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 {VirtualMachineScaleSet} - 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. + * + * {VirtualMachineScaleSet} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineScaleSet} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginUpdate(resourceGroupName: string, vmScaleSetName: string, parameters: models.VirtualMachineScaleSetUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdate(resourceGroupName: string, vmScaleSetName: string, parameters: models.VirtualMachineScaleSetUpdate, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, vmScaleSetName: string, parameters: models.VirtualMachineScaleSetUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @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. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + beginDeleteMethod(resourceGroupName: string, vmScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, vmScaleSetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deallocates specific virtual machines in a VM scale set. Shuts down the + * virtual machines and releases the compute resources. You are not billed for + * the compute resources that this virtual machine scale set deallocates. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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. + */ + beginDeallocateWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deallocates specific virtual machines in a VM scale set. Shuts down the + * virtual machines and releases the compute resources. You are not billed for + * the compute resources that this virtual machine scale set deallocates. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + beginDeallocate(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeallocate(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + beginDeallocate(resourceGroupName: string, vmScaleSetName: string, options: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes virtual machines in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {array} instanceIds The virtual machine scale set instance ids. + * + * @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. + */ + beginDeleteInstancesWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceIds: string[], options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes virtual machines in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {array} instanceIds The virtual machine scale set instance ids. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + beginDeleteInstances(resourceGroupName: string, vmScaleSetName: string, instanceIds: string[], options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteInstances(resourceGroupName: string, vmScaleSetName: string, instanceIds: string[], callback: ServiceCallback): void; + beginDeleteInstances(resourceGroupName: string, vmScaleSetName: string, instanceIds: string[], options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Power off (stop) one or more virtual machines in a VM scale set. Note that + * resources are still attached and you are getting charged for the resources. + * Instead, use deallocate to release resources and avoid charges. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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. + */ + beginPowerOffWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Power off (stop) one or more virtual machines in a VM scale set. Note that + * resources are still attached and you are getting charged for the resources. + * Instead, use deallocate to release resources and avoid charges. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + beginPowerOff(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise; + beginPowerOff(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + beginPowerOff(resourceGroupName: string, vmScaleSetName: string, options: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Restarts one or more virtual machines in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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. + */ + beginRestartWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Restarts one or more virtual machines in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + beginRestart(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise; + beginRestart(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + beginRestart(resourceGroupName: string, vmScaleSetName: string, options: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Starts one or more virtual machines in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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. + */ + beginStartWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Starts one or more virtual machines in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + beginStart(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise; + beginStart(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + beginStart(resourceGroupName: string, vmScaleSetName: string, options: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Redeploy one or more virtual machines in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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. + */ + beginRedeployWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Redeploy one or more virtual machines in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + beginRedeploy(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise; + beginRedeploy(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + beginRedeploy(resourceGroupName: string, vmScaleSetName: string, options: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Perform maintenance on one or more virtual machines in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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. + */ + beginPerformMaintenanceWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Perform maintenance on one or more virtual machines in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + beginPerformMaintenance(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise; + beginPerformMaintenance(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + beginPerformMaintenance(resourceGroupName: string, vmScaleSetName: string, options: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Upgrades one or more virtual machines to the latest SKU set in the VM scale + * set model. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {array} instanceIds The virtual machine scale set instance ids. + * + * @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. + */ + beginUpdateInstancesWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceIds: string[], options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Upgrades one or more virtual machines to the latest SKU set in the VM scale + * set model. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {array} instanceIds The virtual machine scale set instance ids. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + beginUpdateInstances(resourceGroupName: string, vmScaleSetName: string, instanceIds: string[], options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdateInstances(resourceGroupName: string, vmScaleSetName: string, instanceIds: string[], callback: ServiceCallback): void; + beginUpdateInstances(resourceGroupName: string, vmScaleSetName: string, instanceIds: string[], options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Reimages (upgrade the operating system) one or more virtual machines in a VM + * scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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. + */ + beginReimageWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Reimages (upgrade the operating system) one or more virtual machines in a VM + * scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + beginReimage(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise; + beginReimage(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + beginReimage(resourceGroupName: string, vmScaleSetName: string, options: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Reimages all the disks ( including data disks ) in the virtual machines in a + * VM scale set. This operation is only supported for managed disks. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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. + */ + beginReimageAllWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Reimages all the disks ( including data disks ) in the virtual machines in a + * VM scale set. This operation is only supported for managed disks. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + beginReimageAll(resourceGroupName: string, vmScaleSetName: string, options?: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }): Promise; + beginReimageAll(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + beginReimageAll(resourceGroupName: string, vmScaleSetName: string, options: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a list of all VM scale sets under a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a list of all VM scale sets under a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {VirtualMachineScaleSetListResult} - 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. + * + * {VirtualMachineScaleSetListResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineScaleSetListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a list of all VM Scale Sets in the subscription, regardless of the + * associated resource group. Use nextLink property in the response to get the + * next page of VM Scale Sets. Do this till nextLink is null to fetch all the + * VM Scale Sets. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listAllNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a list of all VM Scale Sets in the subscription, regardless of the + * associated resource group. Use nextLink property in the response to get the + * next page of VM Scale Sets. Do this till nextLink is null to fetch all the + * VM Scale Sets. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {VirtualMachineScaleSetListWithLinkResult} - 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. + * + * {VirtualMachineScaleSetListWithLinkResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineScaleSetListWithLinkResult} + * 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. + */ + listAllNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAllNext(nextPageLink: string, callback: ServiceCallback): void; + listAllNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a list of SKUs available for your VM scale set, including the minimum + * and maximum VM instances allowed for each SKU. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listSkusNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a list of SKUs available for your VM scale set, including the minimum + * and maximum VM instances allowed for each SKU. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {VirtualMachineScaleSetListSkusResult} - 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. + * + * {VirtualMachineScaleSetListSkusResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineScaleSetListSkusResult} 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. + */ + listSkusNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSkusNext(nextPageLink: string, callback: ServiceCallback): void; + listSkusNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets list of OS upgrades on a VM scale set instance. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getOSUpgradeHistoryNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets list of OS upgrades on a VM scale set instance. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {VirtualMachineScaleSetListOSUpgradeHistory} - 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. + * + * {VirtualMachineScaleSetListOSUpgradeHistory} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineScaleSetListOSUpgradeHistory} + * 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. + */ + getOSUpgradeHistoryNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getOSUpgradeHistoryNext(nextPageLink: string, callback: ServiceCallback): void; + getOSUpgradeHistoryNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * VirtualMachineScaleSetExtensions + * __NOTE__: An instance of this class is automatically created for an + * instance of the ComputeManagementClient. + */ +export interface VirtualMachineScaleSetExtensions { + + + /** + * The operation to create or update an extension. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set where the + * extension should be create or updated. + * + * @param {string} vmssExtensionName The name of the VM scale set extension. + * + * @param {object} extensionParameters Parameters supplied to the Create VM + * scale set Extension operation. + * + * @param {string} [extensionParameters.name] The name of the extension. + * + * @param {string} [extensionParameters.forceUpdateTag] If a value is provided + * and is different from the previous value, the extension handler will be + * forced to update even if the extension configuration has not changed. + * + * @param {string} [extensionParameters.publisher] The name of the extension + * handler publisher. + * + * @param {string} [extensionParameters.type] Specifies the type of the + * extension; an example is "CustomScriptExtension". + * + * @param {string} [extensionParameters.typeHandlerVersion] Specifies the + * version of the script handler. + * + * @param {boolean} [extensionParameters.autoUpgradeMinorVersion] Indicates + * whether the extension should use a newer minor version if one is available + * at deployment time. Once deployed, however, the extension will not upgrade + * minor versions unless redeployed, even with this property set to true. + * + * @param {object} [extensionParameters.settings] Json formatted public + * settings for the extension. + * + * @param {object} [extensionParameters.protectedSettings] The extension can + * contain either protectedSettings or protectedSettingsFromKeyVault or no + * protected settings at all. + * + * @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. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, vmssExtensionName: string, extensionParameters: models.VirtualMachineScaleSetExtension, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * The operation to create or update an extension. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set where the + * extension should be create or updated. + * + * @param {string} vmssExtensionName The name of the VM scale set extension. + * + * @param {object} extensionParameters Parameters supplied to the Create VM + * scale set Extension operation. + * + * @param {string} [extensionParameters.name] The name of the extension. + * + * @param {string} [extensionParameters.forceUpdateTag] If a value is provided + * and is different from the previous value, the extension handler will be + * forced to update even if the extension configuration has not changed. + * + * @param {string} [extensionParameters.publisher] The name of the extension + * handler publisher. + * + * @param {string} [extensionParameters.type] Specifies the type of the + * extension; an example is "CustomScriptExtension". + * + * @param {string} [extensionParameters.typeHandlerVersion] Specifies the + * version of the script handler. + * + * @param {boolean} [extensionParameters.autoUpgradeMinorVersion] Indicates + * whether the extension should use a newer minor version if one is available + * at deployment time. Once deployed, however, the extension will not upgrade + * minor versions unless redeployed, even with this property set to true. + * + * @param {object} [extensionParameters.settings] Json formatted public + * settings for the extension. + * + * @param {object} [extensionParameters.protectedSettings] The extension can + * contain either protectedSettings or protectedSettingsFromKeyVault or no + * protected settings at all. + * + * @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 {VirtualMachineScaleSetExtension} - 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. + * + * {VirtualMachineScaleSetExtension} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineScaleSetExtension} 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. + */ + createOrUpdate(resourceGroupName: string, vmScaleSetName: string, vmssExtensionName: string, extensionParameters: models.VirtualMachineScaleSetExtension, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, vmScaleSetName: string, vmssExtensionName: string, extensionParameters: models.VirtualMachineScaleSetExtension, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, vmScaleSetName: string, vmssExtensionName: string, extensionParameters: models.VirtualMachineScaleSetExtension, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * The operation to delete the extension. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set where the + * extension should be deleted. + * + * @param {string} vmssExtensionName The name of the VM scale set extension. + * + * @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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, vmssExtensionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * The operation to delete the extension. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set where the + * extension should be deleted. + * + * @param {string} vmssExtensionName The name of the VM scale set extension. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + deleteMethod(resourceGroupName: string, vmScaleSetName: string, vmssExtensionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, vmScaleSetName: string, vmssExtensionName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, vmScaleSetName: string, vmssExtensionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * The operation to get the extension. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set containing the + * extension. + * + * @param {string} vmssExtensionName The name of the VM scale set extension. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] The expand expression to apply on the + * operation. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, vmssExtensionName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * The operation to get the extension. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set containing the + * extension. + * + * @param {string} vmssExtensionName The name of the VM scale set extension. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] The expand expression to apply on the + * operation. + * + * @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 {VirtualMachineScaleSetExtension} - 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. + * + * {VirtualMachineScaleSetExtension} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineScaleSetExtension} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, vmScaleSetName: string, vmssExtensionName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, vmScaleSetName: string, vmssExtensionName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, vmScaleSetName: string, vmssExtensionName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a list of all extensions in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set containing the + * extension. + * + * @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. + */ + listWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a list of all extensions in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set containing the + * extension. + * + * @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 {VirtualMachineScaleSetExtensionListResult} - 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. + * + * {VirtualMachineScaleSetExtensionListResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineScaleSetExtensionListResult} + * for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(resourceGroupName: string, vmScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, vmScaleSetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * The operation to create or update an extension. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set where the + * extension should be create or updated. + * + * @param {string} vmssExtensionName The name of the VM scale set extension. + * + * @param {object} extensionParameters Parameters supplied to the Create VM + * scale set Extension operation. + * + * @param {string} [extensionParameters.name] The name of the extension. + * + * @param {string} [extensionParameters.forceUpdateTag] If a value is provided + * and is different from the previous value, the extension handler will be + * forced to update even if the extension configuration has not changed. + * + * @param {string} [extensionParameters.publisher] The name of the extension + * handler publisher. + * + * @param {string} [extensionParameters.type] Specifies the type of the + * extension; an example is "CustomScriptExtension". + * + * @param {string} [extensionParameters.typeHandlerVersion] Specifies the + * version of the script handler. + * + * @param {boolean} [extensionParameters.autoUpgradeMinorVersion] Indicates + * whether the extension should use a newer minor version if one is available + * at deployment time. Once deployed, however, the extension will not upgrade + * minor versions unless redeployed, even with this property set to true. + * + * @param {object} [extensionParameters.settings] Json formatted public + * settings for the extension. + * + * @param {object} [extensionParameters.protectedSettings] The extension can + * contain either protectedSettings or protectedSettingsFromKeyVault or no + * protected settings at all. + * + * @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. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, vmssExtensionName: string, extensionParameters: models.VirtualMachineScaleSetExtension, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * The operation to create or update an extension. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set where the + * extension should be create or updated. + * + * @param {string} vmssExtensionName The name of the VM scale set extension. + * + * @param {object} extensionParameters Parameters supplied to the Create VM + * scale set Extension operation. + * + * @param {string} [extensionParameters.name] The name of the extension. + * + * @param {string} [extensionParameters.forceUpdateTag] If a value is provided + * and is different from the previous value, the extension handler will be + * forced to update even if the extension configuration has not changed. + * + * @param {string} [extensionParameters.publisher] The name of the extension + * handler publisher. + * + * @param {string} [extensionParameters.type] Specifies the type of the + * extension; an example is "CustomScriptExtension". + * + * @param {string} [extensionParameters.typeHandlerVersion] Specifies the + * version of the script handler. + * + * @param {boolean} [extensionParameters.autoUpgradeMinorVersion] Indicates + * whether the extension should use a newer minor version if one is available + * at deployment time. Once deployed, however, the extension will not upgrade + * minor versions unless redeployed, even with this property set to true. + * + * @param {object} [extensionParameters.settings] Json formatted public + * settings for the extension. + * + * @param {object} [extensionParameters.protectedSettings] The extension can + * contain either protectedSettings or protectedSettingsFromKeyVault or no + * protected settings at all. + * + * @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 {VirtualMachineScaleSetExtension} - 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. + * + * {VirtualMachineScaleSetExtension} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineScaleSetExtension} 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. + */ + beginCreateOrUpdate(resourceGroupName: string, vmScaleSetName: string, vmssExtensionName: string, extensionParameters: models.VirtualMachineScaleSetExtension, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, vmScaleSetName: string, vmssExtensionName: string, extensionParameters: models.VirtualMachineScaleSetExtension, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, vmScaleSetName: string, vmssExtensionName: string, extensionParameters: models.VirtualMachineScaleSetExtension, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * The operation to delete the extension. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set where the + * extension should be deleted. + * + * @param {string} vmssExtensionName The name of the VM scale set extension. + * + * @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. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, vmssExtensionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * The operation to delete the extension. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set where the + * extension should be deleted. + * + * @param {string} vmssExtensionName The name of the VM scale set extension. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + beginDeleteMethod(resourceGroupName: string, vmScaleSetName: string, vmssExtensionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, vmScaleSetName: string, vmssExtensionName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, vmScaleSetName: string, vmssExtensionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a list of all extensions in a VM scale set. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a list of all extensions in a VM scale set. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {VirtualMachineScaleSetExtensionListResult} - 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. + * + * {VirtualMachineScaleSetExtensionListResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineScaleSetExtensionListResult} + * for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * VirtualMachineScaleSetRollingUpgrades + * __NOTE__: An instance of this class is automatically created for an + * instance of the ComputeManagementClient. + */ +export interface VirtualMachineScaleSetRollingUpgrades { + + + /** + * Cancels the current virtual machine scale set rolling upgrade. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @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. + */ + cancelWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Cancels the current virtual machine scale set rolling upgrade. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + cancel(resourceGroupName: string, vmScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + cancel(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + cancel(resourceGroupName: string, vmScaleSetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Starts a rolling upgrade to move all virtual machine scale set instances to + * the latest available Platform Image OS version. Instances which are already + * running the latest available OS version are not affected. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @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. + */ + startOSUpgradeWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Starts a rolling upgrade to move all virtual machine scale set instances to + * the latest available Platform Image OS version. Instances which are already + * running the latest available OS version are not affected. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + startOSUpgrade(resourceGroupName: string, vmScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + startOSUpgrade(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + startOSUpgrade(resourceGroupName: string, vmScaleSetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the status of the latest virtual machine scale set rolling upgrade. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @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. + */ + getLatestWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the status of the latest virtual machine scale set rolling upgrade. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @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 {RollingUpgradeStatusInfo} - 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. + * + * {RollingUpgradeStatusInfo} [result] - The deserialized result object if an error did not occur. + * See {@link RollingUpgradeStatusInfo} 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. + */ + getLatest(resourceGroupName: string, vmScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getLatest(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + getLatest(resourceGroupName: string, vmScaleSetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Cancels the current virtual machine scale set rolling upgrade. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @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. + */ + beginCancelWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Cancels the current virtual machine scale set rolling upgrade. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + beginCancel(resourceGroupName: string, vmScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCancel(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + beginCancel(resourceGroupName: string, vmScaleSetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Starts a rolling upgrade to move all virtual machine scale set instances to + * the latest available Platform Image OS version. Instances which are already + * running the latest available OS version are not affected. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @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. + */ + beginStartOSUpgradeWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Starts a rolling upgrade to move all virtual machine scale set instances to + * the latest available Platform Image OS version. Instances which are already + * running the latest available OS version are not affected. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + beginStartOSUpgrade(resourceGroupName: string, vmScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginStartOSUpgrade(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + beginStartOSUpgrade(resourceGroupName: string, vmScaleSetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * VirtualMachineScaleSetVMs + * __NOTE__: An instance of this class is automatically created for an + * instance of the ComputeManagementClient. + */ +export interface VirtualMachineScaleSetVMs { + + + /** + * Reimages (upgrade the operating system) a specific virtual machine in a VM + * scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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. + */ + reimageWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Reimages (upgrade the operating system) a specific virtual machine in a VM + * scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + reimage(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + reimage(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; + reimage(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Allows you to re-image all the disks ( including data disks ) in the a VM + * scale set instance. This operation is only supported for managed disks. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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. + */ + reimageAllWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Allows you to re-image all the disks ( including data disks ) in the a VM + * scale set instance. This operation is only supported for managed disks. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + reimageAll(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + reimageAll(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; + reimageAll(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deallocates a specific virtual machine in a VM scale set. Shuts down the + * virtual machine and releases the compute resources it uses. You are not + * billed for the compute resources of this virtual machine once it is + * deallocated. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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. + */ + deallocateWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deallocates a specific virtual machine in a VM scale set. Shuts down the + * virtual machine and releases the compute resources it uses. You are not + * billed for the compute resources of this virtual machine once it is + * deallocated. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + deallocate(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deallocate(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; + deallocate(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates a virtual machine of a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set where the + * extension should be create or updated. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Update Virtual Machine + * Scale Sets VM operation. + * + * @param {object} [parameters.hardwareProfile] Specifies the hardware settings + * for the virtual machine. + * + * @param {string} [parameters.hardwareProfile.vmSize] Specifies the size of + * the virtual machine. For more information about virtual machine sizes, see + * [Sizes for virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    The available VM sizes depend on region and availability set. For a + * list of available sizes use these APIs:

    [List all available + * virtual machine sizes in an availability + * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) + *

    [List all available virtual machine sizes in a + * region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) + *

    [List all available virtual machine sizes for + * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). + * Possible values include: '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_B1s', 'Standard_B1ms', + * 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', + * '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_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', + * 'Standard_D32_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', + * 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', + * 'Standard_D64s_v3', '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_DS13-4_v2', 'Standard_DS13-2_v2', + * 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', 'Standard_E2_v3', + * 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', 'Standard_E32_v3', + * 'Standard_E64_v3', 'Standard_E2s_v3', 'Standard_E4s_v3', 'Standard_E8s_v3', + * 'Standard_E16s_v3', 'Standard_E32s_v3', 'Standard_E64s_v3', + * 'Standard_E32-16_v3', 'Standard_E32-8s_v3', 'Standard_E64-32s_v3', + * 'Standard_E64-16s_v3', 'Standard_F1', 'Standard_F2', 'Standard_F4', + * 'Standard_F8', 'Standard_F16', 'Standard_F1s', 'Standard_F2s', + * 'Standard_F4s', 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2', + * 'Standard_F4s_v2', 'Standard_F8s_v2', 'Standard_F16s_v2', + * 'Standard_F32s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1', + * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', + * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', + * 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8', + * 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m', + * 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', + * 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms', + * 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms', + * 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms', + * 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', + * 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2', + * 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3', + * 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s', + * 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6', + * 'Standard_NV12', 'Standard_NV24' + * + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. + * + * @param {object} [parameters.storageProfile.imageReference] Specifies + * information about the image to use. You can specify information about + * platform images, marketplace images, or virtual machine images. This element + * is required when you want to use a platform image, marketplace image, or + * virtual machine image, but is not used in other creation operations. + * + * @param {string} [parameters.storageProfile.imageReference.publisher] The + * image publisher. + * + * @param {string} [parameters.storageProfile.imageReference.offer] Specifies + * the offer of the platform image or marketplace image used to create the + * virtual machine. + * + * @param {string} [parameters.storageProfile.imageReference.sku] The image + * SKU. + * + * @param {string} [parameters.storageProfile.imageReference.version] Specifies + * the version of the platform image or marketplace image used to create the + * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the + * latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. + * + * @param {string} [parameters.storageProfile.imageReference.id] Resource Id + * + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} [parameters.storageProfile.osDisk.osType] This property + * allows you to specify the type of the OS that is included in the disk if + * creating a VM from user-image or a specialized VHD.

    Possible values + * are:

    **Windows**

    **Linux**. Possible values include: + * 'Windows', 'Linux' + * + * @param {object} [parameters.storageProfile.osDisk.encryptionSettings] + * Specifies the encryption settings for the OS Disk.

    Minimum + * api-version: 2015-06-15 + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey] + * Specifies the location of the disk encryption key, which is a Key Vault + * Secret. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.secretUrl + * The URL referencing a secret in a Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the secret. + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey] + * Specifies the location of the key encryption key in Key Vault. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.keyUrl + * The URL referencing a key encryption key in Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the key. + * + * @param {boolean} + * [parameters.storageProfile.osDisk.encryptionSettings.enabled] Specifies + * whether disk encryption should be enabled on the virtual machine. + * + * @param {string} [parameters.storageProfile.osDisk.name] The disk name. + * + * @param {object} [parameters.storageProfile.osDisk.vhd] The virtual hard + * disk. + * + * @param {object} [parameters.storageProfile.osDisk.image] The source user + * image virtual hard disk. The virtual hard disk will be copied before being + * attached to the virtual machine. If SourceImage is provided, the destination + * virtual hard drive must not exist. + * + * @param {string} [parameters.storageProfile.osDisk.image.uri] Specifies the + * virtual hard disk's uri. + * + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {boolean} [parameters.storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @param {string} parameters.storageProfile.osDisk.createOption Specifies how + * the virtual machine should be created.

    Possible values are:

    + * **Attach** \u2013 This value is used when you are using a specialized disk + * to create the virtual machine.

    **FromImage** \u2013 This value is + * used when you are using an image to create the virtual machine. If you are + * using a platform image, you also use the imageReference element described + * above. If you are using a marketplace image, you also use the plan element + * previously described. Possible values include: 'FromImage', 'Empty', + * 'Attach' + * + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of an empty data disk in gigabytes. This element can be used to + * overwrite the name of the disk in a virtual machine image.

    This + * value cannot be larger than 1023 GB + * + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed + * disk parameters. + * + * @param {string} + * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies + * the storage account type for the managed disk. Possible values are: + * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id + * + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {object} [parameters.osProfile] Specifies the operating system + * settings for the virtual machine. + * + * @param {string} [parameters.osProfile.computerName] Specifies the host OS + * name of the virtual machine.

    **Max-length (Windows):** 15 + * characters

    **Max-length (Linux):** 64 characters.

    For + * naming conventions and restrictions see [Azure infrastructure services + * implementation + * guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). + * + * @param {string} [parameters.osProfile.adminUsername] Specifies the name of + * the administrator account.

    **Windows-only restriction:** Cannot end + * in "."

    **Disallowed values:** "administrator", "admin", "user", + * "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", + * "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", + * "john", "owner", "root", "server", "sql", "support", "support_388945a0", + * "sys", "test2", "test3", "user4", "user5".

    **Minimum-length + * (Linux):** 1 character

    **Max-length (Linux):** 64 characters + *

    **Max-length (Windows):** 20 characters

  • For root + * access to the Linux VM, see [Using root privileges on Linux virtual machines + * in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in this + * field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {string} [parameters.osProfile.adminPassword] Specifies the password + * of the administrator account.

    **Minimum-length (Windows):** 8 + * characters

    **Minimum-length (Linux):** 6 characters

    + * **Max-length (Windows):** 123 characters

    **Max-length (Linux):** 72 + * characters

    **Complexity requirements:** 3 out of 4 conditions below + * need to be fulfilled
    Has lower characters
    Has upper characters
    + * Has a digit
    Has a special character (Regex match [\W_])

    + * **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", + * "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", + * "iloveyou!"

    For resetting the password, see [How to reset the + * Remote Desktop service or its login password in a Windows + * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    For resetting root password, see [Manage users, SSH, and check or + * repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + * + * @param {string} [parameters.osProfile.customData] Specifies a base-64 + * encoded string of custom data. The base-64 encoded string is decoded to a + * binary array that is saved as a file on the Virtual Machine. The maximum + * length of the binary array is 65535 bytes.

    For using cloud-init for + * your VM, see [Using cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {object} [parameters.osProfile.windowsConfiguration] Specifies + * Windows operating system settings on the virtual machine. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.provisionVMAgent] Indicates + * whether virtual machine agent should be provisioned on the virtual machine. + *

    When this property is not specified in the request body, default + * behavior is to set it to true. This will ensure that VM Agent is installed + * on the VM so that extensions can be added to the VM later. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.enableAutomaticUpdates] Indicates + * whether virtual machine is enabled for automatic updates. + * + * @param {string} [parameters.osProfile.windowsConfiguration.timeZone] + * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" + * + * @param {array} + * [parameters.osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * + * @param {object} [parameters.osProfile.windowsConfiguration.winRM] Specifies + * the Windows Remote Management listeners. This enables remote Windows + * PowerShell. + * + * @param {array} [parameters.osProfile.windowsConfiguration.winRM.listeners] + * The list of Windows Remote Management listeners + * + * @param {object} [parameters.osProfile.linuxConfiguration] Specifies the + * Linux operating system settings on the virtual machine.

    For a list + * of supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @param {boolean} + * [parameters.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * + * @param {object} [parameters.osProfile.linuxConfiguration.ssh] Specifies the + * ssh key configuration for a Linux OS. + * + * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The + * list of SSH public keys used to authenticate with linux based VMs. + * + * @param {array} [parameters.osProfile.secrets] Specifies set of certificates + * that should be installed onto the virtual machine. + * + * @param {object} [parameters.networkProfile] Specifies the network interfaces + * of the virtual machine. + * + * @param {array} [parameters.networkProfile.networkInterfaces] Specifies the + * list of resource Ids for the network interfaces associated with the virtual + * machine. + * + * @param {object} [parameters.diagnosticsProfile] Specifies the boot + * diagnostic settings state.

    Minimum api-version: 2015-06-15. + * + * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, + * you can easily view the output of your console log.

    For both + * Windows and Linux virtual machines, Azure also enables you to see a + * screenshot of the VM from the hypervisor. + * + * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] + * Whether boot diagnostics should be enabled on the Virtual Machine. + * + * @param {string} [parameters.diagnosticsProfile.bootDiagnostics.storageUri] + * Uri of the storage account to use for placing the console output and + * screenshot. + * + * @param {object} [parameters.availabilitySet] Specifies information about the + * availability set that the virtual machine should be assigned to. Virtual + * machines specified in the same availability set are allocated to different + * nodes to maximize availability. For more information about availability + * sets, see [Manage the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    For more information on Azure planned maintainance, see [Planned + * maintenance for virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Currently, a VM can only be added to availability set at creation + * time. An existing VM cannot be added to an availability set. + * + * @param {string} [parameters.availabilitySet.id] Resource Id + * + * @param {string} [parameters.licenseType] Specifies that the image or disk + * that is being used was licensed on-premises. This element is only used for + * images that contain the Windows Server operating system.

    Possible + * values are:

    Windows_Client

    Windows_Server

    If this + * element is included in a request for an update, the value must match the + * initial value. This value cannot be updated.

    For more information, + * see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Minimum api-version: 2015-06-15 + * + * @param {object} [parameters.plan] Specifies information about the + * marketplace image used to create the virtual machine. This element is only + * used for marketplace images. Before you can use a marketplace image from an + * API, you must enable the image for programmatic use. In the Azure portal, + * find the marketplace image that you want to use and then click **Want to + * deploy programmatically, Get Started ->**. Enter any required information + * and then click **Save**. + * + * @param {string} [parameters.plan.name] The plan ID. + * + * @param {string} [parameters.plan.publisher] The publisher ID. + * + * @param {string} [parameters.plan.product] Specifies the product of the image + * from the marketplace. This is the same value as Offer under the + * imageReference element. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + updateWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceId: string, parameters: models.VirtualMachineScaleSetVM, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates a virtual machine of a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set where the + * extension should be create or updated. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Update Virtual Machine + * Scale Sets VM operation. + * + * @param {object} [parameters.hardwareProfile] Specifies the hardware settings + * for the virtual machine. + * + * @param {string} [parameters.hardwareProfile.vmSize] Specifies the size of + * the virtual machine. For more information about virtual machine sizes, see + * [Sizes for virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    The available VM sizes depend on region and availability set. For a + * list of available sizes use these APIs:

    [List all available + * virtual machine sizes in an availability + * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) + *

    [List all available virtual machine sizes in a + * region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) + *

    [List all available virtual machine sizes for + * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). + * Possible values include: '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_B1s', 'Standard_B1ms', + * 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', + * '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_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', + * 'Standard_D32_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', + * 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', + * 'Standard_D64s_v3', '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_DS13-4_v2', 'Standard_DS13-2_v2', + * 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', 'Standard_E2_v3', + * 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', 'Standard_E32_v3', + * 'Standard_E64_v3', 'Standard_E2s_v3', 'Standard_E4s_v3', 'Standard_E8s_v3', + * 'Standard_E16s_v3', 'Standard_E32s_v3', 'Standard_E64s_v3', + * 'Standard_E32-16_v3', 'Standard_E32-8s_v3', 'Standard_E64-32s_v3', + * 'Standard_E64-16s_v3', 'Standard_F1', 'Standard_F2', 'Standard_F4', + * 'Standard_F8', 'Standard_F16', 'Standard_F1s', 'Standard_F2s', + * 'Standard_F4s', 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2', + * 'Standard_F4s_v2', 'Standard_F8s_v2', 'Standard_F16s_v2', + * 'Standard_F32s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1', + * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', + * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', + * 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8', + * 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m', + * 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', + * 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms', + * 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms', + * 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms', + * 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', + * 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2', + * 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3', + * 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s', + * 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6', + * 'Standard_NV12', 'Standard_NV24' + * + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. + * + * @param {object} [parameters.storageProfile.imageReference] Specifies + * information about the image to use. You can specify information about + * platform images, marketplace images, or virtual machine images. This element + * is required when you want to use a platform image, marketplace image, or + * virtual machine image, but is not used in other creation operations. + * + * @param {string} [parameters.storageProfile.imageReference.publisher] The + * image publisher. + * + * @param {string} [parameters.storageProfile.imageReference.offer] Specifies + * the offer of the platform image or marketplace image used to create the + * virtual machine. + * + * @param {string} [parameters.storageProfile.imageReference.sku] The image + * SKU. + * + * @param {string} [parameters.storageProfile.imageReference.version] Specifies + * the version of the platform image or marketplace image used to create the + * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the + * latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. + * + * @param {string} [parameters.storageProfile.imageReference.id] Resource Id + * + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} [parameters.storageProfile.osDisk.osType] This property + * allows you to specify the type of the OS that is included in the disk if + * creating a VM from user-image or a specialized VHD.

    Possible values + * are:

    **Windows**

    **Linux**. Possible values include: + * 'Windows', 'Linux' + * + * @param {object} [parameters.storageProfile.osDisk.encryptionSettings] + * Specifies the encryption settings for the OS Disk.

    Minimum + * api-version: 2015-06-15 + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey] + * Specifies the location of the disk encryption key, which is a Key Vault + * Secret. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.secretUrl + * The URL referencing a secret in a Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the secret. + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey] + * Specifies the location of the key encryption key in Key Vault. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.keyUrl + * The URL referencing a key encryption key in Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the key. + * + * @param {boolean} + * [parameters.storageProfile.osDisk.encryptionSettings.enabled] Specifies + * whether disk encryption should be enabled on the virtual machine. + * + * @param {string} [parameters.storageProfile.osDisk.name] The disk name. + * + * @param {object} [parameters.storageProfile.osDisk.vhd] The virtual hard + * disk. + * + * @param {object} [parameters.storageProfile.osDisk.image] The source user + * image virtual hard disk. The virtual hard disk will be copied before being + * attached to the virtual machine. If SourceImage is provided, the destination + * virtual hard drive must not exist. + * + * @param {string} [parameters.storageProfile.osDisk.image.uri] Specifies the + * virtual hard disk's uri. + * + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {boolean} [parameters.storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @param {string} parameters.storageProfile.osDisk.createOption Specifies how + * the virtual machine should be created.

    Possible values are:

    + * **Attach** \u2013 This value is used when you are using a specialized disk + * to create the virtual machine.

    **FromImage** \u2013 This value is + * used when you are using an image to create the virtual machine. If you are + * using a platform image, you also use the imageReference element described + * above. If you are using a marketplace image, you also use the plan element + * previously described. Possible values include: 'FromImage', 'Empty', + * 'Attach' + * + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of an empty data disk in gigabytes. This element can be used to + * overwrite the name of the disk in a virtual machine image.

    This + * value cannot be larger than 1023 GB + * + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed + * disk parameters. + * + * @param {string} + * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies + * the storage account type for the managed disk. Possible values are: + * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id + * + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {object} [parameters.osProfile] Specifies the operating system + * settings for the virtual machine. + * + * @param {string} [parameters.osProfile.computerName] Specifies the host OS + * name of the virtual machine.

    **Max-length (Windows):** 15 + * characters

    **Max-length (Linux):** 64 characters.

    For + * naming conventions and restrictions see [Azure infrastructure services + * implementation + * guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). + * + * @param {string} [parameters.osProfile.adminUsername] Specifies the name of + * the administrator account.

    **Windows-only restriction:** Cannot end + * in "."

    **Disallowed values:** "administrator", "admin", "user", + * "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", + * "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", + * "john", "owner", "root", "server", "sql", "support", "support_388945a0", + * "sys", "test2", "test3", "user4", "user5".

    **Minimum-length + * (Linux):** 1 character

    **Max-length (Linux):** 64 characters + *

    **Max-length (Windows):** 20 characters

  • For root + * access to the Linux VM, see [Using root privileges on Linux virtual machines + * in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in this + * field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {string} [parameters.osProfile.adminPassword] Specifies the password + * of the administrator account.

    **Minimum-length (Windows):** 8 + * characters

    **Minimum-length (Linux):** 6 characters

    + * **Max-length (Windows):** 123 characters

    **Max-length (Linux):** 72 + * characters

    **Complexity requirements:** 3 out of 4 conditions below + * need to be fulfilled
    Has lower characters
    Has upper characters
    + * Has a digit
    Has a special character (Regex match [\W_])

    + * **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", + * "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", + * "iloveyou!"

    For resetting the password, see [How to reset the + * Remote Desktop service or its login password in a Windows + * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    For resetting root password, see [Manage users, SSH, and check or + * repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + * + * @param {string} [parameters.osProfile.customData] Specifies a base-64 + * encoded string of custom data. The base-64 encoded string is decoded to a + * binary array that is saved as a file on the Virtual Machine. The maximum + * length of the binary array is 65535 bytes.

    For using cloud-init for + * your VM, see [Using cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {object} [parameters.osProfile.windowsConfiguration] Specifies + * Windows operating system settings on the virtual machine. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.provisionVMAgent] Indicates + * whether virtual machine agent should be provisioned on the virtual machine. + *

    When this property is not specified in the request body, default + * behavior is to set it to true. This will ensure that VM Agent is installed + * on the VM so that extensions can be added to the VM later. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.enableAutomaticUpdates] Indicates + * whether virtual machine is enabled for automatic updates. + * + * @param {string} [parameters.osProfile.windowsConfiguration.timeZone] + * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" + * + * @param {array} + * [parameters.osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * + * @param {object} [parameters.osProfile.windowsConfiguration.winRM] Specifies + * the Windows Remote Management listeners. This enables remote Windows + * PowerShell. + * + * @param {array} [parameters.osProfile.windowsConfiguration.winRM.listeners] + * The list of Windows Remote Management listeners + * + * @param {object} [parameters.osProfile.linuxConfiguration] Specifies the + * Linux operating system settings on the virtual machine.

    For a list + * of supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @param {boolean} + * [parameters.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * + * @param {object} [parameters.osProfile.linuxConfiguration.ssh] Specifies the + * ssh key configuration for a Linux OS. + * + * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The + * list of SSH public keys used to authenticate with linux based VMs. + * + * @param {array} [parameters.osProfile.secrets] Specifies set of certificates + * that should be installed onto the virtual machine. + * + * @param {object} [parameters.networkProfile] Specifies the network interfaces + * of the virtual machine. + * + * @param {array} [parameters.networkProfile.networkInterfaces] Specifies the + * list of resource Ids for the network interfaces associated with the virtual + * machine. + * + * @param {object} [parameters.diagnosticsProfile] Specifies the boot + * diagnostic settings state.

    Minimum api-version: 2015-06-15. + * + * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, + * you can easily view the output of your console log.

    For both + * Windows and Linux virtual machines, Azure also enables you to see a + * screenshot of the VM from the hypervisor. + * + * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] + * Whether boot diagnostics should be enabled on the Virtual Machine. + * + * @param {string} [parameters.diagnosticsProfile.bootDiagnostics.storageUri] + * Uri of the storage account to use for placing the console output and + * screenshot. + * + * @param {object} [parameters.availabilitySet] Specifies information about the + * availability set that the virtual machine should be assigned to. Virtual + * machines specified in the same availability set are allocated to different + * nodes to maximize availability. For more information about availability + * sets, see [Manage the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    For more information on Azure planned maintainance, see [Planned + * maintenance for virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Currently, a VM can only be added to availability set at creation + * time. An existing VM cannot be added to an availability set. + * + * @param {string} [parameters.availabilitySet.id] Resource Id + * + * @param {string} [parameters.licenseType] Specifies that the image or disk + * that is being used was licensed on-premises. This element is only used for + * images that contain the Windows Server operating system.

    Possible + * values are:

    Windows_Client

    Windows_Server

    If this + * element is included in a request for an update, the value must match the + * initial value. This value cannot be updated.

    For more information, + * see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Minimum api-version: 2015-06-15 + * + * @param {object} [parameters.plan] Specifies information about the + * marketplace image used to create the virtual machine. This element is only + * used for marketplace images. Before you can use a marketplace image from an + * API, you must enable the image for programmatic use. In the Azure portal, + * find the marketplace image that you want to use and then click **Want to + * deploy programmatically, Get Started ->**. Enter any required information + * and then click **Save**. + * + * @param {string} [parameters.plan.name] The plan ID. + * + * @param {string} [parameters.plan.publisher] The publisher ID. + * + * @param {string} [parameters.plan.product] Specifies the product of the image + * from the marketplace. This is the same value as Offer under the + * imageReference element. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @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 {VirtualMachineScaleSetVM} - 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. + * + * {VirtualMachineScaleSetVM} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineScaleSetVM} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + update(resourceGroupName: string, vmScaleSetName: string, instanceId: string, parameters: models.VirtualMachineScaleSetVM, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, vmScaleSetName: string, instanceId: string, parameters: models.VirtualMachineScaleSetVM, callback: ServiceCallback): void; + update(resourceGroupName: string, vmScaleSetName: string, instanceId: string, parameters: models.VirtualMachineScaleSetVM, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes a virtual machine from a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes a virtual machine from a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + deleteMethod(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a virtual machine from a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a virtual machine from a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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 {VirtualMachineScaleSetVM} - 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. + * + * {VirtualMachineScaleSetVM} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineScaleSetVM} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; + get(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the status of a virtual machine from a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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. + */ + getInstanceViewWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the status of a virtual machine from a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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 {VirtualMachineScaleSetVMInstanceView} - 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. + * + * {VirtualMachineScaleSetVMInstanceView} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineScaleSetVMInstanceView} 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. + */ + getInstanceView(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getInstanceView(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; + getInstanceView(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a list of all virtual machines in a VM scale sets. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualMachineScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply to the operation. + * + * @param {string} [options.select] The list parameters. + * + * @param {string} [options.expand] The expand expression to apply to the + * operation. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName: string, virtualMachineScaleSetName: string, options?: { filter? : string, select? : string, expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a list of all virtual machines in a VM scale sets. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualMachineScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply to the operation. + * + * @param {string} [options.select] The list parameters. + * + * @param {string} [options.expand] The expand expression to apply to the + * operation. + * + * @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 {VirtualMachineScaleSetVMListResult} - 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. + * + * {VirtualMachineScaleSetVMListResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineScaleSetVMListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(resourceGroupName: string, virtualMachineScaleSetName: string, options?: { filter? : string, select? : string, expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, virtualMachineScaleSetName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, virtualMachineScaleSetName: string, options: { filter? : string, select? : string, expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Power off (stop) a virtual machine in a VM scale set. Note that resources + * are still attached and you are getting charged for the resources. Instead, + * use deallocate to release resources and avoid charges. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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. + */ + powerOffWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Power off (stop) a virtual machine in a VM scale set. Note that resources + * are still attached and you are getting charged for the resources. Instead, + * use deallocate to release resources and avoid charges. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + powerOff(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + powerOff(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; + powerOff(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Restarts a virtual machine in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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. + */ + restartWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Restarts a virtual machine in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + restart(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + restart(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; + restart(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Starts a virtual machine in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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. + */ + startWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Starts a virtual machine in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + start(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + start(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; + start(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Redeploys a virtual machine in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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. + */ + redeployWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Redeploys a virtual machine in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + redeploy(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + redeploy(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; + redeploy(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Performs maintenance on a virtual machine in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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. + */ + performMaintenanceWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Performs maintenance on a virtual machine in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + performMaintenance(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + performMaintenance(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; + performMaintenance(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Reimages (upgrade the operating system) a specific virtual machine in a VM + * scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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. + */ + beginReimageWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Reimages (upgrade the operating system) a specific virtual machine in a VM + * scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + beginReimage(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginReimage(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; + beginReimage(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Allows you to re-image all the disks ( including data disks ) in the a VM + * scale set instance. This operation is only supported for managed disks. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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. + */ + beginReimageAllWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Allows you to re-image all the disks ( including data disks ) in the a VM + * scale set instance. This operation is only supported for managed disks. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + beginReimageAll(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginReimageAll(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; + beginReimageAll(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deallocates a specific virtual machine in a VM scale set. Shuts down the + * virtual machine and releases the compute resources it uses. You are not + * billed for the compute resources of this virtual machine once it is + * deallocated. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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. + */ + beginDeallocateWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deallocates a specific virtual machine in a VM scale set. Shuts down the + * virtual machine and releases the compute resources it uses. You are not + * billed for the compute resources of this virtual machine once it is + * deallocated. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + beginDeallocate(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeallocate(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; + beginDeallocate(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates a virtual machine of a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set where the + * extension should be create or updated. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Update Virtual Machine + * Scale Sets VM operation. + * + * @param {object} [parameters.hardwareProfile] Specifies the hardware settings + * for the virtual machine. + * + * @param {string} [parameters.hardwareProfile.vmSize] Specifies the size of + * the virtual machine. For more information about virtual machine sizes, see + * [Sizes for virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    The available VM sizes depend on region and availability set. For a + * list of available sizes use these APIs:

    [List all available + * virtual machine sizes in an availability + * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) + *

    [List all available virtual machine sizes in a + * region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) + *

    [List all available virtual machine sizes for + * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). + * Possible values include: '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_B1s', 'Standard_B1ms', + * 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', + * '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_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', + * 'Standard_D32_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', + * 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', + * 'Standard_D64s_v3', '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_DS13-4_v2', 'Standard_DS13-2_v2', + * 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', 'Standard_E2_v3', + * 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', 'Standard_E32_v3', + * 'Standard_E64_v3', 'Standard_E2s_v3', 'Standard_E4s_v3', 'Standard_E8s_v3', + * 'Standard_E16s_v3', 'Standard_E32s_v3', 'Standard_E64s_v3', + * 'Standard_E32-16_v3', 'Standard_E32-8s_v3', 'Standard_E64-32s_v3', + * 'Standard_E64-16s_v3', 'Standard_F1', 'Standard_F2', 'Standard_F4', + * 'Standard_F8', 'Standard_F16', 'Standard_F1s', 'Standard_F2s', + * 'Standard_F4s', 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2', + * 'Standard_F4s_v2', 'Standard_F8s_v2', 'Standard_F16s_v2', + * 'Standard_F32s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1', + * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', + * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', + * 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8', + * 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m', + * 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', + * 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms', + * 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms', + * 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms', + * 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', + * 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2', + * 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3', + * 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s', + * 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6', + * 'Standard_NV12', 'Standard_NV24' + * + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. + * + * @param {object} [parameters.storageProfile.imageReference] Specifies + * information about the image to use. You can specify information about + * platform images, marketplace images, or virtual machine images. This element + * is required when you want to use a platform image, marketplace image, or + * virtual machine image, but is not used in other creation operations. + * + * @param {string} [parameters.storageProfile.imageReference.publisher] The + * image publisher. + * + * @param {string} [parameters.storageProfile.imageReference.offer] Specifies + * the offer of the platform image or marketplace image used to create the + * virtual machine. + * + * @param {string} [parameters.storageProfile.imageReference.sku] The image + * SKU. + * + * @param {string} [parameters.storageProfile.imageReference.version] Specifies + * the version of the platform image or marketplace image used to create the + * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the + * latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. + * + * @param {string} [parameters.storageProfile.imageReference.id] Resource Id + * + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} [parameters.storageProfile.osDisk.osType] This property + * allows you to specify the type of the OS that is included in the disk if + * creating a VM from user-image or a specialized VHD.

    Possible values + * are:

    **Windows**

    **Linux**. Possible values include: + * 'Windows', 'Linux' + * + * @param {object} [parameters.storageProfile.osDisk.encryptionSettings] + * Specifies the encryption settings for the OS Disk.

    Minimum + * api-version: 2015-06-15 + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey] + * Specifies the location of the disk encryption key, which is a Key Vault + * Secret. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.secretUrl + * The URL referencing a secret in a Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the secret. + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey] + * Specifies the location of the key encryption key in Key Vault. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.keyUrl + * The URL referencing a key encryption key in Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the key. + * + * @param {boolean} + * [parameters.storageProfile.osDisk.encryptionSettings.enabled] Specifies + * whether disk encryption should be enabled on the virtual machine. + * + * @param {string} [parameters.storageProfile.osDisk.name] The disk name. + * + * @param {object} [parameters.storageProfile.osDisk.vhd] The virtual hard + * disk. + * + * @param {object} [parameters.storageProfile.osDisk.image] The source user + * image virtual hard disk. The virtual hard disk will be copied before being + * attached to the virtual machine. If SourceImage is provided, the destination + * virtual hard drive must not exist. + * + * @param {string} [parameters.storageProfile.osDisk.image.uri] Specifies the + * virtual hard disk's uri. + * + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {boolean} [parameters.storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @param {string} parameters.storageProfile.osDisk.createOption Specifies how + * the virtual machine should be created.

    Possible values are:

    + * **Attach** \u2013 This value is used when you are using a specialized disk + * to create the virtual machine.

    **FromImage** \u2013 This value is + * used when you are using an image to create the virtual machine. If you are + * using a platform image, you also use the imageReference element described + * above. If you are using a marketplace image, you also use the plan element + * previously described. Possible values include: 'FromImage', 'Empty', + * 'Attach' + * + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of an empty data disk in gigabytes. This element can be used to + * overwrite the name of the disk in a virtual machine image.

    This + * value cannot be larger than 1023 GB + * + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed + * disk parameters. + * + * @param {string} + * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies + * the storage account type for the managed disk. Possible values are: + * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id + * + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {object} [parameters.osProfile] Specifies the operating system + * settings for the virtual machine. + * + * @param {string} [parameters.osProfile.computerName] Specifies the host OS + * name of the virtual machine.

    **Max-length (Windows):** 15 + * characters

    **Max-length (Linux):** 64 characters.

    For + * naming conventions and restrictions see [Azure infrastructure services + * implementation + * guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). + * + * @param {string} [parameters.osProfile.adminUsername] Specifies the name of + * the administrator account.

    **Windows-only restriction:** Cannot end + * in "."

    **Disallowed values:** "administrator", "admin", "user", + * "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", + * "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", + * "john", "owner", "root", "server", "sql", "support", "support_388945a0", + * "sys", "test2", "test3", "user4", "user5".

    **Minimum-length + * (Linux):** 1 character

    **Max-length (Linux):** 64 characters + *

    **Max-length (Windows):** 20 characters

  • For root + * access to the Linux VM, see [Using root privileges on Linux virtual machines + * in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in this + * field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {string} [parameters.osProfile.adminPassword] Specifies the password + * of the administrator account.

    **Minimum-length (Windows):** 8 + * characters

    **Minimum-length (Linux):** 6 characters

    + * **Max-length (Windows):** 123 characters

    **Max-length (Linux):** 72 + * characters

    **Complexity requirements:** 3 out of 4 conditions below + * need to be fulfilled
    Has lower characters
    Has upper characters
    + * Has a digit
    Has a special character (Regex match [\W_])

    + * **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", + * "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", + * "iloveyou!"

    For resetting the password, see [How to reset the + * Remote Desktop service or its login password in a Windows + * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    For resetting root password, see [Manage users, SSH, and check or + * repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + * + * @param {string} [parameters.osProfile.customData] Specifies a base-64 + * encoded string of custom data. The base-64 encoded string is decoded to a + * binary array that is saved as a file on the Virtual Machine. The maximum + * length of the binary array is 65535 bytes.

    For using cloud-init for + * your VM, see [Using cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {object} [parameters.osProfile.windowsConfiguration] Specifies + * Windows operating system settings on the virtual machine. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.provisionVMAgent] Indicates + * whether virtual machine agent should be provisioned on the virtual machine. + *

    When this property is not specified in the request body, default + * behavior is to set it to true. This will ensure that VM Agent is installed + * on the VM so that extensions can be added to the VM later. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.enableAutomaticUpdates] Indicates + * whether virtual machine is enabled for automatic updates. + * + * @param {string} [parameters.osProfile.windowsConfiguration.timeZone] + * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" + * + * @param {array} + * [parameters.osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * + * @param {object} [parameters.osProfile.windowsConfiguration.winRM] Specifies + * the Windows Remote Management listeners. This enables remote Windows + * PowerShell. + * + * @param {array} [parameters.osProfile.windowsConfiguration.winRM.listeners] + * The list of Windows Remote Management listeners + * + * @param {object} [parameters.osProfile.linuxConfiguration] Specifies the + * Linux operating system settings on the virtual machine.

    For a list + * of supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @param {boolean} + * [parameters.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * + * @param {object} [parameters.osProfile.linuxConfiguration.ssh] Specifies the + * ssh key configuration for a Linux OS. + * + * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The + * list of SSH public keys used to authenticate with linux based VMs. + * + * @param {array} [parameters.osProfile.secrets] Specifies set of certificates + * that should be installed onto the virtual machine. + * + * @param {object} [parameters.networkProfile] Specifies the network interfaces + * of the virtual machine. + * + * @param {array} [parameters.networkProfile.networkInterfaces] Specifies the + * list of resource Ids for the network interfaces associated with the virtual + * machine. + * + * @param {object} [parameters.diagnosticsProfile] Specifies the boot + * diagnostic settings state.

    Minimum api-version: 2015-06-15. + * + * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, + * you can easily view the output of your console log.

    For both + * Windows and Linux virtual machines, Azure also enables you to see a + * screenshot of the VM from the hypervisor. + * + * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] + * Whether boot diagnostics should be enabled on the Virtual Machine. + * + * @param {string} [parameters.diagnosticsProfile.bootDiagnostics.storageUri] + * Uri of the storage account to use for placing the console output and + * screenshot. + * + * @param {object} [parameters.availabilitySet] Specifies information about the + * availability set that the virtual machine should be assigned to. Virtual + * machines specified in the same availability set are allocated to different + * nodes to maximize availability. For more information about availability + * sets, see [Manage the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    For more information on Azure planned maintainance, see [Planned + * maintenance for virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Currently, a VM can only be added to availability set at creation + * time. An existing VM cannot be added to an availability set. + * + * @param {string} [parameters.availabilitySet.id] Resource Id + * + * @param {string} [parameters.licenseType] Specifies that the image or disk + * that is being used was licensed on-premises. This element is only used for + * images that contain the Windows Server operating system.

    Possible + * values are:

    Windows_Client

    Windows_Server

    If this + * element is included in a request for an update, the value must match the + * initial value. This value cannot be updated.

    For more information, + * see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Minimum api-version: 2015-06-15 + * + * @param {object} [parameters.plan] Specifies information about the + * marketplace image used to create the virtual machine. This element is only + * used for marketplace images. Before you can use a marketplace image from an + * API, you must enable the image for programmatic use. In the Azure portal, + * find the marketplace image that you want to use and then click **Want to + * deploy programmatically, Get Started ->**. Enter any required information + * and then click **Save**. + * + * @param {string} [parameters.plan.name] The plan ID. + * + * @param {string} [parameters.plan.publisher] The publisher ID. + * + * @param {string} [parameters.plan.product] Specifies the product of the image + * from the marketplace. This is the same value as Offer under the + * imageReference element. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginUpdateWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceId: string, parameters: models.VirtualMachineScaleSetVM, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates a virtual machine of a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set where the + * extension should be create or updated. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Update Virtual Machine + * Scale Sets VM operation. + * + * @param {object} [parameters.hardwareProfile] Specifies the hardware settings + * for the virtual machine. + * + * @param {string} [parameters.hardwareProfile.vmSize] Specifies the size of + * the virtual machine. For more information about virtual machine sizes, see + * [Sizes for virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    The available VM sizes depend on region and availability set. For a + * list of available sizes use these APIs:

    [List all available + * virtual machine sizes in an availability + * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) + *

    [List all available virtual machine sizes in a + * region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) + *

    [List all available virtual machine sizes for + * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). + * Possible values include: '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_B1s', 'Standard_B1ms', + * 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', + * '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_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', + * 'Standard_D32_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', + * 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', + * 'Standard_D64s_v3', '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_DS13-4_v2', 'Standard_DS13-2_v2', + * 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', 'Standard_E2_v3', + * 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', 'Standard_E32_v3', + * 'Standard_E64_v3', 'Standard_E2s_v3', 'Standard_E4s_v3', 'Standard_E8s_v3', + * 'Standard_E16s_v3', 'Standard_E32s_v3', 'Standard_E64s_v3', + * 'Standard_E32-16_v3', 'Standard_E32-8s_v3', 'Standard_E64-32s_v3', + * 'Standard_E64-16s_v3', 'Standard_F1', 'Standard_F2', 'Standard_F4', + * 'Standard_F8', 'Standard_F16', 'Standard_F1s', 'Standard_F2s', + * 'Standard_F4s', 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2', + * 'Standard_F4s_v2', 'Standard_F8s_v2', 'Standard_F16s_v2', + * 'Standard_F32s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1', + * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', + * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', + * 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8', + * 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m', + * 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', + * 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms', + * 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms', + * 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms', + * 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', + * 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2', + * 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3', + * 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s', + * 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6', + * 'Standard_NV12', 'Standard_NV24' + * + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. + * + * @param {object} [parameters.storageProfile.imageReference] Specifies + * information about the image to use. You can specify information about + * platform images, marketplace images, or virtual machine images. This element + * is required when you want to use a platform image, marketplace image, or + * virtual machine image, but is not used in other creation operations. + * + * @param {string} [parameters.storageProfile.imageReference.publisher] The + * image publisher. + * + * @param {string} [parameters.storageProfile.imageReference.offer] Specifies + * the offer of the platform image or marketplace image used to create the + * virtual machine. + * + * @param {string} [parameters.storageProfile.imageReference.sku] The image + * SKU. + * + * @param {string} [parameters.storageProfile.imageReference.version] Specifies + * the version of the platform image or marketplace image used to create the + * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the + * latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. + * + * @param {string} [parameters.storageProfile.imageReference.id] Resource Id + * + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} [parameters.storageProfile.osDisk.osType] This property + * allows you to specify the type of the OS that is included in the disk if + * creating a VM from user-image or a specialized VHD.

    Possible values + * are:

    **Windows**

    **Linux**. Possible values include: + * 'Windows', 'Linux' + * + * @param {object} [parameters.storageProfile.osDisk.encryptionSettings] + * Specifies the encryption settings for the OS Disk.

    Minimum + * api-version: 2015-06-15 + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey] + * Specifies the location of the disk encryption key, which is a Key Vault + * Secret. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.secretUrl + * The URL referencing a secret in a Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the secret. + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey] + * Specifies the location of the key encryption key in Key Vault. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.keyUrl + * The URL referencing a key encryption key in Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the key. + * + * @param {boolean} + * [parameters.storageProfile.osDisk.encryptionSettings.enabled] Specifies + * whether disk encryption should be enabled on the virtual machine. + * + * @param {string} [parameters.storageProfile.osDisk.name] The disk name. + * + * @param {object} [parameters.storageProfile.osDisk.vhd] The virtual hard + * disk. + * + * @param {object} [parameters.storageProfile.osDisk.image] The source user + * image virtual hard disk. The virtual hard disk will be copied before being + * attached to the virtual machine. If SourceImage is provided, the destination + * virtual hard drive must not exist. + * + * @param {string} [parameters.storageProfile.osDisk.image.uri] Specifies the + * virtual hard disk's uri. + * + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {boolean} [parameters.storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @param {string} parameters.storageProfile.osDisk.createOption Specifies how + * the virtual machine should be created.

    Possible values are:

    + * **Attach** \u2013 This value is used when you are using a specialized disk + * to create the virtual machine.

    **FromImage** \u2013 This value is + * used when you are using an image to create the virtual machine. If you are + * using a platform image, you also use the imageReference element described + * above. If you are using a marketplace image, you also use the plan element + * previously described. Possible values include: 'FromImage', 'Empty', + * 'Attach' + * + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of an empty data disk in gigabytes. This element can be used to + * overwrite the name of the disk in a virtual machine image.

    This + * value cannot be larger than 1023 GB + * + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed + * disk parameters. + * + * @param {string} + * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies + * the storage account type for the managed disk. Possible values are: + * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id + * + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {object} [parameters.osProfile] Specifies the operating system + * settings for the virtual machine. + * + * @param {string} [parameters.osProfile.computerName] Specifies the host OS + * name of the virtual machine.

    **Max-length (Windows):** 15 + * characters

    **Max-length (Linux):** 64 characters.

    For + * naming conventions and restrictions see [Azure infrastructure services + * implementation + * guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). + * + * @param {string} [parameters.osProfile.adminUsername] Specifies the name of + * the administrator account.

    **Windows-only restriction:** Cannot end + * in "."

    **Disallowed values:** "administrator", "admin", "user", + * "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", + * "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", + * "john", "owner", "root", "server", "sql", "support", "support_388945a0", + * "sys", "test2", "test3", "user4", "user5".

    **Minimum-length + * (Linux):** 1 character

    **Max-length (Linux):** 64 characters + *

    **Max-length (Windows):** 20 characters

  • For root + * access to the Linux VM, see [Using root privileges on Linux virtual machines + * in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in this + * field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {string} [parameters.osProfile.adminPassword] Specifies the password + * of the administrator account.

    **Minimum-length (Windows):** 8 + * characters

    **Minimum-length (Linux):** 6 characters

    + * **Max-length (Windows):** 123 characters

    **Max-length (Linux):** 72 + * characters

    **Complexity requirements:** 3 out of 4 conditions below + * need to be fulfilled
    Has lower characters
    Has upper characters
    + * Has a digit
    Has a special character (Regex match [\W_])

    + * **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", + * "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", + * "iloveyou!"

    For resetting the password, see [How to reset the + * Remote Desktop service or its login password in a Windows + * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    For resetting root password, see [Manage users, SSH, and check or + * repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + * + * @param {string} [parameters.osProfile.customData] Specifies a base-64 + * encoded string of custom data. The base-64 encoded string is decoded to a + * binary array that is saved as a file on the Virtual Machine. The maximum + * length of the binary array is 65535 bytes.

    For using cloud-init for + * your VM, see [Using cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {object} [parameters.osProfile.windowsConfiguration] Specifies + * Windows operating system settings on the virtual machine. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.provisionVMAgent] Indicates + * whether virtual machine agent should be provisioned on the virtual machine. + *

    When this property is not specified in the request body, default + * behavior is to set it to true. This will ensure that VM Agent is installed + * on the VM so that extensions can be added to the VM later. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.enableAutomaticUpdates] Indicates + * whether virtual machine is enabled for automatic updates. + * + * @param {string} [parameters.osProfile.windowsConfiguration.timeZone] + * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" + * + * @param {array} + * [parameters.osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * + * @param {object} [parameters.osProfile.windowsConfiguration.winRM] Specifies + * the Windows Remote Management listeners. This enables remote Windows + * PowerShell. + * + * @param {array} [parameters.osProfile.windowsConfiguration.winRM.listeners] + * The list of Windows Remote Management listeners + * + * @param {object} [parameters.osProfile.linuxConfiguration] Specifies the + * Linux operating system settings on the virtual machine.

    For a list + * of supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @param {boolean} + * [parameters.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * + * @param {object} [parameters.osProfile.linuxConfiguration.ssh] Specifies the + * ssh key configuration for a Linux OS. + * + * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The + * list of SSH public keys used to authenticate with linux based VMs. + * + * @param {array} [parameters.osProfile.secrets] Specifies set of certificates + * that should be installed onto the virtual machine. + * + * @param {object} [parameters.networkProfile] Specifies the network interfaces + * of the virtual machine. + * + * @param {array} [parameters.networkProfile.networkInterfaces] Specifies the + * list of resource Ids for the network interfaces associated with the virtual + * machine. + * + * @param {object} [parameters.diagnosticsProfile] Specifies the boot + * diagnostic settings state.

    Minimum api-version: 2015-06-15. + * + * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, + * you can easily view the output of your console log.

    For both + * Windows and Linux virtual machines, Azure also enables you to see a + * screenshot of the VM from the hypervisor. + * + * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] + * Whether boot diagnostics should be enabled on the Virtual Machine. + * + * @param {string} [parameters.diagnosticsProfile.bootDiagnostics.storageUri] + * Uri of the storage account to use for placing the console output and + * screenshot. + * + * @param {object} [parameters.availabilitySet] Specifies information about the + * availability set that the virtual machine should be assigned to. Virtual + * machines specified in the same availability set are allocated to different + * nodes to maximize availability. For more information about availability + * sets, see [Manage the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    For more information on Azure planned maintainance, see [Planned + * maintenance for virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Currently, a VM can only be added to availability set at creation + * time. An existing VM cannot be added to an availability set. + * + * @param {string} [parameters.availabilitySet.id] Resource Id + * + * @param {string} [parameters.licenseType] Specifies that the image or disk + * that is being used was licensed on-premises. This element is only used for + * images that contain the Windows Server operating system.

    Possible + * values are:

    Windows_Client

    Windows_Server

    If this + * element is included in a request for an update, the value must match the + * initial value. This value cannot be updated.

    For more information, + * see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Minimum api-version: 2015-06-15 + * + * @param {object} [parameters.plan] Specifies information about the + * marketplace image used to create the virtual machine. This element is only + * used for marketplace images. Before you can use a marketplace image from an + * API, you must enable the image for programmatic use. In the Azure portal, + * find the marketplace image that you want to use and then click **Want to + * deploy programmatically, Get Started ->**. Enter any required information + * and then click **Save**. + * + * @param {string} [parameters.plan.name] The plan ID. + * + * @param {string} [parameters.plan.publisher] The publisher ID. + * + * @param {string} [parameters.plan.product] Specifies the product of the image + * from the marketplace. This is the same value as Offer under the + * imageReference element. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @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 {VirtualMachineScaleSetVM} - 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. + * + * {VirtualMachineScaleSetVM} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineScaleSetVM} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginUpdate(resourceGroupName: string, vmScaleSetName: string, instanceId: string, parameters: models.VirtualMachineScaleSetVM, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdate(resourceGroupName: string, vmScaleSetName: string, instanceId: string, parameters: models.VirtualMachineScaleSetVM, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, vmScaleSetName: string, instanceId: string, parameters: models.VirtualMachineScaleSetVM, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes a virtual machine from a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes a virtual machine from a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + beginDeleteMethod(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Power off (stop) a virtual machine in a VM scale set. Note that resources + * are still attached and you are getting charged for the resources. Instead, + * use deallocate to release resources and avoid charges. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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. + */ + beginPowerOffWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Power off (stop) a virtual machine in a VM scale set. Note that resources + * are still attached and you are getting charged for the resources. Instead, + * use deallocate to release resources and avoid charges. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + beginPowerOff(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginPowerOff(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; + beginPowerOff(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Restarts a virtual machine in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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. + */ + beginRestartWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Restarts a virtual machine in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + beginRestart(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginRestart(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; + beginRestart(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Starts a virtual machine in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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. + */ + beginStartWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Starts a virtual machine in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + beginStart(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginStart(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; + beginStart(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Redeploys a virtual machine in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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. + */ + beginRedeployWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Redeploys a virtual machine in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + beginRedeploy(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginRedeploy(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; + beginRedeploy(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Performs maintenance on a virtual machine in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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. + */ + beginPerformMaintenanceWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Performs maintenance on a virtual machine in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + beginPerformMaintenance(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginPerformMaintenance(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; + beginPerformMaintenance(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a list of all virtual machines in a VM scale sets. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a list of all virtual machines in a VM scale sets. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {VirtualMachineScaleSetVMListResult} - 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. + * + * {VirtualMachineScaleSetVMListResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineScaleSetVMListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * LogAnalytics + * __NOTE__: An instance of this class is automatically created for an + * instance of the ComputeManagementClient. + */ +export interface LogAnalytics { + + + /** + * Export logs that show Api requests made by this subscription in the given + * time window to show throttling activities. + * + * @param {object} parameters Parameters supplied to the LogAnalytics + * getRequestRateByInterval Api. + * + * @param {string} parameters.intervalLength Interval value in minutes used to + * create LogAnalytics call rate logs. Possible values include: 'ThreeMins', + * 'FiveMins', 'ThirtyMins', 'SixtyMins' + * + * @param {string} parameters.blobContainerSasUri SAS Uri of the logging blob + * container to which LogAnalytics Api writes output logs to. + * + * @param {date} parameters.fromTime From time of the query + * + * @param {date} parameters.toTime To time of the query + * + * @param {boolean} [parameters.groupByThrottlePolicy] Group query result by + * Throttle Policy applied. + * + * @param {boolean} [parameters.groupByOperationName] Group query result by by + * Operation Name. + * + * @param {boolean} [parameters.groupByResourceName] Group query result by + * Resource Name. + * + * @param {string} location The location upon which virtual-machine-sizes is + * queried. + * + * @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. + */ + exportRequestRateByIntervalWithHttpOperationResponse(parameters: models.RequestRateByIntervalInput, location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Export logs that show Api requests made by this subscription in the given + * time window to show throttling activities. + * + * @param {object} parameters Parameters supplied to the LogAnalytics + * getRequestRateByInterval Api. + * + * @param {string} parameters.intervalLength Interval value in minutes used to + * create LogAnalytics call rate logs. Possible values include: 'ThreeMins', + * 'FiveMins', 'ThirtyMins', 'SixtyMins' + * + * @param {string} parameters.blobContainerSasUri SAS Uri of the logging blob + * container to which LogAnalytics Api writes output logs to. + * + * @param {date} parameters.fromTime From time of the query + * + * @param {date} parameters.toTime To time of the query + * + * @param {boolean} [parameters.groupByThrottlePolicy] Group query result by + * Throttle Policy applied. + * + * @param {boolean} [parameters.groupByOperationName] Group query result by by + * Operation Name. + * + * @param {boolean} [parameters.groupByResourceName] Group query result by + * Resource Name. + * + * @param {string} location The location upon which virtual-machine-sizes is + * queried. + * + * @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 {LogAnalyticsOperationResult} - 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. + * + * {LogAnalyticsOperationResult} [result] - The deserialized result object if an error did not occur. + * See {@link LogAnalyticsOperationResult} 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. + */ + exportRequestRateByInterval(parameters: models.RequestRateByIntervalInput, location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + exportRequestRateByInterval(parameters: models.RequestRateByIntervalInput, location: string, callback: ServiceCallback): void; + exportRequestRateByInterval(parameters: models.RequestRateByIntervalInput, location: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Export logs that show total throttled Api requests for this subscription in + * the given time window. + * + * @param {object} parameters Parameters supplied to the LogAnalytics + * getThrottledRequests Api. + * + * @param {string} parameters.blobContainerSasUri SAS Uri of the logging blob + * container to which LogAnalytics Api writes output logs to. + * + * @param {date} parameters.fromTime From time of the query + * + * @param {date} parameters.toTime To time of the query + * + * @param {boolean} [parameters.groupByThrottlePolicy] Group query result by + * Throttle Policy applied. + * + * @param {boolean} [parameters.groupByOperationName] Group query result by by + * Operation Name. + * + * @param {boolean} [parameters.groupByResourceName] Group query result by + * Resource Name. + * + * @param {string} location The location upon which virtual-machine-sizes is + * queried. + * + * @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. + */ + exportThrottledRequestsWithHttpOperationResponse(parameters: models.ThrottledRequestsInput, location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Export logs that show total throttled Api requests for this subscription in + * the given time window. + * + * @param {object} parameters Parameters supplied to the LogAnalytics + * getThrottledRequests Api. + * + * @param {string} parameters.blobContainerSasUri SAS Uri of the logging blob + * container to which LogAnalytics Api writes output logs to. + * + * @param {date} parameters.fromTime From time of the query + * + * @param {date} parameters.toTime To time of the query + * + * @param {boolean} [parameters.groupByThrottlePolicy] Group query result by + * Throttle Policy applied. + * + * @param {boolean} [parameters.groupByOperationName] Group query result by by + * Operation Name. + * + * @param {boolean} [parameters.groupByResourceName] Group query result by + * Resource Name. + * + * @param {string} location The location upon which virtual-machine-sizes is + * queried. + * + * @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 {LogAnalyticsOperationResult} - 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. + * + * {LogAnalyticsOperationResult} [result] - The deserialized result object if an error did not occur. + * See {@link LogAnalyticsOperationResult} 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. + */ + exportThrottledRequests(parameters: models.ThrottledRequestsInput, location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + exportThrottledRequests(parameters: models.ThrottledRequestsInput, location: string, callback: ServiceCallback): void; + exportThrottledRequests(parameters: models.ThrottledRequestsInput, location: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Export logs that show Api requests made by this subscription in the given + * time window to show throttling activities. + * + * @param {object} parameters Parameters supplied to the LogAnalytics + * getRequestRateByInterval Api. + * + * @param {string} parameters.intervalLength Interval value in minutes used to + * create LogAnalytics call rate logs. Possible values include: 'ThreeMins', + * 'FiveMins', 'ThirtyMins', 'SixtyMins' + * + * @param {string} parameters.blobContainerSasUri SAS Uri of the logging blob + * container to which LogAnalytics Api writes output logs to. + * + * @param {date} parameters.fromTime From time of the query + * + * @param {date} parameters.toTime To time of the query + * + * @param {boolean} [parameters.groupByThrottlePolicy] Group query result by + * Throttle Policy applied. + * + * @param {boolean} [parameters.groupByOperationName] Group query result by by + * Operation Name. + * + * @param {boolean} [parameters.groupByResourceName] Group query result by + * Resource Name. + * + * @param {string} location The location upon which virtual-machine-sizes is + * queried. + * + * @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. + */ + beginExportRequestRateByIntervalWithHttpOperationResponse(parameters: models.RequestRateByIntervalInput, location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Export logs that show Api requests made by this subscription in the given + * time window to show throttling activities. + * + * @param {object} parameters Parameters supplied to the LogAnalytics + * getRequestRateByInterval Api. + * + * @param {string} parameters.intervalLength Interval value in minutes used to + * create LogAnalytics call rate logs. Possible values include: 'ThreeMins', + * 'FiveMins', 'ThirtyMins', 'SixtyMins' + * + * @param {string} parameters.blobContainerSasUri SAS Uri of the logging blob + * container to which LogAnalytics Api writes output logs to. + * + * @param {date} parameters.fromTime From time of the query + * + * @param {date} parameters.toTime To time of the query + * + * @param {boolean} [parameters.groupByThrottlePolicy] Group query result by + * Throttle Policy applied. + * + * @param {boolean} [parameters.groupByOperationName] Group query result by by + * Operation Name. + * + * @param {boolean} [parameters.groupByResourceName] Group query result by + * Resource Name. + * + * @param {string} location The location upon which virtual-machine-sizes is + * queried. + * + * @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 {LogAnalyticsOperationResult} - 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. + * + * {LogAnalyticsOperationResult} [result] - The deserialized result object if an error did not occur. + * See {@link LogAnalyticsOperationResult} 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. + */ + beginExportRequestRateByInterval(parameters: models.RequestRateByIntervalInput, location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginExportRequestRateByInterval(parameters: models.RequestRateByIntervalInput, location: string, callback: ServiceCallback): void; + beginExportRequestRateByInterval(parameters: models.RequestRateByIntervalInput, location: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Export logs that show total throttled Api requests for this subscription in + * the given time window. + * + * @param {object} parameters Parameters supplied to the LogAnalytics + * getThrottledRequests Api. + * + * @param {string} parameters.blobContainerSasUri SAS Uri of the logging blob + * container to which LogAnalytics Api writes output logs to. + * + * @param {date} parameters.fromTime From time of the query + * + * @param {date} parameters.toTime To time of the query + * + * @param {boolean} [parameters.groupByThrottlePolicy] Group query result by + * Throttle Policy applied. + * + * @param {boolean} [parameters.groupByOperationName] Group query result by by + * Operation Name. + * + * @param {boolean} [parameters.groupByResourceName] Group query result by + * Resource Name. + * + * @param {string} location The location upon which virtual-machine-sizes is + * queried. + * + * @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. + */ + beginExportThrottledRequestsWithHttpOperationResponse(parameters: models.ThrottledRequestsInput, location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Export logs that show total throttled Api requests for this subscription in + * the given time window. + * + * @param {object} parameters Parameters supplied to the LogAnalytics + * getThrottledRequests Api. + * + * @param {string} parameters.blobContainerSasUri SAS Uri of the logging blob + * container to which LogAnalytics Api writes output logs to. + * + * @param {date} parameters.fromTime From time of the query + * + * @param {date} parameters.toTime To time of the query + * + * @param {boolean} [parameters.groupByThrottlePolicy] Group query result by + * Throttle Policy applied. + * + * @param {boolean} [parameters.groupByOperationName] Group query result by by + * Operation Name. + * + * @param {boolean} [parameters.groupByResourceName] Group query result by + * Resource Name. + * + * @param {string} location The location upon which virtual-machine-sizes is + * queried. + * + * @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 {LogAnalyticsOperationResult} - 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. + * + * {LogAnalyticsOperationResult} [result] - The deserialized result object if an error did not occur. + * See {@link LogAnalyticsOperationResult} 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. + */ + beginExportThrottledRequests(parameters: models.ThrottledRequestsInput, location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginExportThrottledRequests(parameters: models.ThrottledRequestsInput, location: string, callback: ServiceCallback): void; + beginExportThrottledRequests(parameters: models.ThrottledRequestsInput, location: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * VirtualMachineRunCommands + * __NOTE__: An instance of this class is automatically created for an + * instance of the ComputeManagementClient. + */ +export interface VirtualMachineRunCommands { + + + /** + * Lists all available run commands for a subscription in a location. + * + * @param {string} location The location upon which run commands is queried. + * + * @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. + */ + listWithHttpOperationResponse(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all available run commands for a subscription in a location. + * + * @param {string} location The location upon which run commands is queried. + * + * @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 {RunCommandListResult} - 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. + * + * {RunCommandListResult} [result] - The deserialized result object if an error did not occur. + * See {@link RunCommandListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(location: string, callback: ServiceCallback): void; + list(location: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets specific run command for a subscription in a location. + * + * @param {string} location The location upon which run commands is queried. + * + * @param {string} commandId The command id. + * + * @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(location: string, commandId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets specific run command for a subscription in a location. + * + * @param {string} location The location upon which run commands is queried. + * + * @param {string} commandId The command id. + * + * @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 {RunCommandDocument} - 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. + * + * {RunCommandDocument} [result] - The deserialized result object if an error did not occur. + * See {@link RunCommandDocument} 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(location: string, commandId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(location: string, commandId: string, callback: ServiceCallback): void; + get(location: string, commandId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists all available run commands for a subscription in a location. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all available run commands for a subscription in a location. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {RunCommandListResult} - 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. + * + * {RunCommandListResult} [result] - The deserialized result object if an error did not occur. + * See {@link RunCommandListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * ResourceSkus + * __NOTE__: An instance of this class is automatically created for an + * instance of the ComputeManagementClient. + */ +export interface ResourceSkus { + + + /** + * Gets the list of Microsoft.Compute SKUs available for your 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. + */ + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the list of Microsoft.Compute SKUs available for your 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 {ResourceSkusResult} - 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. + * + * {ResourceSkusResult} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceSkusResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the list of Microsoft.Compute SKUs available for your Subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the list of Microsoft.Compute SKUs available for your Subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ResourceSkusResult} - 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. + * + * {ResourceSkusResult} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceSkusResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * Disks + * __NOTE__: An instance of this class is automatically created for an + * instance of the ComputeManagementClient. + */ +export interface Disks { + + + /** + * Creates or updates a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @param {object} disk Disk object supplied in the body of the Put disk + * operation. + * + * @param {object} [disk.sku] + * + * @param {string} [disk.sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS' + * + * @param {array} [disk.zones] The Logical zone list for Disk. + * + * @param {string} [disk.osType] The Operating System type. Possible values + * include: 'Windows', 'Linux' + * + * @param {object} disk.creationData Disk source information. CreationData + * information cannot be changed after the disk has been created. + * + * @param {string} disk.creationData.createOption This enumerates the possible + * sources of a disk's creation. Possible values include: 'Empty', 'Attach', + * 'FromImage', 'Import', 'Copy', 'Restore' + * + * @param {string} [disk.creationData.storageAccountId] If createOption is + * Import, the Azure Resource Manager identifier of the storage account + * containing the blob to import as a disk. Required only if the blob is in a + * different subscription + * + * @param {object} [disk.creationData.imageReference] Disk source information. + * + * @param {string} disk.creationData.imageReference.id A relative uri + * containing either a Platform Imgage Repository or user image reference. + * + * @param {number} [disk.creationData.imageReference.lun] If the disk is + * created from an image's data disk, this is an index that indicates which of + * the data disks in the image to use. For OS disks, this field is null. + * + * @param {string} [disk.creationData.sourceUri] If createOption is Import, + * this is the URI of a blob to be imported into a managed disk. + * + * @param {string} [disk.creationData.sourceResourceId] If createOption is + * Copy, this is the ARM id of the source snapshot or disk. + * + * @param {number} [disk.diskSizeGB] If creationData.createOption is Empty, + * this field is mandatory and it indicates the size of the VHD to create. If + * this field is present for updates or creation with other options, it + * indicates a resize. Resizes are only allowed if the disk is not attached to + * a running VM, and can only increase the disk's size. + * + * @param {object} [disk.encryptionSettings] Encryption settings for disk or + * snapshot + * + * @param {boolean} [disk.encryptionSettings.enabled] Set this flag to true and + * provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * encryption. Set this flag to false and remove DiskEncryptionKey and + * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the + * request object, the existing settings remain unchanged. + * + * @param {object} [disk.encryptionSettings.diskEncryptionKey] Key Vault Secret + * Url and vault id of the disk encryption key + * + * @param {object} disk.encryptionSettings.diskEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} disk.encryptionSettings.diskEncryptionKey.secretUrl Url + * pointing to a key or secret in KeyVault + * + * @param {object} [disk.encryptionSettings.keyEncryptionKey] Key Vault Key Url + * and vault id of the key encryption key + * + * @param {object} disk.encryptionSettings.keyEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} [disk.encryptionSettings.keyEncryptionKey.sourceVault.id] + * Resource Id + * + * @param {string} disk.encryptionSettings.keyEncryptionKey.keyUrl Url pointing + * to a key or secret in KeyVault + * + * @param {string} disk.location Resource location + * + * @param {object} [disk.tags] Resource tags + * + * @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. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, diskName: string, disk: models.Disk, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @param {object} disk Disk object supplied in the body of the Put disk + * operation. + * + * @param {object} [disk.sku] + * + * @param {string} [disk.sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS' + * + * @param {array} [disk.zones] The Logical zone list for Disk. + * + * @param {string} [disk.osType] The Operating System type. Possible values + * include: 'Windows', 'Linux' + * + * @param {object} disk.creationData Disk source information. CreationData + * information cannot be changed after the disk has been created. + * + * @param {string} disk.creationData.createOption This enumerates the possible + * sources of a disk's creation. Possible values include: 'Empty', 'Attach', + * 'FromImage', 'Import', 'Copy', 'Restore' + * + * @param {string} [disk.creationData.storageAccountId] If createOption is + * Import, the Azure Resource Manager identifier of the storage account + * containing the blob to import as a disk. Required only if the blob is in a + * different subscription + * + * @param {object} [disk.creationData.imageReference] Disk source information. + * + * @param {string} disk.creationData.imageReference.id A relative uri + * containing either a Platform Imgage Repository or user image reference. + * + * @param {number} [disk.creationData.imageReference.lun] If the disk is + * created from an image's data disk, this is an index that indicates which of + * the data disks in the image to use. For OS disks, this field is null. + * + * @param {string} [disk.creationData.sourceUri] If createOption is Import, + * this is the URI of a blob to be imported into a managed disk. + * + * @param {string} [disk.creationData.sourceResourceId] If createOption is + * Copy, this is the ARM id of the source snapshot or disk. + * + * @param {number} [disk.diskSizeGB] If creationData.createOption is Empty, + * this field is mandatory and it indicates the size of the VHD to create. If + * this field is present for updates or creation with other options, it + * indicates a resize. Resizes are only allowed if the disk is not attached to + * a running VM, and can only increase the disk's size. + * + * @param {object} [disk.encryptionSettings] Encryption settings for disk or + * snapshot + * + * @param {boolean} [disk.encryptionSettings.enabled] Set this flag to true and + * provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * encryption. Set this flag to false and remove DiskEncryptionKey and + * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the + * request object, the existing settings remain unchanged. + * + * @param {object} [disk.encryptionSettings.diskEncryptionKey] Key Vault Secret + * Url and vault id of the disk encryption key + * + * @param {object} disk.encryptionSettings.diskEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} disk.encryptionSettings.diskEncryptionKey.secretUrl Url + * pointing to a key or secret in KeyVault + * + * @param {object} [disk.encryptionSettings.keyEncryptionKey] Key Vault Key Url + * and vault id of the key encryption key + * + * @param {object} disk.encryptionSettings.keyEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} [disk.encryptionSettings.keyEncryptionKey.sourceVault.id] + * Resource Id + * + * @param {string} disk.encryptionSettings.keyEncryptionKey.keyUrl Url pointing + * to a key or secret in KeyVault + * + * @param {string} disk.location Resource location + * + * @param {object} [disk.tags] Resource tags + * + * @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 {Disk} - 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. + * + * {Disk} [result] - The deserialized result object if an error did not occur. + * See {@link Disk} 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. + */ + createOrUpdate(resourceGroupName: string, diskName: string, disk: models.Disk, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, diskName: string, disk: models.Disk, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, diskName: string, disk: models.Disk, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates (patches) a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @param {object} disk Disk object supplied in the body of the Patch disk + * operation. + * + * @param {string} [disk.osType] the Operating System type. Possible values + * include: 'Windows', 'Linux' + * + * @param {number} [disk.diskSizeGB] If creationData.createOption is Empty, + * this field is mandatory and it indicates the size of the VHD to create. If + * this field is present for updates or creation with other options, it + * indicates a resize. Resizes are only allowed if the disk is not attached to + * a running VM, and can only increase the disk's size. + * + * @param {object} [disk.encryptionSettings] Encryption settings for disk or + * snapshot + * + * @param {boolean} [disk.encryptionSettings.enabled] Set this flag to true and + * provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * encryption. Set this flag to false and remove DiskEncryptionKey and + * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the + * request object, the existing settings remain unchanged. + * + * @param {object} [disk.encryptionSettings.diskEncryptionKey] Key Vault Secret + * Url and vault id of the disk encryption key + * + * @param {object} disk.encryptionSettings.diskEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} disk.encryptionSettings.diskEncryptionKey.secretUrl Url + * pointing to a key or secret in KeyVault + * + * @param {object} [disk.encryptionSettings.keyEncryptionKey] Key Vault Key Url + * and vault id of the key encryption key + * + * @param {object} disk.encryptionSettings.keyEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} [disk.encryptionSettings.keyEncryptionKey.sourceVault.id] + * Resource Id + * + * @param {string} disk.encryptionSettings.keyEncryptionKey.keyUrl Url pointing + * to a key or secret in KeyVault + * + * @param {object} [disk.tags] Resource tags + * + * @param {object} [disk.sku] + * + * @param {string} [disk.sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + updateWithHttpOperationResponse(resourceGroupName: string, diskName: string, disk: models.DiskUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates (patches) a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @param {object} disk Disk object supplied in the body of the Patch disk + * operation. + * + * @param {string} [disk.osType] the Operating System type. Possible values + * include: 'Windows', 'Linux' + * + * @param {number} [disk.diskSizeGB] If creationData.createOption is Empty, + * this field is mandatory and it indicates the size of the VHD to create. If + * this field is present for updates or creation with other options, it + * indicates a resize. Resizes are only allowed if the disk is not attached to + * a running VM, and can only increase the disk's size. + * + * @param {object} [disk.encryptionSettings] Encryption settings for disk or + * snapshot + * + * @param {boolean} [disk.encryptionSettings.enabled] Set this flag to true and + * provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * encryption. Set this flag to false and remove DiskEncryptionKey and + * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the + * request object, the existing settings remain unchanged. + * + * @param {object} [disk.encryptionSettings.diskEncryptionKey] Key Vault Secret + * Url and vault id of the disk encryption key + * + * @param {object} disk.encryptionSettings.diskEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} disk.encryptionSettings.diskEncryptionKey.secretUrl Url + * pointing to a key or secret in KeyVault + * + * @param {object} [disk.encryptionSettings.keyEncryptionKey] Key Vault Key Url + * and vault id of the key encryption key + * + * @param {object} disk.encryptionSettings.keyEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} [disk.encryptionSettings.keyEncryptionKey.sourceVault.id] + * Resource Id + * + * @param {string} disk.encryptionSettings.keyEncryptionKey.keyUrl Url pointing + * to a key or secret in KeyVault + * + * @param {object} [disk.tags] Resource tags + * + * @param {object} [disk.sku] + * + * @param {string} [disk.sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS' + * + * @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 {Disk} - 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. + * + * {Disk} [result] - The deserialized result object if an error did not occur. + * See {@link Disk} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + update(resourceGroupName: string, diskName: string, disk: models.DiskUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, diskName: string, disk: models.DiskUpdate, callback: ServiceCallback): void; + update(resourceGroupName: string, diskName: string, disk: models.DiskUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets information about a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, diskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets information about a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @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 {Disk} - 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. + * + * {Disk} [result] - The deserialized result object if an error did not occur. + * See {@link Disk} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, diskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, diskName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, diskName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, diskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + deleteMethod(resourceGroupName: string, diskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, diskName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, diskName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists all the disks under a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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. + */ + listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all the disks under a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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 {DiskList} - 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. + * + * {DiskList} [result] - The deserialized result object if an error did not occur. + * See {@link DiskList} 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. + */ + 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; + + + /** + * Lists all the disks under a 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. + */ + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all the disks under a 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 {DiskList} - 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. + * + * {DiskList} [result] - The deserialized result object if an error did not occur. + * See {@link DiskList} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Grants access to a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @param {object} grantAccessData Access data object supplied in the body of + * the get disk access operation. + * + * @param {string} grantAccessData.access Possible values include: 'None', + * 'Read' + * + * @param {number} grantAccessData.durationInSeconds Time duration in seconds + * until the SAS access expires. + * + * @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. + */ + grantAccessWithHttpOperationResponse(resourceGroupName: string, diskName: string, grantAccessData: models.GrantAccessData, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Grants access to a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @param {object} grantAccessData Access data object supplied in the body of + * the get disk access operation. + * + * @param {string} grantAccessData.access Possible values include: 'None', + * 'Read' + * + * @param {number} grantAccessData.durationInSeconds Time duration in seconds + * until the SAS access expires. + * + * @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 {AccessUri} - 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. + * + * {AccessUri} [result] - The deserialized result object if an error did not occur. + * See {@link AccessUri} 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. + */ + grantAccess(resourceGroupName: string, diskName: string, grantAccessData: models.GrantAccessData, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + grantAccess(resourceGroupName: string, diskName: string, grantAccessData: models.GrantAccessData, callback: ServiceCallback): void; + grantAccess(resourceGroupName: string, diskName: string, grantAccessData: models.GrantAccessData, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Revokes access to a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @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. + */ + revokeAccessWithHttpOperationResponse(resourceGroupName: string, diskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Revokes access to a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + revokeAccess(resourceGroupName: string, diskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + revokeAccess(resourceGroupName: string, diskName: string, callback: ServiceCallback): void; + revokeAccess(resourceGroupName: string, diskName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @param {object} disk Disk object supplied in the body of the Put disk + * operation. + * + * @param {object} [disk.sku] + * + * @param {string} [disk.sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS' + * + * @param {array} [disk.zones] The Logical zone list for Disk. + * + * @param {string} [disk.osType] The Operating System type. Possible values + * include: 'Windows', 'Linux' + * + * @param {object} disk.creationData Disk source information. CreationData + * information cannot be changed after the disk has been created. + * + * @param {string} disk.creationData.createOption This enumerates the possible + * sources of a disk's creation. Possible values include: 'Empty', 'Attach', + * 'FromImage', 'Import', 'Copy', 'Restore' + * + * @param {string} [disk.creationData.storageAccountId] If createOption is + * Import, the Azure Resource Manager identifier of the storage account + * containing the blob to import as a disk. Required only if the blob is in a + * different subscription + * + * @param {object} [disk.creationData.imageReference] Disk source information. + * + * @param {string} disk.creationData.imageReference.id A relative uri + * containing either a Platform Imgage Repository or user image reference. + * + * @param {number} [disk.creationData.imageReference.lun] If the disk is + * created from an image's data disk, this is an index that indicates which of + * the data disks in the image to use. For OS disks, this field is null. + * + * @param {string} [disk.creationData.sourceUri] If createOption is Import, + * this is the URI of a blob to be imported into a managed disk. + * + * @param {string} [disk.creationData.sourceResourceId] If createOption is + * Copy, this is the ARM id of the source snapshot or disk. + * + * @param {number} [disk.diskSizeGB] If creationData.createOption is Empty, + * this field is mandatory and it indicates the size of the VHD to create. If + * this field is present for updates or creation with other options, it + * indicates a resize. Resizes are only allowed if the disk is not attached to + * a running VM, and can only increase the disk's size. + * + * @param {object} [disk.encryptionSettings] Encryption settings for disk or + * snapshot + * + * @param {boolean} [disk.encryptionSettings.enabled] Set this flag to true and + * provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * encryption. Set this flag to false and remove DiskEncryptionKey and + * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the + * request object, the existing settings remain unchanged. + * + * @param {object} [disk.encryptionSettings.diskEncryptionKey] Key Vault Secret + * Url and vault id of the disk encryption key + * + * @param {object} disk.encryptionSettings.diskEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} disk.encryptionSettings.diskEncryptionKey.secretUrl Url + * pointing to a key or secret in KeyVault + * + * @param {object} [disk.encryptionSettings.keyEncryptionKey] Key Vault Key Url + * and vault id of the key encryption key + * + * @param {object} disk.encryptionSettings.keyEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} [disk.encryptionSettings.keyEncryptionKey.sourceVault.id] + * Resource Id + * + * @param {string} disk.encryptionSettings.keyEncryptionKey.keyUrl Url pointing + * to a key or secret in KeyVault + * + * @param {string} disk.location Resource location + * + * @param {object} [disk.tags] Resource tags + * + * @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. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, diskName: string, disk: models.Disk, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @param {object} disk Disk object supplied in the body of the Put disk + * operation. + * + * @param {object} [disk.sku] + * + * @param {string} [disk.sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS' + * + * @param {array} [disk.zones] The Logical zone list for Disk. + * + * @param {string} [disk.osType] The Operating System type. Possible values + * include: 'Windows', 'Linux' + * + * @param {object} disk.creationData Disk source information. CreationData + * information cannot be changed after the disk has been created. + * + * @param {string} disk.creationData.createOption This enumerates the possible + * sources of a disk's creation. Possible values include: 'Empty', 'Attach', + * 'FromImage', 'Import', 'Copy', 'Restore' + * + * @param {string} [disk.creationData.storageAccountId] If createOption is + * Import, the Azure Resource Manager identifier of the storage account + * containing the blob to import as a disk. Required only if the blob is in a + * different subscription + * + * @param {object} [disk.creationData.imageReference] Disk source information. + * + * @param {string} disk.creationData.imageReference.id A relative uri + * containing either a Platform Imgage Repository or user image reference. + * + * @param {number} [disk.creationData.imageReference.lun] If the disk is + * created from an image's data disk, this is an index that indicates which of + * the data disks in the image to use. For OS disks, this field is null. + * + * @param {string} [disk.creationData.sourceUri] If createOption is Import, + * this is the URI of a blob to be imported into a managed disk. + * + * @param {string} [disk.creationData.sourceResourceId] If createOption is + * Copy, this is the ARM id of the source snapshot or disk. + * + * @param {number} [disk.diskSizeGB] If creationData.createOption is Empty, + * this field is mandatory and it indicates the size of the VHD to create. If + * this field is present for updates or creation with other options, it + * indicates a resize. Resizes are only allowed if the disk is not attached to + * a running VM, and can only increase the disk's size. + * + * @param {object} [disk.encryptionSettings] Encryption settings for disk or + * snapshot + * + * @param {boolean} [disk.encryptionSettings.enabled] Set this flag to true and + * provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * encryption. Set this flag to false and remove DiskEncryptionKey and + * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the + * request object, the existing settings remain unchanged. + * + * @param {object} [disk.encryptionSettings.diskEncryptionKey] Key Vault Secret + * Url and vault id of the disk encryption key + * + * @param {object} disk.encryptionSettings.diskEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} disk.encryptionSettings.diskEncryptionKey.secretUrl Url + * pointing to a key or secret in KeyVault + * + * @param {object} [disk.encryptionSettings.keyEncryptionKey] Key Vault Key Url + * and vault id of the key encryption key + * + * @param {object} disk.encryptionSettings.keyEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} [disk.encryptionSettings.keyEncryptionKey.sourceVault.id] + * Resource Id + * + * @param {string} disk.encryptionSettings.keyEncryptionKey.keyUrl Url pointing + * to a key or secret in KeyVault + * + * @param {string} disk.location Resource location + * + * @param {object} [disk.tags] Resource tags + * + * @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 {Disk} - 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. + * + * {Disk} [result] - The deserialized result object if an error did not occur. + * See {@link Disk} 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. + */ + beginCreateOrUpdate(resourceGroupName: string, diskName: string, disk: models.Disk, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, diskName: string, disk: models.Disk, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, diskName: string, disk: models.Disk, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates (patches) a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @param {object} disk Disk object supplied in the body of the Patch disk + * operation. + * + * @param {string} [disk.osType] the Operating System type. Possible values + * include: 'Windows', 'Linux' + * + * @param {number} [disk.diskSizeGB] If creationData.createOption is Empty, + * this field is mandatory and it indicates the size of the VHD to create. If + * this field is present for updates or creation with other options, it + * indicates a resize. Resizes are only allowed if the disk is not attached to + * a running VM, and can only increase the disk's size. + * + * @param {object} [disk.encryptionSettings] Encryption settings for disk or + * snapshot + * + * @param {boolean} [disk.encryptionSettings.enabled] Set this flag to true and + * provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * encryption. Set this flag to false and remove DiskEncryptionKey and + * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the + * request object, the existing settings remain unchanged. + * + * @param {object} [disk.encryptionSettings.diskEncryptionKey] Key Vault Secret + * Url and vault id of the disk encryption key + * + * @param {object} disk.encryptionSettings.diskEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} disk.encryptionSettings.diskEncryptionKey.secretUrl Url + * pointing to a key or secret in KeyVault + * + * @param {object} [disk.encryptionSettings.keyEncryptionKey] Key Vault Key Url + * and vault id of the key encryption key + * + * @param {object} disk.encryptionSettings.keyEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} [disk.encryptionSettings.keyEncryptionKey.sourceVault.id] + * Resource Id + * + * @param {string} disk.encryptionSettings.keyEncryptionKey.keyUrl Url pointing + * to a key or secret in KeyVault + * + * @param {object} [disk.tags] Resource tags + * + * @param {object} [disk.sku] + * + * @param {string} [disk.sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginUpdateWithHttpOperationResponse(resourceGroupName: string, diskName: string, disk: models.DiskUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates (patches) a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @param {object} disk Disk object supplied in the body of the Patch disk + * operation. + * + * @param {string} [disk.osType] the Operating System type. Possible values + * include: 'Windows', 'Linux' + * + * @param {number} [disk.diskSizeGB] If creationData.createOption is Empty, + * this field is mandatory and it indicates the size of the VHD to create. If + * this field is present for updates or creation with other options, it + * indicates a resize. Resizes are only allowed if the disk is not attached to + * a running VM, and can only increase the disk's size. + * + * @param {object} [disk.encryptionSettings] Encryption settings for disk or + * snapshot + * + * @param {boolean} [disk.encryptionSettings.enabled] Set this flag to true and + * provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * encryption. Set this flag to false and remove DiskEncryptionKey and + * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the + * request object, the existing settings remain unchanged. + * + * @param {object} [disk.encryptionSettings.diskEncryptionKey] Key Vault Secret + * Url and vault id of the disk encryption key + * + * @param {object} disk.encryptionSettings.diskEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} disk.encryptionSettings.diskEncryptionKey.secretUrl Url + * pointing to a key or secret in KeyVault + * + * @param {object} [disk.encryptionSettings.keyEncryptionKey] Key Vault Key Url + * and vault id of the key encryption key + * + * @param {object} disk.encryptionSettings.keyEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} [disk.encryptionSettings.keyEncryptionKey.sourceVault.id] + * Resource Id + * + * @param {string} disk.encryptionSettings.keyEncryptionKey.keyUrl Url pointing + * to a key or secret in KeyVault + * + * @param {object} [disk.tags] Resource tags + * + * @param {object} [disk.sku] + * + * @param {string} [disk.sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS' + * + * @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 {Disk} - 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. + * + * {Disk} [result] - The deserialized result object if an error did not occur. + * See {@link Disk} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginUpdate(resourceGroupName: string, diskName: string, disk: models.DiskUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdate(resourceGroupName: string, diskName: string, disk: models.DiskUpdate, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, diskName: string, disk: models.DiskUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @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. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, diskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + beginDeleteMethod(resourceGroupName: string, diskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, diskName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, diskName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Grants access to a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @param {object} grantAccessData Access data object supplied in the body of + * the get disk access operation. + * + * @param {string} grantAccessData.access Possible values include: 'None', + * 'Read' + * + * @param {number} grantAccessData.durationInSeconds Time duration in seconds + * until the SAS access expires. + * + * @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. + */ + beginGrantAccessWithHttpOperationResponse(resourceGroupName: string, diskName: string, grantAccessData: models.GrantAccessData, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Grants access to a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @param {object} grantAccessData Access data object supplied in the body of + * the get disk access operation. + * + * @param {string} grantAccessData.access Possible values include: 'None', + * 'Read' + * + * @param {number} grantAccessData.durationInSeconds Time duration in seconds + * until the SAS access expires. + * + * @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 {AccessUri} - 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. + * + * {AccessUri} [result] - The deserialized result object if an error did not occur. + * See {@link AccessUri} 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. + */ + beginGrantAccess(resourceGroupName: string, diskName: string, grantAccessData: models.GrantAccessData, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginGrantAccess(resourceGroupName: string, diskName: string, grantAccessData: models.GrantAccessData, callback: ServiceCallback): void; + beginGrantAccess(resourceGroupName: string, diskName: string, grantAccessData: models.GrantAccessData, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Revokes access to a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @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. + */ + beginRevokeAccessWithHttpOperationResponse(resourceGroupName: string, diskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Revokes access to a disk. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} diskName The name of the managed disk that is being created. + * The name can't be changed after the disk is created. Supported characters + * for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 + * characters. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + beginRevokeAccess(resourceGroupName: string, diskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginRevokeAccess(resourceGroupName: string, diskName: string, callback: ServiceCallback): void; + beginRevokeAccess(resourceGroupName: string, diskName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists all the disks under a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all the disks under a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DiskList} - 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. + * + * {DiskList} [result] - The deserialized result object if an error did not occur. + * See {@link DiskList} 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. + */ + listByResourceGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists all the disks under a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all the disks under a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DiskList} - 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. + * + * {DiskList} [result] - The deserialized result object if an error did not occur. + * See {@link DiskList} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * Snapshots + * __NOTE__: An instance of this class is automatically created for an + * instance of the ComputeManagementClient. + */ +export interface Snapshots { + + + /** + * Creates or updates a snapshot. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. + * + * @param {object} snapshot Snapshot object supplied in the body of the Put + * disk operation. + * + * @param {object} [snapshot.sku] + * + * @param {string} [snapshot.sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS', 'Standard_ZRS' + * + * @param {string} [snapshot.osType] The Operating System type. Possible values + * include: 'Windows', 'Linux' + * + * @param {object} snapshot.creationData Disk source information. CreationData + * information cannot be changed after the disk has been created. + * + * @param {string} snapshot.creationData.createOption This enumerates the + * possible sources of a disk's creation. Possible values include: 'Empty', + * 'Attach', 'FromImage', 'Import', 'Copy', 'Restore' + * + * @param {string} [snapshot.creationData.storageAccountId] If createOption is + * Import, the Azure Resource Manager identifier of the storage account + * containing the blob to import as a disk. Required only if the blob is in a + * different subscription + * + * @param {object} [snapshot.creationData.imageReference] Disk source + * information. + * + * @param {string} snapshot.creationData.imageReference.id A relative uri + * containing either a Platform Imgage Repository or user image reference. + * + * @param {number} [snapshot.creationData.imageReference.lun] If the disk is + * created from an image's data disk, this is an index that indicates which of + * the data disks in the image to use. For OS disks, this field is null. + * + * @param {string} [snapshot.creationData.sourceUri] If createOption is Import, + * this is the URI of a blob to be imported into a managed disk. + * + * @param {string} [snapshot.creationData.sourceResourceId] If createOption is + * Copy, this is the ARM id of the source snapshot or disk. + * + * @param {number} [snapshot.diskSizeGB] If creationData.createOption is Empty, + * this field is mandatory and it indicates the size of the VHD to create. If + * this field is present for updates or creation with other options, it + * indicates a resize. Resizes are only allowed if the disk is not attached to + * a running VM, and can only increase the disk's size. + * + * @param {object} [snapshot.encryptionSettings] Encryption settings for disk + * or snapshot + * + * @param {boolean} [snapshot.encryptionSettings.enabled] Set this flag to true + * and provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * encryption. Set this flag to false and remove DiskEncryptionKey and + * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the + * request object, the existing settings remain unchanged. + * + * @param {object} [snapshot.encryptionSettings.diskEncryptionKey] Key Vault + * Secret Url and vault id of the disk encryption key + * + * @param {object} snapshot.encryptionSettings.diskEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} snapshot.encryptionSettings.diskEncryptionKey.secretUrl Url + * pointing to a key or secret in KeyVault + * + * @param {object} [snapshot.encryptionSettings.keyEncryptionKey] Key Vault Key + * Url and vault id of the key encryption key + * + * @param {object} snapshot.encryptionSettings.keyEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} + * [snapshot.encryptionSettings.keyEncryptionKey.sourceVault.id] Resource Id + * + * @param {string} snapshot.encryptionSettings.keyEncryptionKey.keyUrl Url + * pointing to a key or secret in KeyVault + * + * @param {string} snapshot.location Resource location + * + * @param {object} [snapshot.tags] Resource tags + * + * @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. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, snapshotName: string, snapshot: models.Snapshot, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a snapshot. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. + * + * @param {object} snapshot Snapshot object supplied in the body of the Put + * disk operation. + * + * @param {object} [snapshot.sku] + * + * @param {string} [snapshot.sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS', 'Standard_ZRS' + * + * @param {string} [snapshot.osType] The Operating System type. Possible values + * include: 'Windows', 'Linux' + * + * @param {object} snapshot.creationData Disk source information. CreationData + * information cannot be changed after the disk has been created. + * + * @param {string} snapshot.creationData.createOption This enumerates the + * possible sources of a disk's creation. Possible values include: 'Empty', + * 'Attach', 'FromImage', 'Import', 'Copy', 'Restore' + * + * @param {string} [snapshot.creationData.storageAccountId] If createOption is + * Import, the Azure Resource Manager identifier of the storage account + * containing the blob to import as a disk. Required only if the blob is in a + * different subscription + * + * @param {object} [snapshot.creationData.imageReference] Disk source + * information. + * + * @param {string} snapshot.creationData.imageReference.id A relative uri + * containing either a Platform Imgage Repository or user image reference. + * + * @param {number} [snapshot.creationData.imageReference.lun] If the disk is + * created from an image's data disk, this is an index that indicates which of + * the data disks in the image to use. For OS disks, this field is null. + * + * @param {string} [snapshot.creationData.sourceUri] If createOption is Import, + * this is the URI of a blob to be imported into a managed disk. + * + * @param {string} [snapshot.creationData.sourceResourceId] If createOption is + * Copy, this is the ARM id of the source snapshot or disk. + * + * @param {number} [snapshot.diskSizeGB] If creationData.createOption is Empty, + * this field is mandatory and it indicates the size of the VHD to create. If + * this field is present for updates or creation with other options, it + * indicates a resize. Resizes are only allowed if the disk is not attached to + * a running VM, and can only increase the disk's size. + * + * @param {object} [snapshot.encryptionSettings] Encryption settings for disk + * or snapshot + * + * @param {boolean} [snapshot.encryptionSettings.enabled] Set this flag to true + * and provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * encryption. Set this flag to false and remove DiskEncryptionKey and + * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the + * request object, the existing settings remain unchanged. + * + * @param {object} [snapshot.encryptionSettings.diskEncryptionKey] Key Vault + * Secret Url and vault id of the disk encryption key + * + * @param {object} snapshot.encryptionSettings.diskEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} snapshot.encryptionSettings.diskEncryptionKey.secretUrl Url + * pointing to a key or secret in KeyVault + * + * @param {object} [snapshot.encryptionSettings.keyEncryptionKey] Key Vault Key + * Url and vault id of the key encryption key + * + * @param {object} snapshot.encryptionSettings.keyEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} + * [snapshot.encryptionSettings.keyEncryptionKey.sourceVault.id] Resource Id + * + * @param {string} snapshot.encryptionSettings.keyEncryptionKey.keyUrl Url + * pointing to a key or secret in KeyVault + * + * @param {string} snapshot.location Resource location + * + * @param {object} [snapshot.tags] Resource tags + * + * @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 {Snapshot} - 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. + * + * {Snapshot} [result] - The deserialized result object if an error did not occur. + * See {@link Snapshot} 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. + */ + createOrUpdate(resourceGroupName: string, snapshotName: string, snapshot: models.Snapshot, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, snapshotName: string, snapshot: models.Snapshot, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, snapshotName: string, snapshot: models.Snapshot, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates (patches) a snapshot. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. + * + * @param {object} snapshot Snapshot object supplied in the body of the Patch + * snapshot operation. + * + * @param {string} [snapshot.osType] the Operating System type. Possible values + * include: 'Windows', 'Linux' + * + * @param {number} [snapshot.diskSizeGB] If creationData.createOption is Empty, + * this field is mandatory and it indicates the size of the VHD to create. If + * this field is present for updates or creation with other options, it + * indicates a resize. Resizes are only allowed if the disk is not attached to + * a running VM, and can only increase the disk's size. + * + * @param {object} [snapshot.encryptionSettings] Encryption settings for disk + * or snapshot + * + * @param {boolean} [snapshot.encryptionSettings.enabled] Set this flag to true + * and provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * encryption. Set this flag to false and remove DiskEncryptionKey and + * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the + * request object, the existing settings remain unchanged. + * + * @param {object} [snapshot.encryptionSettings.diskEncryptionKey] Key Vault + * Secret Url and vault id of the disk encryption key + * + * @param {object} snapshot.encryptionSettings.diskEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} snapshot.encryptionSettings.diskEncryptionKey.secretUrl Url + * pointing to a key or secret in KeyVault + * + * @param {object} [snapshot.encryptionSettings.keyEncryptionKey] Key Vault Key + * Url and vault id of the key encryption key + * + * @param {object} snapshot.encryptionSettings.keyEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} + * [snapshot.encryptionSettings.keyEncryptionKey.sourceVault.id] Resource Id + * + * @param {string} snapshot.encryptionSettings.keyEncryptionKey.keyUrl Url + * pointing to a key or secret in KeyVault + * + * @param {object} [snapshot.tags] Resource tags + * + * @param {object} [snapshot.sku] + * + * @param {string} [snapshot.sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + updateWithHttpOperationResponse(resourceGroupName: string, snapshotName: string, snapshot: models.SnapshotUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates (patches) a snapshot. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. + * + * @param {object} snapshot Snapshot object supplied in the body of the Patch + * snapshot operation. + * + * @param {string} [snapshot.osType] the Operating System type. Possible values + * include: 'Windows', 'Linux' + * + * @param {number} [snapshot.diskSizeGB] If creationData.createOption is Empty, + * this field is mandatory and it indicates the size of the VHD to create. If + * this field is present for updates or creation with other options, it + * indicates a resize. Resizes are only allowed if the disk is not attached to + * a running VM, and can only increase the disk's size. + * + * @param {object} [snapshot.encryptionSettings] Encryption settings for disk + * or snapshot + * + * @param {boolean} [snapshot.encryptionSettings.enabled] Set this flag to true + * and provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * encryption. Set this flag to false and remove DiskEncryptionKey and + * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the + * request object, the existing settings remain unchanged. + * + * @param {object} [snapshot.encryptionSettings.diskEncryptionKey] Key Vault + * Secret Url and vault id of the disk encryption key + * + * @param {object} snapshot.encryptionSettings.diskEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} snapshot.encryptionSettings.diskEncryptionKey.secretUrl Url + * pointing to a key or secret in KeyVault + * + * @param {object} [snapshot.encryptionSettings.keyEncryptionKey] Key Vault Key + * Url and vault id of the key encryption key + * + * @param {object} snapshot.encryptionSettings.keyEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} + * [snapshot.encryptionSettings.keyEncryptionKey.sourceVault.id] Resource Id + * + * @param {string} snapshot.encryptionSettings.keyEncryptionKey.keyUrl Url + * pointing to a key or secret in KeyVault + * + * @param {object} [snapshot.tags] Resource tags + * + * @param {object} [snapshot.sku] + * + * @param {string} [snapshot.sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS' + * + * @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 {Snapshot} - 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. + * + * {Snapshot} [result] - The deserialized result object if an error did not occur. + * See {@link Snapshot} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + update(resourceGroupName: string, snapshotName: string, snapshot: models.SnapshotUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, snapshotName: string, snapshot: models.SnapshotUpdate, callback: ServiceCallback): void; + update(resourceGroupName: string, snapshotName: string, snapshot: models.SnapshotUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets information about a snapshot. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, snapshotName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets information about a snapshot. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. + * + * @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 {Snapshot} - 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. + * + * {Snapshot} [result] - The deserialized result object if an error did not occur. + * See {@link Snapshot} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, snapshotName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, snapshotName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, snapshotName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes a snapshot. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. + * + * @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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, snapshotName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes a snapshot. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + deleteMethod(resourceGroupName: string, snapshotName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, snapshotName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, snapshotName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists snapshots under a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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. + */ + listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists snapshots under a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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 {SnapshotList} - 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. + * + * {SnapshotList} [result] - The deserialized result object if an error did not occur. + * See {@link SnapshotList} 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. + */ + 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; + + + /** + * Lists snapshots under a 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. + */ + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists snapshots under a 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 {SnapshotList} - 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. + * + * {SnapshotList} [result] - The deserialized result object if an error did not occur. + * See {@link SnapshotList} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Grants access to a snapshot. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. + * + * @param {object} grantAccessData Access data object supplied in the body of + * the get snapshot access operation. + * + * @param {string} grantAccessData.access Possible values include: 'None', + * 'Read' + * + * @param {number} grantAccessData.durationInSeconds Time duration in seconds + * until the SAS access expires. + * + * @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. + */ + grantAccessWithHttpOperationResponse(resourceGroupName: string, snapshotName: string, grantAccessData: models.GrantAccessData, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Grants access to a snapshot. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. + * + * @param {object} grantAccessData Access data object supplied in the body of + * the get snapshot access operation. + * + * @param {string} grantAccessData.access Possible values include: 'None', + * 'Read' + * + * @param {number} grantAccessData.durationInSeconds Time duration in seconds + * until the SAS access expires. + * + * @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 {AccessUri} - 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. + * + * {AccessUri} [result] - The deserialized result object if an error did not occur. + * See {@link AccessUri} 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. + */ + grantAccess(resourceGroupName: string, snapshotName: string, grantAccessData: models.GrantAccessData, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + grantAccess(resourceGroupName: string, snapshotName: string, grantAccessData: models.GrantAccessData, callback: ServiceCallback): void; + grantAccess(resourceGroupName: string, snapshotName: string, grantAccessData: models.GrantAccessData, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Revokes access to a snapshot. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. + * + * @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. + */ + revokeAccessWithHttpOperationResponse(resourceGroupName: string, snapshotName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Revokes access to a snapshot. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + revokeAccess(resourceGroupName: string, snapshotName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + revokeAccess(resourceGroupName: string, snapshotName: string, callback: ServiceCallback): void; + revokeAccess(resourceGroupName: string, snapshotName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates a snapshot. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. + * + * @param {object} snapshot Snapshot object supplied in the body of the Put + * disk operation. + * + * @param {object} [snapshot.sku] + * + * @param {string} [snapshot.sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS', 'Standard_ZRS' + * + * @param {string} [snapshot.osType] The Operating System type. Possible values + * include: 'Windows', 'Linux' + * + * @param {object} snapshot.creationData Disk source information. CreationData + * information cannot be changed after the disk has been created. + * + * @param {string} snapshot.creationData.createOption This enumerates the + * possible sources of a disk's creation. Possible values include: 'Empty', + * 'Attach', 'FromImage', 'Import', 'Copy', 'Restore' + * + * @param {string} [snapshot.creationData.storageAccountId] If createOption is + * Import, the Azure Resource Manager identifier of the storage account + * containing the blob to import as a disk. Required only if the blob is in a + * different subscription + * + * @param {object} [snapshot.creationData.imageReference] Disk source + * information. + * + * @param {string} snapshot.creationData.imageReference.id A relative uri + * containing either a Platform Imgage Repository or user image reference. + * + * @param {number} [snapshot.creationData.imageReference.lun] If the disk is + * created from an image's data disk, this is an index that indicates which of + * the data disks in the image to use. For OS disks, this field is null. + * + * @param {string} [snapshot.creationData.sourceUri] If createOption is Import, + * this is the URI of a blob to be imported into a managed disk. + * + * @param {string} [snapshot.creationData.sourceResourceId] If createOption is + * Copy, this is the ARM id of the source snapshot or disk. + * + * @param {number} [snapshot.diskSizeGB] If creationData.createOption is Empty, + * this field is mandatory and it indicates the size of the VHD to create. If + * this field is present for updates or creation with other options, it + * indicates a resize. Resizes are only allowed if the disk is not attached to + * a running VM, and can only increase the disk's size. + * + * @param {object} [snapshot.encryptionSettings] Encryption settings for disk + * or snapshot + * + * @param {boolean} [snapshot.encryptionSettings.enabled] Set this flag to true + * and provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * encryption. Set this flag to false and remove DiskEncryptionKey and + * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the + * request object, the existing settings remain unchanged. + * + * @param {object} [snapshot.encryptionSettings.diskEncryptionKey] Key Vault + * Secret Url and vault id of the disk encryption key + * + * @param {object} snapshot.encryptionSettings.diskEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} snapshot.encryptionSettings.diskEncryptionKey.secretUrl Url + * pointing to a key or secret in KeyVault + * + * @param {object} [snapshot.encryptionSettings.keyEncryptionKey] Key Vault Key + * Url and vault id of the key encryption key + * + * @param {object} snapshot.encryptionSettings.keyEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} + * [snapshot.encryptionSettings.keyEncryptionKey.sourceVault.id] Resource Id + * + * @param {string} snapshot.encryptionSettings.keyEncryptionKey.keyUrl Url + * pointing to a key or secret in KeyVault + * + * @param {string} snapshot.location Resource location + * + * @param {object} [snapshot.tags] Resource tags + * + * @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. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, snapshotName: string, snapshot: models.Snapshot, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a snapshot. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. + * + * @param {object} snapshot Snapshot object supplied in the body of the Put + * disk operation. + * + * @param {object} [snapshot.sku] + * + * @param {string} [snapshot.sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS', 'Standard_ZRS' + * + * @param {string} [snapshot.osType] The Operating System type. Possible values + * include: 'Windows', 'Linux' + * + * @param {object} snapshot.creationData Disk source information. CreationData + * information cannot be changed after the disk has been created. + * + * @param {string} snapshot.creationData.createOption This enumerates the + * possible sources of a disk's creation. Possible values include: 'Empty', + * 'Attach', 'FromImage', 'Import', 'Copy', 'Restore' + * + * @param {string} [snapshot.creationData.storageAccountId] If createOption is + * Import, the Azure Resource Manager identifier of the storage account + * containing the blob to import as a disk. Required only if the blob is in a + * different subscription + * + * @param {object} [snapshot.creationData.imageReference] Disk source + * information. + * + * @param {string} snapshot.creationData.imageReference.id A relative uri + * containing either a Platform Imgage Repository or user image reference. + * + * @param {number} [snapshot.creationData.imageReference.lun] If the disk is + * created from an image's data disk, this is an index that indicates which of + * the data disks in the image to use. For OS disks, this field is null. + * + * @param {string} [snapshot.creationData.sourceUri] If createOption is Import, + * this is the URI of a blob to be imported into a managed disk. + * + * @param {string} [snapshot.creationData.sourceResourceId] If createOption is + * Copy, this is the ARM id of the source snapshot or disk. + * + * @param {number} [snapshot.diskSizeGB] If creationData.createOption is Empty, + * this field is mandatory and it indicates the size of the VHD to create. If + * this field is present for updates or creation with other options, it + * indicates a resize. Resizes are only allowed if the disk is not attached to + * a running VM, and can only increase the disk's size. + * + * @param {object} [snapshot.encryptionSettings] Encryption settings for disk + * or snapshot + * + * @param {boolean} [snapshot.encryptionSettings.enabled] Set this flag to true + * and provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * encryption. Set this flag to false and remove DiskEncryptionKey and + * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the + * request object, the existing settings remain unchanged. + * + * @param {object} [snapshot.encryptionSettings.diskEncryptionKey] Key Vault + * Secret Url and vault id of the disk encryption key + * + * @param {object} snapshot.encryptionSettings.diskEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} snapshot.encryptionSettings.diskEncryptionKey.secretUrl Url + * pointing to a key or secret in KeyVault + * + * @param {object} [snapshot.encryptionSettings.keyEncryptionKey] Key Vault Key + * Url and vault id of the key encryption key + * + * @param {object} snapshot.encryptionSettings.keyEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} + * [snapshot.encryptionSettings.keyEncryptionKey.sourceVault.id] Resource Id + * + * @param {string} snapshot.encryptionSettings.keyEncryptionKey.keyUrl Url + * pointing to a key or secret in KeyVault + * + * @param {string} snapshot.location Resource location + * + * @param {object} [snapshot.tags] Resource tags + * + * @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 {Snapshot} - 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. + * + * {Snapshot} [result] - The deserialized result object if an error did not occur. + * See {@link Snapshot} 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. + */ + beginCreateOrUpdate(resourceGroupName: string, snapshotName: string, snapshot: models.Snapshot, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, snapshotName: string, snapshot: models.Snapshot, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, snapshotName: string, snapshot: models.Snapshot, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates (patches) a snapshot. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. + * + * @param {object} snapshot Snapshot object supplied in the body of the Patch + * snapshot operation. + * + * @param {string} [snapshot.osType] the Operating System type. Possible values + * include: 'Windows', 'Linux' + * + * @param {number} [snapshot.diskSizeGB] If creationData.createOption is Empty, + * this field is mandatory and it indicates the size of the VHD to create. If + * this field is present for updates or creation with other options, it + * indicates a resize. Resizes are only allowed if the disk is not attached to + * a running VM, and can only increase the disk's size. + * + * @param {object} [snapshot.encryptionSettings] Encryption settings for disk + * or snapshot + * + * @param {boolean} [snapshot.encryptionSettings.enabled] Set this flag to true + * and provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * encryption. Set this flag to false and remove DiskEncryptionKey and + * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the + * request object, the existing settings remain unchanged. + * + * @param {object} [snapshot.encryptionSettings.diskEncryptionKey] Key Vault + * Secret Url and vault id of the disk encryption key + * + * @param {object} snapshot.encryptionSettings.diskEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} snapshot.encryptionSettings.diskEncryptionKey.secretUrl Url + * pointing to a key or secret in KeyVault + * + * @param {object} [snapshot.encryptionSettings.keyEncryptionKey] Key Vault Key + * Url and vault id of the key encryption key + * + * @param {object} snapshot.encryptionSettings.keyEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} + * [snapshot.encryptionSettings.keyEncryptionKey.sourceVault.id] Resource Id + * + * @param {string} snapshot.encryptionSettings.keyEncryptionKey.keyUrl Url + * pointing to a key or secret in KeyVault + * + * @param {object} [snapshot.tags] Resource tags + * + * @param {object} [snapshot.sku] + * + * @param {string} [snapshot.sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginUpdateWithHttpOperationResponse(resourceGroupName: string, snapshotName: string, snapshot: models.SnapshotUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates (patches) a snapshot. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. + * + * @param {object} snapshot Snapshot object supplied in the body of the Patch + * snapshot operation. + * + * @param {string} [snapshot.osType] the Operating System type. Possible values + * include: 'Windows', 'Linux' + * + * @param {number} [snapshot.diskSizeGB] If creationData.createOption is Empty, + * this field is mandatory and it indicates the size of the VHD to create. If + * this field is present for updates or creation with other options, it + * indicates a resize. Resizes are only allowed if the disk is not attached to + * a running VM, and can only increase the disk's size. + * + * @param {object} [snapshot.encryptionSettings] Encryption settings for disk + * or snapshot + * + * @param {boolean} [snapshot.encryptionSettings.enabled] Set this flag to true + * and provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * encryption. Set this flag to false and remove DiskEncryptionKey and + * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the + * request object, the existing settings remain unchanged. + * + * @param {object} [snapshot.encryptionSettings.diskEncryptionKey] Key Vault + * Secret Url and vault id of the disk encryption key + * + * @param {object} snapshot.encryptionSettings.diskEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} snapshot.encryptionSettings.diskEncryptionKey.secretUrl Url + * pointing to a key or secret in KeyVault + * + * @param {object} [snapshot.encryptionSettings.keyEncryptionKey] Key Vault Key + * Url and vault id of the key encryption key + * + * @param {object} snapshot.encryptionSettings.keyEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} + * [snapshot.encryptionSettings.keyEncryptionKey.sourceVault.id] Resource Id + * + * @param {string} snapshot.encryptionSettings.keyEncryptionKey.keyUrl Url + * pointing to a key or secret in KeyVault + * + * @param {object} [snapshot.tags] Resource tags + * + * @param {object} [snapshot.sku] + * + * @param {string} [snapshot.sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS' + * + * @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 {Snapshot} - 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. + * + * {Snapshot} [result] - The deserialized result object if an error did not occur. + * See {@link Snapshot} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginUpdate(resourceGroupName: string, snapshotName: string, snapshot: models.SnapshotUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdate(resourceGroupName: string, snapshotName: string, snapshot: models.SnapshotUpdate, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, snapshotName: string, snapshot: models.SnapshotUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes a snapshot. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. + * + * @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. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, snapshotName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes a snapshot. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + beginDeleteMethod(resourceGroupName: string, snapshotName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, snapshotName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, snapshotName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Grants access to a snapshot. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. + * + * @param {object} grantAccessData Access data object supplied in the body of + * the get snapshot access operation. + * + * @param {string} grantAccessData.access Possible values include: 'None', + * 'Read' + * + * @param {number} grantAccessData.durationInSeconds Time duration in seconds + * until the SAS access expires. + * + * @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. + */ + beginGrantAccessWithHttpOperationResponse(resourceGroupName: string, snapshotName: string, grantAccessData: models.GrantAccessData, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Grants access to a snapshot. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. + * + * @param {object} grantAccessData Access data object supplied in the body of + * the get snapshot access operation. + * + * @param {string} grantAccessData.access Possible values include: 'None', + * 'Read' + * + * @param {number} grantAccessData.durationInSeconds Time duration in seconds + * until the SAS access expires. + * + * @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 {AccessUri} - 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. + * + * {AccessUri} [result] - The deserialized result object if an error did not occur. + * See {@link AccessUri} 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. + */ + beginGrantAccess(resourceGroupName: string, snapshotName: string, grantAccessData: models.GrantAccessData, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginGrantAccess(resourceGroupName: string, snapshotName: string, grantAccessData: models.GrantAccessData, callback: ServiceCallback): void; + beginGrantAccess(resourceGroupName: string, snapshotName: string, grantAccessData: models.GrantAccessData, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Revokes access to a snapshot. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. + * + * @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. + */ + beginRevokeAccessWithHttpOperationResponse(resourceGroupName: string, snapshotName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Revokes access to a snapshot. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. + * + * @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 {OperationStatusResponse} - 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. + * + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + beginRevokeAccess(resourceGroupName: string, snapshotName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginRevokeAccess(resourceGroupName: string, snapshotName: string, callback: ServiceCallback): void; + beginRevokeAccess(resourceGroupName: string, snapshotName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists snapshots under a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists snapshots under a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {SnapshotList} - 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. + * + * {SnapshotList} [result] - The deserialized result object if an error did not occur. + * See {@link SnapshotList} 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. + */ + listByResourceGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists snapshots under a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists snapshots under a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {SnapshotList} - 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. + * + * {SnapshotList} [result] - The deserialized result object if an error did not occur. + * See {@link SnapshotList} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * ContainerServices + * __NOTE__: An instance of this class is automatically created for an + * instance of the ComputeManagementClient. + */ +export interface ContainerServices { + + + /** + * @summary Gets a list of container services in the specified subscription. + * + * Gets a list of container services in the specified subscription. The + * operation returns properties of each container service including state, + * orchestrator, number of masters and agents, and FQDNs of masters and agents. + * + * @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. + */ + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a list of container services in the specified subscription. + * + * Gets a list of container services in the specified subscription. The + * operation returns properties of each container service including state, + * orchestrator, number of masters and agents, and FQDNs of masters and agents. + * + * @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 {ContainerServiceListResult} - 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. + * + * {ContainerServiceListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ContainerServiceListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates or updates a container service. + * + * Creates or updates a container service with the specified configuration of + * orchestrator, masters, and agents. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} containerServiceName The name of the container service in + * the specified subscription and resource group. + * + * @param {object} parameters Parameters supplied to the Create or Update a + * Container Service operation. + * + * @param {object} [parameters.orchestratorProfile] Properties of the + * orchestrator. + * + * @param {string} parameters.orchestratorProfile.orchestratorType The + * orchestrator to use to manage container service cluster resources. Valid + * values are Swarm, DCOS, and Custom. Possible values include: 'Swarm', + * 'DCOS', 'Custom', 'Kubernetes' + * + * @param {object} [parameters.customProfile] Properties for custom clusters. + * + * @param {string} parameters.customProfile.orchestrator The name of the custom + * orchestrator to use. + * + * @param {object} [parameters.servicePrincipalProfile] Properties for cluster + * service principals. + * + * @param {string} parameters.servicePrincipalProfile.clientId The ID for the + * service principal. + * + * @param {string} parameters.servicePrincipalProfile.secret The secret + * password associated with the service principal. + * + * @param {object} parameters.masterProfile Properties of master agents. + * + * @param {number} [parameters.masterProfile.count] Number of masters (VMs) in + * the container service cluster. Allowed values are 1, 3, and 5. The default + * value is 1. + * + * @param {string} parameters.masterProfile.dnsPrefix DNS prefix to be used to + * create the FQDN for master. + * + * @param {array} parameters.agentPoolProfiles Properties of the agent pool. + * + * @param {object} [parameters.windowsProfile] Properties of Windows VMs. + * + * @param {string} parameters.windowsProfile.adminUsername The administrator + * username to use for Windows VMs. + * + * @param {string} parameters.windowsProfile.adminPassword The administrator + * password to use for Windows VMs. + * + * @param {object} parameters.linuxProfile Properties of Linux VMs. + * + * @param {string} parameters.linuxProfile.adminUsername The administrator + * username to use for Linux VMs. + * + * @param {object} parameters.linuxProfile.ssh The ssh key configuration for + * Linux VMs. + * + * @param {array} parameters.linuxProfile.ssh.publicKeys the list of SSH public + * keys used to authenticate with Linux-based VMs. + * + * @param {object} [parameters.diagnosticsProfile] Properties of the diagnostic + * agent. + * + * @param {object} parameters.diagnosticsProfile.vmDiagnostics Profile for the + * container service VM diagnostic agent. + * + * @param {boolean} parameters.diagnosticsProfile.vmDiagnostics.enabled Whether + * the VM diagnostic agent is provisioned on the VM. + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @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. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, containerServiceName: string, parameters: models.ContainerService, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates or updates a container service. + * + * Creates or updates a container service with the specified configuration of + * orchestrator, masters, and agents. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} containerServiceName The name of the container service in + * the specified subscription and resource group. + * + * @param {object} parameters Parameters supplied to the Create or Update a + * Container Service operation. + * + * @param {object} [parameters.orchestratorProfile] Properties of the + * orchestrator. + * + * @param {string} parameters.orchestratorProfile.orchestratorType The + * orchestrator to use to manage container service cluster resources. Valid + * values are Swarm, DCOS, and Custom. Possible values include: 'Swarm', + * 'DCOS', 'Custom', 'Kubernetes' + * + * @param {object} [parameters.customProfile] Properties for custom clusters. + * + * @param {string} parameters.customProfile.orchestrator The name of the custom + * orchestrator to use. + * + * @param {object} [parameters.servicePrincipalProfile] Properties for cluster + * service principals. + * + * @param {string} parameters.servicePrincipalProfile.clientId The ID for the + * service principal. + * + * @param {string} parameters.servicePrincipalProfile.secret The secret + * password associated with the service principal. + * + * @param {object} parameters.masterProfile Properties of master agents. + * + * @param {number} [parameters.masterProfile.count] Number of masters (VMs) in + * the container service cluster. Allowed values are 1, 3, and 5. The default + * value is 1. + * + * @param {string} parameters.masterProfile.dnsPrefix DNS prefix to be used to + * create the FQDN for master. + * + * @param {array} parameters.agentPoolProfiles Properties of the agent pool. + * + * @param {object} [parameters.windowsProfile] Properties of Windows VMs. + * + * @param {string} parameters.windowsProfile.adminUsername The administrator + * username to use for Windows VMs. + * + * @param {string} parameters.windowsProfile.adminPassword The administrator + * password to use for Windows VMs. + * + * @param {object} parameters.linuxProfile Properties of Linux VMs. + * + * @param {string} parameters.linuxProfile.adminUsername The administrator + * username to use for Linux VMs. + * + * @param {object} parameters.linuxProfile.ssh The ssh key configuration for + * Linux VMs. + * + * @param {array} parameters.linuxProfile.ssh.publicKeys the list of SSH public + * keys used to authenticate with Linux-based VMs. + * + * @param {object} [parameters.diagnosticsProfile] Properties of the diagnostic + * agent. + * + * @param {object} parameters.diagnosticsProfile.vmDiagnostics Profile for the + * container service VM diagnostic agent. + * + * @param {boolean} parameters.diagnosticsProfile.vmDiagnostics.enabled Whether + * the VM diagnostic agent is provisioned on the VM. + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @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 {ContainerService} - 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. + * + * {ContainerService} [result] - The deserialized result object if an error did not occur. + * See {@link ContainerService} 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. + */ + createOrUpdate(resourceGroupName: string, containerServiceName: string, parameters: models.ContainerService, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, containerServiceName: string, parameters: models.ContainerService, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, containerServiceName: string, parameters: models.ContainerService, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the properties of the specified container service. + * + * Gets the properties of the specified container service in the specified + * subscription and resource group. The operation returns the properties + * including state, orchestrator, number of masters and agents, and FQDNs of + * masters and agents. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} containerServiceName The name of the container service in + * the specified subscription and resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, containerServiceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the properties of the specified container service. + * + * Gets the properties of the specified container service in the specified + * subscription and resource group. The operation returns the properties + * including state, orchestrator, number of masters and agents, and FQDNs of + * masters and agents. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} containerServiceName The name of the container service in + * the specified subscription and resource group. + * + * @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 {ContainerService} - 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. + * + * {ContainerService} [result] - The deserialized result object if an error did not occur. + * See {@link ContainerService} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, containerServiceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, containerServiceName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, containerServiceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Deletes the specified container service. + * + * Deletes the specified container service in the specified subscription and + * resource group. The operation does not delete other resources created as + * part of creating a container service, including storage accounts, VMs, and + * availability sets. All the other resources created with the container + * service are part of the same resource group and can be deleted individually. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} containerServiceName The name of the container service in + * the specified subscription and resource group. + * + * @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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, containerServiceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Deletes the specified container service. + * + * Deletes the specified container service in the specified subscription and + * resource group. The operation does not delete other resources created as + * part of creating a container service, including storage accounts, VMs, and + * availability sets. All the other resources created with the container + * service are part of the same resource group and can be deleted individually. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} containerServiceName The name of the container service in + * the specified subscription and resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName: string, containerServiceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, containerServiceName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, containerServiceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets a list of container services in the specified resource group. + * + * Gets a list of container services in the specified subscription and resource + * group. The operation returns properties of each container service including + * state, orchestrator, number of masters and agents, and FQDNs of masters and + * agents. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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. + */ + listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a list of container services in the specified resource group. + * + * Gets a list of container services in the specified subscription and resource + * group. The operation returns properties of each container service including + * state, orchestrator, number of masters and agents, and FQDNs of masters and + * agents. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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 {ContainerServiceListResult} - 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. + * + * {ContainerServiceListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ContainerServiceListResult} 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. + */ + 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; + + + /** + * @summary Creates or updates a container service. + * + * Creates or updates a container service with the specified configuration of + * orchestrator, masters, and agents. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} containerServiceName The name of the container service in + * the specified subscription and resource group. + * + * @param {object} parameters Parameters supplied to the Create or Update a + * Container Service operation. + * + * @param {object} [parameters.orchestratorProfile] Properties of the + * orchestrator. + * + * @param {string} parameters.orchestratorProfile.orchestratorType The + * orchestrator to use to manage container service cluster resources. Valid + * values are Swarm, DCOS, and Custom. Possible values include: 'Swarm', + * 'DCOS', 'Custom', 'Kubernetes' + * + * @param {object} [parameters.customProfile] Properties for custom clusters. + * + * @param {string} parameters.customProfile.orchestrator The name of the custom + * orchestrator to use. + * + * @param {object} [parameters.servicePrincipalProfile] Properties for cluster + * service principals. + * + * @param {string} parameters.servicePrincipalProfile.clientId The ID for the + * service principal. + * + * @param {string} parameters.servicePrincipalProfile.secret The secret + * password associated with the service principal. + * + * @param {object} parameters.masterProfile Properties of master agents. + * + * @param {number} [parameters.masterProfile.count] Number of masters (VMs) in + * the container service cluster. Allowed values are 1, 3, and 5. The default + * value is 1. + * + * @param {string} parameters.masterProfile.dnsPrefix DNS prefix to be used to + * create the FQDN for master. + * + * @param {array} parameters.agentPoolProfiles Properties of the agent pool. + * + * @param {object} [parameters.windowsProfile] Properties of Windows VMs. + * + * @param {string} parameters.windowsProfile.adminUsername The administrator + * username to use for Windows VMs. + * + * @param {string} parameters.windowsProfile.adminPassword The administrator + * password to use for Windows VMs. + * + * @param {object} parameters.linuxProfile Properties of Linux VMs. + * + * @param {string} parameters.linuxProfile.adminUsername The administrator + * username to use for Linux VMs. + * + * @param {object} parameters.linuxProfile.ssh The ssh key configuration for + * Linux VMs. + * + * @param {array} parameters.linuxProfile.ssh.publicKeys the list of SSH public + * keys used to authenticate with Linux-based VMs. + * + * @param {object} [parameters.diagnosticsProfile] Properties of the diagnostic + * agent. + * + * @param {object} parameters.diagnosticsProfile.vmDiagnostics Profile for the + * container service VM diagnostic agent. + * + * @param {boolean} parameters.diagnosticsProfile.vmDiagnostics.enabled Whether + * the VM diagnostic agent is provisioned on the VM. + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @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. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, containerServiceName: string, parameters: models.ContainerService, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates or updates a container service. + * + * Creates or updates a container service with the specified configuration of + * orchestrator, masters, and agents. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} containerServiceName The name of the container service in + * the specified subscription and resource group. + * + * @param {object} parameters Parameters supplied to the Create or Update a + * Container Service operation. + * + * @param {object} [parameters.orchestratorProfile] Properties of the + * orchestrator. + * + * @param {string} parameters.orchestratorProfile.orchestratorType The + * orchestrator to use to manage container service cluster resources. Valid + * values are Swarm, DCOS, and Custom. Possible values include: 'Swarm', + * 'DCOS', 'Custom', 'Kubernetes' + * + * @param {object} [parameters.customProfile] Properties for custom clusters. + * + * @param {string} parameters.customProfile.orchestrator The name of the custom + * orchestrator to use. + * + * @param {object} [parameters.servicePrincipalProfile] Properties for cluster + * service principals. + * + * @param {string} parameters.servicePrincipalProfile.clientId The ID for the + * service principal. + * + * @param {string} parameters.servicePrincipalProfile.secret The secret + * password associated with the service principal. + * + * @param {object} parameters.masterProfile Properties of master agents. + * + * @param {number} [parameters.masterProfile.count] Number of masters (VMs) in + * the container service cluster. Allowed values are 1, 3, and 5. The default + * value is 1. + * + * @param {string} parameters.masterProfile.dnsPrefix DNS prefix to be used to + * create the FQDN for master. + * + * @param {array} parameters.agentPoolProfiles Properties of the agent pool. + * + * @param {object} [parameters.windowsProfile] Properties of Windows VMs. + * + * @param {string} parameters.windowsProfile.adminUsername The administrator + * username to use for Windows VMs. + * + * @param {string} parameters.windowsProfile.adminPassword The administrator + * password to use for Windows VMs. + * + * @param {object} parameters.linuxProfile Properties of Linux VMs. + * + * @param {string} parameters.linuxProfile.adminUsername The administrator + * username to use for Linux VMs. + * + * @param {object} parameters.linuxProfile.ssh The ssh key configuration for + * Linux VMs. + * + * @param {array} parameters.linuxProfile.ssh.publicKeys the list of SSH public + * keys used to authenticate with Linux-based VMs. + * + * @param {object} [parameters.diagnosticsProfile] Properties of the diagnostic + * agent. + * + * @param {object} parameters.diagnosticsProfile.vmDiagnostics Profile for the + * container service VM diagnostic agent. + * + * @param {boolean} parameters.diagnosticsProfile.vmDiagnostics.enabled Whether + * the VM diagnostic agent is provisioned on the VM. + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @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 {ContainerService} - 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. + * + * {ContainerService} [result] - The deserialized result object if an error did not occur. + * See {@link ContainerService} 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. + */ + beginCreateOrUpdate(resourceGroupName: string, containerServiceName: string, parameters: models.ContainerService, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, containerServiceName: string, parameters: models.ContainerService, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, containerServiceName: string, parameters: models.ContainerService, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Deletes the specified container service. + * + * Deletes the specified container service in the specified subscription and + * resource group. The operation does not delete other resources created as + * part of creating a container service, including storage accounts, VMs, and + * availability sets. All the other resources created with the container + * service are part of the same resource group and can be deleted individually. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} containerServiceName The name of the container service in + * the specified subscription and resource group. + * + * @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. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, containerServiceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Deletes the specified container service. + * + * Deletes the specified container service in the specified subscription and + * resource group. The operation does not delete other resources created as + * part of creating a container service, including storage accounts, VMs, and + * availability sets. All the other resources created with the container + * service are part of the same resource group and can be deleted individually. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} containerServiceName The name of the container service in + * the specified subscription and resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(resourceGroupName: string, containerServiceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, containerServiceName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, containerServiceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets a list of container services in the specified subscription. + * + * Gets a list of container services in the specified subscription. The + * operation returns properties of each container service including state, + * orchestrator, number of masters and agents, and FQDNs of masters and agents. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a list of container services in the specified subscription. + * + * Gets a list of container services in the specified subscription. The + * operation returns properties of each container service including state, + * orchestrator, number of masters and agents, and FQDNs of masters and agents. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ContainerServiceListResult} - 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. + * + * {ContainerServiceListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ContainerServiceListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets a list of container services in the specified resource group. + * + * Gets a list of container services in the specified subscription and resource + * group. The operation returns properties of each container service including + * state, orchestrator, number of masters and agents, and FQDNs of masters and + * agents. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a list of container services in the specified resource group. + * + * Gets a list of container services in the specified subscription and resource + * group. The operation returns properties of each container service including + * state, orchestrator, number of masters and agents, and FQDNs of masters and + * agents. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ContainerServiceListResult} - 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. + * + * {ContainerServiceListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ContainerServiceListResult} 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. + */ + listByResourceGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} diff --git a/lib/services/computeManagement2/lib/lib/operations/index.js b/lib/services/computeManagement2/lib/lib/operations/index.js new file mode 100644 index 0000000000..26857f8e1c --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/operations/index.js @@ -0,0 +1,35 @@ +/* + * 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. + */ + +/* jshint latedef:false */ +/* jshint forin:false */ +/* jshint noempty:false */ + +'use strict'; + +exports.Operations = require('./operations'); +exports.AvailabilitySets = require('./availabilitySets'); +exports.VirtualMachineExtensionImages = require('./virtualMachineExtensionImages'); +exports.VirtualMachineExtensions = require('./virtualMachineExtensions'); +exports.VirtualMachineImages = require('./virtualMachineImages'); +exports.UsageOperations = require('./usageOperations'); +exports.VirtualMachineSizes = require('./virtualMachineSizes'); +exports.Images = require('./images'); +exports.VirtualMachines = require('./virtualMachines'); +exports.VirtualMachineScaleSets = require('./virtualMachineScaleSets'); +exports.VirtualMachineScaleSetExtensions = require('./virtualMachineScaleSetExtensions'); +exports.VirtualMachineScaleSetRollingUpgrades = require('./virtualMachineScaleSetRollingUpgrades'); +exports.VirtualMachineScaleSetVMs = require('./virtualMachineScaleSetVMs'); +exports.LogAnalytics = require('./logAnalytics'); +exports.VirtualMachineRunCommands = require('./virtualMachineRunCommands'); +exports.ResourceSkus = require('./resourceSkus'); +exports.Disks = require('./disks'); +exports.Snapshots = require('./snapshots'); +exports.ContainerServices = require('./containerServices'); diff --git a/lib/services/computeManagement2/lib/lib/operations/logAnalytics.js b/lib/services/computeManagement2/lib/lib/operations/logAnalytics.js new file mode 100644 index 0000000000..8fa32eb27b --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/operations/logAnalytics.js @@ -0,0 +1,1114 @@ +/* + * 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; + + +/** + * Export logs that show Api requests made by this subscription in the given + * time window to show throttling activities. + * + * @param {object} parameters Parameters supplied to the LogAnalytics + * getRequestRateByInterval Api. + * + * @param {string} parameters.intervalLength Interval value in minutes used to + * create LogAnalytics call rate logs. Possible values include: 'ThreeMins', + * 'FiveMins', 'ThirtyMins', 'SixtyMins' + * + * @param {string} parameters.blobContainerSasUri SAS Uri of the logging blob + * container to which LogAnalytics Api writes output logs to. + * + * @param {date} parameters.fromTime From time of the query + * + * @param {date} parameters.toTime To time of the query + * + * @param {boolean} [parameters.groupByThrottlePolicy] Group query result by + * Throttle Policy applied. + * + * @param {boolean} [parameters.groupByOperationName] Group query result by by + * Operation Name. + * + * @param {boolean} [parameters.groupByResourceName] Group query result by + * Resource Name. + * + * @param {string} location The location upon which virtual-machine-sizes is + * queried. + * + * @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 LogAnalyticsOperationResult} 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 _exportRequestRateByInterval(parameters, location, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginExportRequestRateByInterval(parameters, location, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['LogAnalyticsOperationResult']().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); + }); + }); +} + + +/** + * Export logs that show total throttled Api requests for this subscription in + * the given time window. + * + * @param {object} parameters Parameters supplied to the LogAnalytics + * getThrottledRequests Api. + * + * @param {string} parameters.blobContainerSasUri SAS Uri of the logging blob + * container to which LogAnalytics Api writes output logs to. + * + * @param {date} parameters.fromTime From time of the query + * + * @param {date} parameters.toTime To time of the query + * + * @param {boolean} [parameters.groupByThrottlePolicy] Group query result by + * Throttle Policy applied. + * + * @param {boolean} [parameters.groupByOperationName] Group query result by by + * Operation Name. + * + * @param {boolean} [parameters.groupByResourceName] Group query result by + * Resource Name. + * + * @param {string} location The location upon which virtual-machine-sizes is + * queried. + * + * @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 LogAnalyticsOperationResult} 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 _exportThrottledRequests(parameters, location, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginExportThrottledRequests(parameters, location, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['LogAnalyticsOperationResult']().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); + }); + }); +} + +/** + * Export logs that show Api requests made by this subscription in the given + * time window to show throttling activities. + * + * @param {object} parameters Parameters supplied to the LogAnalytics + * getRequestRateByInterval Api. + * + * @param {string} parameters.intervalLength Interval value in minutes used to + * create LogAnalytics call rate logs. Possible values include: 'ThreeMins', + * 'FiveMins', 'ThirtyMins', 'SixtyMins' + * + * @param {string} parameters.blobContainerSasUri SAS Uri of the logging blob + * container to which LogAnalytics Api writes output logs to. + * + * @param {date} parameters.fromTime From time of the query + * + * @param {date} parameters.toTime To time of the query + * + * @param {boolean} [parameters.groupByThrottlePolicy] Group query result by + * Throttle Policy applied. + * + * @param {boolean} [parameters.groupByOperationName] Group query result by by + * Operation Name. + * + * @param {boolean} [parameters.groupByResourceName] Group query result by + * Resource Name. + * + * @param {string} location The location upon which virtual-machine-sizes is + * queried. + * + * @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 LogAnalyticsOperationResult} 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 _beginExportRequestRateByInterval(parameters, location, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (location === null || location === undefined || typeof location.valueOf() !== 'string') { + throw new Error('location cannot be null or undefined and it must be of type string.'); + } + if (location !== null && location !== undefined) { + if (location.match(/^[-\w\._]+$/) === null) + { + throw new Error('"location" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + } + } + 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.Compute/locations/{location}/logAnalytics/apiAccess/getRequestRateByInterval'; + requestUrl = requestUrl.replace('{location}', encodeURIComponent(location)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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['RequestRateByIntervalInput']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + 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['LogAnalyticsOperationResult']().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); + }); +} + +/** + * Export logs that show total throttled Api requests for this subscription in + * the given time window. + * + * @param {object} parameters Parameters supplied to the LogAnalytics + * getThrottledRequests Api. + * + * @param {string} parameters.blobContainerSasUri SAS Uri of the logging blob + * container to which LogAnalytics Api writes output logs to. + * + * @param {date} parameters.fromTime From time of the query + * + * @param {date} parameters.toTime To time of the query + * + * @param {boolean} [parameters.groupByThrottlePolicy] Group query result by + * Throttle Policy applied. + * + * @param {boolean} [parameters.groupByOperationName] Group query result by by + * Operation Name. + * + * @param {boolean} [parameters.groupByResourceName] Group query result by + * Resource Name. + * + * @param {string} location The location upon which virtual-machine-sizes is + * queried. + * + * @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 LogAnalyticsOperationResult} 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 _beginExportThrottledRequests(parameters, location, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (location === null || location === undefined || typeof location.valueOf() !== 'string') { + throw new Error('location cannot be null or undefined and it must be of type string.'); + } + if (location !== null && location !== undefined) { + if (location.match(/^[-\w\._]+$/) === null) + { + throw new Error('"location" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + } + } + 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.Compute/locations/{location}/logAnalytics/apiAccess/getThrottledRequests'; + requestUrl = requestUrl.replace('{location}', encodeURIComponent(location)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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['ThrottledRequestsInput']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + 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['LogAnalyticsOperationResult']().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 LogAnalytics. */ +class LogAnalytics { + /** + * Create a LogAnalytics. + * @param {ComputeManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._exportRequestRateByInterval = _exportRequestRateByInterval; + this._exportThrottledRequests = _exportThrottledRequests; + this._beginExportRequestRateByInterval = _beginExportRequestRateByInterval; + this._beginExportThrottledRequests = _beginExportThrottledRequests; + } + + /** + * Export logs that show Api requests made by this subscription in the given + * time window to show throttling activities. + * + * @param {object} parameters Parameters supplied to the LogAnalytics + * getRequestRateByInterval Api. + * + * @param {string} parameters.intervalLength Interval value in minutes used to + * create LogAnalytics call rate logs. Possible values include: 'ThreeMins', + * 'FiveMins', 'ThirtyMins', 'SixtyMins' + * + * @param {string} parameters.blobContainerSasUri SAS Uri of the logging blob + * container to which LogAnalytics Api writes output logs to. + * + * @param {date} parameters.fromTime From time of the query + * + * @param {date} parameters.toTime To time of the query + * + * @param {boolean} [parameters.groupByThrottlePolicy] Group query result by + * Throttle Policy applied. + * + * @param {boolean} [parameters.groupByOperationName] Group query result by by + * Operation Name. + * + * @param {boolean} [parameters.groupByResourceName] Group query result by + * Resource Name. + * + * @param {string} location The location upon which virtual-machine-sizes is + * queried. + * + * @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. + */ + exportRequestRateByIntervalWithHttpOperationResponse(parameters, location, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._exportRequestRateByInterval(parameters, location, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Export logs that show Api requests made by this subscription in the given + * time window to show throttling activities. + * + * @param {object} parameters Parameters supplied to the LogAnalytics + * getRequestRateByInterval Api. + * + * @param {string} parameters.intervalLength Interval value in minutes used to + * create LogAnalytics call rate logs. Possible values include: 'ThreeMins', + * 'FiveMins', 'ThirtyMins', 'SixtyMins' + * + * @param {string} parameters.blobContainerSasUri SAS Uri of the logging blob + * container to which LogAnalytics Api writes output logs to. + * + * @param {date} parameters.fromTime From time of the query + * + * @param {date} parameters.toTime To time of the query + * + * @param {boolean} [parameters.groupByThrottlePolicy] Group query result by + * Throttle Policy applied. + * + * @param {boolean} [parameters.groupByOperationName] Group query result by by + * Operation Name. + * + * @param {boolean} [parameters.groupByResourceName] Group query result by + * Resource Name. + * + * @param {string} location The location upon which virtual-machine-sizes is + * queried. + * + * @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 {LogAnalyticsOperationResult} - 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 LogAnalyticsOperationResult} 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. + */ + exportRequestRateByInterval(parameters, location, 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._exportRequestRateByInterval(parameters, location, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._exportRequestRateByInterval(parameters, location, options, optionalCallback); + } + } + + /** + * Export logs that show total throttled Api requests for this subscription in + * the given time window. + * + * @param {object} parameters Parameters supplied to the LogAnalytics + * getThrottledRequests Api. + * + * @param {string} parameters.blobContainerSasUri SAS Uri of the logging blob + * container to which LogAnalytics Api writes output logs to. + * + * @param {date} parameters.fromTime From time of the query + * + * @param {date} parameters.toTime To time of the query + * + * @param {boolean} [parameters.groupByThrottlePolicy] Group query result by + * Throttle Policy applied. + * + * @param {boolean} [parameters.groupByOperationName] Group query result by by + * Operation Name. + * + * @param {boolean} [parameters.groupByResourceName] Group query result by + * Resource Name. + * + * @param {string} location The location upon which virtual-machine-sizes is + * queried. + * + * @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. + */ + exportThrottledRequestsWithHttpOperationResponse(parameters, location, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._exportThrottledRequests(parameters, location, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Export logs that show total throttled Api requests for this subscription in + * the given time window. + * + * @param {object} parameters Parameters supplied to the LogAnalytics + * getThrottledRequests Api. + * + * @param {string} parameters.blobContainerSasUri SAS Uri of the logging blob + * container to which LogAnalytics Api writes output logs to. + * + * @param {date} parameters.fromTime From time of the query + * + * @param {date} parameters.toTime To time of the query + * + * @param {boolean} [parameters.groupByThrottlePolicy] Group query result by + * Throttle Policy applied. + * + * @param {boolean} [parameters.groupByOperationName] Group query result by by + * Operation Name. + * + * @param {boolean} [parameters.groupByResourceName] Group query result by + * Resource Name. + * + * @param {string} location The location upon which virtual-machine-sizes is + * queried. + * + * @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 {LogAnalyticsOperationResult} - 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 LogAnalyticsOperationResult} 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. + */ + exportThrottledRequests(parameters, location, 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._exportThrottledRequests(parameters, location, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._exportThrottledRequests(parameters, location, options, optionalCallback); + } + } + + /** + * Export logs that show Api requests made by this subscription in the given + * time window to show throttling activities. + * + * @param {object} parameters Parameters supplied to the LogAnalytics + * getRequestRateByInterval Api. + * + * @param {string} parameters.intervalLength Interval value in minutes used to + * create LogAnalytics call rate logs. Possible values include: 'ThreeMins', + * 'FiveMins', 'ThirtyMins', 'SixtyMins' + * + * @param {string} parameters.blobContainerSasUri SAS Uri of the logging blob + * container to which LogAnalytics Api writes output logs to. + * + * @param {date} parameters.fromTime From time of the query + * + * @param {date} parameters.toTime To time of the query + * + * @param {boolean} [parameters.groupByThrottlePolicy] Group query result by + * Throttle Policy applied. + * + * @param {boolean} [parameters.groupByOperationName] Group query result by by + * Operation Name. + * + * @param {boolean} [parameters.groupByResourceName] Group query result by + * Resource Name. + * + * @param {string} location The location upon which virtual-machine-sizes is + * queried. + * + * @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. + */ + beginExportRequestRateByIntervalWithHttpOperationResponse(parameters, location, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginExportRequestRateByInterval(parameters, location, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Export logs that show Api requests made by this subscription in the given + * time window to show throttling activities. + * + * @param {object} parameters Parameters supplied to the LogAnalytics + * getRequestRateByInterval Api. + * + * @param {string} parameters.intervalLength Interval value in minutes used to + * create LogAnalytics call rate logs. Possible values include: 'ThreeMins', + * 'FiveMins', 'ThirtyMins', 'SixtyMins' + * + * @param {string} parameters.blobContainerSasUri SAS Uri of the logging blob + * container to which LogAnalytics Api writes output logs to. + * + * @param {date} parameters.fromTime From time of the query + * + * @param {date} parameters.toTime To time of the query + * + * @param {boolean} [parameters.groupByThrottlePolicy] Group query result by + * Throttle Policy applied. + * + * @param {boolean} [parameters.groupByOperationName] Group query result by by + * Operation Name. + * + * @param {boolean} [parameters.groupByResourceName] Group query result by + * Resource Name. + * + * @param {string} location The location upon which virtual-machine-sizes is + * queried. + * + * @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 {LogAnalyticsOperationResult} - 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 LogAnalyticsOperationResult} 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. + */ + beginExportRequestRateByInterval(parameters, location, 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._beginExportRequestRateByInterval(parameters, location, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginExportRequestRateByInterval(parameters, location, options, optionalCallback); + } + } + + /** + * Export logs that show total throttled Api requests for this subscription in + * the given time window. + * + * @param {object} parameters Parameters supplied to the LogAnalytics + * getThrottledRequests Api. + * + * @param {string} parameters.blobContainerSasUri SAS Uri of the logging blob + * container to which LogAnalytics Api writes output logs to. + * + * @param {date} parameters.fromTime From time of the query + * + * @param {date} parameters.toTime To time of the query + * + * @param {boolean} [parameters.groupByThrottlePolicy] Group query result by + * Throttle Policy applied. + * + * @param {boolean} [parameters.groupByOperationName] Group query result by by + * Operation Name. + * + * @param {boolean} [parameters.groupByResourceName] Group query result by + * Resource Name. + * + * @param {string} location The location upon which virtual-machine-sizes is + * queried. + * + * @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. + */ + beginExportThrottledRequestsWithHttpOperationResponse(parameters, location, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginExportThrottledRequests(parameters, location, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Export logs that show total throttled Api requests for this subscription in + * the given time window. + * + * @param {object} parameters Parameters supplied to the LogAnalytics + * getThrottledRequests Api. + * + * @param {string} parameters.blobContainerSasUri SAS Uri of the logging blob + * container to which LogAnalytics Api writes output logs to. + * + * @param {date} parameters.fromTime From time of the query + * + * @param {date} parameters.toTime To time of the query + * + * @param {boolean} [parameters.groupByThrottlePolicy] Group query result by + * Throttle Policy applied. + * + * @param {boolean} [parameters.groupByOperationName] Group query result by by + * Operation Name. + * + * @param {boolean} [parameters.groupByResourceName] Group query result by + * Resource Name. + * + * @param {string} location The location upon which virtual-machine-sizes is + * queried. + * + * @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 {LogAnalyticsOperationResult} - 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 LogAnalyticsOperationResult} 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. + */ + beginExportThrottledRequests(parameters, location, 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._beginExportThrottledRequests(parameters, location, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginExportThrottledRequests(parameters, location, options, optionalCallback); + } + } + +} + +module.exports = LogAnalytics; diff --git a/lib/services/computeManagement2/lib/lib/operations/operations.js b/lib/services/computeManagement2/lib/lib/operations/operations.js new file mode 100644 index 0000000000..bdb52b2e71 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/operations/operations.js @@ -0,0 +1,237 @@ +/* + * 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; + +/** + * Gets a list of compute operations. + * + * @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 ComputeOperationListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + 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('/') ? '' : '/') + 'providers/Microsoft.Compute/operations'; + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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['ComputeOperationListResult']().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 Operations. */ +class Operations { + /** + * Create a Operations. + * @param {ComputeManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + } + + /** + * Gets a list of compute operations. + * + * @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. + */ + listWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a list of compute operations. + * + * @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 {ComputeOperationListResult} - 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 ComputeOperationListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + list(options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._list(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(options, optionalCallback); + } + } + +} + +module.exports = Operations; diff --git a/lib/services/computeManagement2/lib/lib/operations/resourceSkus.js b/lib/services/computeManagement2/lib/lib/operations/resourceSkus.js new file mode 100644 index 0000000000..fc465ff3d1 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/operations/resourceSkus.js @@ -0,0 +1,451 @@ +/* + * 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; + +/** + * Gets the list of Microsoft.Compute SKUs available for your 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 ResourceSkusResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-09-01'; + // 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.Compute/skus'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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['ResourceSkusResult']().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); + }); +} + +/** + * Gets the list of Microsoft.Compute SKUs available for your Subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceSkusResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ResourceSkusResult']().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 ResourceSkus. */ +class ResourceSkus { + /** + * Create a ResourceSkus. + * @param {ComputeManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._listNext = _listNext; + } + + /** + * Gets the list of Microsoft.Compute SKUs available for your 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. + */ + listWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the list of Microsoft.Compute SKUs available for your 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 {ResourceSkusResult} - 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 ResourceSkusResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + list(options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._list(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(options, optionalCallback); + } + } + + /** + * Gets the list of Microsoft.Compute SKUs available for your Subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the list of Microsoft.Compute SKUs available for your Subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ResourceSkusResult} - 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 ResourceSkusResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = ResourceSkus; diff --git a/lib/services/computeManagement2/lib/lib/operations/snapshots.js b/lib/services/computeManagement2/lib/lib/operations/snapshots.js new file mode 100644 index 0000000000..0bc6378ffd --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/operations/snapshots.js @@ -0,0 +1,4102 @@ +/* + * 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; + + +/** + * Creates or updates a snapshot. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. + * + * @param {object} snapshot Snapshot object supplied in the body of the Put + * disk operation. + * + * @param {object} [snapshot.sku] + * + * @param {string} [snapshot.sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS', 'Standard_ZRS' + * + * @param {string} [snapshot.osType] The Operating System type. Possible values + * include: 'Windows', 'Linux' + * + * @param {object} snapshot.creationData Disk source information. CreationData + * information cannot be changed after the disk has been created. + * + * @param {string} snapshot.creationData.createOption This enumerates the + * possible sources of a disk's creation. Possible values include: 'Empty', + * 'Attach', 'FromImage', 'Import', 'Copy', 'Restore' + * + * @param {string} [snapshot.creationData.storageAccountId] If createOption is + * Import, the Azure Resource Manager identifier of the storage account + * containing the blob to import as a disk. Required only if the blob is in a + * different subscription + * + * @param {object} [snapshot.creationData.imageReference] Disk source + * information. + * + * @param {string} snapshot.creationData.imageReference.id A relative uri + * containing either a Platform Imgage Repository or user image reference. + * + * @param {number} [snapshot.creationData.imageReference.lun] If the disk is + * created from an image's data disk, this is an index that indicates which of + * the data disks in the image to use. For OS disks, this field is null. + * + * @param {string} [snapshot.creationData.sourceUri] If createOption is Import, + * this is the URI of a blob to be imported into a managed disk. + * + * @param {string} [snapshot.creationData.sourceResourceId] If createOption is + * Copy, this is the ARM id of the source snapshot or disk. + * + * @param {number} [snapshot.diskSizeGB] If creationData.createOption is Empty, + * this field is mandatory and it indicates the size of the VHD to create. If + * this field is present for updates or creation with other options, it + * indicates a resize. Resizes are only allowed if the disk is not attached to + * a running VM, and can only increase the disk's size. + * + * @param {object} [snapshot.encryptionSettings] Encryption settings for disk + * or snapshot + * + * @param {boolean} [snapshot.encryptionSettings.enabled] Set this flag to true + * and provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * encryption. Set this flag to false and remove DiskEncryptionKey and + * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the + * request object, the existing settings remain unchanged. + * + * @param {object} [snapshot.encryptionSettings.diskEncryptionKey] Key Vault + * Secret Url and vault id of the disk encryption key + * + * @param {object} snapshot.encryptionSettings.diskEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} snapshot.encryptionSettings.diskEncryptionKey.secretUrl Url + * pointing to a key or secret in KeyVault + * + * @param {object} [snapshot.encryptionSettings.keyEncryptionKey] Key Vault Key + * Url and vault id of the key encryption key + * + * @param {object} snapshot.encryptionSettings.keyEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} + * [snapshot.encryptionSettings.keyEncryptionKey.sourceVault.id] Resource Id + * + * @param {string} snapshot.encryptionSettings.keyEncryptionKey.keyUrl Url + * pointing to a key or secret in KeyVault + * + * @param {string} snapshot.location Resource location + * + * @param {object} [snapshot.tags] Resource tags + * + * @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 Snapshot} 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 _createOrUpdate(resourceGroupName, snapshotName, snapshot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginCreateOrUpdate(resourceGroupName, snapshotName, snapshot, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Snapshot']().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); + }); + }); +} + + +/** + * Updates (patches) a snapshot. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. + * + * @param {object} snapshot Snapshot object supplied in the body of the Patch + * snapshot operation. + * + * @param {string} [snapshot.osType] the Operating System type. Possible values + * include: 'Windows', 'Linux' + * + * @param {number} [snapshot.diskSizeGB] If creationData.createOption is Empty, + * this field is mandatory and it indicates the size of the VHD to create. If + * this field is present for updates or creation with other options, it + * indicates a resize. Resizes are only allowed if the disk is not attached to + * a running VM, and can only increase the disk's size. + * + * @param {object} [snapshot.encryptionSettings] Encryption settings for disk + * or snapshot + * + * @param {boolean} [snapshot.encryptionSettings.enabled] Set this flag to true + * and provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * encryption. Set this flag to false and remove DiskEncryptionKey and + * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the + * request object, the existing settings remain unchanged. + * + * @param {object} [snapshot.encryptionSettings.diskEncryptionKey] Key Vault + * Secret Url and vault id of the disk encryption key + * + * @param {object} snapshot.encryptionSettings.diskEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} snapshot.encryptionSettings.diskEncryptionKey.secretUrl Url + * pointing to a key or secret in KeyVault + * + * @param {object} [snapshot.encryptionSettings.keyEncryptionKey] Key Vault Key + * Url and vault id of the key encryption key + * + * @param {object} snapshot.encryptionSettings.keyEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} + * [snapshot.encryptionSettings.keyEncryptionKey.sourceVault.id] Resource Id + * + * @param {string} snapshot.encryptionSettings.keyEncryptionKey.keyUrl Url + * pointing to a key or secret in KeyVault + * + * @param {object} [snapshot.tags] Resource tags + * + * @param {object} [snapshot.sku] + * + * @param {string} [snapshot.sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS' + * + * @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 Snapshot} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _update(resourceGroupName, snapshotName, snapshot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginUpdate(resourceGroupName, snapshotName, snapshot, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Snapshot']().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); + }); + }); +} + +/** + * Gets information about a snapshot. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. + * + * @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 Snapshot} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, snapshotName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-04-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (snapshotName === null || snapshotName === undefined || typeof snapshotName.valueOf() !== 'string') { + throw new Error('snapshotName cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{snapshotName}', encodeURIComponent(snapshotName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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['Snapshot']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Deletes a snapshot. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. + * + * @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 OperationStatusResponse} 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 _deleteMethod(resourceGroupName, snapshotName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginDeleteMethod(resourceGroupName, snapshotName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().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); + }); + }); +} + +/** + * Lists snapshots under a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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 SnapshotList} 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 _listByResourceGroup(resourceGroupName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-04-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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['SnapshotList']().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); + }); +} + +/** + * Lists snapshots under a 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 SnapshotList} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-04-01'; + // 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.Compute/snapshots'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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['SnapshotList']().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); + }); +} + + +/** + * Grants access to a snapshot. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. + * + * @param {object} grantAccessData Access data object supplied in the body of + * the get snapshot access operation. + * + * @param {string} grantAccessData.access Possible values include: 'None', + * 'Read' + * + * @param {number} grantAccessData.durationInSeconds Time duration in seconds + * until the SAS access expires. + * + * @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 AccessUri} 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 _grantAccess(resourceGroupName, snapshotName, grantAccessData, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginGrantAccess(resourceGroupName, snapshotName, grantAccessData, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['AccessUri']().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); + }); + }); +} + + +/** + * Revokes access to a snapshot. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. + * + * @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 OperationStatusResponse} 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 _revokeAccess(resourceGroupName, snapshotName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginRevokeAccess(resourceGroupName, snapshotName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().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); + }); + }); +} + +/** + * Creates or updates a snapshot. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. + * + * @param {object} snapshot Snapshot object supplied in the body of the Put + * disk operation. + * + * @param {object} [snapshot.sku] + * + * @param {string} [snapshot.sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS', 'Standard_ZRS' + * + * @param {string} [snapshot.osType] The Operating System type. Possible values + * include: 'Windows', 'Linux' + * + * @param {object} snapshot.creationData Disk source information. CreationData + * information cannot be changed after the disk has been created. + * + * @param {string} snapshot.creationData.createOption This enumerates the + * possible sources of a disk's creation. Possible values include: 'Empty', + * 'Attach', 'FromImage', 'Import', 'Copy', 'Restore' + * + * @param {string} [snapshot.creationData.storageAccountId] If createOption is + * Import, the Azure Resource Manager identifier of the storage account + * containing the blob to import as a disk. Required only if the blob is in a + * different subscription + * + * @param {object} [snapshot.creationData.imageReference] Disk source + * information. + * + * @param {string} snapshot.creationData.imageReference.id A relative uri + * containing either a Platform Imgage Repository or user image reference. + * + * @param {number} [snapshot.creationData.imageReference.lun] If the disk is + * created from an image's data disk, this is an index that indicates which of + * the data disks in the image to use. For OS disks, this field is null. + * + * @param {string} [snapshot.creationData.sourceUri] If createOption is Import, + * this is the URI of a blob to be imported into a managed disk. + * + * @param {string} [snapshot.creationData.sourceResourceId] If createOption is + * Copy, this is the ARM id of the source snapshot or disk. + * + * @param {number} [snapshot.diskSizeGB] If creationData.createOption is Empty, + * this field is mandatory and it indicates the size of the VHD to create. If + * this field is present for updates or creation with other options, it + * indicates a resize. Resizes are only allowed if the disk is not attached to + * a running VM, and can only increase the disk's size. + * + * @param {object} [snapshot.encryptionSettings] Encryption settings for disk + * or snapshot + * + * @param {boolean} [snapshot.encryptionSettings.enabled] Set this flag to true + * and provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * encryption. Set this flag to false and remove DiskEncryptionKey and + * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the + * request object, the existing settings remain unchanged. + * + * @param {object} [snapshot.encryptionSettings.diskEncryptionKey] Key Vault + * Secret Url and vault id of the disk encryption key + * + * @param {object} snapshot.encryptionSettings.diskEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} snapshot.encryptionSettings.diskEncryptionKey.secretUrl Url + * pointing to a key or secret in KeyVault + * + * @param {object} [snapshot.encryptionSettings.keyEncryptionKey] Key Vault Key + * Url and vault id of the key encryption key + * + * @param {object} snapshot.encryptionSettings.keyEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} + * [snapshot.encryptionSettings.keyEncryptionKey.sourceVault.id] Resource Id + * + * @param {string} snapshot.encryptionSettings.keyEncryptionKey.keyUrl Url + * pointing to a key or secret in KeyVault + * + * @param {string} snapshot.location Resource location + * + * @param {object} [snapshot.tags] Resource tags + * + * @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 Snapshot} 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 _beginCreateOrUpdate(resourceGroupName, snapshotName, snapshot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-04-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (snapshotName === null || snapshotName === undefined || typeof snapshotName.valueOf() !== 'string') { + throw new Error('snapshotName cannot be null or undefined and it must be of type string.'); + } + if (snapshot === null || snapshot === undefined) { + throw new Error('snapshot cannot be null or undefined.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{snapshotName}', encodeURIComponent(snapshotName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (snapshot !== null && snapshot !== undefined) { + let requestModelMapper = new client.models['Snapshot']().mapper(); + requestModel = client.serialize(requestModelMapper, snapshot, 'snapshot'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(snapshot, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Snapshot']().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); + } + } + // Deserialize Response + if (statusCode === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Snapshot']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Updates (patches) a snapshot. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. + * + * @param {object} snapshot Snapshot object supplied in the body of the Patch + * snapshot operation. + * + * @param {string} [snapshot.osType] the Operating System type. Possible values + * include: 'Windows', 'Linux' + * + * @param {number} [snapshot.diskSizeGB] If creationData.createOption is Empty, + * this field is mandatory and it indicates the size of the VHD to create. If + * this field is present for updates or creation with other options, it + * indicates a resize. Resizes are only allowed if the disk is not attached to + * a running VM, and can only increase the disk's size. + * + * @param {object} [snapshot.encryptionSettings] Encryption settings for disk + * or snapshot + * + * @param {boolean} [snapshot.encryptionSettings.enabled] Set this flag to true + * and provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * encryption. Set this flag to false and remove DiskEncryptionKey and + * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the + * request object, the existing settings remain unchanged. + * + * @param {object} [snapshot.encryptionSettings.diskEncryptionKey] Key Vault + * Secret Url and vault id of the disk encryption key + * + * @param {object} snapshot.encryptionSettings.diskEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} snapshot.encryptionSettings.diskEncryptionKey.secretUrl Url + * pointing to a key or secret in KeyVault + * + * @param {object} [snapshot.encryptionSettings.keyEncryptionKey] Key Vault Key + * Url and vault id of the key encryption key + * + * @param {object} snapshot.encryptionSettings.keyEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} + * [snapshot.encryptionSettings.keyEncryptionKey.sourceVault.id] Resource Id + * + * @param {string} snapshot.encryptionSettings.keyEncryptionKey.keyUrl Url + * pointing to a key or secret in KeyVault + * + * @param {object} [snapshot.tags] Resource tags + * + * @param {object} [snapshot.sku] + * + * @param {string} [snapshot.sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS' + * + * @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 Snapshot} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginUpdate(resourceGroupName, snapshotName, snapshot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-04-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (snapshotName === null || snapshotName === undefined || typeof snapshotName.valueOf() !== 'string') { + throw new Error('snapshotName cannot be null or undefined and it must be of type string.'); + } + if (snapshot === null || snapshot === undefined) { + throw new Error('snapshot cannot be null or undefined.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{snapshotName}', encodeURIComponent(snapshotName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (snapshot !== null && snapshot !== undefined) { + let requestModelMapper = new client.models['SnapshotUpdate']().mapper(); + requestModel = client.serialize(requestModelMapper, snapshot, 'snapshot'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(snapshot, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Snapshot']().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); + } + } + // Deserialize Response + if (statusCode === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Snapshot']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Deletes a snapshot. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. + * + * @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 OperationStatusResponse} 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 _beginDeleteMethod(resourceGroupName, snapshotName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-04-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (snapshotName === null || snapshotName === undefined || typeof snapshotName.valueOf() !== 'string') { + throw new Error('snapshotName cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{snapshotName}', encodeURIComponent(snapshotName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // 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['OperationStatusResponse']().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); + }); +} + +/** + * Grants access to a snapshot. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. + * + * @param {object} grantAccessData Access data object supplied in the body of + * the get snapshot access operation. + * + * @param {string} grantAccessData.access Possible values include: 'None', + * 'Read' + * + * @param {number} grantAccessData.durationInSeconds Time duration in seconds + * until the SAS access expires. + * + * @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 AccessUri} 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 _beginGrantAccess(resourceGroupName, snapshotName, grantAccessData, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-04-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (snapshotName === null || snapshotName === undefined || typeof snapshotName.valueOf() !== 'string') { + throw new Error('snapshotName cannot be null or undefined and it must be of type string.'); + } + if (grantAccessData === null || grantAccessData === undefined) { + throw new Error('grantAccessData cannot be null or undefined.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/beginGetAccess'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{snapshotName}', encodeURIComponent(snapshotName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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 (grantAccessData !== null && grantAccessData !== undefined) { + let requestModelMapper = new client.models['GrantAccessData']().mapper(); + requestModel = client.serialize(requestModelMapper, grantAccessData, 'grantAccessData'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(grantAccessData, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['AccessUri']().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); + }); +} + +/** + * Revokes access to a snapshot. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. + * + * @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 OperationStatusResponse} 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 _beginRevokeAccess(resourceGroupName, snapshotName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-04-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (snapshotName === null || snapshotName === undefined || typeof snapshotName.valueOf() !== 'string') { + throw new Error('snapshotName cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/endGetAccess'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{snapshotName}', encodeURIComponent(snapshotName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().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); + }); +} + +/** + * Lists snapshots under a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SnapshotList} 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 _listByResourceGroupNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SnapshotList']().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); + }); +} + +/** + * Lists snapshots under a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SnapshotList} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SnapshotList']().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 Snapshots. */ +class Snapshots { + /** + * Create a Snapshots. + * @param {ComputeManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._createOrUpdate = _createOrUpdate; + this._update = _update; + this._get = _get; + this._deleteMethod = _deleteMethod; + this._listByResourceGroup = _listByResourceGroup; + this._list = _list; + this._grantAccess = _grantAccess; + this._revokeAccess = _revokeAccess; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginUpdate = _beginUpdate; + this._beginDeleteMethod = _beginDeleteMethod; + this._beginGrantAccess = _beginGrantAccess; + this._beginRevokeAccess = _beginRevokeAccess; + this._listByResourceGroupNext = _listByResourceGroupNext; + this._listNext = _listNext; + } + + /** + * Creates or updates a snapshot. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. + * + * @param {object} snapshot Snapshot object supplied in the body of the Put + * disk operation. + * + * @param {object} [snapshot.sku] + * + * @param {string} [snapshot.sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS', 'Standard_ZRS' + * + * @param {string} [snapshot.osType] The Operating System type. Possible values + * include: 'Windows', 'Linux' + * + * @param {object} snapshot.creationData Disk source information. CreationData + * information cannot be changed after the disk has been created. + * + * @param {string} snapshot.creationData.createOption This enumerates the + * possible sources of a disk's creation. Possible values include: 'Empty', + * 'Attach', 'FromImage', 'Import', 'Copy', 'Restore' + * + * @param {string} [snapshot.creationData.storageAccountId] If createOption is + * Import, the Azure Resource Manager identifier of the storage account + * containing the blob to import as a disk. Required only if the blob is in a + * different subscription + * + * @param {object} [snapshot.creationData.imageReference] Disk source + * information. + * + * @param {string} snapshot.creationData.imageReference.id A relative uri + * containing either a Platform Imgage Repository or user image reference. + * + * @param {number} [snapshot.creationData.imageReference.lun] If the disk is + * created from an image's data disk, this is an index that indicates which of + * the data disks in the image to use. For OS disks, this field is null. + * + * @param {string} [snapshot.creationData.sourceUri] If createOption is Import, + * this is the URI of a blob to be imported into a managed disk. + * + * @param {string} [snapshot.creationData.sourceResourceId] If createOption is + * Copy, this is the ARM id of the source snapshot or disk. + * + * @param {number} [snapshot.diskSizeGB] If creationData.createOption is Empty, + * this field is mandatory and it indicates the size of the VHD to create. If + * this field is present for updates or creation with other options, it + * indicates a resize. Resizes are only allowed if the disk is not attached to + * a running VM, and can only increase the disk's size. + * + * @param {object} [snapshot.encryptionSettings] Encryption settings for disk + * or snapshot + * + * @param {boolean} [snapshot.encryptionSettings.enabled] Set this flag to true + * and provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * encryption. Set this flag to false and remove DiskEncryptionKey and + * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the + * request object, the existing settings remain unchanged. + * + * @param {object} [snapshot.encryptionSettings.diskEncryptionKey] Key Vault + * Secret Url and vault id of the disk encryption key + * + * @param {object} snapshot.encryptionSettings.diskEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} snapshot.encryptionSettings.diskEncryptionKey.secretUrl Url + * pointing to a key or secret in KeyVault + * + * @param {object} [snapshot.encryptionSettings.keyEncryptionKey] Key Vault Key + * Url and vault id of the key encryption key + * + * @param {object} snapshot.encryptionSettings.keyEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} + * [snapshot.encryptionSettings.keyEncryptionKey.sourceVault.id] Resource Id + * + * @param {string} snapshot.encryptionSettings.keyEncryptionKey.keyUrl Url + * pointing to a key or secret in KeyVault + * + * @param {string} snapshot.location Resource location + * + * @param {object} [snapshot.tags] Resource tags + * + * @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. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, snapshotName, snapshot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, snapshotName, snapshot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates a snapshot. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. + * + * @param {object} snapshot Snapshot object supplied in the body of the Put + * disk operation. + * + * @param {object} [snapshot.sku] + * + * @param {string} [snapshot.sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS', 'Standard_ZRS' + * + * @param {string} [snapshot.osType] The Operating System type. Possible values + * include: 'Windows', 'Linux' + * + * @param {object} snapshot.creationData Disk source information. CreationData + * information cannot be changed after the disk has been created. + * + * @param {string} snapshot.creationData.createOption This enumerates the + * possible sources of a disk's creation. Possible values include: 'Empty', + * 'Attach', 'FromImage', 'Import', 'Copy', 'Restore' + * + * @param {string} [snapshot.creationData.storageAccountId] If createOption is + * Import, the Azure Resource Manager identifier of the storage account + * containing the blob to import as a disk. Required only if the blob is in a + * different subscription + * + * @param {object} [snapshot.creationData.imageReference] Disk source + * information. + * + * @param {string} snapshot.creationData.imageReference.id A relative uri + * containing either a Platform Imgage Repository or user image reference. + * + * @param {number} [snapshot.creationData.imageReference.lun] If the disk is + * created from an image's data disk, this is an index that indicates which of + * the data disks in the image to use. For OS disks, this field is null. + * + * @param {string} [snapshot.creationData.sourceUri] If createOption is Import, + * this is the URI of a blob to be imported into a managed disk. + * + * @param {string} [snapshot.creationData.sourceResourceId] If createOption is + * Copy, this is the ARM id of the source snapshot or disk. + * + * @param {number} [snapshot.diskSizeGB] If creationData.createOption is Empty, + * this field is mandatory and it indicates the size of the VHD to create. If + * this field is present for updates or creation with other options, it + * indicates a resize. Resizes are only allowed if the disk is not attached to + * a running VM, and can only increase the disk's size. + * + * @param {object} [snapshot.encryptionSettings] Encryption settings for disk + * or snapshot + * + * @param {boolean} [snapshot.encryptionSettings.enabled] Set this flag to true + * and provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * encryption. Set this flag to false and remove DiskEncryptionKey and + * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the + * request object, the existing settings remain unchanged. + * + * @param {object} [snapshot.encryptionSettings.diskEncryptionKey] Key Vault + * Secret Url and vault id of the disk encryption key + * + * @param {object} snapshot.encryptionSettings.diskEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} snapshot.encryptionSettings.diskEncryptionKey.secretUrl Url + * pointing to a key or secret in KeyVault + * + * @param {object} [snapshot.encryptionSettings.keyEncryptionKey] Key Vault Key + * Url and vault id of the key encryption key + * + * @param {object} snapshot.encryptionSettings.keyEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} + * [snapshot.encryptionSettings.keyEncryptionKey.sourceVault.id] Resource Id + * + * @param {string} snapshot.encryptionSettings.keyEncryptionKey.keyUrl Url + * pointing to a key or secret in KeyVault + * + * @param {string} snapshot.location Resource location + * + * @param {object} [snapshot.tags] Resource tags + * + * @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 {Snapshot} - 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 Snapshot} 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. + */ + createOrUpdate(resourceGroupName, snapshotName, snapshot, 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._createOrUpdate(resourceGroupName, snapshotName, snapshot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, snapshotName, snapshot, options, optionalCallback); + } + } + + /** + * Updates (patches) a snapshot. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. + * + * @param {object} snapshot Snapshot object supplied in the body of the Patch + * snapshot operation. + * + * @param {string} [snapshot.osType] the Operating System type. Possible values + * include: 'Windows', 'Linux' + * + * @param {number} [snapshot.diskSizeGB] If creationData.createOption is Empty, + * this field is mandatory and it indicates the size of the VHD to create. If + * this field is present for updates or creation with other options, it + * indicates a resize. Resizes are only allowed if the disk is not attached to + * a running VM, and can only increase the disk's size. + * + * @param {object} [snapshot.encryptionSettings] Encryption settings for disk + * or snapshot + * + * @param {boolean} [snapshot.encryptionSettings.enabled] Set this flag to true + * and provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * encryption. Set this flag to false and remove DiskEncryptionKey and + * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the + * request object, the existing settings remain unchanged. + * + * @param {object} [snapshot.encryptionSettings.diskEncryptionKey] Key Vault + * Secret Url and vault id of the disk encryption key + * + * @param {object} snapshot.encryptionSettings.diskEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} snapshot.encryptionSettings.diskEncryptionKey.secretUrl Url + * pointing to a key or secret in KeyVault + * + * @param {object} [snapshot.encryptionSettings.keyEncryptionKey] Key Vault Key + * Url and vault id of the key encryption key + * + * @param {object} snapshot.encryptionSettings.keyEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} + * [snapshot.encryptionSettings.keyEncryptionKey.sourceVault.id] Resource Id + * + * @param {string} snapshot.encryptionSettings.keyEncryptionKey.keyUrl Url + * pointing to a key or secret in KeyVault + * + * @param {object} [snapshot.tags] Resource tags + * + * @param {object} [snapshot.sku] + * + * @param {string} [snapshot.sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateWithHttpOperationResponse(resourceGroupName, snapshotName, snapshot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._update(resourceGroupName, snapshotName, snapshot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates (patches) a snapshot. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. + * + * @param {object} snapshot Snapshot object supplied in the body of the Patch + * snapshot operation. + * + * @param {string} [snapshot.osType] the Operating System type. Possible values + * include: 'Windows', 'Linux' + * + * @param {number} [snapshot.diskSizeGB] If creationData.createOption is Empty, + * this field is mandatory and it indicates the size of the VHD to create. If + * this field is present for updates or creation with other options, it + * indicates a resize. Resizes are only allowed if the disk is not attached to + * a running VM, and can only increase the disk's size. + * + * @param {object} [snapshot.encryptionSettings] Encryption settings for disk + * or snapshot + * + * @param {boolean} [snapshot.encryptionSettings.enabled] Set this flag to true + * and provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * encryption. Set this flag to false and remove DiskEncryptionKey and + * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the + * request object, the existing settings remain unchanged. + * + * @param {object} [snapshot.encryptionSettings.diskEncryptionKey] Key Vault + * Secret Url and vault id of the disk encryption key + * + * @param {object} snapshot.encryptionSettings.diskEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} snapshot.encryptionSettings.diskEncryptionKey.secretUrl Url + * pointing to a key or secret in KeyVault + * + * @param {object} [snapshot.encryptionSettings.keyEncryptionKey] Key Vault Key + * Url and vault id of the key encryption key + * + * @param {object} snapshot.encryptionSettings.keyEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} + * [snapshot.encryptionSettings.keyEncryptionKey.sourceVault.id] Resource Id + * + * @param {string} snapshot.encryptionSettings.keyEncryptionKey.keyUrl Url + * pointing to a key or secret in KeyVault + * + * @param {object} [snapshot.tags] Resource tags + * + * @param {object} [snapshot.sku] + * + * @param {string} [snapshot.sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS' + * + * @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 {Snapshot} - 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 Snapshot} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + update(resourceGroupName, snapshotName, snapshot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._update(resourceGroupName, snapshotName, snapshot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._update(resourceGroupName, snapshotName, snapshot, options, optionalCallback); + } + } + + /** + * Gets information about a snapshot. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, snapshotName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, snapshotName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets information about a snapshot. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. + * + * @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 {Snapshot} - 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 Snapshot} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, snapshotName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(resourceGroupName, snapshotName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, snapshotName, options, optionalCallback); + } + } + + /** + * Deletes a snapshot. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. + * + * @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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, snapshotName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, snapshotName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes a snapshot. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + deleteMethod(resourceGroupName, snapshotName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, snapshotName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, snapshotName, options, optionalCallback); + } + } + + /** + * Lists snapshots under a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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. + */ + listByResourceGroupWithHttpOperationResponse(resourceGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists snapshots under a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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 {SnapshotList} - 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 SnapshotList} 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. + */ + listByResourceGroup(resourceGroupName, 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._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByResourceGroup(resourceGroupName, options, optionalCallback); + } + } + + /** + * Lists snapshots under a 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. + */ + listWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists snapshots under a 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 {SnapshotList} - 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 SnapshotList} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + list(options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._list(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(options, optionalCallback); + } + } + + /** + * Grants access to a snapshot. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. + * + * @param {object} grantAccessData Access data object supplied in the body of + * the get snapshot access operation. + * + * @param {string} grantAccessData.access Possible values include: 'None', + * 'Read' + * + * @param {number} grantAccessData.durationInSeconds Time duration in seconds + * until the SAS access expires. + * + * @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. + */ + grantAccessWithHttpOperationResponse(resourceGroupName, snapshotName, grantAccessData, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._grantAccess(resourceGroupName, snapshotName, grantAccessData, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Grants access to a snapshot. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. + * + * @param {object} grantAccessData Access data object supplied in the body of + * the get snapshot access operation. + * + * @param {string} grantAccessData.access Possible values include: 'None', + * 'Read' + * + * @param {number} grantAccessData.durationInSeconds Time duration in seconds + * until the SAS access expires. + * + * @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 {AccessUri} - 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 AccessUri} 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. + */ + grantAccess(resourceGroupName, snapshotName, grantAccessData, 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._grantAccess(resourceGroupName, snapshotName, grantAccessData, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._grantAccess(resourceGroupName, snapshotName, grantAccessData, options, optionalCallback); + } + } + + /** + * Revokes access to a snapshot. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. + * + * @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. + */ + revokeAccessWithHttpOperationResponse(resourceGroupName, snapshotName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._revokeAccess(resourceGroupName, snapshotName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Revokes access to a snapshot. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + revokeAccess(resourceGroupName, snapshotName, 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._revokeAccess(resourceGroupName, snapshotName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._revokeAccess(resourceGroupName, snapshotName, options, optionalCallback); + } + } + + /** + * Creates or updates a snapshot. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. + * + * @param {object} snapshot Snapshot object supplied in the body of the Put + * disk operation. + * + * @param {object} [snapshot.sku] + * + * @param {string} [snapshot.sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS', 'Standard_ZRS' + * + * @param {string} [snapshot.osType] The Operating System type. Possible values + * include: 'Windows', 'Linux' + * + * @param {object} snapshot.creationData Disk source information. CreationData + * information cannot be changed after the disk has been created. + * + * @param {string} snapshot.creationData.createOption This enumerates the + * possible sources of a disk's creation. Possible values include: 'Empty', + * 'Attach', 'FromImage', 'Import', 'Copy', 'Restore' + * + * @param {string} [snapshot.creationData.storageAccountId] If createOption is + * Import, the Azure Resource Manager identifier of the storage account + * containing the blob to import as a disk. Required only if the blob is in a + * different subscription + * + * @param {object} [snapshot.creationData.imageReference] Disk source + * information. + * + * @param {string} snapshot.creationData.imageReference.id A relative uri + * containing either a Platform Imgage Repository or user image reference. + * + * @param {number} [snapshot.creationData.imageReference.lun] If the disk is + * created from an image's data disk, this is an index that indicates which of + * the data disks in the image to use. For OS disks, this field is null. + * + * @param {string} [snapshot.creationData.sourceUri] If createOption is Import, + * this is the URI of a blob to be imported into a managed disk. + * + * @param {string} [snapshot.creationData.sourceResourceId] If createOption is + * Copy, this is the ARM id of the source snapshot or disk. + * + * @param {number} [snapshot.diskSizeGB] If creationData.createOption is Empty, + * this field is mandatory and it indicates the size of the VHD to create. If + * this field is present for updates or creation with other options, it + * indicates a resize. Resizes are only allowed if the disk is not attached to + * a running VM, and can only increase the disk's size. + * + * @param {object} [snapshot.encryptionSettings] Encryption settings for disk + * or snapshot + * + * @param {boolean} [snapshot.encryptionSettings.enabled] Set this flag to true + * and provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * encryption. Set this flag to false and remove DiskEncryptionKey and + * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the + * request object, the existing settings remain unchanged. + * + * @param {object} [snapshot.encryptionSettings.diskEncryptionKey] Key Vault + * Secret Url and vault id of the disk encryption key + * + * @param {object} snapshot.encryptionSettings.diskEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} snapshot.encryptionSettings.diskEncryptionKey.secretUrl Url + * pointing to a key or secret in KeyVault + * + * @param {object} [snapshot.encryptionSettings.keyEncryptionKey] Key Vault Key + * Url and vault id of the key encryption key + * + * @param {object} snapshot.encryptionSettings.keyEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} + * [snapshot.encryptionSettings.keyEncryptionKey.sourceVault.id] Resource Id + * + * @param {string} snapshot.encryptionSettings.keyEncryptionKey.keyUrl Url + * pointing to a key or secret in KeyVault + * + * @param {string} snapshot.location Resource location + * + * @param {object} [snapshot.tags] Resource tags + * + * @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. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, snapshotName, snapshot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, snapshotName, snapshot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates a snapshot. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. + * + * @param {object} snapshot Snapshot object supplied in the body of the Put + * disk operation. + * + * @param {object} [snapshot.sku] + * + * @param {string} [snapshot.sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS', 'Standard_ZRS' + * + * @param {string} [snapshot.osType] The Operating System type. Possible values + * include: 'Windows', 'Linux' + * + * @param {object} snapshot.creationData Disk source information. CreationData + * information cannot be changed after the disk has been created. + * + * @param {string} snapshot.creationData.createOption This enumerates the + * possible sources of a disk's creation. Possible values include: 'Empty', + * 'Attach', 'FromImage', 'Import', 'Copy', 'Restore' + * + * @param {string} [snapshot.creationData.storageAccountId] If createOption is + * Import, the Azure Resource Manager identifier of the storage account + * containing the blob to import as a disk. Required only if the blob is in a + * different subscription + * + * @param {object} [snapshot.creationData.imageReference] Disk source + * information. + * + * @param {string} snapshot.creationData.imageReference.id A relative uri + * containing either a Platform Imgage Repository or user image reference. + * + * @param {number} [snapshot.creationData.imageReference.lun] If the disk is + * created from an image's data disk, this is an index that indicates which of + * the data disks in the image to use. For OS disks, this field is null. + * + * @param {string} [snapshot.creationData.sourceUri] If createOption is Import, + * this is the URI of a blob to be imported into a managed disk. + * + * @param {string} [snapshot.creationData.sourceResourceId] If createOption is + * Copy, this is the ARM id of the source snapshot or disk. + * + * @param {number} [snapshot.diskSizeGB] If creationData.createOption is Empty, + * this field is mandatory and it indicates the size of the VHD to create. If + * this field is present for updates or creation with other options, it + * indicates a resize. Resizes are only allowed if the disk is not attached to + * a running VM, and can only increase the disk's size. + * + * @param {object} [snapshot.encryptionSettings] Encryption settings for disk + * or snapshot + * + * @param {boolean} [snapshot.encryptionSettings.enabled] Set this flag to true + * and provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * encryption. Set this flag to false and remove DiskEncryptionKey and + * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the + * request object, the existing settings remain unchanged. + * + * @param {object} [snapshot.encryptionSettings.diskEncryptionKey] Key Vault + * Secret Url and vault id of the disk encryption key + * + * @param {object} snapshot.encryptionSettings.diskEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} snapshot.encryptionSettings.diskEncryptionKey.secretUrl Url + * pointing to a key or secret in KeyVault + * + * @param {object} [snapshot.encryptionSettings.keyEncryptionKey] Key Vault Key + * Url and vault id of the key encryption key + * + * @param {object} snapshot.encryptionSettings.keyEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} + * [snapshot.encryptionSettings.keyEncryptionKey.sourceVault.id] Resource Id + * + * @param {string} snapshot.encryptionSettings.keyEncryptionKey.keyUrl Url + * pointing to a key or secret in KeyVault + * + * @param {string} snapshot.location Resource location + * + * @param {object} [snapshot.tags] Resource tags + * + * @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 {Snapshot} - 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 Snapshot} 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. + */ + beginCreateOrUpdate(resourceGroupName, snapshotName, snapshot, 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._beginCreateOrUpdate(resourceGroupName, snapshotName, snapshot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, snapshotName, snapshot, options, optionalCallback); + } + } + + /** + * Updates (patches) a snapshot. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. + * + * @param {object} snapshot Snapshot object supplied in the body of the Patch + * snapshot operation. + * + * @param {string} [snapshot.osType] the Operating System type. Possible values + * include: 'Windows', 'Linux' + * + * @param {number} [snapshot.diskSizeGB] If creationData.createOption is Empty, + * this field is mandatory and it indicates the size of the VHD to create. If + * this field is present for updates or creation with other options, it + * indicates a resize. Resizes are only allowed if the disk is not attached to + * a running VM, and can only increase the disk's size. + * + * @param {object} [snapshot.encryptionSettings] Encryption settings for disk + * or snapshot + * + * @param {boolean} [snapshot.encryptionSettings.enabled] Set this flag to true + * and provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * encryption. Set this flag to false and remove DiskEncryptionKey and + * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the + * request object, the existing settings remain unchanged. + * + * @param {object} [snapshot.encryptionSettings.diskEncryptionKey] Key Vault + * Secret Url and vault id of the disk encryption key + * + * @param {object} snapshot.encryptionSettings.diskEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} snapshot.encryptionSettings.diskEncryptionKey.secretUrl Url + * pointing to a key or secret in KeyVault + * + * @param {object} [snapshot.encryptionSettings.keyEncryptionKey] Key Vault Key + * Url and vault id of the key encryption key + * + * @param {object} snapshot.encryptionSettings.keyEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} + * [snapshot.encryptionSettings.keyEncryptionKey.sourceVault.id] Resource Id + * + * @param {string} snapshot.encryptionSettings.keyEncryptionKey.keyUrl Url + * pointing to a key or secret in KeyVault + * + * @param {object} [snapshot.tags] Resource tags + * + * @param {object} [snapshot.sku] + * + * @param {string} [snapshot.sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginUpdateWithHttpOperationResponse(resourceGroupName, snapshotName, snapshot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginUpdate(resourceGroupName, snapshotName, snapshot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates (patches) a snapshot. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. + * + * @param {object} snapshot Snapshot object supplied in the body of the Patch + * snapshot operation. + * + * @param {string} [snapshot.osType] the Operating System type. Possible values + * include: 'Windows', 'Linux' + * + * @param {number} [snapshot.diskSizeGB] If creationData.createOption is Empty, + * this field is mandatory and it indicates the size of the VHD to create. If + * this field is present for updates or creation with other options, it + * indicates a resize. Resizes are only allowed if the disk is not attached to + * a running VM, and can only increase the disk's size. + * + * @param {object} [snapshot.encryptionSettings] Encryption settings for disk + * or snapshot + * + * @param {boolean} [snapshot.encryptionSettings.enabled] Set this flag to true + * and provide DiskEncryptionKey and optional KeyEncryptionKey to enable + * encryption. Set this flag to false and remove DiskEncryptionKey and + * KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the + * request object, the existing settings remain unchanged. + * + * @param {object} [snapshot.encryptionSettings.diskEncryptionKey] Key Vault + * Secret Url and vault id of the disk encryption key + * + * @param {object} snapshot.encryptionSettings.diskEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} snapshot.encryptionSettings.diskEncryptionKey.secretUrl Url + * pointing to a key or secret in KeyVault + * + * @param {object} [snapshot.encryptionSettings.keyEncryptionKey] Key Vault Key + * Url and vault id of the key encryption key + * + * @param {object} snapshot.encryptionSettings.keyEncryptionKey.sourceVault + * Resource id of the KeyVault containing the key or secret + * + * @param {string} + * [snapshot.encryptionSettings.keyEncryptionKey.sourceVault.id] Resource Id + * + * @param {string} snapshot.encryptionSettings.keyEncryptionKey.keyUrl Url + * pointing to a key or secret in KeyVault + * + * @param {object} [snapshot.tags] Resource tags + * + * @param {object} [snapshot.sku] + * + * @param {string} [snapshot.sku.name] The sku name. Possible values include: + * 'Standard_LRS', 'Premium_LRS' + * + * @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 {Snapshot} - 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 Snapshot} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginUpdate(resourceGroupName, snapshotName, snapshot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginUpdate(resourceGroupName, snapshotName, snapshot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginUpdate(resourceGroupName, snapshotName, snapshot, options, optionalCallback); + } + } + + /** + * Deletes a snapshot. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. + * + * @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. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, snapshotName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, snapshotName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes a snapshot. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + beginDeleteMethod(resourceGroupName, snapshotName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, snapshotName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, snapshotName, options, optionalCallback); + } + } + + /** + * Grants access to a snapshot. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. + * + * @param {object} grantAccessData Access data object supplied in the body of + * the get snapshot access operation. + * + * @param {string} grantAccessData.access Possible values include: 'None', + * 'Read' + * + * @param {number} grantAccessData.durationInSeconds Time duration in seconds + * until the SAS access expires. + * + * @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. + */ + beginGrantAccessWithHttpOperationResponse(resourceGroupName, snapshotName, grantAccessData, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginGrantAccess(resourceGroupName, snapshotName, grantAccessData, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Grants access to a snapshot. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. + * + * @param {object} grantAccessData Access data object supplied in the body of + * the get snapshot access operation. + * + * @param {string} grantAccessData.access Possible values include: 'None', + * 'Read' + * + * @param {number} grantAccessData.durationInSeconds Time duration in seconds + * until the SAS access expires. + * + * @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 {AccessUri} - 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 AccessUri} 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. + */ + beginGrantAccess(resourceGroupName, snapshotName, grantAccessData, 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._beginGrantAccess(resourceGroupName, snapshotName, grantAccessData, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginGrantAccess(resourceGroupName, snapshotName, grantAccessData, options, optionalCallback); + } + } + + /** + * Revokes access to a snapshot. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. + * + * @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. + */ + beginRevokeAccessWithHttpOperationResponse(resourceGroupName, snapshotName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginRevokeAccess(resourceGroupName, snapshotName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Revokes access to a snapshot. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} snapshotName The name of the snapshot that is being created. + * The name can't be changed after the snapshot is created. Supported + * characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 + * characters. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + beginRevokeAccess(resourceGroupName, snapshotName, 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._beginRevokeAccess(resourceGroupName, snapshotName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginRevokeAccess(resourceGroupName, snapshotName, options, optionalCallback); + } + } + + /** + * Lists snapshots under a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByResourceGroupNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists snapshots under a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {SnapshotList} - 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 SnapshotList} 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. + */ + listByResourceGroupNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByResourceGroupNext(nextPageLink, options, optionalCallback); + } + } + + /** + * Lists snapshots under a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists snapshots under a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {SnapshotList} - 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 SnapshotList} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = Snapshots; diff --git a/lib/services/computeManagement2/lib/lib/operations/usageOperations.js b/lib/services/computeManagement2/lib/lib/operations/usageOperations.js new file mode 100644 index 0000000000..a6a356e1f3 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/operations/usageOperations.js @@ -0,0 +1,479 @@ +/* + * 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; + +/** + * Gets, for the specified location, the current compute resource usage + * information as well as the limits for compute resources under the + * subscription. + * + * @param {string} location The location for which resource usage is queried. + * + * @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 ListUsagesResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(location, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (location === null || location === undefined || typeof location.valueOf() !== 'string') { + throw new Error('location cannot be null or undefined and it must be of type string.'); + } + if (location !== null && location !== undefined) { + if (location.match(/^[-\w\._]+$/) === null) + { + throw new Error('"location" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + } + } + 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.Compute/locations/{location}/usages'; + requestUrl = requestUrl.replace('{location}', encodeURIComponent(location)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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['ListUsagesResult']().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); + }); +} + +/** + * Gets, for the specified location, the current compute resource usage + * information as well as the limits for compute resources under the + * subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ListUsagesResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ListUsagesResult']().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 UsageOperations. */ +class UsageOperations { + /** + * Create a UsageOperations. + * @param {ComputeManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._listNext = _listNext; + } + + /** + * Gets, for the specified location, the current compute resource usage + * information as well as the limits for compute resources under the + * subscription. + * + * @param {string} location The location for which resource usage is queried. + * + * @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. + */ + listWithHttpOperationResponse(location, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(location, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets, for the specified location, the current compute resource usage + * information as well as the limits for compute resources under the + * subscription. + * + * @param {string} location The location for which resource usage is queried. + * + * @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 {ListUsagesResult} - 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 ListUsagesResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + list(location, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._list(location, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(location, options, optionalCallback); + } + } + + /** + * Gets, for the specified location, the current compute resource usage + * information as well as the limits for compute resources under the + * subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets, for the specified location, the current compute resource usage + * information as well as the limits for compute resources under the + * subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ListUsagesResult} - 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 ListUsagesResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = UsageOperations; diff --git a/lib/services/computeManagement2/lib/lib/operations/virtualMachineExtensionImages.js b/lib/services/computeManagement2/lib/lib/operations/virtualMachineExtensionImages.js new file mode 100644 index 0000000000..fc9e07d629 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/operations/virtualMachineExtensionImages.js @@ -0,0 +1,814 @@ +/* + * 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; + +/** + * Gets a virtual machine extension image. + * + * @param {string} location The name of a supported Azure region. + * + * @param {string} publisherName + * + * @param {string} type + * + * @param {string} version + * + * @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 VirtualMachineExtensionImage} 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(location, publisherName, type, version, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (location === null || location === undefined || typeof location.valueOf() !== 'string') { + throw new Error('location cannot be null or undefined and it must be of type string.'); + } + if (publisherName === null || publisherName === undefined || typeof publisherName.valueOf() !== 'string') { + throw new Error('publisherName cannot be null or undefined and it must be of type string.'); + } + if (type === null || type === undefined || typeof type.valueOf() !== 'string') { + throw new Error('type cannot be null or undefined and it must be of type string.'); + } + if (version === null || version === undefined || typeof version.valueOf() !== 'string') { + throw new Error('version cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions/{version}'; + requestUrl = requestUrl.replace('{location}', encodeURIComponent(location)); + requestUrl = requestUrl.replace('{publisherName}', encodeURIComponent(publisherName)); + requestUrl = requestUrl.replace('{type}', encodeURIComponent(type)); + requestUrl = requestUrl.replace('{version}', encodeURIComponent(version)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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['VirtualMachineExtensionImage']().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); + }); +} + +/** + * Gets a list of virtual machine extension image types. + * + * @param {string} location The name of a supported Azure region. + * + * @param {string} publisherName + * + * @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. + * + * {array} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listTypes(location, publisherName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (location === null || location === undefined || typeof location.valueOf() !== 'string') { + throw new Error('location cannot be null or undefined and it must be of type string.'); + } + if (publisherName === null || publisherName === undefined || typeof publisherName.valueOf() !== 'string') { + throw new Error('publisherName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types'; + requestUrl = requestUrl.replace('{location}', encodeURIComponent(location)); + requestUrl = requestUrl.replace('{publisherName}', encodeURIComponent(publisherName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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 = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VirtualMachineExtensionImageElementType', + type: { + name: 'Composite', + className: 'VirtualMachineExtensionImage' + } + } + } + }; + 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); + }); +} + +/** + * Gets a list of virtual machine extension image versions. + * + * @param {string} location The name of a supported Azure region. + * + * @param {string} publisherName + * + * @param {string} type + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. + * + * @param {number} [options.top] + * + * @param {string} [options.orderby] + * + * @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. + * + * {array} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listVersions(location, publisherName, type, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let filter = (options && options.filter !== undefined) ? options.filter : undefined; + let top = (options && options.top !== undefined) ? options.top : undefined; + let orderby = (options && options.orderby !== undefined) ? options.orderby : undefined; + let apiVersion = '2017-12-01'; + // Validate + try { + if (location === null || location === undefined || typeof location.valueOf() !== 'string') { + throw new Error('location cannot be null or undefined and it must be of type string.'); + } + if (publisherName === null || publisherName === undefined || typeof publisherName.valueOf() !== 'string') { + throw new Error('publisherName cannot be null or undefined and it must be of type string.'); + } + if (type === null || type === undefined || typeof type.valueOf() !== 'string') { + throw new Error('type cannot be null or undefined and it must be of type string.'); + } + if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { + throw new Error('filter must be of type string.'); + } + if (top !== null && top !== undefined && typeof top !== 'number') { + throw new Error('top must be of type number.'); + } + if (orderby !== null && orderby !== undefined && typeof orderby.valueOf() !== 'string') { + throw new Error('orderby must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions'; + requestUrl = requestUrl.replace('{location}', encodeURIComponent(location)); + requestUrl = requestUrl.replace('{publisherName}', encodeURIComponent(publisherName)); + requestUrl = requestUrl.replace('{type}', encodeURIComponent(type)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (filter !== null && filter !== undefined) { + queryParameters.push('$filter=' + encodeURIComponent(filter)); + } + if (top !== null && top !== undefined) { + queryParameters.push('$top=' + encodeURIComponent(top.toString())); + } + if (orderby !== null && orderby !== undefined) { + queryParameters.push('$orderby=' + encodeURIComponent(orderby)); + } + queryParameters.push('api-version=' + encodeURIComponent(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 = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VirtualMachineExtensionImageElementType', + type: { + name: 'Composite', + className: 'VirtualMachineExtensionImage' + } + } + } + }; + 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 VirtualMachineExtensionImages. */ +class VirtualMachineExtensionImages { + /** + * Create a VirtualMachineExtensionImages. + * @param {ComputeManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._get = _get; + this._listTypes = _listTypes; + this._listVersions = _listVersions; + } + + /** + * Gets a virtual machine extension image. + * + * @param {string} location The name of a supported Azure region. + * + * @param {string} publisherName + * + * @param {string} type + * + * @param {string} version + * + * @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(location, publisherName, type, version, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(location, publisherName, type, version, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a virtual machine extension image. + * + * @param {string} location The name of a supported Azure region. + * + * @param {string} publisherName + * + * @param {string} type + * + * @param {string} version + * + * @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 {VirtualMachineExtensionImage} - 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 VirtualMachineExtensionImage} 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(location, publisherName, type, version, 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(location, publisherName, type, version, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(location, publisherName, type, version, options, optionalCallback); + } + } + + /** + * Gets a list of virtual machine extension image types. + * + * @param {string} location The name of a supported Azure region. + * + * @param {string} publisherName + * + * @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. + */ + listTypesWithHttpOperationResponse(location, publisherName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listTypes(location, publisherName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a list of virtual machine extension image types. + * + * @param {string} location The name of a supported Azure region. + * + * @param {string} publisherName + * + * @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 {Array} - 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. + * + * {array} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listTypes(location, publisherName, 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._listTypes(location, publisherName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listTypes(location, publisherName, options, optionalCallback); + } + } + + /** + * Gets a list of virtual machine extension image versions. + * + * @param {string} location The name of a supported Azure region. + * + * @param {string} publisherName + * + * @param {string} type + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. + * + * @param {number} [options.top] + * + * @param {string} [options.orderby] + * + * @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. + */ + listVersionsWithHttpOperationResponse(location, publisherName, type, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listVersions(location, publisherName, type, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a list of virtual machine extension image versions. + * + * @param {string} location The name of a supported Azure region. + * + * @param {string} publisherName + * + * @param {string} type + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. + * + * @param {number} [options.top] + * + * @param {string} [options.orderby] + * + * @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 {Array} - 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. + * + * {array} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listVersions(location, publisherName, type, 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._listVersions(location, publisherName, type, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listVersions(location, publisherName, type, options, optionalCallback); + } + } + +} + +module.exports = VirtualMachineExtensionImages; diff --git a/lib/services/computeManagement2/lib/lib/operations/virtualMachineExtensions.js b/lib/services/computeManagement2/lib/lib/operations/virtualMachineExtensions.js new file mode 100644 index 0000000000..064b547637 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/operations/virtualMachineExtensions.js @@ -0,0 +1,1466 @@ +/* + * 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; + + +/** + * The operation to create or update the extension. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine where the extension + * should be create or updated. + * + * @param {string} vmExtensionName The name of the virtual machine extension. + * + * @param {object} extensionParameters Parameters supplied to the Create + * Virtual Machine Extension operation. + * + * @param {string} [extensionParameters.forceUpdateTag] How the extension + * handler should be forced to update even if the extension configuration has + * not changed. + * + * @param {string} [extensionParameters.publisher] The name of the extension + * handler publisher. + * + * @param {string} [extensionParameters.virtualMachineExtensionType] Specifies + * the type of the extension; an example is "CustomScriptExtension". + * + * @param {string} [extensionParameters.typeHandlerVersion] Specifies the + * version of the script handler. + * + * @param {boolean} [extensionParameters.autoUpgradeMinorVersion] Indicates + * whether the extension should use a newer minor version if one is available + * at deployment time. Once deployed, however, the extension will not upgrade + * minor versions unless redeployed, even with this property set to true. + * + * @param {object} [extensionParameters.settings] Json formatted public + * settings for the extension. + * + * @param {object} [extensionParameters.protectedSettings] The extension can + * contain either protectedSettings or protectedSettingsFromKeyVault or no + * protected settings at all. + * + * @param {object} [extensionParameters.instanceView] The virtual machine + * extension instance view. + * + * @param {string} [extensionParameters.instanceView.name] The virtual machine + * extension name. + * + * @param {string} [extensionParameters.instanceView.type] Specifies the type + * of the extension; an example is "CustomScriptExtension". + * + * @param {string} [extensionParameters.instanceView.typeHandlerVersion] + * Specifies the version of the script handler. + * + * @param {array} [extensionParameters.instanceView.substatuses] The resource + * status information. + * + * @param {array} [extensionParameters.instanceView.statuses] The resource + * status information. + * + * @param {string} extensionParameters.location Resource location + * + * @param {object} [extensionParameters.tags] Resource tags + * + * @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 VirtualMachineExtension} 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 _createOrUpdate(resourceGroupName, vmName, vmExtensionName, extensionParameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginCreateOrUpdate(resourceGroupName, vmName, vmExtensionName, extensionParameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['VirtualMachineExtension']().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); + }); + }); +} + + +/** + * The operation to delete the extension. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine where the extension + * should be deleted. + * + * @param {string} vmExtensionName The name of the virtual machine extension. + * + * @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 OperationStatusResponse} 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 _deleteMethod(resourceGroupName, vmName, vmExtensionName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginDeleteMethod(resourceGroupName, vmName, vmExtensionName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().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); + }); + }); +} + +/** + * The operation to get the extension. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine containing the + * extension. + * + * @param {string} vmExtensionName The name of the virtual machine extension. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] The expand expression to apply on the + * operation. + * + * @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 VirtualMachineExtension} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, vmName, vmExtensionName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let expand = (options && options.expand !== undefined) ? options.expand : undefined; + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmName === null || vmName === undefined || typeof vmName.valueOf() !== 'string') { + throw new Error('vmName cannot be null or undefined and it must be of type string.'); + } + if (vmExtensionName === null || vmExtensionName === undefined || typeof vmExtensionName.valueOf() !== 'string') { + throw new Error('vmExtensionName cannot be null or undefined and it must be of type string.'); + } + if (expand !== null && expand !== undefined && typeof expand.valueOf() !== 'string') { + throw new Error('expand must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmName}', encodeURIComponent(vmName)); + requestUrl = requestUrl.replace('{vmExtensionName}', encodeURIComponent(vmExtensionName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (expand !== null && expand !== undefined) { + queryParameters.push('$expand=' + encodeURIComponent(expand)); + } + queryParameters.push('api-version=' + encodeURIComponent(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['VirtualMachineExtension']().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); + }); +} + +/** + * The operation to create or update the extension. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine where the extension + * should be create or updated. + * + * @param {string} vmExtensionName The name of the virtual machine extension. + * + * @param {object} extensionParameters Parameters supplied to the Create + * Virtual Machine Extension operation. + * + * @param {string} [extensionParameters.forceUpdateTag] How the extension + * handler should be forced to update even if the extension configuration has + * not changed. + * + * @param {string} [extensionParameters.publisher] The name of the extension + * handler publisher. + * + * @param {string} [extensionParameters.virtualMachineExtensionType] Specifies + * the type of the extension; an example is "CustomScriptExtension". + * + * @param {string} [extensionParameters.typeHandlerVersion] Specifies the + * version of the script handler. + * + * @param {boolean} [extensionParameters.autoUpgradeMinorVersion] Indicates + * whether the extension should use a newer minor version if one is available + * at deployment time. Once deployed, however, the extension will not upgrade + * minor versions unless redeployed, even with this property set to true. + * + * @param {object} [extensionParameters.settings] Json formatted public + * settings for the extension. + * + * @param {object} [extensionParameters.protectedSettings] The extension can + * contain either protectedSettings or protectedSettingsFromKeyVault or no + * protected settings at all. + * + * @param {object} [extensionParameters.instanceView] The virtual machine + * extension instance view. + * + * @param {string} [extensionParameters.instanceView.name] The virtual machine + * extension name. + * + * @param {string} [extensionParameters.instanceView.type] Specifies the type + * of the extension; an example is "CustomScriptExtension". + * + * @param {string} [extensionParameters.instanceView.typeHandlerVersion] + * Specifies the version of the script handler. + * + * @param {array} [extensionParameters.instanceView.substatuses] The resource + * status information. + * + * @param {array} [extensionParameters.instanceView.statuses] The resource + * status information. + * + * @param {string} extensionParameters.location Resource location + * + * @param {object} [extensionParameters.tags] Resource tags + * + * @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 VirtualMachineExtension} 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 _beginCreateOrUpdate(resourceGroupName, vmName, vmExtensionName, extensionParameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmName === null || vmName === undefined || typeof vmName.valueOf() !== 'string') { + throw new Error('vmName cannot be null or undefined and it must be of type string.'); + } + if (vmExtensionName === null || vmExtensionName === undefined || typeof vmExtensionName.valueOf() !== 'string') { + throw new Error('vmExtensionName cannot be null or undefined and it must be of type string.'); + } + if (extensionParameters === null || extensionParameters === undefined) { + throw new Error('extensionParameters cannot be null or undefined.'); + } + 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmName}', encodeURIComponent(vmName)); + requestUrl = requestUrl.replace('{vmExtensionName}', encodeURIComponent(vmExtensionName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (extensionParameters !== null && extensionParameters !== undefined) { + let requestModelMapper = new client.models['VirtualMachineExtension']().mapper(); + requestModel = client.serialize(requestModelMapper, extensionParameters, 'extensionParameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(extensionParameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + 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['VirtualMachineExtension']().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); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['VirtualMachineExtension']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * The operation to delete the extension. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine where the extension + * should be deleted. + * + * @param {string} vmExtensionName The name of the virtual machine extension. + * + * @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 OperationStatusResponse} 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 _beginDeleteMethod(resourceGroupName, vmName, vmExtensionName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmName === null || vmName === undefined || typeof vmName.valueOf() !== 'string') { + throw new Error('vmName cannot be null or undefined and it must be of type string.'); + } + if (vmExtensionName === null || vmExtensionName === undefined || typeof vmExtensionName.valueOf() !== 'string') { + throw new Error('vmExtensionName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmName}', encodeURIComponent(vmName)); + requestUrl = requestUrl.replace('{vmExtensionName}', encodeURIComponent(vmExtensionName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // 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['OperationStatusResponse']().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 VirtualMachineExtensions. */ +class VirtualMachineExtensions { + /** + * Create a VirtualMachineExtensions. + * @param {ComputeManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._createOrUpdate = _createOrUpdate; + this._deleteMethod = _deleteMethod; + this._get = _get; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginDeleteMethod = _beginDeleteMethod; + } + + /** + * The operation to create or update the extension. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine where the extension + * should be create or updated. + * + * @param {string} vmExtensionName The name of the virtual machine extension. + * + * @param {object} extensionParameters Parameters supplied to the Create + * Virtual Machine Extension operation. + * + * @param {string} [extensionParameters.forceUpdateTag] How the extension + * handler should be forced to update even if the extension configuration has + * not changed. + * + * @param {string} [extensionParameters.publisher] The name of the extension + * handler publisher. + * + * @param {string} [extensionParameters.virtualMachineExtensionType] Specifies + * the type of the extension; an example is "CustomScriptExtension". + * + * @param {string} [extensionParameters.typeHandlerVersion] Specifies the + * version of the script handler. + * + * @param {boolean} [extensionParameters.autoUpgradeMinorVersion] Indicates + * whether the extension should use a newer minor version if one is available + * at deployment time. Once deployed, however, the extension will not upgrade + * minor versions unless redeployed, even with this property set to true. + * + * @param {object} [extensionParameters.settings] Json formatted public + * settings for the extension. + * + * @param {object} [extensionParameters.protectedSettings] The extension can + * contain either protectedSettings or protectedSettingsFromKeyVault or no + * protected settings at all. + * + * @param {object} [extensionParameters.instanceView] The virtual machine + * extension instance view. + * + * @param {string} [extensionParameters.instanceView.name] The virtual machine + * extension name. + * + * @param {string} [extensionParameters.instanceView.type] Specifies the type + * of the extension; an example is "CustomScriptExtension". + * + * @param {string} [extensionParameters.instanceView.typeHandlerVersion] + * Specifies the version of the script handler. + * + * @param {array} [extensionParameters.instanceView.substatuses] The resource + * status information. + * + * @param {array} [extensionParameters.instanceView.statuses] The resource + * status information. + * + * @param {string} extensionParameters.location Resource location + * + * @param {object} [extensionParameters.tags] Resource tags + * + * @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. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, vmName, vmExtensionName, extensionParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, vmName, vmExtensionName, extensionParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * The operation to create or update the extension. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine where the extension + * should be create or updated. + * + * @param {string} vmExtensionName The name of the virtual machine extension. + * + * @param {object} extensionParameters Parameters supplied to the Create + * Virtual Machine Extension operation. + * + * @param {string} [extensionParameters.forceUpdateTag] How the extension + * handler should be forced to update even if the extension configuration has + * not changed. + * + * @param {string} [extensionParameters.publisher] The name of the extension + * handler publisher. + * + * @param {string} [extensionParameters.virtualMachineExtensionType] Specifies + * the type of the extension; an example is "CustomScriptExtension". + * + * @param {string} [extensionParameters.typeHandlerVersion] Specifies the + * version of the script handler. + * + * @param {boolean} [extensionParameters.autoUpgradeMinorVersion] Indicates + * whether the extension should use a newer minor version if one is available + * at deployment time. Once deployed, however, the extension will not upgrade + * minor versions unless redeployed, even with this property set to true. + * + * @param {object} [extensionParameters.settings] Json formatted public + * settings for the extension. + * + * @param {object} [extensionParameters.protectedSettings] The extension can + * contain either protectedSettings or protectedSettingsFromKeyVault or no + * protected settings at all. + * + * @param {object} [extensionParameters.instanceView] The virtual machine + * extension instance view. + * + * @param {string} [extensionParameters.instanceView.name] The virtual machine + * extension name. + * + * @param {string} [extensionParameters.instanceView.type] Specifies the type + * of the extension; an example is "CustomScriptExtension". + * + * @param {string} [extensionParameters.instanceView.typeHandlerVersion] + * Specifies the version of the script handler. + * + * @param {array} [extensionParameters.instanceView.substatuses] The resource + * status information. + * + * @param {array} [extensionParameters.instanceView.statuses] The resource + * status information. + * + * @param {string} extensionParameters.location Resource location + * + * @param {object} [extensionParameters.tags] Resource tags + * + * @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 {VirtualMachineExtension} - 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 VirtualMachineExtension} 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. + */ + createOrUpdate(resourceGroupName, vmName, vmExtensionName, extensionParameters, 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._createOrUpdate(resourceGroupName, vmName, vmExtensionName, extensionParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, vmName, vmExtensionName, extensionParameters, options, optionalCallback); + } + } + + /** + * The operation to delete the extension. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine where the extension + * should be deleted. + * + * @param {string} vmExtensionName The name of the virtual machine extension. + * + * @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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, vmName, vmExtensionName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, vmName, vmExtensionName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * The operation to delete the extension. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine where the extension + * should be deleted. + * + * @param {string} vmExtensionName The name of the virtual machine extension. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + deleteMethod(resourceGroupName, vmName, vmExtensionName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, vmName, vmExtensionName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, vmName, vmExtensionName, options, optionalCallback); + } + } + + /** + * The operation to get the extension. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine containing the + * extension. + * + * @param {string} vmExtensionName The name of the virtual machine extension. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] The expand expression to apply on the + * operation. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, vmName, vmExtensionName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, vmName, vmExtensionName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * The operation to get the extension. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine containing the + * extension. + * + * @param {string} vmExtensionName The name of the virtual machine extension. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] The expand expression to apply on the + * operation. + * + * @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 {VirtualMachineExtension} - 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 VirtualMachineExtension} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, vmName, vmExtensionName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(resourceGroupName, vmName, vmExtensionName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, vmName, vmExtensionName, options, optionalCallback); + } + } + + /** + * The operation to create or update the extension. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine where the extension + * should be create or updated. + * + * @param {string} vmExtensionName The name of the virtual machine extension. + * + * @param {object} extensionParameters Parameters supplied to the Create + * Virtual Machine Extension operation. + * + * @param {string} [extensionParameters.forceUpdateTag] How the extension + * handler should be forced to update even if the extension configuration has + * not changed. + * + * @param {string} [extensionParameters.publisher] The name of the extension + * handler publisher. + * + * @param {string} [extensionParameters.virtualMachineExtensionType] Specifies + * the type of the extension; an example is "CustomScriptExtension". + * + * @param {string} [extensionParameters.typeHandlerVersion] Specifies the + * version of the script handler. + * + * @param {boolean} [extensionParameters.autoUpgradeMinorVersion] Indicates + * whether the extension should use a newer minor version if one is available + * at deployment time. Once deployed, however, the extension will not upgrade + * minor versions unless redeployed, even with this property set to true. + * + * @param {object} [extensionParameters.settings] Json formatted public + * settings for the extension. + * + * @param {object} [extensionParameters.protectedSettings] The extension can + * contain either protectedSettings or protectedSettingsFromKeyVault or no + * protected settings at all. + * + * @param {object} [extensionParameters.instanceView] The virtual machine + * extension instance view. + * + * @param {string} [extensionParameters.instanceView.name] The virtual machine + * extension name. + * + * @param {string} [extensionParameters.instanceView.type] Specifies the type + * of the extension; an example is "CustomScriptExtension". + * + * @param {string} [extensionParameters.instanceView.typeHandlerVersion] + * Specifies the version of the script handler. + * + * @param {array} [extensionParameters.instanceView.substatuses] The resource + * status information. + * + * @param {array} [extensionParameters.instanceView.statuses] The resource + * status information. + * + * @param {string} extensionParameters.location Resource location + * + * @param {object} [extensionParameters.tags] Resource tags + * + * @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. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, vmName, vmExtensionName, extensionParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, vmName, vmExtensionName, extensionParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * The operation to create or update the extension. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine where the extension + * should be create or updated. + * + * @param {string} vmExtensionName The name of the virtual machine extension. + * + * @param {object} extensionParameters Parameters supplied to the Create + * Virtual Machine Extension operation. + * + * @param {string} [extensionParameters.forceUpdateTag] How the extension + * handler should be forced to update even if the extension configuration has + * not changed. + * + * @param {string} [extensionParameters.publisher] The name of the extension + * handler publisher. + * + * @param {string} [extensionParameters.virtualMachineExtensionType] Specifies + * the type of the extension; an example is "CustomScriptExtension". + * + * @param {string} [extensionParameters.typeHandlerVersion] Specifies the + * version of the script handler. + * + * @param {boolean} [extensionParameters.autoUpgradeMinorVersion] Indicates + * whether the extension should use a newer minor version if one is available + * at deployment time. Once deployed, however, the extension will not upgrade + * minor versions unless redeployed, even with this property set to true. + * + * @param {object} [extensionParameters.settings] Json formatted public + * settings for the extension. + * + * @param {object} [extensionParameters.protectedSettings] The extension can + * contain either protectedSettings or protectedSettingsFromKeyVault or no + * protected settings at all. + * + * @param {object} [extensionParameters.instanceView] The virtual machine + * extension instance view. + * + * @param {string} [extensionParameters.instanceView.name] The virtual machine + * extension name. + * + * @param {string} [extensionParameters.instanceView.type] Specifies the type + * of the extension; an example is "CustomScriptExtension". + * + * @param {string} [extensionParameters.instanceView.typeHandlerVersion] + * Specifies the version of the script handler. + * + * @param {array} [extensionParameters.instanceView.substatuses] The resource + * status information. + * + * @param {array} [extensionParameters.instanceView.statuses] The resource + * status information. + * + * @param {string} extensionParameters.location Resource location + * + * @param {object} [extensionParameters.tags] Resource tags + * + * @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 {VirtualMachineExtension} - 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 VirtualMachineExtension} 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. + */ + beginCreateOrUpdate(resourceGroupName, vmName, vmExtensionName, extensionParameters, 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._beginCreateOrUpdate(resourceGroupName, vmName, vmExtensionName, extensionParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, vmName, vmExtensionName, extensionParameters, options, optionalCallback); + } + } + + /** + * The operation to delete the extension. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine where the extension + * should be deleted. + * + * @param {string} vmExtensionName The name of the virtual machine extension. + * + * @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. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, vmName, vmExtensionName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, vmName, vmExtensionName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * The operation to delete the extension. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine where the extension + * should be deleted. + * + * @param {string} vmExtensionName The name of the virtual machine extension. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + beginDeleteMethod(resourceGroupName, vmName, vmExtensionName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, vmName, vmExtensionName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, vmName, vmExtensionName, options, optionalCallback); + } + } + +} + +module.exports = VirtualMachineExtensions; diff --git a/lib/services/computeManagement2/lib/lib/operations/virtualMachineImages.js b/lib/services/computeManagement2/lib/lib/operations/virtualMachineImages.js new file mode 100644 index 0000000000..236d37b95f --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/operations/virtualMachineImages.js @@ -0,0 +1,1328 @@ +/* + * 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; + +/** + * Gets a virtual machine image. + * + * @param {string} location The name of a supported Azure region. + * + * @param {string} publisherName A valid image publisher. + * + * @param {string} offer A valid image publisher offer. + * + * @param {string} skus A valid image SKU. + * + * @param {string} version A valid image SKU version. + * + * @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 VirtualMachineImage} 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(location, publisherName, offer, skus, version, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (location === null || location === undefined || typeof location.valueOf() !== 'string') { + throw new Error('location cannot be null or undefined and it must be of type string.'); + } + if (publisherName === null || publisherName === undefined || typeof publisherName.valueOf() !== 'string') { + throw new Error('publisherName cannot be null or undefined and it must be of type string.'); + } + if (offer === null || offer === undefined || typeof offer.valueOf() !== 'string') { + throw new Error('offer cannot be null or undefined and it must be of type string.'); + } + if (skus === null || skus === undefined || typeof skus.valueOf() !== 'string') { + throw new Error('skus cannot be null or undefined and it must be of type string.'); + } + if (version === null || version === undefined || typeof version.valueOf() !== 'string') { + throw new Error('version cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions/{version}'; + requestUrl = requestUrl.replace('{location}', encodeURIComponent(location)); + requestUrl = requestUrl.replace('{publisherName}', encodeURIComponent(publisherName)); + requestUrl = requestUrl.replace('{offer}', encodeURIComponent(offer)); + requestUrl = requestUrl.replace('{skus}', encodeURIComponent(skus)); + requestUrl = requestUrl.replace('{version}', encodeURIComponent(version)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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['VirtualMachineImage']().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); + }); +} + +/** + * Gets a list of all virtual machine image versions for the specified + * location, publisher, offer, and SKU. + * + * @param {string} location The name of a supported Azure region. + * + * @param {string} publisherName A valid image publisher. + * + * @param {string} offer A valid image publisher offer. + * + * @param {string} skus A valid image SKU. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. + * + * @param {number} [options.top] + * + * @param {string} [options.orderby] + * + * @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. + * + * {array} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(location, publisherName, offer, skus, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let filter = (options && options.filter !== undefined) ? options.filter : undefined; + let top = (options && options.top !== undefined) ? options.top : undefined; + let orderby = (options && options.orderby !== undefined) ? options.orderby : undefined; + let apiVersion = '2017-12-01'; + // Validate + try { + if (location === null || location === undefined || typeof location.valueOf() !== 'string') { + throw new Error('location cannot be null or undefined and it must be of type string.'); + } + if (publisherName === null || publisherName === undefined || typeof publisherName.valueOf() !== 'string') { + throw new Error('publisherName cannot be null or undefined and it must be of type string.'); + } + if (offer === null || offer === undefined || typeof offer.valueOf() !== 'string') { + throw new Error('offer cannot be null or undefined and it must be of type string.'); + } + if (skus === null || skus === undefined || typeof skus.valueOf() !== 'string') { + throw new Error('skus cannot be null or undefined and it must be of type string.'); + } + if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { + throw new Error('filter must be of type string.'); + } + if (top !== null && top !== undefined && typeof top !== 'number') { + throw new Error('top must be of type number.'); + } + if (orderby !== null && orderby !== undefined && typeof orderby.valueOf() !== 'string') { + throw new Error('orderby must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions'; + requestUrl = requestUrl.replace('{location}', encodeURIComponent(location)); + requestUrl = requestUrl.replace('{publisherName}', encodeURIComponent(publisherName)); + requestUrl = requestUrl.replace('{offer}', encodeURIComponent(offer)); + requestUrl = requestUrl.replace('{skus}', encodeURIComponent(skus)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (filter !== null && filter !== undefined) { + queryParameters.push('$filter=' + encodeURIComponent(filter)); + } + if (top !== null && top !== undefined) { + queryParameters.push('$top=' + encodeURIComponent(top.toString())); + } + if (orderby !== null && orderby !== undefined) { + queryParameters.push('$orderby=' + encodeURIComponent(orderby)); + } + queryParameters.push('api-version=' + encodeURIComponent(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 = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VirtualMachineImageResourceElementType', + type: { + name: 'Composite', + className: 'VirtualMachineImageResource' + } + } + } + }; + 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); + }); +} + +/** + * Gets a list of virtual machine image offers for the specified location and + * publisher. + * + * @param {string} location The name of a supported Azure region. + * + * @param {string} publisherName A valid image publisher. + * + * @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. + * + * {array} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listOffers(location, publisherName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (location === null || location === undefined || typeof location.valueOf() !== 'string') { + throw new Error('location cannot be null or undefined and it must be of type string.'); + } + if (publisherName === null || publisherName === undefined || typeof publisherName.valueOf() !== 'string') { + throw new Error('publisherName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers'; + requestUrl = requestUrl.replace('{location}', encodeURIComponent(location)); + requestUrl = requestUrl.replace('{publisherName}', encodeURIComponent(publisherName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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 = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VirtualMachineImageResourceElementType', + type: { + name: 'Composite', + className: 'VirtualMachineImageResource' + } + } + } + }; + 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); + }); +} + +/** + * Gets a list of virtual machine image publishers for the specified Azure + * location. + * + * @param {string} location The name of a supported Azure region. + * + * @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. + * + * {array} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listPublishers(location, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (location === null || location === undefined || typeof location.valueOf() !== 'string') { + throw new Error('location cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers'; + requestUrl = requestUrl.replace('{location}', encodeURIComponent(location)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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 = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VirtualMachineImageResourceElementType', + type: { + name: 'Composite', + className: 'VirtualMachineImageResource' + } + } + } + }; + 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); + }); +} + +/** + * Gets a list of virtual machine image SKUs for the specified location, + * publisher, and offer. + * + * @param {string} location The name of a supported Azure region. + * + * @param {string} publisherName A valid image publisher. + * + * @param {string} offer A valid image publisher offer. + * + * @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. + * + * {array} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listSkus(location, publisherName, offer, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (location === null || location === undefined || typeof location.valueOf() !== 'string') { + throw new Error('location cannot be null or undefined and it must be of type string.'); + } + if (publisherName === null || publisherName === undefined || typeof publisherName.valueOf() !== 'string') { + throw new Error('publisherName cannot be null or undefined and it must be of type string.'); + } + if (offer === null || offer === undefined || typeof offer.valueOf() !== 'string') { + throw new Error('offer cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus'; + requestUrl = requestUrl.replace('{location}', encodeURIComponent(location)); + requestUrl = requestUrl.replace('{publisherName}', encodeURIComponent(publisherName)); + requestUrl = requestUrl.replace('{offer}', encodeURIComponent(offer)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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 = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VirtualMachineImageResourceElementType', + type: { + name: 'Composite', + className: 'VirtualMachineImageResource' + } + } + } + }; + 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 VirtualMachineImages. */ +class VirtualMachineImages { + /** + * Create a VirtualMachineImages. + * @param {ComputeManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._get = _get; + this._list = _list; + this._listOffers = _listOffers; + this._listPublishers = _listPublishers; + this._listSkus = _listSkus; + } + + /** + * Gets a virtual machine image. + * + * @param {string} location The name of a supported Azure region. + * + * @param {string} publisherName A valid image publisher. + * + * @param {string} offer A valid image publisher offer. + * + * @param {string} skus A valid image SKU. + * + * @param {string} version A valid image SKU version. + * + * @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(location, publisherName, offer, skus, version, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(location, publisherName, offer, skus, version, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a virtual machine image. + * + * @param {string} location The name of a supported Azure region. + * + * @param {string} publisherName A valid image publisher. + * + * @param {string} offer A valid image publisher offer. + * + * @param {string} skus A valid image SKU. + * + * @param {string} version A valid image SKU version. + * + * @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 {VirtualMachineImage} - 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 VirtualMachineImage} 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(location, publisherName, offer, skus, version, 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(location, publisherName, offer, skus, version, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(location, publisherName, offer, skus, version, options, optionalCallback); + } + } + + /** + * Gets a list of all virtual machine image versions for the specified + * location, publisher, offer, and SKU. + * + * @param {string} location The name of a supported Azure region. + * + * @param {string} publisherName A valid image publisher. + * + * @param {string} offer A valid image publisher offer. + * + * @param {string} skus A valid image SKU. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. + * + * @param {number} [options.top] + * + * @param {string} [options.orderby] + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listWithHttpOperationResponse(location, publisherName, offer, skus, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(location, publisherName, offer, skus, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a list of all virtual machine image versions for the specified + * location, publisher, offer, and SKU. + * + * @param {string} location The name of a supported Azure region. + * + * @param {string} publisherName A valid image publisher. + * + * @param {string} offer A valid image publisher offer. + * + * @param {string} skus A valid image SKU. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. + * + * @param {number} [options.top] + * + * @param {string} [options.orderby] + * + * @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 {Array} - 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. + * + * {array} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + list(location, publisherName, offer, skus, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._list(location, publisherName, offer, skus, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(location, publisherName, offer, skus, options, optionalCallback); + } + } + + /** + * Gets a list of virtual machine image offers for the specified location and + * publisher. + * + * @param {string} location The name of a supported Azure region. + * + * @param {string} publisherName A valid image publisher. + * + * @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. + */ + listOffersWithHttpOperationResponse(location, publisherName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listOffers(location, publisherName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a list of virtual machine image offers for the specified location and + * publisher. + * + * @param {string} location The name of a supported Azure region. + * + * @param {string} publisherName A valid image publisher. + * + * @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 {Array} - 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. + * + * {array} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listOffers(location, publisherName, 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._listOffers(location, publisherName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listOffers(location, publisherName, options, optionalCallback); + } + } + + /** + * Gets a list of virtual machine image publishers for the specified Azure + * location. + * + * @param {string} location The name of a supported Azure region. + * + * @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. + */ + listPublishersWithHttpOperationResponse(location, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listPublishers(location, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a list of virtual machine image publishers for the specified Azure + * location. + * + * @param {string} location The name of a supported Azure region. + * + * @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 {Array} - 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. + * + * {array} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listPublishers(location, 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._listPublishers(location, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listPublishers(location, options, optionalCallback); + } + } + + /** + * Gets a list of virtual machine image SKUs for the specified location, + * publisher, and offer. + * + * @param {string} location The name of a supported Azure region. + * + * @param {string} publisherName A valid image publisher. + * + * @param {string} offer A valid image publisher offer. + * + * @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. + */ + listSkusWithHttpOperationResponse(location, publisherName, offer, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listSkus(location, publisherName, offer, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a list of virtual machine image SKUs for the specified location, + * publisher, and offer. + * + * @param {string} location The name of a supported Azure region. + * + * @param {string} publisherName A valid image publisher. + * + * @param {string} offer A valid image publisher offer. + * + * @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 {Array} - 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. + * + * {array} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listSkus(location, publisherName, offer, 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._listSkus(location, publisherName, offer, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSkus(location, publisherName, offer, options, optionalCallback); + } + } + +} + +module.exports = VirtualMachineImages; diff --git a/lib/services/computeManagement2/lib/lib/operations/virtualMachineRunCommands.js b/lib/services/computeManagement2/lib/lib/operations/virtualMachineRunCommands.js new file mode 100644 index 0000000000..b5a3b434bb --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/operations/virtualMachineRunCommands.js @@ -0,0 +1,703 @@ +/* + * 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; + +/** + * Lists all available run commands for a subscription in a location. + * + * @param {string} location The location upon which run commands is queried. + * + * @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 RunCommandListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(location, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (location === null || location === undefined || typeof location.valueOf() !== 'string') { + throw new Error('location cannot be null or undefined and it must be of type string.'); + } + if (location !== null && location !== undefined) { + if (location.match(/^[-\w\._]+$/) === null) + { + throw new Error('"location" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + } + } + 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.Compute/locations/{location}/runCommands'; + requestUrl = requestUrl.replace('{location}', encodeURIComponent(location)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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['RunCommandListResult']().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); + }); +} + +/** + * Gets specific run command for a subscription in a location. + * + * @param {string} location The location upon which run commands is queried. + * + * @param {string} commandId The command id. + * + * @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 RunCommandDocument} 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(location, commandId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (location === null || location === undefined || typeof location.valueOf() !== 'string') { + throw new Error('location cannot be null or undefined and it must be of type string.'); + } + if (location !== null && location !== undefined) { + if (location.match(/^[-\w\._]+$/) === null) + { + throw new Error('"location" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + } + } + if (commandId === null || commandId === undefined || typeof commandId.valueOf() !== 'string') { + throw new Error('commandId cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/runCommands/{commandId}'; + requestUrl = requestUrl.replace('{location}', encodeURIComponent(location)); + requestUrl = requestUrl.replace('{commandId}', encodeURIComponent(commandId)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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['RunCommandDocument']().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); + }); +} + +/** + * Lists all available run commands for a subscription in a location. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RunCommandListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['RunCommandListResult']().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 VirtualMachineRunCommands. */ +class VirtualMachineRunCommands { + /** + * Create a VirtualMachineRunCommands. + * @param {ComputeManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._get = _get; + this._listNext = _listNext; + } + + /** + * Lists all available run commands for a subscription in a location. + * + * @param {string} location The location upon which run commands is queried. + * + * @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. + */ + listWithHttpOperationResponse(location, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(location, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all available run commands for a subscription in a location. + * + * @param {string} location The location upon which run commands is queried. + * + * @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 {RunCommandListResult} - 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 RunCommandListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + list(location, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._list(location, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(location, options, optionalCallback); + } + } + + /** + * Gets specific run command for a subscription in a location. + * + * @param {string} location The location upon which run commands is queried. + * + * @param {string} commandId The command id. + * + * @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(location, commandId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(location, commandId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets specific run command for a subscription in a location. + * + * @param {string} location The location upon which run commands is queried. + * + * @param {string} commandId The command id. + * + * @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 {RunCommandDocument} - 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 RunCommandDocument} 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(location, commandId, 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(location, commandId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(location, commandId, options, optionalCallback); + } + } + + /** + * Lists all available run commands for a subscription in a location. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all available run commands for a subscription in a location. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {RunCommandListResult} - 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 RunCommandListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = VirtualMachineRunCommands; diff --git a/lib/services/computeManagement2/lib/lib/operations/virtualMachineScaleSetExtensions.js b/lib/services/computeManagement2/lib/lib/operations/virtualMachineScaleSetExtensions.js new file mode 100644 index 0000000000..591b99d1ab --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/operations/virtualMachineScaleSetExtensions.js @@ -0,0 +1,1795 @@ +/* + * 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; + + +/** + * The operation to create or update an extension. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set where the + * extension should be create or updated. + * + * @param {string} vmssExtensionName The name of the VM scale set extension. + * + * @param {object} extensionParameters Parameters supplied to the Create VM + * scale set Extension operation. + * + * @param {string} [extensionParameters.name] The name of the extension. + * + * @param {string} [extensionParameters.forceUpdateTag] If a value is provided + * and is different from the previous value, the extension handler will be + * forced to update even if the extension configuration has not changed. + * + * @param {string} [extensionParameters.publisher] The name of the extension + * handler publisher. + * + * @param {string} [extensionParameters.type] Specifies the type of the + * extension; an example is "CustomScriptExtension". + * + * @param {string} [extensionParameters.typeHandlerVersion] Specifies the + * version of the script handler. + * + * @param {boolean} [extensionParameters.autoUpgradeMinorVersion] Indicates + * whether the extension should use a newer minor version if one is available + * at deployment time. Once deployed, however, the extension will not upgrade + * minor versions unless redeployed, even with this property set to true. + * + * @param {object} [extensionParameters.settings] Json formatted public + * settings for the extension. + * + * @param {object} [extensionParameters.protectedSettings] The extension can + * contain either protectedSettings or protectedSettingsFromKeyVault or no + * protected settings at all. + * + * @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 VirtualMachineScaleSetExtension} 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 _createOrUpdate(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginCreateOrUpdate(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['VirtualMachineScaleSetExtension']().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); + }); + }); +} + + +/** + * The operation to delete the extension. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set where the + * extension should be deleted. + * + * @param {string} vmssExtensionName The name of the VM scale set extension. + * + * @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 OperationStatusResponse} 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 _deleteMethod(resourceGroupName, vmScaleSetName, vmssExtensionName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginDeleteMethod(resourceGroupName, vmScaleSetName, vmssExtensionName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().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); + }); + }); +} + +/** + * The operation to get the extension. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set containing the + * extension. + * + * @param {string} vmssExtensionName The name of the VM scale set extension. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] The expand expression to apply on the + * operation. + * + * @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 VirtualMachineScaleSetExtension} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, vmScaleSetName, vmssExtensionName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let expand = (options && options.expand !== undefined) ? options.expand : undefined; + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmScaleSetName === null || vmScaleSetName === undefined || typeof vmScaleSetName.valueOf() !== 'string') { + throw new Error('vmScaleSetName cannot be null or undefined and it must be of type string.'); + } + if (vmssExtensionName === null || vmssExtensionName === undefined || typeof vmssExtensionName.valueOf() !== 'string') { + throw new Error('vmssExtensionName cannot be null or undefined and it must be of type string.'); + } + if (expand !== null && expand !== undefined && typeof expand.valueOf() !== 'string') { + throw new Error('expand must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmScaleSetName}', encodeURIComponent(vmScaleSetName)); + requestUrl = requestUrl.replace('{vmssExtensionName}', encodeURIComponent(vmssExtensionName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (expand !== null && expand !== undefined) { + queryParameters.push('$expand=' + encodeURIComponent(expand)); + } + queryParameters.push('api-version=' + encodeURIComponent(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['VirtualMachineScaleSetExtension']().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); + }); +} + +/** + * Gets a list of all extensions in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set containing the + * extension. + * + * @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 VirtualMachineScaleSetExtensionListResult} + * for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(resourceGroupName, vmScaleSetName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmScaleSetName === null || vmScaleSetName === undefined || typeof vmScaleSetName.valueOf() !== 'string') { + throw new Error('vmScaleSetName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmScaleSetName}', encodeURIComponent(vmScaleSetName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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['VirtualMachineScaleSetExtensionListResult']().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); + }); +} + +/** + * The operation to create or update an extension. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set where the + * extension should be create or updated. + * + * @param {string} vmssExtensionName The name of the VM scale set extension. + * + * @param {object} extensionParameters Parameters supplied to the Create VM + * scale set Extension operation. + * + * @param {string} [extensionParameters.name] The name of the extension. + * + * @param {string} [extensionParameters.forceUpdateTag] If a value is provided + * and is different from the previous value, the extension handler will be + * forced to update even if the extension configuration has not changed. + * + * @param {string} [extensionParameters.publisher] The name of the extension + * handler publisher. + * + * @param {string} [extensionParameters.type] Specifies the type of the + * extension; an example is "CustomScriptExtension". + * + * @param {string} [extensionParameters.typeHandlerVersion] Specifies the + * version of the script handler. + * + * @param {boolean} [extensionParameters.autoUpgradeMinorVersion] Indicates + * whether the extension should use a newer minor version if one is available + * at deployment time. Once deployed, however, the extension will not upgrade + * minor versions unless redeployed, even with this property set to true. + * + * @param {object} [extensionParameters.settings] Json formatted public + * settings for the extension. + * + * @param {object} [extensionParameters.protectedSettings] The extension can + * contain either protectedSettings or protectedSettingsFromKeyVault or no + * protected settings at all. + * + * @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 VirtualMachineScaleSetExtension} 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 _beginCreateOrUpdate(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmScaleSetName === null || vmScaleSetName === undefined || typeof vmScaleSetName.valueOf() !== 'string') { + throw new Error('vmScaleSetName cannot be null or undefined and it must be of type string.'); + } + if (vmssExtensionName === null || vmssExtensionName === undefined || typeof vmssExtensionName.valueOf() !== 'string') { + throw new Error('vmssExtensionName cannot be null or undefined and it must be of type string.'); + } + if (extensionParameters === null || extensionParameters === undefined) { + throw new Error('extensionParameters cannot be null or undefined.'); + } + 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmScaleSetName}', encodeURIComponent(vmScaleSetName)); + requestUrl = requestUrl.replace('{vmssExtensionName}', encodeURIComponent(vmssExtensionName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (extensionParameters !== null && extensionParameters !== undefined) { + let requestModelMapper = new client.models['VirtualMachineScaleSetExtension']().mapper(); + requestModel = client.serialize(requestModelMapper, extensionParameters, 'extensionParameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(extensionParameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + 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['VirtualMachineScaleSetExtension']().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); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['VirtualMachineScaleSetExtension']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * The operation to delete the extension. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set where the + * extension should be deleted. + * + * @param {string} vmssExtensionName The name of the VM scale set extension. + * + * @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 OperationStatusResponse} 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 _beginDeleteMethod(resourceGroupName, vmScaleSetName, vmssExtensionName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmScaleSetName === null || vmScaleSetName === undefined || typeof vmScaleSetName.valueOf() !== 'string') { + throw new Error('vmScaleSetName cannot be null or undefined and it must be of type string.'); + } + if (vmssExtensionName === null || vmssExtensionName === undefined || typeof vmssExtensionName.valueOf() !== 'string') { + throw new Error('vmssExtensionName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmScaleSetName}', encodeURIComponent(vmScaleSetName)); + requestUrl = requestUrl.replace('{vmssExtensionName}', encodeURIComponent(vmssExtensionName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // 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['OperationStatusResponse']().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); + }); +} + +/** + * Gets a list of all extensions in a VM scale set. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineScaleSetExtensionListResult} + * for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['VirtualMachineScaleSetExtensionListResult']().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 VirtualMachineScaleSetExtensions. */ +class VirtualMachineScaleSetExtensions { + /** + * Create a VirtualMachineScaleSetExtensions. + * @param {ComputeManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._createOrUpdate = _createOrUpdate; + this._deleteMethod = _deleteMethod; + this._get = _get; + this._list = _list; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginDeleteMethod = _beginDeleteMethod; + this._listNext = _listNext; + } + + /** + * The operation to create or update an extension. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set where the + * extension should be create or updated. + * + * @param {string} vmssExtensionName The name of the VM scale set extension. + * + * @param {object} extensionParameters Parameters supplied to the Create VM + * scale set Extension operation. + * + * @param {string} [extensionParameters.name] The name of the extension. + * + * @param {string} [extensionParameters.forceUpdateTag] If a value is provided + * and is different from the previous value, the extension handler will be + * forced to update even if the extension configuration has not changed. + * + * @param {string} [extensionParameters.publisher] The name of the extension + * handler publisher. + * + * @param {string} [extensionParameters.type] Specifies the type of the + * extension; an example is "CustomScriptExtension". + * + * @param {string} [extensionParameters.typeHandlerVersion] Specifies the + * version of the script handler. + * + * @param {boolean} [extensionParameters.autoUpgradeMinorVersion] Indicates + * whether the extension should use a newer minor version if one is available + * at deployment time. Once deployed, however, the extension will not upgrade + * minor versions unless redeployed, even with this property set to true. + * + * @param {object} [extensionParameters.settings] Json formatted public + * settings for the extension. + * + * @param {object} [extensionParameters.protectedSettings] The extension can + * contain either protectedSettings or protectedSettingsFromKeyVault or no + * protected settings at all. + * + * @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. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * The operation to create or update an extension. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set where the + * extension should be create or updated. + * + * @param {string} vmssExtensionName The name of the VM scale set extension. + * + * @param {object} extensionParameters Parameters supplied to the Create VM + * scale set Extension operation. + * + * @param {string} [extensionParameters.name] The name of the extension. + * + * @param {string} [extensionParameters.forceUpdateTag] If a value is provided + * and is different from the previous value, the extension handler will be + * forced to update even if the extension configuration has not changed. + * + * @param {string} [extensionParameters.publisher] The name of the extension + * handler publisher. + * + * @param {string} [extensionParameters.type] Specifies the type of the + * extension; an example is "CustomScriptExtension". + * + * @param {string} [extensionParameters.typeHandlerVersion] Specifies the + * version of the script handler. + * + * @param {boolean} [extensionParameters.autoUpgradeMinorVersion] Indicates + * whether the extension should use a newer minor version if one is available + * at deployment time. Once deployed, however, the extension will not upgrade + * minor versions unless redeployed, even with this property set to true. + * + * @param {object} [extensionParameters.settings] Json formatted public + * settings for the extension. + * + * @param {object} [extensionParameters.protectedSettings] The extension can + * contain either protectedSettings or protectedSettingsFromKeyVault or no + * protected settings at all. + * + * @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 {VirtualMachineScaleSetExtension} - 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 VirtualMachineScaleSetExtension} 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. + */ + createOrUpdate(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, 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._createOrUpdate(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, options, optionalCallback); + } + } + + /** + * The operation to delete the extension. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set where the + * extension should be deleted. + * + * @param {string} vmssExtensionName The name of the VM scale set extension. + * + * @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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, vmScaleSetName, vmssExtensionName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, vmScaleSetName, vmssExtensionName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * The operation to delete the extension. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set where the + * extension should be deleted. + * + * @param {string} vmssExtensionName The name of the VM scale set extension. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + deleteMethod(resourceGroupName, vmScaleSetName, vmssExtensionName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, vmScaleSetName, vmssExtensionName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, vmScaleSetName, vmssExtensionName, options, optionalCallback); + } + } + + /** + * The operation to get the extension. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set containing the + * extension. + * + * @param {string} vmssExtensionName The name of the VM scale set extension. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] The expand expression to apply on the + * operation. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, vmScaleSetName, vmssExtensionName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, vmScaleSetName, vmssExtensionName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * The operation to get the extension. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set containing the + * extension. + * + * @param {string} vmssExtensionName The name of the VM scale set extension. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] The expand expression to apply on the + * operation. + * + * @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 {VirtualMachineScaleSetExtension} - 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 VirtualMachineScaleSetExtension} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, vmScaleSetName, vmssExtensionName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(resourceGroupName, vmScaleSetName, vmssExtensionName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, vmScaleSetName, vmssExtensionName, options, optionalCallback); + } + } + + /** + * Gets a list of all extensions in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set containing the + * extension. + * + * @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. + */ + listWithHttpOperationResponse(resourceGroupName, vmScaleSetName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a list of all extensions in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set containing the + * extension. + * + * @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 {VirtualMachineScaleSetExtensionListResult} - 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 VirtualMachineScaleSetExtensionListResult} + * for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + list(resourceGroupName, vmScaleSetName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._list(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(resourceGroupName, vmScaleSetName, options, optionalCallback); + } + } + + /** + * The operation to create or update an extension. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set where the + * extension should be create or updated. + * + * @param {string} vmssExtensionName The name of the VM scale set extension. + * + * @param {object} extensionParameters Parameters supplied to the Create VM + * scale set Extension operation. + * + * @param {string} [extensionParameters.name] The name of the extension. + * + * @param {string} [extensionParameters.forceUpdateTag] If a value is provided + * and is different from the previous value, the extension handler will be + * forced to update even if the extension configuration has not changed. + * + * @param {string} [extensionParameters.publisher] The name of the extension + * handler publisher. + * + * @param {string} [extensionParameters.type] Specifies the type of the + * extension; an example is "CustomScriptExtension". + * + * @param {string} [extensionParameters.typeHandlerVersion] Specifies the + * version of the script handler. + * + * @param {boolean} [extensionParameters.autoUpgradeMinorVersion] Indicates + * whether the extension should use a newer minor version if one is available + * at deployment time. Once deployed, however, the extension will not upgrade + * minor versions unless redeployed, even with this property set to true. + * + * @param {object} [extensionParameters.settings] Json formatted public + * settings for the extension. + * + * @param {object} [extensionParameters.protectedSettings] The extension can + * contain either protectedSettings or protectedSettingsFromKeyVault or no + * protected settings at all. + * + * @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. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * The operation to create or update an extension. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set where the + * extension should be create or updated. + * + * @param {string} vmssExtensionName The name of the VM scale set extension. + * + * @param {object} extensionParameters Parameters supplied to the Create VM + * scale set Extension operation. + * + * @param {string} [extensionParameters.name] The name of the extension. + * + * @param {string} [extensionParameters.forceUpdateTag] If a value is provided + * and is different from the previous value, the extension handler will be + * forced to update even if the extension configuration has not changed. + * + * @param {string} [extensionParameters.publisher] The name of the extension + * handler publisher. + * + * @param {string} [extensionParameters.type] Specifies the type of the + * extension; an example is "CustomScriptExtension". + * + * @param {string} [extensionParameters.typeHandlerVersion] Specifies the + * version of the script handler. + * + * @param {boolean} [extensionParameters.autoUpgradeMinorVersion] Indicates + * whether the extension should use a newer minor version if one is available + * at deployment time. Once deployed, however, the extension will not upgrade + * minor versions unless redeployed, even with this property set to true. + * + * @param {object} [extensionParameters.settings] Json formatted public + * settings for the extension. + * + * @param {object} [extensionParameters.protectedSettings] The extension can + * contain either protectedSettings or protectedSettingsFromKeyVault or no + * protected settings at all. + * + * @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 {VirtualMachineScaleSetExtension} - 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 VirtualMachineScaleSetExtension} 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. + */ + beginCreateOrUpdate(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, 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._beginCreateOrUpdate(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, options, optionalCallback); + } + } + + /** + * The operation to delete the extension. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set where the + * extension should be deleted. + * + * @param {string} vmssExtensionName The name of the VM scale set extension. + * + * @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. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, vmScaleSetName, vmssExtensionName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, vmScaleSetName, vmssExtensionName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * The operation to delete the extension. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set where the + * extension should be deleted. + * + * @param {string} vmssExtensionName The name of the VM scale set extension. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + beginDeleteMethod(resourceGroupName, vmScaleSetName, vmssExtensionName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, vmScaleSetName, vmssExtensionName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, vmScaleSetName, vmssExtensionName, options, optionalCallback); + } + } + + /** + * Gets a list of all extensions in a VM scale set. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a list of all extensions in a VM scale set. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {VirtualMachineScaleSetExtensionListResult} - 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 VirtualMachineScaleSetExtensionListResult} + * for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = VirtualMachineScaleSetExtensions; diff --git a/lib/services/computeManagement2/lib/lib/operations/virtualMachineScaleSetRollingUpgrades.js b/lib/services/computeManagement2/lib/lib/operations/virtualMachineScaleSetRollingUpgrades.js new file mode 100644 index 0000000000..920f0cb874 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/operations/virtualMachineScaleSetRollingUpgrades.js @@ -0,0 +1,1071 @@ +/* + * 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; + + +/** + * Cancels the current virtual machine scale set rolling upgrade. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @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 OperationStatusResponse} 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 _cancel(resourceGroupName, vmScaleSetName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginCancel(resourceGroupName, vmScaleSetName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Starts a rolling upgrade to move all virtual machine scale set instances to + * the latest available Platform Image OS version. Instances which are already + * running the latest available OS version are not affected. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @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 OperationStatusResponse} 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 _startOSUpgrade(resourceGroupName, vmScaleSetName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginStartOSUpgrade(resourceGroupName, vmScaleSetName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().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); + }); + }); +} + +/** + * Gets the status of the latest virtual machine scale set rolling upgrade. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @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 RollingUpgradeStatusInfo} 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 _getLatest(resourceGroupName, vmScaleSetName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmScaleSetName === null || vmScaleSetName === undefined || typeof vmScaleSetName.valueOf() !== 'string') { + throw new Error('vmScaleSetName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/rollingUpgrades/latest'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmScaleSetName}', encodeURIComponent(vmScaleSetName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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['RollingUpgradeStatusInfo']().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); + }); +} + +/** + * Cancels the current virtual machine scale set rolling upgrade. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @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 OperationStatusResponse} 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 _beginCancel(resourceGroupName, vmScaleSetName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmScaleSetName === null || vmScaleSetName === undefined || typeof vmScaleSetName.valueOf() !== 'string') { + throw new Error('vmScaleSetName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/rollingUpgrades/cancel'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmScaleSetName}', encodeURIComponent(vmScaleSetName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Starts a rolling upgrade to move all virtual machine scale set instances to + * the latest available Platform Image OS version. Instances which are already + * running the latest available OS version are not affected. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @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 OperationStatusResponse} 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 _beginStartOSUpgrade(resourceGroupName, vmScaleSetName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmScaleSetName === null || vmScaleSetName === undefined || typeof vmScaleSetName.valueOf() !== 'string') { + throw new Error('vmScaleSetName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/osRollingUpgrade'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmScaleSetName}', encodeURIComponent(vmScaleSetName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().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 VirtualMachineScaleSetRollingUpgrades. */ +class VirtualMachineScaleSetRollingUpgrades { + /** + * Create a VirtualMachineScaleSetRollingUpgrades. + * @param {ComputeManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._cancel = _cancel; + this._startOSUpgrade = _startOSUpgrade; + this._getLatest = _getLatest; + this._beginCancel = _beginCancel; + this._beginStartOSUpgrade = _beginStartOSUpgrade; + } + + /** + * Cancels the current virtual machine scale set rolling upgrade. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @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. + */ + cancelWithHttpOperationResponse(resourceGroupName, vmScaleSetName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._cancel(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Cancels the current virtual machine scale set rolling upgrade. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + cancel(resourceGroupName, vmScaleSetName, 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._cancel(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._cancel(resourceGroupName, vmScaleSetName, options, optionalCallback); + } + } + + /** + * Starts a rolling upgrade to move all virtual machine scale set instances to + * the latest available Platform Image OS version. Instances which are already + * running the latest available OS version are not affected. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @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. + */ + startOSUpgradeWithHttpOperationResponse(resourceGroupName, vmScaleSetName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._startOSUpgrade(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Starts a rolling upgrade to move all virtual machine scale set instances to + * the latest available Platform Image OS version. Instances which are already + * running the latest available OS version are not affected. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + startOSUpgrade(resourceGroupName, vmScaleSetName, 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._startOSUpgrade(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._startOSUpgrade(resourceGroupName, vmScaleSetName, options, optionalCallback); + } + } + + /** + * Gets the status of the latest virtual machine scale set rolling upgrade. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @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. + */ + getLatestWithHttpOperationResponse(resourceGroupName, vmScaleSetName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getLatest(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the status of the latest virtual machine scale set rolling upgrade. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @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 {RollingUpgradeStatusInfo} - 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 RollingUpgradeStatusInfo} 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. + */ + getLatest(resourceGroupName, vmScaleSetName, 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._getLatest(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getLatest(resourceGroupName, vmScaleSetName, options, optionalCallback); + } + } + + /** + * Cancels the current virtual machine scale set rolling upgrade. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @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. + */ + beginCancelWithHttpOperationResponse(resourceGroupName, vmScaleSetName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCancel(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Cancels the current virtual machine scale set rolling upgrade. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + beginCancel(resourceGroupName, vmScaleSetName, 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._beginCancel(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCancel(resourceGroupName, vmScaleSetName, options, optionalCallback); + } + } + + /** + * Starts a rolling upgrade to move all virtual machine scale set instances to + * the latest available Platform Image OS version. Instances which are already + * running the latest available OS version are not affected. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @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. + */ + beginStartOSUpgradeWithHttpOperationResponse(resourceGroupName, vmScaleSetName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginStartOSUpgrade(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Starts a rolling upgrade to move all virtual machine scale set instances to + * the latest available Platform Image OS version. Instances which are already + * running the latest available OS version are not affected. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + beginStartOSUpgrade(resourceGroupName, vmScaleSetName, 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._beginStartOSUpgrade(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginStartOSUpgrade(resourceGroupName, vmScaleSetName, options, optionalCallback); + } + } + +} + +module.exports = VirtualMachineScaleSetRollingUpgrades; diff --git a/lib/services/computeManagement2/lib/lib/operations/virtualMachineScaleSetVMs.js b/lib/services/computeManagement2/lib/lib/operations/virtualMachineScaleSetVMs.js new file mode 100644 index 0000000000..a86c085fe7 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/operations/virtualMachineScaleSetVMs.js @@ -0,0 +1,7399 @@ +/* + * 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; + + +/** + * Reimages (upgrade the operating system) a specific virtual machine in a VM + * scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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 OperationStatusResponse} 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 _reimage(resourceGroupName, vmScaleSetName, instanceId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginReimage(resourceGroupName, vmScaleSetName, instanceId, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().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); + }); + }); +} + + +/** + * Allows you to re-image all the disks ( including data disks ) in the a VM + * scale set instance. This operation is only supported for managed disks. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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 OperationStatusResponse} 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 _reimageAll(resourceGroupName, vmScaleSetName, instanceId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginReimageAll(resourceGroupName, vmScaleSetName, instanceId, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().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); + }); + }); +} + + +/** + * Deallocates a specific virtual machine in a VM scale set. Shuts down the + * virtual machine and releases the compute resources it uses. You are not + * billed for the compute resources of this virtual machine once it is + * deallocated. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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 OperationStatusResponse} 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 _deallocate(resourceGroupName, vmScaleSetName, instanceId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginDeallocate(resourceGroupName, vmScaleSetName, instanceId, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().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); + }); + }); +} + + +/** + * Updates a virtual machine of a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set where the + * extension should be create or updated. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Update Virtual Machine + * Scale Sets VM operation. + * + * @param {object} [parameters.hardwareProfile] Specifies the hardware settings + * for the virtual machine. + * + * @param {string} [parameters.hardwareProfile.vmSize] Specifies the size of + * the virtual machine. For more information about virtual machine sizes, see + * [Sizes for virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    The available VM sizes depend on region and availability set. For a + * list of available sizes use these APIs:

    [List all available + * virtual machine sizes in an availability + * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) + *

    [List all available virtual machine sizes in a + * region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) + *

    [List all available virtual machine sizes for + * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). + * Possible values include: '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_B1s', 'Standard_B1ms', + * 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', + * '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_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', + * 'Standard_D32_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', + * 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', + * 'Standard_D64s_v3', '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_DS13-4_v2', 'Standard_DS13-2_v2', + * 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', 'Standard_E2_v3', + * 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', 'Standard_E32_v3', + * 'Standard_E64_v3', 'Standard_E2s_v3', 'Standard_E4s_v3', 'Standard_E8s_v3', + * 'Standard_E16s_v3', 'Standard_E32s_v3', 'Standard_E64s_v3', + * 'Standard_E32-16_v3', 'Standard_E32-8s_v3', 'Standard_E64-32s_v3', + * 'Standard_E64-16s_v3', 'Standard_F1', 'Standard_F2', 'Standard_F4', + * 'Standard_F8', 'Standard_F16', 'Standard_F1s', 'Standard_F2s', + * 'Standard_F4s', 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2', + * 'Standard_F4s_v2', 'Standard_F8s_v2', 'Standard_F16s_v2', + * 'Standard_F32s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1', + * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', + * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', + * 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8', + * 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m', + * 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', + * 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms', + * 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms', + * 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms', + * 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', + * 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2', + * 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3', + * 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s', + * 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6', + * 'Standard_NV12', 'Standard_NV24' + * + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. + * + * @param {object} [parameters.storageProfile.imageReference] Specifies + * information about the image to use. You can specify information about + * platform images, marketplace images, or virtual machine images. This element + * is required when you want to use a platform image, marketplace image, or + * virtual machine image, but is not used in other creation operations. + * + * @param {string} [parameters.storageProfile.imageReference.publisher] The + * image publisher. + * + * @param {string} [parameters.storageProfile.imageReference.offer] Specifies + * the offer of the platform image or marketplace image used to create the + * virtual machine. + * + * @param {string} [parameters.storageProfile.imageReference.sku] The image + * SKU. + * + * @param {string} [parameters.storageProfile.imageReference.version] Specifies + * the version of the platform image or marketplace image used to create the + * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the + * latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. + * + * @param {string} [parameters.storageProfile.imageReference.id] Resource Id + * + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} [parameters.storageProfile.osDisk.osType] This property + * allows you to specify the type of the OS that is included in the disk if + * creating a VM from user-image or a specialized VHD.

    Possible values + * are:

    **Windows**

    **Linux**. Possible values include: + * 'Windows', 'Linux' + * + * @param {object} [parameters.storageProfile.osDisk.encryptionSettings] + * Specifies the encryption settings for the OS Disk.

    Minimum + * api-version: 2015-06-15 + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey] + * Specifies the location of the disk encryption key, which is a Key Vault + * Secret. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.secretUrl + * The URL referencing a secret in a Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the secret. + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey] + * Specifies the location of the key encryption key in Key Vault. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.keyUrl + * The URL referencing a key encryption key in Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the key. + * + * @param {boolean} + * [parameters.storageProfile.osDisk.encryptionSettings.enabled] Specifies + * whether disk encryption should be enabled on the virtual machine. + * + * @param {string} [parameters.storageProfile.osDisk.name] The disk name. + * + * @param {object} [parameters.storageProfile.osDisk.vhd] The virtual hard + * disk. + * + * @param {object} [parameters.storageProfile.osDisk.image] The source user + * image virtual hard disk. The virtual hard disk will be copied before being + * attached to the virtual machine. If SourceImage is provided, the destination + * virtual hard drive must not exist. + * + * @param {string} [parameters.storageProfile.osDisk.image.uri] Specifies the + * virtual hard disk's uri. + * + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {boolean} [parameters.storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @param {string} parameters.storageProfile.osDisk.createOption Specifies how + * the virtual machine should be created.

    Possible values are:

    + * **Attach** \u2013 This value is used when you are using a specialized disk + * to create the virtual machine.

    **FromImage** \u2013 This value is + * used when you are using an image to create the virtual machine. If you are + * using a platform image, you also use the imageReference element described + * above. If you are using a marketplace image, you also use the plan element + * previously described. Possible values include: 'FromImage', 'Empty', + * 'Attach' + * + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of an empty data disk in gigabytes. This element can be used to + * overwrite the name of the disk in a virtual machine image.

    This + * value cannot be larger than 1023 GB + * + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed + * disk parameters. + * + * @param {string} + * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies + * the storage account type for the managed disk. Possible values are: + * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id + * + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {object} [parameters.osProfile] Specifies the operating system + * settings for the virtual machine. + * + * @param {string} [parameters.osProfile.computerName] Specifies the host OS + * name of the virtual machine.

    **Max-length (Windows):** 15 + * characters

    **Max-length (Linux):** 64 characters.

    For + * naming conventions and restrictions see [Azure infrastructure services + * implementation + * guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). + * + * @param {string} [parameters.osProfile.adminUsername] Specifies the name of + * the administrator account.

    **Windows-only restriction:** Cannot end + * in "."

    **Disallowed values:** "administrator", "admin", "user", + * "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", + * "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", + * "john", "owner", "root", "server", "sql", "support", "support_388945a0", + * "sys", "test2", "test3", "user4", "user5".

    **Minimum-length + * (Linux):** 1 character

    **Max-length (Linux):** 64 characters + *

    **Max-length (Windows):** 20 characters

  • For root + * access to the Linux VM, see [Using root privileges on Linux virtual machines + * in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in this + * field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {string} [parameters.osProfile.adminPassword] Specifies the password + * of the administrator account.

    **Minimum-length (Windows):** 8 + * characters

    **Minimum-length (Linux):** 6 characters

    + * **Max-length (Windows):** 123 characters

    **Max-length (Linux):** 72 + * characters

    **Complexity requirements:** 3 out of 4 conditions below + * need to be fulfilled
    Has lower characters
    Has upper characters
    + * Has a digit
    Has a special character (Regex match [\W_])

    + * **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", + * "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", + * "iloveyou!"

    For resetting the password, see [How to reset the + * Remote Desktop service or its login password in a Windows + * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    For resetting root password, see [Manage users, SSH, and check or + * repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + * + * @param {string} [parameters.osProfile.customData] Specifies a base-64 + * encoded string of custom data. The base-64 encoded string is decoded to a + * binary array that is saved as a file on the Virtual Machine. The maximum + * length of the binary array is 65535 bytes.

    For using cloud-init for + * your VM, see [Using cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {object} [parameters.osProfile.windowsConfiguration] Specifies + * Windows operating system settings on the virtual machine. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.provisionVMAgent] Indicates + * whether virtual machine agent should be provisioned on the virtual machine. + *

    When this property is not specified in the request body, default + * behavior is to set it to true. This will ensure that VM Agent is installed + * on the VM so that extensions can be added to the VM later. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.enableAutomaticUpdates] Indicates + * whether virtual machine is enabled for automatic updates. + * + * @param {string} [parameters.osProfile.windowsConfiguration.timeZone] + * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" + * + * @param {array} + * [parameters.osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * + * @param {object} [parameters.osProfile.windowsConfiguration.winRM] Specifies + * the Windows Remote Management listeners. This enables remote Windows + * PowerShell. + * + * @param {array} [parameters.osProfile.windowsConfiguration.winRM.listeners] + * The list of Windows Remote Management listeners + * + * @param {object} [parameters.osProfile.linuxConfiguration] Specifies the + * Linux operating system settings on the virtual machine.

    For a list + * of supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @param {boolean} + * [parameters.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * + * @param {object} [parameters.osProfile.linuxConfiguration.ssh] Specifies the + * ssh key configuration for a Linux OS. + * + * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The + * list of SSH public keys used to authenticate with linux based VMs. + * + * @param {array} [parameters.osProfile.secrets] Specifies set of certificates + * that should be installed onto the virtual machine. + * + * @param {object} [parameters.networkProfile] Specifies the network interfaces + * of the virtual machine. + * + * @param {array} [parameters.networkProfile.networkInterfaces] Specifies the + * list of resource Ids for the network interfaces associated with the virtual + * machine. + * + * @param {object} [parameters.diagnosticsProfile] Specifies the boot + * diagnostic settings state.

    Minimum api-version: 2015-06-15. + * + * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, + * you can easily view the output of your console log.

    For both + * Windows and Linux virtual machines, Azure also enables you to see a + * screenshot of the VM from the hypervisor. + * + * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] + * Whether boot diagnostics should be enabled on the Virtual Machine. + * + * @param {string} [parameters.diagnosticsProfile.bootDiagnostics.storageUri] + * Uri of the storage account to use for placing the console output and + * screenshot. + * + * @param {object} [parameters.availabilitySet] Specifies information about the + * availability set that the virtual machine should be assigned to. Virtual + * machines specified in the same availability set are allocated to different + * nodes to maximize availability. For more information about availability + * sets, see [Manage the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    For more information on Azure planned maintainance, see [Planned + * maintenance for virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Currently, a VM can only be added to availability set at creation + * time. An existing VM cannot be added to an availability set. + * + * @param {string} [parameters.availabilitySet.id] Resource Id + * + * @param {string} [parameters.licenseType] Specifies that the image or disk + * that is being used was licensed on-premises. This element is only used for + * images that contain the Windows Server operating system.

    Possible + * values are:

    Windows_Client

    Windows_Server

    If this + * element is included in a request for an update, the value must match the + * initial value. This value cannot be updated.

    For more information, + * see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Minimum api-version: 2015-06-15 + * + * @param {object} [parameters.plan] Specifies information about the + * marketplace image used to create the virtual machine. This element is only + * used for marketplace images. Before you can use a marketplace image from an + * API, you must enable the image for programmatic use. In the Azure portal, + * find the marketplace image that you want to use and then click **Want to + * deploy programmatically, Get Started ->**. Enter any required information + * and then click **Save**. + * + * @param {string} [parameters.plan.name] The plan ID. + * + * @param {string} [parameters.plan.publisher] The publisher ID. + * + * @param {string} [parameters.plan.product] Specifies the product of the image + * from the marketplace. This is the same value as Offer under the + * imageReference element. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @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 VirtualMachineScaleSetVM} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _update(resourceGroupName, vmScaleSetName, instanceId, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginUpdate(resourceGroupName, vmScaleSetName, instanceId, parameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['VirtualMachineScaleSetVM']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Deletes a virtual machine from a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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 OperationStatusResponse} 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 _deleteMethod(resourceGroupName, vmScaleSetName, instanceId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginDeleteMethod(resourceGroupName, vmScaleSetName, instanceId, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().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); + }); + }); +} + +/** + * Gets a virtual machine from a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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 VirtualMachineScaleSetVM} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, vmScaleSetName, instanceId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmScaleSetName === null || vmScaleSetName === undefined || typeof vmScaleSetName.valueOf() !== 'string') { + throw new Error('vmScaleSetName cannot be null or undefined and it must be of type string.'); + } + if (instanceId === null || instanceId === undefined || typeof instanceId.valueOf() !== 'string') { + throw new Error('instanceId cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmScaleSetName}', encodeURIComponent(vmScaleSetName)); + requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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['VirtualMachineScaleSetVM']().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); + }); +} + +/** + * Gets the status of a virtual machine from a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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 VirtualMachineScaleSetVMInstanceView} 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 _getInstanceView(resourceGroupName, vmScaleSetName, instanceId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmScaleSetName === null || vmScaleSetName === undefined || typeof vmScaleSetName.valueOf() !== 'string') { + throw new Error('vmScaleSetName cannot be null or undefined and it must be of type string.'); + } + if (instanceId === null || instanceId === undefined || typeof instanceId.valueOf() !== 'string') { + throw new Error('instanceId cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/instanceView'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmScaleSetName}', encodeURIComponent(vmScaleSetName)); + requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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['VirtualMachineScaleSetVMInstanceView']().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); + }); +} + +/** + * Gets a list of all virtual machines in a VM scale sets. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualMachineScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply to the operation. + * + * @param {string} [options.select] The list parameters. + * + * @param {string} [options.expand] The expand expression to apply to the + * operation. + * + * @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 VirtualMachineScaleSetVMListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(resourceGroupName, virtualMachineScaleSetName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let filter = (options && options.filter !== undefined) ? options.filter : undefined; + let select = (options && options.select !== undefined) ? options.select : undefined; + let expand = (options && options.expand !== undefined) ? options.expand : undefined; + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (virtualMachineScaleSetName === null || virtualMachineScaleSetName === undefined || typeof virtualMachineScaleSetName.valueOf() !== 'string') { + throw new Error('virtualMachineScaleSetName cannot be null or undefined and it must be of type string.'); + } + if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { + throw new Error('filter must be of type string.'); + } + if (select !== null && select !== undefined && typeof select.valueOf() !== 'string') { + throw new Error('select must be of type string.'); + } + if (expand !== null && expand !== undefined && typeof expand.valueOf() !== 'string') { + throw new Error('expand must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{virtualMachineScaleSetName}', encodeURIComponent(virtualMachineScaleSetName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (filter !== null && filter !== undefined) { + queryParameters.push('$filter=' + encodeURIComponent(filter)); + } + if (select !== null && select !== undefined) { + queryParameters.push('$select=' + encodeURIComponent(select)); + } + if (expand !== null && expand !== undefined) { + queryParameters.push('$expand=' + encodeURIComponent(expand)); + } + queryParameters.push('api-version=' + encodeURIComponent(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['VirtualMachineScaleSetVMListResult']().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); + }); +} + + +/** + * Power off (stop) a virtual machine in a VM scale set. Note that resources + * are still attached and you are getting charged for the resources. Instead, + * use deallocate to release resources and avoid charges. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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 OperationStatusResponse} 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 _powerOff(resourceGroupName, vmScaleSetName, instanceId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginPowerOff(resourceGroupName, vmScaleSetName, instanceId, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().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); + }); + }); +} + + +/** + * Restarts a virtual machine in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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 OperationStatusResponse} 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 _restart(resourceGroupName, vmScaleSetName, instanceId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginRestart(resourceGroupName, vmScaleSetName, instanceId, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Starts a virtual machine in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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 OperationStatusResponse} 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 _start(resourceGroupName, vmScaleSetName, instanceId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginStart(resourceGroupName, vmScaleSetName, instanceId, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().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); + }); + }); +} + + +/** + * Redeploys a virtual machine in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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 OperationStatusResponse} 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 _redeploy(resourceGroupName, vmScaleSetName, instanceId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginRedeploy(resourceGroupName, vmScaleSetName, instanceId, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().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); + }); + }); +} + + +/** + * Performs maintenance on a virtual machine in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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 OperationStatusResponse} 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 _performMaintenance(resourceGroupName, vmScaleSetName, instanceId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginPerformMaintenance(resourceGroupName, vmScaleSetName, instanceId, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().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); + }); + }); +} + +/** + * Reimages (upgrade the operating system) a specific virtual machine in a VM + * scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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 OperationStatusResponse} 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 _beginReimage(resourceGroupName, vmScaleSetName, instanceId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmScaleSetName === null || vmScaleSetName === undefined || typeof vmScaleSetName.valueOf() !== 'string') { + throw new Error('vmScaleSetName cannot be null or undefined and it must be of type string.'); + } + if (instanceId === null || instanceId === undefined || typeof instanceId.valueOf() !== 'string') { + throw new Error('instanceId cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/reimage'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmScaleSetName}', encodeURIComponent(vmScaleSetName)); + requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().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); + }); +} + +/** + * Allows you to re-image all the disks ( including data disks ) in the a VM + * scale set instance. This operation is only supported for managed disks. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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 OperationStatusResponse} 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 _beginReimageAll(resourceGroupName, vmScaleSetName, instanceId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmScaleSetName === null || vmScaleSetName === undefined || typeof vmScaleSetName.valueOf() !== 'string') { + throw new Error('vmScaleSetName cannot be null or undefined and it must be of type string.'); + } + if (instanceId === null || instanceId === undefined || typeof instanceId.valueOf() !== 'string') { + throw new Error('instanceId cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/reimageall'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmScaleSetName}', encodeURIComponent(vmScaleSetName)); + requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().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); + }); +} + +/** + * Deallocates a specific virtual machine in a VM scale set. Shuts down the + * virtual machine and releases the compute resources it uses. You are not + * billed for the compute resources of this virtual machine once it is + * deallocated. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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 OperationStatusResponse} 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 _beginDeallocate(resourceGroupName, vmScaleSetName, instanceId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmScaleSetName === null || vmScaleSetName === undefined || typeof vmScaleSetName.valueOf() !== 'string') { + throw new Error('vmScaleSetName cannot be null or undefined and it must be of type string.'); + } + if (instanceId === null || instanceId === undefined || typeof instanceId.valueOf() !== 'string') { + throw new Error('instanceId cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/deallocate'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmScaleSetName}', encodeURIComponent(vmScaleSetName)); + requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().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); + }); +} + +/** + * Updates a virtual machine of a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set where the + * extension should be create or updated. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Update Virtual Machine + * Scale Sets VM operation. + * + * @param {object} [parameters.hardwareProfile] Specifies the hardware settings + * for the virtual machine. + * + * @param {string} [parameters.hardwareProfile.vmSize] Specifies the size of + * the virtual machine. For more information about virtual machine sizes, see + * [Sizes for virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    The available VM sizes depend on region and availability set. For a + * list of available sizes use these APIs:

    [List all available + * virtual machine sizes in an availability + * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) + *

    [List all available virtual machine sizes in a + * region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) + *

    [List all available virtual machine sizes for + * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). + * Possible values include: '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_B1s', 'Standard_B1ms', + * 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', + * '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_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', + * 'Standard_D32_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', + * 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', + * 'Standard_D64s_v3', '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_DS13-4_v2', 'Standard_DS13-2_v2', + * 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', 'Standard_E2_v3', + * 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', 'Standard_E32_v3', + * 'Standard_E64_v3', 'Standard_E2s_v3', 'Standard_E4s_v3', 'Standard_E8s_v3', + * 'Standard_E16s_v3', 'Standard_E32s_v3', 'Standard_E64s_v3', + * 'Standard_E32-16_v3', 'Standard_E32-8s_v3', 'Standard_E64-32s_v3', + * 'Standard_E64-16s_v3', 'Standard_F1', 'Standard_F2', 'Standard_F4', + * 'Standard_F8', 'Standard_F16', 'Standard_F1s', 'Standard_F2s', + * 'Standard_F4s', 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2', + * 'Standard_F4s_v2', 'Standard_F8s_v2', 'Standard_F16s_v2', + * 'Standard_F32s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1', + * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', + * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', + * 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8', + * 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m', + * 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', + * 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms', + * 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms', + * 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms', + * 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', + * 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2', + * 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3', + * 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s', + * 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6', + * 'Standard_NV12', 'Standard_NV24' + * + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. + * + * @param {object} [parameters.storageProfile.imageReference] Specifies + * information about the image to use. You can specify information about + * platform images, marketplace images, or virtual machine images. This element + * is required when you want to use a platform image, marketplace image, or + * virtual machine image, but is not used in other creation operations. + * + * @param {string} [parameters.storageProfile.imageReference.publisher] The + * image publisher. + * + * @param {string} [parameters.storageProfile.imageReference.offer] Specifies + * the offer of the platform image or marketplace image used to create the + * virtual machine. + * + * @param {string} [parameters.storageProfile.imageReference.sku] The image + * SKU. + * + * @param {string} [parameters.storageProfile.imageReference.version] Specifies + * the version of the platform image or marketplace image used to create the + * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the + * latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. + * + * @param {string} [parameters.storageProfile.imageReference.id] Resource Id + * + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} [parameters.storageProfile.osDisk.osType] This property + * allows you to specify the type of the OS that is included in the disk if + * creating a VM from user-image or a specialized VHD.

    Possible values + * are:

    **Windows**

    **Linux**. Possible values include: + * 'Windows', 'Linux' + * + * @param {object} [parameters.storageProfile.osDisk.encryptionSettings] + * Specifies the encryption settings for the OS Disk.

    Minimum + * api-version: 2015-06-15 + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey] + * Specifies the location of the disk encryption key, which is a Key Vault + * Secret. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.secretUrl + * The URL referencing a secret in a Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the secret. + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey] + * Specifies the location of the key encryption key in Key Vault. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.keyUrl + * The URL referencing a key encryption key in Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the key. + * + * @param {boolean} + * [parameters.storageProfile.osDisk.encryptionSettings.enabled] Specifies + * whether disk encryption should be enabled on the virtual machine. + * + * @param {string} [parameters.storageProfile.osDisk.name] The disk name. + * + * @param {object} [parameters.storageProfile.osDisk.vhd] The virtual hard + * disk. + * + * @param {object} [parameters.storageProfile.osDisk.image] The source user + * image virtual hard disk. The virtual hard disk will be copied before being + * attached to the virtual machine. If SourceImage is provided, the destination + * virtual hard drive must not exist. + * + * @param {string} [parameters.storageProfile.osDisk.image.uri] Specifies the + * virtual hard disk's uri. + * + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {boolean} [parameters.storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @param {string} parameters.storageProfile.osDisk.createOption Specifies how + * the virtual machine should be created.

    Possible values are:

    + * **Attach** \u2013 This value is used when you are using a specialized disk + * to create the virtual machine.

    **FromImage** \u2013 This value is + * used when you are using an image to create the virtual machine. If you are + * using a platform image, you also use the imageReference element described + * above. If you are using a marketplace image, you also use the plan element + * previously described. Possible values include: 'FromImage', 'Empty', + * 'Attach' + * + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of an empty data disk in gigabytes. This element can be used to + * overwrite the name of the disk in a virtual machine image.

    This + * value cannot be larger than 1023 GB + * + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed + * disk parameters. + * + * @param {string} + * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies + * the storage account type for the managed disk. Possible values are: + * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id + * + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {object} [parameters.osProfile] Specifies the operating system + * settings for the virtual machine. + * + * @param {string} [parameters.osProfile.computerName] Specifies the host OS + * name of the virtual machine.

    **Max-length (Windows):** 15 + * characters

    **Max-length (Linux):** 64 characters.

    For + * naming conventions and restrictions see [Azure infrastructure services + * implementation + * guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). + * + * @param {string} [parameters.osProfile.adminUsername] Specifies the name of + * the administrator account.

    **Windows-only restriction:** Cannot end + * in "."

    **Disallowed values:** "administrator", "admin", "user", + * "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", + * "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", + * "john", "owner", "root", "server", "sql", "support", "support_388945a0", + * "sys", "test2", "test3", "user4", "user5".

    **Minimum-length + * (Linux):** 1 character

    **Max-length (Linux):** 64 characters + *

    **Max-length (Windows):** 20 characters

  • For root + * access to the Linux VM, see [Using root privileges on Linux virtual machines + * in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in this + * field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {string} [parameters.osProfile.adminPassword] Specifies the password + * of the administrator account.

    **Minimum-length (Windows):** 8 + * characters

    **Minimum-length (Linux):** 6 characters

    + * **Max-length (Windows):** 123 characters

    **Max-length (Linux):** 72 + * characters

    **Complexity requirements:** 3 out of 4 conditions below + * need to be fulfilled
    Has lower characters
    Has upper characters
    + * Has a digit
    Has a special character (Regex match [\W_])

    + * **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", + * "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", + * "iloveyou!"

    For resetting the password, see [How to reset the + * Remote Desktop service or its login password in a Windows + * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    For resetting root password, see [Manage users, SSH, and check or + * repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + * + * @param {string} [parameters.osProfile.customData] Specifies a base-64 + * encoded string of custom data. The base-64 encoded string is decoded to a + * binary array that is saved as a file on the Virtual Machine. The maximum + * length of the binary array is 65535 bytes.

    For using cloud-init for + * your VM, see [Using cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {object} [parameters.osProfile.windowsConfiguration] Specifies + * Windows operating system settings on the virtual machine. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.provisionVMAgent] Indicates + * whether virtual machine agent should be provisioned on the virtual machine. + *

    When this property is not specified in the request body, default + * behavior is to set it to true. This will ensure that VM Agent is installed + * on the VM so that extensions can be added to the VM later. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.enableAutomaticUpdates] Indicates + * whether virtual machine is enabled for automatic updates. + * + * @param {string} [parameters.osProfile.windowsConfiguration.timeZone] + * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" + * + * @param {array} + * [parameters.osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * + * @param {object} [parameters.osProfile.windowsConfiguration.winRM] Specifies + * the Windows Remote Management listeners. This enables remote Windows + * PowerShell. + * + * @param {array} [parameters.osProfile.windowsConfiguration.winRM.listeners] + * The list of Windows Remote Management listeners + * + * @param {object} [parameters.osProfile.linuxConfiguration] Specifies the + * Linux operating system settings on the virtual machine.

    For a list + * of supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @param {boolean} + * [parameters.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * + * @param {object} [parameters.osProfile.linuxConfiguration.ssh] Specifies the + * ssh key configuration for a Linux OS. + * + * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The + * list of SSH public keys used to authenticate with linux based VMs. + * + * @param {array} [parameters.osProfile.secrets] Specifies set of certificates + * that should be installed onto the virtual machine. + * + * @param {object} [parameters.networkProfile] Specifies the network interfaces + * of the virtual machine. + * + * @param {array} [parameters.networkProfile.networkInterfaces] Specifies the + * list of resource Ids for the network interfaces associated with the virtual + * machine. + * + * @param {object} [parameters.diagnosticsProfile] Specifies the boot + * diagnostic settings state.

    Minimum api-version: 2015-06-15. + * + * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, + * you can easily view the output of your console log.

    For both + * Windows and Linux virtual machines, Azure also enables you to see a + * screenshot of the VM from the hypervisor. + * + * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] + * Whether boot diagnostics should be enabled on the Virtual Machine. + * + * @param {string} [parameters.diagnosticsProfile.bootDiagnostics.storageUri] + * Uri of the storage account to use for placing the console output and + * screenshot. + * + * @param {object} [parameters.availabilitySet] Specifies information about the + * availability set that the virtual machine should be assigned to. Virtual + * machines specified in the same availability set are allocated to different + * nodes to maximize availability. For more information about availability + * sets, see [Manage the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    For more information on Azure planned maintainance, see [Planned + * maintenance for virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Currently, a VM can only be added to availability set at creation + * time. An existing VM cannot be added to an availability set. + * + * @param {string} [parameters.availabilitySet.id] Resource Id + * + * @param {string} [parameters.licenseType] Specifies that the image or disk + * that is being used was licensed on-premises. This element is only used for + * images that contain the Windows Server operating system.

    Possible + * values are:

    Windows_Client

    Windows_Server

    If this + * element is included in a request for an update, the value must match the + * initial value. This value cannot be updated.

    For more information, + * see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Minimum api-version: 2015-06-15 + * + * @param {object} [parameters.plan] Specifies information about the + * marketplace image used to create the virtual machine. This element is only + * used for marketplace images. Before you can use a marketplace image from an + * API, you must enable the image for programmatic use. In the Azure portal, + * find the marketplace image that you want to use and then click **Want to + * deploy programmatically, Get Started ->**. Enter any required information + * and then click **Save**. + * + * @param {string} [parameters.plan.name] The plan ID. + * + * @param {string} [parameters.plan.publisher] The publisher ID. + * + * @param {string} [parameters.plan.product] Specifies the product of the image + * from the marketplace. This is the same value as Offer under the + * imageReference element. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @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 VirtualMachineScaleSetVM} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginUpdate(resourceGroupName, vmScaleSetName, instanceId, 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.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmScaleSetName === null || vmScaleSetName === undefined || typeof vmScaleSetName.valueOf() !== 'string') { + throw new Error('vmScaleSetName cannot be null or undefined and it must be of type string.'); + } + if (instanceId === null || instanceId === undefined || typeof instanceId.valueOf() !== 'string') { + throw new Error('instanceId 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.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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmScaleSetName}', encodeURIComponent(vmScaleSetName)); + requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['VirtualMachineScaleSetVM']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + 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['VirtualMachineScaleSetVM']().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); + } + } + // Deserialize Response + if (statusCode === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['VirtualMachineScaleSetVM']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Deletes a virtual machine from a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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 OperationStatusResponse} 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 _beginDeleteMethod(resourceGroupName, vmScaleSetName, instanceId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmScaleSetName === null || vmScaleSetName === undefined || typeof vmScaleSetName.valueOf() !== 'string') { + throw new Error('vmScaleSetName cannot be null or undefined and it must be of type string.'); + } + if (instanceId === null || instanceId === undefined || typeof instanceId.valueOf() !== 'string') { + throw new Error('instanceId cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmScaleSetName}', encodeURIComponent(vmScaleSetName)); + requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // 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['OperationStatusResponse']().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); + }); +} + +/** + * Power off (stop) a virtual machine in a VM scale set. Note that resources + * are still attached and you are getting charged for the resources. Instead, + * use deallocate to release resources and avoid charges. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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 OperationStatusResponse} 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 _beginPowerOff(resourceGroupName, vmScaleSetName, instanceId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmScaleSetName === null || vmScaleSetName === undefined || typeof vmScaleSetName.valueOf() !== 'string') { + throw new Error('vmScaleSetName cannot be null or undefined and it must be of type string.'); + } + if (instanceId === null || instanceId === undefined || typeof instanceId.valueOf() !== 'string') { + throw new Error('instanceId cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/poweroff'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmScaleSetName}', encodeURIComponent(vmScaleSetName)); + requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().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); + }); +} + +/** + * Restarts a virtual machine in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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 OperationStatusResponse} 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 _beginRestart(resourceGroupName, vmScaleSetName, instanceId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmScaleSetName === null || vmScaleSetName === undefined || typeof vmScaleSetName.valueOf() !== 'string') { + throw new Error('vmScaleSetName cannot be null or undefined and it must be of type string.'); + } + if (instanceId === null || instanceId === undefined || typeof instanceId.valueOf() !== 'string') { + throw new Error('instanceId cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/restart'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmScaleSetName}', encodeURIComponent(vmScaleSetName)); + requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Starts a virtual machine in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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 OperationStatusResponse} 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 _beginStart(resourceGroupName, vmScaleSetName, instanceId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmScaleSetName === null || vmScaleSetName === undefined || typeof vmScaleSetName.valueOf() !== 'string') { + throw new Error('vmScaleSetName cannot be null or undefined and it must be of type string.'); + } + if (instanceId === null || instanceId === undefined || typeof instanceId.valueOf() !== 'string') { + throw new Error('instanceId cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/start'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmScaleSetName}', encodeURIComponent(vmScaleSetName)); + requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().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); + }); +} + +/** + * Redeploys a virtual machine in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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 OperationStatusResponse} 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 _beginRedeploy(resourceGroupName, vmScaleSetName, instanceId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmScaleSetName === null || vmScaleSetName === undefined || typeof vmScaleSetName.valueOf() !== 'string') { + throw new Error('vmScaleSetName cannot be null or undefined and it must be of type string.'); + } + if (instanceId === null || instanceId === undefined || typeof instanceId.valueOf() !== 'string') { + throw new Error('instanceId cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/redeploy'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmScaleSetName}', encodeURIComponent(vmScaleSetName)); + requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().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); + }); +} + +/** + * Performs maintenance on a virtual machine in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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 OperationStatusResponse} 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 _beginPerformMaintenance(resourceGroupName, vmScaleSetName, instanceId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmScaleSetName === null || vmScaleSetName === undefined || typeof vmScaleSetName.valueOf() !== 'string') { + throw new Error('vmScaleSetName cannot be null or undefined and it must be of type string.'); + } + if (instanceId === null || instanceId === undefined || typeof instanceId.valueOf() !== 'string') { + throw new Error('instanceId cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/performMaintenance'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmScaleSetName}', encodeURIComponent(vmScaleSetName)); + requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().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); + }); +} + +/** + * Gets a list of all virtual machines in a VM scale sets. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineScaleSetVMListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['VirtualMachineScaleSetVMListResult']().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 VirtualMachineScaleSetVMs. */ +class VirtualMachineScaleSetVMs { + /** + * Create a VirtualMachineScaleSetVMs. + * @param {ComputeManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._reimage = _reimage; + this._reimageAll = _reimageAll; + this._deallocate = _deallocate; + this._update = _update; + this._deleteMethod = _deleteMethod; + this._get = _get; + this._getInstanceView = _getInstanceView; + this._list = _list; + this._powerOff = _powerOff; + this._restart = _restart; + this._start = _start; + this._redeploy = _redeploy; + this._performMaintenance = _performMaintenance; + this._beginReimage = _beginReimage; + this._beginReimageAll = _beginReimageAll; + this._beginDeallocate = _beginDeallocate; + this._beginUpdate = _beginUpdate; + this._beginDeleteMethod = _beginDeleteMethod; + this._beginPowerOff = _beginPowerOff; + this._beginRestart = _beginRestart; + this._beginStart = _beginStart; + this._beginRedeploy = _beginRedeploy; + this._beginPerformMaintenance = _beginPerformMaintenance; + this._listNext = _listNext; + } + + /** + * Reimages (upgrade the operating system) a specific virtual machine in a VM + * scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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. + */ + reimageWithHttpOperationResponse(resourceGroupName, vmScaleSetName, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._reimage(resourceGroupName, vmScaleSetName, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Reimages (upgrade the operating system) a specific virtual machine in a VM + * scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + reimage(resourceGroupName, vmScaleSetName, instanceId, 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._reimage(resourceGroupName, vmScaleSetName, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._reimage(resourceGroupName, vmScaleSetName, instanceId, options, optionalCallback); + } + } + + /** + * Allows you to re-image all the disks ( including data disks ) in the a VM + * scale set instance. This operation is only supported for managed disks. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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. + */ + reimageAllWithHttpOperationResponse(resourceGroupName, vmScaleSetName, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._reimageAll(resourceGroupName, vmScaleSetName, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Allows you to re-image all the disks ( including data disks ) in the a VM + * scale set instance. This operation is only supported for managed disks. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + reimageAll(resourceGroupName, vmScaleSetName, instanceId, 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._reimageAll(resourceGroupName, vmScaleSetName, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._reimageAll(resourceGroupName, vmScaleSetName, instanceId, options, optionalCallback); + } + } + + /** + * Deallocates a specific virtual machine in a VM scale set. Shuts down the + * virtual machine and releases the compute resources it uses. You are not + * billed for the compute resources of this virtual machine once it is + * deallocated. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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. + */ + deallocateWithHttpOperationResponse(resourceGroupName, vmScaleSetName, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deallocate(resourceGroupName, vmScaleSetName, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deallocates a specific virtual machine in a VM scale set. Shuts down the + * virtual machine and releases the compute resources it uses. You are not + * billed for the compute resources of this virtual machine once it is + * deallocated. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + deallocate(resourceGroupName, vmScaleSetName, instanceId, 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._deallocate(resourceGroupName, vmScaleSetName, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deallocate(resourceGroupName, vmScaleSetName, instanceId, options, optionalCallback); + } + } + + /** + * Updates a virtual machine of a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set where the + * extension should be create or updated. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Update Virtual Machine + * Scale Sets VM operation. + * + * @param {object} [parameters.hardwareProfile] Specifies the hardware settings + * for the virtual machine. + * + * @param {string} [parameters.hardwareProfile.vmSize] Specifies the size of + * the virtual machine. For more information about virtual machine sizes, see + * [Sizes for virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    The available VM sizes depend on region and availability set. For a + * list of available sizes use these APIs:

    [List all available + * virtual machine sizes in an availability + * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) + *

    [List all available virtual machine sizes in a + * region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) + *

    [List all available virtual machine sizes for + * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). + * Possible values include: '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_B1s', 'Standard_B1ms', + * 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', + * '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_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', + * 'Standard_D32_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', + * 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', + * 'Standard_D64s_v3', '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_DS13-4_v2', 'Standard_DS13-2_v2', + * 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', 'Standard_E2_v3', + * 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', 'Standard_E32_v3', + * 'Standard_E64_v3', 'Standard_E2s_v3', 'Standard_E4s_v3', 'Standard_E8s_v3', + * 'Standard_E16s_v3', 'Standard_E32s_v3', 'Standard_E64s_v3', + * 'Standard_E32-16_v3', 'Standard_E32-8s_v3', 'Standard_E64-32s_v3', + * 'Standard_E64-16s_v3', 'Standard_F1', 'Standard_F2', 'Standard_F4', + * 'Standard_F8', 'Standard_F16', 'Standard_F1s', 'Standard_F2s', + * 'Standard_F4s', 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2', + * 'Standard_F4s_v2', 'Standard_F8s_v2', 'Standard_F16s_v2', + * 'Standard_F32s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1', + * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', + * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', + * 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8', + * 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m', + * 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', + * 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms', + * 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms', + * 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms', + * 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', + * 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2', + * 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3', + * 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s', + * 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6', + * 'Standard_NV12', 'Standard_NV24' + * + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. + * + * @param {object} [parameters.storageProfile.imageReference] Specifies + * information about the image to use. You can specify information about + * platform images, marketplace images, or virtual machine images. This element + * is required when you want to use a platform image, marketplace image, or + * virtual machine image, but is not used in other creation operations. + * + * @param {string} [parameters.storageProfile.imageReference.publisher] The + * image publisher. + * + * @param {string} [parameters.storageProfile.imageReference.offer] Specifies + * the offer of the platform image or marketplace image used to create the + * virtual machine. + * + * @param {string} [parameters.storageProfile.imageReference.sku] The image + * SKU. + * + * @param {string} [parameters.storageProfile.imageReference.version] Specifies + * the version of the platform image or marketplace image used to create the + * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the + * latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. + * + * @param {string} [parameters.storageProfile.imageReference.id] Resource Id + * + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} [parameters.storageProfile.osDisk.osType] This property + * allows you to specify the type of the OS that is included in the disk if + * creating a VM from user-image or a specialized VHD.

    Possible values + * are:

    **Windows**

    **Linux**. Possible values include: + * 'Windows', 'Linux' + * + * @param {object} [parameters.storageProfile.osDisk.encryptionSettings] + * Specifies the encryption settings for the OS Disk.

    Minimum + * api-version: 2015-06-15 + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey] + * Specifies the location of the disk encryption key, which is a Key Vault + * Secret. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.secretUrl + * The URL referencing a secret in a Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the secret. + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey] + * Specifies the location of the key encryption key in Key Vault. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.keyUrl + * The URL referencing a key encryption key in Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the key. + * + * @param {boolean} + * [parameters.storageProfile.osDisk.encryptionSettings.enabled] Specifies + * whether disk encryption should be enabled on the virtual machine. + * + * @param {string} [parameters.storageProfile.osDisk.name] The disk name. + * + * @param {object} [parameters.storageProfile.osDisk.vhd] The virtual hard + * disk. + * + * @param {object} [parameters.storageProfile.osDisk.image] The source user + * image virtual hard disk. The virtual hard disk will be copied before being + * attached to the virtual machine. If SourceImage is provided, the destination + * virtual hard drive must not exist. + * + * @param {string} [parameters.storageProfile.osDisk.image.uri] Specifies the + * virtual hard disk's uri. + * + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {boolean} [parameters.storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @param {string} parameters.storageProfile.osDisk.createOption Specifies how + * the virtual machine should be created.

    Possible values are:

    + * **Attach** \u2013 This value is used when you are using a specialized disk + * to create the virtual machine.

    **FromImage** \u2013 This value is + * used when you are using an image to create the virtual machine. If you are + * using a platform image, you also use the imageReference element described + * above. If you are using a marketplace image, you also use the plan element + * previously described. Possible values include: 'FromImage', 'Empty', + * 'Attach' + * + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of an empty data disk in gigabytes. This element can be used to + * overwrite the name of the disk in a virtual machine image.

    This + * value cannot be larger than 1023 GB + * + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed + * disk parameters. + * + * @param {string} + * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies + * the storage account type for the managed disk. Possible values are: + * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id + * + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {object} [parameters.osProfile] Specifies the operating system + * settings for the virtual machine. + * + * @param {string} [parameters.osProfile.computerName] Specifies the host OS + * name of the virtual machine.

    **Max-length (Windows):** 15 + * characters

    **Max-length (Linux):** 64 characters.

    For + * naming conventions and restrictions see [Azure infrastructure services + * implementation + * guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). + * + * @param {string} [parameters.osProfile.adminUsername] Specifies the name of + * the administrator account.

    **Windows-only restriction:** Cannot end + * in "."

    **Disallowed values:** "administrator", "admin", "user", + * "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", + * "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", + * "john", "owner", "root", "server", "sql", "support", "support_388945a0", + * "sys", "test2", "test3", "user4", "user5".

    **Minimum-length + * (Linux):** 1 character

    **Max-length (Linux):** 64 characters + *

    **Max-length (Windows):** 20 characters

  • For root + * access to the Linux VM, see [Using root privileges on Linux virtual machines + * in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in this + * field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {string} [parameters.osProfile.adminPassword] Specifies the password + * of the administrator account.

    **Minimum-length (Windows):** 8 + * characters

    **Minimum-length (Linux):** 6 characters

    + * **Max-length (Windows):** 123 characters

    **Max-length (Linux):** 72 + * characters

    **Complexity requirements:** 3 out of 4 conditions below + * need to be fulfilled
    Has lower characters
    Has upper characters
    + * Has a digit
    Has a special character (Regex match [\W_])

    + * **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", + * "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", + * "iloveyou!"

    For resetting the password, see [How to reset the + * Remote Desktop service or its login password in a Windows + * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    For resetting root password, see [Manage users, SSH, and check or + * repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + * + * @param {string} [parameters.osProfile.customData] Specifies a base-64 + * encoded string of custom data. The base-64 encoded string is decoded to a + * binary array that is saved as a file on the Virtual Machine. The maximum + * length of the binary array is 65535 bytes.

    For using cloud-init for + * your VM, see [Using cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {object} [parameters.osProfile.windowsConfiguration] Specifies + * Windows operating system settings on the virtual machine. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.provisionVMAgent] Indicates + * whether virtual machine agent should be provisioned on the virtual machine. + *

    When this property is not specified in the request body, default + * behavior is to set it to true. This will ensure that VM Agent is installed + * on the VM so that extensions can be added to the VM later. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.enableAutomaticUpdates] Indicates + * whether virtual machine is enabled for automatic updates. + * + * @param {string} [parameters.osProfile.windowsConfiguration.timeZone] + * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" + * + * @param {array} + * [parameters.osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * + * @param {object} [parameters.osProfile.windowsConfiguration.winRM] Specifies + * the Windows Remote Management listeners. This enables remote Windows + * PowerShell. + * + * @param {array} [parameters.osProfile.windowsConfiguration.winRM.listeners] + * The list of Windows Remote Management listeners + * + * @param {object} [parameters.osProfile.linuxConfiguration] Specifies the + * Linux operating system settings on the virtual machine.

    For a list + * of supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @param {boolean} + * [parameters.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * + * @param {object} [parameters.osProfile.linuxConfiguration.ssh] Specifies the + * ssh key configuration for a Linux OS. + * + * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The + * list of SSH public keys used to authenticate with linux based VMs. + * + * @param {array} [parameters.osProfile.secrets] Specifies set of certificates + * that should be installed onto the virtual machine. + * + * @param {object} [parameters.networkProfile] Specifies the network interfaces + * of the virtual machine. + * + * @param {array} [parameters.networkProfile.networkInterfaces] Specifies the + * list of resource Ids for the network interfaces associated with the virtual + * machine. + * + * @param {object} [parameters.diagnosticsProfile] Specifies the boot + * diagnostic settings state.

    Minimum api-version: 2015-06-15. + * + * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, + * you can easily view the output of your console log.

    For both + * Windows and Linux virtual machines, Azure also enables you to see a + * screenshot of the VM from the hypervisor. + * + * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] + * Whether boot diagnostics should be enabled on the Virtual Machine. + * + * @param {string} [parameters.diagnosticsProfile.bootDiagnostics.storageUri] + * Uri of the storage account to use for placing the console output and + * screenshot. + * + * @param {object} [parameters.availabilitySet] Specifies information about the + * availability set that the virtual machine should be assigned to. Virtual + * machines specified in the same availability set are allocated to different + * nodes to maximize availability. For more information about availability + * sets, see [Manage the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    For more information on Azure planned maintainance, see [Planned + * maintenance for virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Currently, a VM can only be added to availability set at creation + * time. An existing VM cannot be added to an availability set. + * + * @param {string} [parameters.availabilitySet.id] Resource Id + * + * @param {string} [parameters.licenseType] Specifies that the image or disk + * that is being used was licensed on-premises. This element is only used for + * images that contain the Windows Server operating system.

    Possible + * values are:

    Windows_Client

    Windows_Server

    If this + * element is included in a request for an update, the value must match the + * initial value. This value cannot be updated.

    For more information, + * see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Minimum api-version: 2015-06-15 + * + * @param {object} [parameters.plan] Specifies information about the + * marketplace image used to create the virtual machine. This element is only + * used for marketplace images. Before you can use a marketplace image from an + * API, you must enable the image for programmatic use. In the Azure portal, + * find the marketplace image that you want to use and then click **Want to + * deploy programmatically, Get Started ->**. Enter any required information + * and then click **Save**. + * + * @param {string} [parameters.plan.name] The plan ID. + * + * @param {string} [parameters.plan.publisher] The publisher ID. + * + * @param {string} [parameters.plan.product] Specifies the product of the image + * from the marketplace. This is the same value as Offer under the + * imageReference element. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateWithHttpOperationResponse(resourceGroupName, vmScaleSetName, instanceId, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._update(resourceGroupName, vmScaleSetName, instanceId, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates a virtual machine of a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set where the + * extension should be create or updated. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Update Virtual Machine + * Scale Sets VM operation. + * + * @param {object} [parameters.hardwareProfile] Specifies the hardware settings + * for the virtual machine. + * + * @param {string} [parameters.hardwareProfile.vmSize] Specifies the size of + * the virtual machine. For more information about virtual machine sizes, see + * [Sizes for virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    The available VM sizes depend on region and availability set. For a + * list of available sizes use these APIs:

    [List all available + * virtual machine sizes in an availability + * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) + *

    [List all available virtual machine sizes in a + * region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) + *

    [List all available virtual machine sizes for + * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). + * Possible values include: '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_B1s', 'Standard_B1ms', + * 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', + * '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_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', + * 'Standard_D32_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', + * 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', + * 'Standard_D64s_v3', '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_DS13-4_v2', 'Standard_DS13-2_v2', + * 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', 'Standard_E2_v3', + * 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', 'Standard_E32_v3', + * 'Standard_E64_v3', 'Standard_E2s_v3', 'Standard_E4s_v3', 'Standard_E8s_v3', + * 'Standard_E16s_v3', 'Standard_E32s_v3', 'Standard_E64s_v3', + * 'Standard_E32-16_v3', 'Standard_E32-8s_v3', 'Standard_E64-32s_v3', + * 'Standard_E64-16s_v3', 'Standard_F1', 'Standard_F2', 'Standard_F4', + * 'Standard_F8', 'Standard_F16', 'Standard_F1s', 'Standard_F2s', + * 'Standard_F4s', 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2', + * 'Standard_F4s_v2', 'Standard_F8s_v2', 'Standard_F16s_v2', + * 'Standard_F32s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1', + * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', + * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', + * 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8', + * 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m', + * 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', + * 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms', + * 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms', + * 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms', + * 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', + * 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2', + * 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3', + * 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s', + * 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6', + * 'Standard_NV12', 'Standard_NV24' + * + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. + * + * @param {object} [parameters.storageProfile.imageReference] Specifies + * information about the image to use. You can specify information about + * platform images, marketplace images, or virtual machine images. This element + * is required when you want to use a platform image, marketplace image, or + * virtual machine image, but is not used in other creation operations. + * + * @param {string} [parameters.storageProfile.imageReference.publisher] The + * image publisher. + * + * @param {string} [parameters.storageProfile.imageReference.offer] Specifies + * the offer of the platform image or marketplace image used to create the + * virtual machine. + * + * @param {string} [parameters.storageProfile.imageReference.sku] The image + * SKU. + * + * @param {string} [parameters.storageProfile.imageReference.version] Specifies + * the version of the platform image or marketplace image used to create the + * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the + * latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. + * + * @param {string} [parameters.storageProfile.imageReference.id] Resource Id + * + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} [parameters.storageProfile.osDisk.osType] This property + * allows you to specify the type of the OS that is included in the disk if + * creating a VM from user-image or a specialized VHD.

    Possible values + * are:

    **Windows**

    **Linux**. Possible values include: + * 'Windows', 'Linux' + * + * @param {object} [parameters.storageProfile.osDisk.encryptionSettings] + * Specifies the encryption settings for the OS Disk.

    Minimum + * api-version: 2015-06-15 + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey] + * Specifies the location of the disk encryption key, which is a Key Vault + * Secret. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.secretUrl + * The URL referencing a secret in a Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the secret. + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey] + * Specifies the location of the key encryption key in Key Vault. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.keyUrl + * The URL referencing a key encryption key in Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the key. + * + * @param {boolean} + * [parameters.storageProfile.osDisk.encryptionSettings.enabled] Specifies + * whether disk encryption should be enabled on the virtual machine. + * + * @param {string} [parameters.storageProfile.osDisk.name] The disk name. + * + * @param {object} [parameters.storageProfile.osDisk.vhd] The virtual hard + * disk. + * + * @param {object} [parameters.storageProfile.osDisk.image] The source user + * image virtual hard disk. The virtual hard disk will be copied before being + * attached to the virtual machine. If SourceImage is provided, the destination + * virtual hard drive must not exist. + * + * @param {string} [parameters.storageProfile.osDisk.image.uri] Specifies the + * virtual hard disk's uri. + * + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {boolean} [parameters.storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @param {string} parameters.storageProfile.osDisk.createOption Specifies how + * the virtual machine should be created.

    Possible values are:

    + * **Attach** \u2013 This value is used when you are using a specialized disk + * to create the virtual machine.

    **FromImage** \u2013 This value is + * used when you are using an image to create the virtual machine. If you are + * using a platform image, you also use the imageReference element described + * above. If you are using a marketplace image, you also use the plan element + * previously described. Possible values include: 'FromImage', 'Empty', + * 'Attach' + * + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of an empty data disk in gigabytes. This element can be used to + * overwrite the name of the disk in a virtual machine image.

    This + * value cannot be larger than 1023 GB + * + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed + * disk parameters. + * + * @param {string} + * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies + * the storage account type for the managed disk. Possible values are: + * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id + * + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {object} [parameters.osProfile] Specifies the operating system + * settings for the virtual machine. + * + * @param {string} [parameters.osProfile.computerName] Specifies the host OS + * name of the virtual machine.

    **Max-length (Windows):** 15 + * characters

    **Max-length (Linux):** 64 characters.

    For + * naming conventions and restrictions see [Azure infrastructure services + * implementation + * guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). + * + * @param {string} [parameters.osProfile.adminUsername] Specifies the name of + * the administrator account.

    **Windows-only restriction:** Cannot end + * in "."

    **Disallowed values:** "administrator", "admin", "user", + * "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", + * "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", + * "john", "owner", "root", "server", "sql", "support", "support_388945a0", + * "sys", "test2", "test3", "user4", "user5".

    **Minimum-length + * (Linux):** 1 character

    **Max-length (Linux):** 64 characters + *

    **Max-length (Windows):** 20 characters

  • For root + * access to the Linux VM, see [Using root privileges on Linux virtual machines + * in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in this + * field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {string} [parameters.osProfile.adminPassword] Specifies the password + * of the administrator account.

    **Minimum-length (Windows):** 8 + * characters

    **Minimum-length (Linux):** 6 characters

    + * **Max-length (Windows):** 123 characters

    **Max-length (Linux):** 72 + * characters

    **Complexity requirements:** 3 out of 4 conditions below + * need to be fulfilled
    Has lower characters
    Has upper characters
    + * Has a digit
    Has a special character (Regex match [\W_])

    + * **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", + * "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", + * "iloveyou!"

    For resetting the password, see [How to reset the + * Remote Desktop service or its login password in a Windows + * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    For resetting root password, see [Manage users, SSH, and check or + * repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + * + * @param {string} [parameters.osProfile.customData] Specifies a base-64 + * encoded string of custom data. The base-64 encoded string is decoded to a + * binary array that is saved as a file on the Virtual Machine. The maximum + * length of the binary array is 65535 bytes.

    For using cloud-init for + * your VM, see [Using cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {object} [parameters.osProfile.windowsConfiguration] Specifies + * Windows operating system settings on the virtual machine. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.provisionVMAgent] Indicates + * whether virtual machine agent should be provisioned on the virtual machine. + *

    When this property is not specified in the request body, default + * behavior is to set it to true. This will ensure that VM Agent is installed + * on the VM so that extensions can be added to the VM later. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.enableAutomaticUpdates] Indicates + * whether virtual machine is enabled for automatic updates. + * + * @param {string} [parameters.osProfile.windowsConfiguration.timeZone] + * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" + * + * @param {array} + * [parameters.osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * + * @param {object} [parameters.osProfile.windowsConfiguration.winRM] Specifies + * the Windows Remote Management listeners. This enables remote Windows + * PowerShell. + * + * @param {array} [parameters.osProfile.windowsConfiguration.winRM.listeners] + * The list of Windows Remote Management listeners + * + * @param {object} [parameters.osProfile.linuxConfiguration] Specifies the + * Linux operating system settings on the virtual machine.

    For a list + * of supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @param {boolean} + * [parameters.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * + * @param {object} [parameters.osProfile.linuxConfiguration.ssh] Specifies the + * ssh key configuration for a Linux OS. + * + * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The + * list of SSH public keys used to authenticate with linux based VMs. + * + * @param {array} [parameters.osProfile.secrets] Specifies set of certificates + * that should be installed onto the virtual machine. + * + * @param {object} [parameters.networkProfile] Specifies the network interfaces + * of the virtual machine. + * + * @param {array} [parameters.networkProfile.networkInterfaces] Specifies the + * list of resource Ids for the network interfaces associated with the virtual + * machine. + * + * @param {object} [parameters.diagnosticsProfile] Specifies the boot + * diagnostic settings state.

    Minimum api-version: 2015-06-15. + * + * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, + * you can easily view the output of your console log.

    For both + * Windows and Linux virtual machines, Azure also enables you to see a + * screenshot of the VM from the hypervisor. + * + * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] + * Whether boot diagnostics should be enabled on the Virtual Machine. + * + * @param {string} [parameters.diagnosticsProfile.bootDiagnostics.storageUri] + * Uri of the storage account to use for placing the console output and + * screenshot. + * + * @param {object} [parameters.availabilitySet] Specifies information about the + * availability set that the virtual machine should be assigned to. Virtual + * machines specified in the same availability set are allocated to different + * nodes to maximize availability. For more information about availability + * sets, see [Manage the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    For more information on Azure planned maintainance, see [Planned + * maintenance for virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Currently, a VM can only be added to availability set at creation + * time. An existing VM cannot be added to an availability set. + * + * @param {string} [parameters.availabilitySet.id] Resource Id + * + * @param {string} [parameters.licenseType] Specifies that the image or disk + * that is being used was licensed on-premises. This element is only used for + * images that contain the Windows Server operating system.

    Possible + * values are:

    Windows_Client

    Windows_Server

    If this + * element is included in a request for an update, the value must match the + * initial value. This value cannot be updated.

    For more information, + * see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Minimum api-version: 2015-06-15 + * + * @param {object} [parameters.plan] Specifies information about the + * marketplace image used to create the virtual machine. This element is only + * used for marketplace images. Before you can use a marketplace image from an + * API, you must enable the image for programmatic use. In the Azure portal, + * find the marketplace image that you want to use and then click **Want to + * deploy programmatically, Get Started ->**. Enter any required information + * and then click **Save**. + * + * @param {string} [parameters.plan.name] The plan ID. + * + * @param {string} [parameters.plan.publisher] The publisher ID. + * + * @param {string} [parameters.plan.product] Specifies the product of the image + * from the marketplace. This is the same value as Offer under the + * imageReference element. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @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 {VirtualMachineScaleSetVM} - 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 VirtualMachineScaleSetVM} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + update(resourceGroupName, vmScaleSetName, instanceId, 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._update(resourceGroupName, vmScaleSetName, instanceId, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._update(resourceGroupName, vmScaleSetName, instanceId, parameters, options, optionalCallback); + } + } + + /** + * Deletes a virtual machine from a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, vmScaleSetName, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, vmScaleSetName, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes a virtual machine from a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + deleteMethod(resourceGroupName, vmScaleSetName, instanceId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, vmScaleSetName, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, vmScaleSetName, instanceId, options, optionalCallback); + } + } + + /** + * Gets a virtual machine from a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, vmScaleSetName, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, vmScaleSetName, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a virtual machine from a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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 {VirtualMachineScaleSetVM} - 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 VirtualMachineScaleSetVM} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, vmScaleSetName, instanceId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(resourceGroupName, vmScaleSetName, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, vmScaleSetName, instanceId, options, optionalCallback); + } + } + + /** + * Gets the status of a virtual machine from a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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. + */ + getInstanceViewWithHttpOperationResponse(resourceGroupName, vmScaleSetName, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getInstanceView(resourceGroupName, vmScaleSetName, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the status of a virtual machine from a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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 {VirtualMachineScaleSetVMInstanceView} - 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 VirtualMachineScaleSetVMInstanceView} 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. + */ + getInstanceView(resourceGroupName, vmScaleSetName, instanceId, 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._getInstanceView(resourceGroupName, vmScaleSetName, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getInstanceView(resourceGroupName, vmScaleSetName, instanceId, options, optionalCallback); + } + } + + /** + * Gets a list of all virtual machines in a VM scale sets. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualMachineScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply to the operation. + * + * @param {string} [options.select] The list parameters. + * + * @param {string} [options.expand] The expand expression to apply to the + * operation. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName, virtualMachineScaleSetName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(resourceGroupName, virtualMachineScaleSetName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a list of all virtual machines in a VM scale sets. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} virtualMachineScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply to the operation. + * + * @param {string} [options.select] The list parameters. + * + * @param {string} [options.expand] The expand expression to apply to the + * operation. + * + * @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 {VirtualMachineScaleSetVMListResult} - 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 VirtualMachineScaleSetVMListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + list(resourceGroupName, virtualMachineScaleSetName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._list(resourceGroupName, virtualMachineScaleSetName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(resourceGroupName, virtualMachineScaleSetName, options, optionalCallback); + } + } + + /** + * Power off (stop) a virtual machine in a VM scale set. Note that resources + * are still attached and you are getting charged for the resources. Instead, + * use deallocate to release resources and avoid charges. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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. + */ + powerOffWithHttpOperationResponse(resourceGroupName, vmScaleSetName, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._powerOff(resourceGroupName, vmScaleSetName, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Power off (stop) a virtual machine in a VM scale set. Note that resources + * are still attached and you are getting charged for the resources. Instead, + * use deallocate to release resources and avoid charges. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + powerOff(resourceGroupName, vmScaleSetName, instanceId, 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._powerOff(resourceGroupName, vmScaleSetName, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._powerOff(resourceGroupName, vmScaleSetName, instanceId, options, optionalCallback); + } + } + + /** + * Restarts a virtual machine in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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. + */ + restartWithHttpOperationResponse(resourceGroupName, vmScaleSetName, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._restart(resourceGroupName, vmScaleSetName, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Restarts a virtual machine in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + restart(resourceGroupName, vmScaleSetName, instanceId, 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._restart(resourceGroupName, vmScaleSetName, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._restart(resourceGroupName, vmScaleSetName, instanceId, options, optionalCallback); + } + } + + /** + * Starts a virtual machine in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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. + */ + startWithHttpOperationResponse(resourceGroupName, vmScaleSetName, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._start(resourceGroupName, vmScaleSetName, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Starts a virtual machine in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + start(resourceGroupName, vmScaleSetName, instanceId, 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._start(resourceGroupName, vmScaleSetName, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._start(resourceGroupName, vmScaleSetName, instanceId, options, optionalCallback); + } + } + + /** + * Redeploys a virtual machine in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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. + */ + redeployWithHttpOperationResponse(resourceGroupName, vmScaleSetName, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._redeploy(resourceGroupName, vmScaleSetName, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Redeploys a virtual machine in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + redeploy(resourceGroupName, vmScaleSetName, instanceId, 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._redeploy(resourceGroupName, vmScaleSetName, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._redeploy(resourceGroupName, vmScaleSetName, instanceId, options, optionalCallback); + } + } + + /** + * Performs maintenance on a virtual machine in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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. + */ + performMaintenanceWithHttpOperationResponse(resourceGroupName, vmScaleSetName, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._performMaintenance(resourceGroupName, vmScaleSetName, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Performs maintenance on a virtual machine in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + performMaintenance(resourceGroupName, vmScaleSetName, instanceId, 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._performMaintenance(resourceGroupName, vmScaleSetName, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._performMaintenance(resourceGroupName, vmScaleSetName, instanceId, options, optionalCallback); + } + } + + /** + * Reimages (upgrade the operating system) a specific virtual machine in a VM + * scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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. + */ + beginReimageWithHttpOperationResponse(resourceGroupName, vmScaleSetName, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginReimage(resourceGroupName, vmScaleSetName, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Reimages (upgrade the operating system) a specific virtual machine in a VM + * scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + beginReimage(resourceGroupName, vmScaleSetName, instanceId, 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._beginReimage(resourceGroupName, vmScaleSetName, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginReimage(resourceGroupName, vmScaleSetName, instanceId, options, optionalCallback); + } + } + + /** + * Allows you to re-image all the disks ( including data disks ) in the a VM + * scale set instance. This operation is only supported for managed disks. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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. + */ + beginReimageAllWithHttpOperationResponse(resourceGroupName, vmScaleSetName, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginReimageAll(resourceGroupName, vmScaleSetName, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Allows you to re-image all the disks ( including data disks ) in the a VM + * scale set instance. This operation is only supported for managed disks. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + beginReimageAll(resourceGroupName, vmScaleSetName, instanceId, 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._beginReimageAll(resourceGroupName, vmScaleSetName, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginReimageAll(resourceGroupName, vmScaleSetName, instanceId, options, optionalCallback); + } + } + + /** + * Deallocates a specific virtual machine in a VM scale set. Shuts down the + * virtual machine and releases the compute resources it uses. You are not + * billed for the compute resources of this virtual machine once it is + * deallocated. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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. + */ + beginDeallocateWithHttpOperationResponse(resourceGroupName, vmScaleSetName, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeallocate(resourceGroupName, vmScaleSetName, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deallocates a specific virtual machine in a VM scale set. Shuts down the + * virtual machine and releases the compute resources it uses. You are not + * billed for the compute resources of this virtual machine once it is + * deallocated. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + beginDeallocate(resourceGroupName, vmScaleSetName, instanceId, 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._beginDeallocate(resourceGroupName, vmScaleSetName, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeallocate(resourceGroupName, vmScaleSetName, instanceId, options, optionalCallback); + } + } + + /** + * Updates a virtual machine of a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set where the + * extension should be create or updated. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Update Virtual Machine + * Scale Sets VM operation. + * + * @param {object} [parameters.hardwareProfile] Specifies the hardware settings + * for the virtual machine. + * + * @param {string} [parameters.hardwareProfile.vmSize] Specifies the size of + * the virtual machine. For more information about virtual machine sizes, see + * [Sizes for virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    The available VM sizes depend on region and availability set. For a + * list of available sizes use these APIs:

    [List all available + * virtual machine sizes in an availability + * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) + *

    [List all available virtual machine sizes in a + * region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) + *

    [List all available virtual machine sizes for + * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). + * Possible values include: '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_B1s', 'Standard_B1ms', + * 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', + * '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_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', + * 'Standard_D32_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', + * 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', + * 'Standard_D64s_v3', '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_DS13-4_v2', 'Standard_DS13-2_v2', + * 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', 'Standard_E2_v3', + * 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', 'Standard_E32_v3', + * 'Standard_E64_v3', 'Standard_E2s_v3', 'Standard_E4s_v3', 'Standard_E8s_v3', + * 'Standard_E16s_v3', 'Standard_E32s_v3', 'Standard_E64s_v3', + * 'Standard_E32-16_v3', 'Standard_E32-8s_v3', 'Standard_E64-32s_v3', + * 'Standard_E64-16s_v3', 'Standard_F1', 'Standard_F2', 'Standard_F4', + * 'Standard_F8', 'Standard_F16', 'Standard_F1s', 'Standard_F2s', + * 'Standard_F4s', 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2', + * 'Standard_F4s_v2', 'Standard_F8s_v2', 'Standard_F16s_v2', + * 'Standard_F32s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1', + * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', + * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', + * 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8', + * 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m', + * 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', + * 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms', + * 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms', + * 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms', + * 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', + * 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2', + * 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3', + * 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s', + * 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6', + * 'Standard_NV12', 'Standard_NV24' + * + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. + * + * @param {object} [parameters.storageProfile.imageReference] Specifies + * information about the image to use. You can specify information about + * platform images, marketplace images, or virtual machine images. This element + * is required when you want to use a platform image, marketplace image, or + * virtual machine image, but is not used in other creation operations. + * + * @param {string} [parameters.storageProfile.imageReference.publisher] The + * image publisher. + * + * @param {string} [parameters.storageProfile.imageReference.offer] Specifies + * the offer of the platform image or marketplace image used to create the + * virtual machine. + * + * @param {string} [parameters.storageProfile.imageReference.sku] The image + * SKU. + * + * @param {string} [parameters.storageProfile.imageReference.version] Specifies + * the version of the platform image or marketplace image used to create the + * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the + * latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. + * + * @param {string} [parameters.storageProfile.imageReference.id] Resource Id + * + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} [parameters.storageProfile.osDisk.osType] This property + * allows you to specify the type of the OS that is included in the disk if + * creating a VM from user-image or a specialized VHD.

    Possible values + * are:

    **Windows**

    **Linux**. Possible values include: + * 'Windows', 'Linux' + * + * @param {object} [parameters.storageProfile.osDisk.encryptionSettings] + * Specifies the encryption settings for the OS Disk.

    Minimum + * api-version: 2015-06-15 + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey] + * Specifies the location of the disk encryption key, which is a Key Vault + * Secret. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.secretUrl + * The URL referencing a secret in a Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the secret. + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey] + * Specifies the location of the key encryption key in Key Vault. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.keyUrl + * The URL referencing a key encryption key in Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the key. + * + * @param {boolean} + * [parameters.storageProfile.osDisk.encryptionSettings.enabled] Specifies + * whether disk encryption should be enabled on the virtual machine. + * + * @param {string} [parameters.storageProfile.osDisk.name] The disk name. + * + * @param {object} [parameters.storageProfile.osDisk.vhd] The virtual hard + * disk. + * + * @param {object} [parameters.storageProfile.osDisk.image] The source user + * image virtual hard disk. The virtual hard disk will be copied before being + * attached to the virtual machine. If SourceImage is provided, the destination + * virtual hard drive must not exist. + * + * @param {string} [parameters.storageProfile.osDisk.image.uri] Specifies the + * virtual hard disk's uri. + * + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {boolean} [parameters.storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @param {string} parameters.storageProfile.osDisk.createOption Specifies how + * the virtual machine should be created.

    Possible values are:

    + * **Attach** \u2013 This value is used when you are using a specialized disk + * to create the virtual machine.

    **FromImage** \u2013 This value is + * used when you are using an image to create the virtual machine. If you are + * using a platform image, you also use the imageReference element described + * above. If you are using a marketplace image, you also use the plan element + * previously described. Possible values include: 'FromImage', 'Empty', + * 'Attach' + * + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of an empty data disk in gigabytes. This element can be used to + * overwrite the name of the disk in a virtual machine image.

    This + * value cannot be larger than 1023 GB + * + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed + * disk parameters. + * + * @param {string} + * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies + * the storage account type for the managed disk. Possible values are: + * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id + * + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {object} [parameters.osProfile] Specifies the operating system + * settings for the virtual machine. + * + * @param {string} [parameters.osProfile.computerName] Specifies the host OS + * name of the virtual machine.

    **Max-length (Windows):** 15 + * characters

    **Max-length (Linux):** 64 characters.

    For + * naming conventions and restrictions see [Azure infrastructure services + * implementation + * guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). + * + * @param {string} [parameters.osProfile.adminUsername] Specifies the name of + * the administrator account.

    **Windows-only restriction:** Cannot end + * in "."

    **Disallowed values:** "administrator", "admin", "user", + * "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", + * "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", + * "john", "owner", "root", "server", "sql", "support", "support_388945a0", + * "sys", "test2", "test3", "user4", "user5".

    **Minimum-length + * (Linux):** 1 character

    **Max-length (Linux):** 64 characters + *

    **Max-length (Windows):** 20 characters

  • For root + * access to the Linux VM, see [Using root privileges on Linux virtual machines + * in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in this + * field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {string} [parameters.osProfile.adminPassword] Specifies the password + * of the administrator account.

    **Minimum-length (Windows):** 8 + * characters

    **Minimum-length (Linux):** 6 characters

    + * **Max-length (Windows):** 123 characters

    **Max-length (Linux):** 72 + * characters

    **Complexity requirements:** 3 out of 4 conditions below + * need to be fulfilled
    Has lower characters
    Has upper characters
    + * Has a digit
    Has a special character (Regex match [\W_])

    + * **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", + * "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", + * "iloveyou!"

    For resetting the password, see [How to reset the + * Remote Desktop service or its login password in a Windows + * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    For resetting root password, see [Manage users, SSH, and check or + * repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + * + * @param {string} [parameters.osProfile.customData] Specifies a base-64 + * encoded string of custom data. The base-64 encoded string is decoded to a + * binary array that is saved as a file on the Virtual Machine. The maximum + * length of the binary array is 65535 bytes.

    For using cloud-init for + * your VM, see [Using cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {object} [parameters.osProfile.windowsConfiguration] Specifies + * Windows operating system settings on the virtual machine. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.provisionVMAgent] Indicates + * whether virtual machine agent should be provisioned on the virtual machine. + *

    When this property is not specified in the request body, default + * behavior is to set it to true. This will ensure that VM Agent is installed + * on the VM so that extensions can be added to the VM later. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.enableAutomaticUpdates] Indicates + * whether virtual machine is enabled for automatic updates. + * + * @param {string} [parameters.osProfile.windowsConfiguration.timeZone] + * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" + * + * @param {array} + * [parameters.osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * + * @param {object} [parameters.osProfile.windowsConfiguration.winRM] Specifies + * the Windows Remote Management listeners. This enables remote Windows + * PowerShell. + * + * @param {array} [parameters.osProfile.windowsConfiguration.winRM.listeners] + * The list of Windows Remote Management listeners + * + * @param {object} [parameters.osProfile.linuxConfiguration] Specifies the + * Linux operating system settings on the virtual machine.

    For a list + * of supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @param {boolean} + * [parameters.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * + * @param {object} [parameters.osProfile.linuxConfiguration.ssh] Specifies the + * ssh key configuration for a Linux OS. + * + * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The + * list of SSH public keys used to authenticate with linux based VMs. + * + * @param {array} [parameters.osProfile.secrets] Specifies set of certificates + * that should be installed onto the virtual machine. + * + * @param {object} [parameters.networkProfile] Specifies the network interfaces + * of the virtual machine. + * + * @param {array} [parameters.networkProfile.networkInterfaces] Specifies the + * list of resource Ids for the network interfaces associated with the virtual + * machine. + * + * @param {object} [parameters.diagnosticsProfile] Specifies the boot + * diagnostic settings state.

    Minimum api-version: 2015-06-15. + * + * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, + * you can easily view the output of your console log.

    For both + * Windows and Linux virtual machines, Azure also enables you to see a + * screenshot of the VM from the hypervisor. + * + * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] + * Whether boot diagnostics should be enabled on the Virtual Machine. + * + * @param {string} [parameters.diagnosticsProfile.bootDiagnostics.storageUri] + * Uri of the storage account to use for placing the console output and + * screenshot. + * + * @param {object} [parameters.availabilitySet] Specifies information about the + * availability set that the virtual machine should be assigned to. Virtual + * machines specified in the same availability set are allocated to different + * nodes to maximize availability. For more information about availability + * sets, see [Manage the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    For more information on Azure planned maintainance, see [Planned + * maintenance for virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Currently, a VM can only be added to availability set at creation + * time. An existing VM cannot be added to an availability set. + * + * @param {string} [parameters.availabilitySet.id] Resource Id + * + * @param {string} [parameters.licenseType] Specifies that the image or disk + * that is being used was licensed on-premises. This element is only used for + * images that contain the Windows Server operating system.

    Possible + * values are:

    Windows_Client

    Windows_Server

    If this + * element is included in a request for an update, the value must match the + * initial value. This value cannot be updated.

    For more information, + * see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Minimum api-version: 2015-06-15 + * + * @param {object} [parameters.plan] Specifies information about the + * marketplace image used to create the virtual machine. This element is only + * used for marketplace images. Before you can use a marketplace image from an + * API, you must enable the image for programmatic use. In the Azure portal, + * find the marketplace image that you want to use and then click **Want to + * deploy programmatically, Get Started ->**. Enter any required information + * and then click **Save**. + * + * @param {string} [parameters.plan.name] The plan ID. + * + * @param {string} [parameters.plan.publisher] The publisher ID. + * + * @param {string} [parameters.plan.product] Specifies the product of the image + * from the marketplace. This is the same value as Offer under the + * imageReference element. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginUpdateWithHttpOperationResponse(resourceGroupName, vmScaleSetName, instanceId, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginUpdate(resourceGroupName, vmScaleSetName, instanceId, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates a virtual machine of a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set where the + * extension should be create or updated. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Update Virtual Machine + * Scale Sets VM operation. + * + * @param {object} [parameters.hardwareProfile] Specifies the hardware settings + * for the virtual machine. + * + * @param {string} [parameters.hardwareProfile.vmSize] Specifies the size of + * the virtual machine. For more information about virtual machine sizes, see + * [Sizes for virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    The available VM sizes depend on region and availability set. For a + * list of available sizes use these APIs:

    [List all available + * virtual machine sizes in an availability + * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) + *

    [List all available virtual machine sizes in a + * region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) + *

    [List all available virtual machine sizes for + * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). + * Possible values include: '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_B1s', 'Standard_B1ms', + * 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', + * '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_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', + * 'Standard_D32_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', + * 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', + * 'Standard_D64s_v3', '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_DS13-4_v2', 'Standard_DS13-2_v2', + * 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', 'Standard_E2_v3', + * 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', 'Standard_E32_v3', + * 'Standard_E64_v3', 'Standard_E2s_v3', 'Standard_E4s_v3', 'Standard_E8s_v3', + * 'Standard_E16s_v3', 'Standard_E32s_v3', 'Standard_E64s_v3', + * 'Standard_E32-16_v3', 'Standard_E32-8s_v3', 'Standard_E64-32s_v3', + * 'Standard_E64-16s_v3', 'Standard_F1', 'Standard_F2', 'Standard_F4', + * 'Standard_F8', 'Standard_F16', 'Standard_F1s', 'Standard_F2s', + * 'Standard_F4s', 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2', + * 'Standard_F4s_v2', 'Standard_F8s_v2', 'Standard_F16s_v2', + * 'Standard_F32s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1', + * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', + * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', + * 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8', + * 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m', + * 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', + * 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms', + * 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms', + * 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms', + * 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', + * 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2', + * 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3', + * 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s', + * 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6', + * 'Standard_NV12', 'Standard_NV24' + * + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. + * + * @param {object} [parameters.storageProfile.imageReference] Specifies + * information about the image to use. You can specify information about + * platform images, marketplace images, or virtual machine images. This element + * is required when you want to use a platform image, marketplace image, or + * virtual machine image, but is not used in other creation operations. + * + * @param {string} [parameters.storageProfile.imageReference.publisher] The + * image publisher. + * + * @param {string} [parameters.storageProfile.imageReference.offer] Specifies + * the offer of the platform image or marketplace image used to create the + * virtual machine. + * + * @param {string} [parameters.storageProfile.imageReference.sku] The image + * SKU. + * + * @param {string} [parameters.storageProfile.imageReference.version] Specifies + * the version of the platform image or marketplace image used to create the + * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the + * latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. + * + * @param {string} [parameters.storageProfile.imageReference.id] Resource Id + * + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} [parameters.storageProfile.osDisk.osType] This property + * allows you to specify the type of the OS that is included in the disk if + * creating a VM from user-image or a specialized VHD.

    Possible values + * are:

    **Windows**

    **Linux**. Possible values include: + * 'Windows', 'Linux' + * + * @param {object} [parameters.storageProfile.osDisk.encryptionSettings] + * Specifies the encryption settings for the OS Disk.

    Minimum + * api-version: 2015-06-15 + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey] + * Specifies the location of the disk encryption key, which is a Key Vault + * Secret. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.secretUrl + * The URL referencing a secret in a Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the secret. + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey] + * Specifies the location of the key encryption key in Key Vault. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.keyUrl + * The URL referencing a key encryption key in Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the key. + * + * @param {boolean} + * [parameters.storageProfile.osDisk.encryptionSettings.enabled] Specifies + * whether disk encryption should be enabled on the virtual machine. + * + * @param {string} [parameters.storageProfile.osDisk.name] The disk name. + * + * @param {object} [parameters.storageProfile.osDisk.vhd] The virtual hard + * disk. + * + * @param {object} [parameters.storageProfile.osDisk.image] The source user + * image virtual hard disk. The virtual hard disk will be copied before being + * attached to the virtual machine. If SourceImage is provided, the destination + * virtual hard drive must not exist. + * + * @param {string} [parameters.storageProfile.osDisk.image.uri] Specifies the + * virtual hard disk's uri. + * + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {boolean} [parameters.storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @param {string} parameters.storageProfile.osDisk.createOption Specifies how + * the virtual machine should be created.

    Possible values are:

    + * **Attach** \u2013 This value is used when you are using a specialized disk + * to create the virtual machine.

    **FromImage** \u2013 This value is + * used when you are using an image to create the virtual machine. If you are + * using a platform image, you also use the imageReference element described + * above. If you are using a marketplace image, you also use the plan element + * previously described. Possible values include: 'FromImage', 'Empty', + * 'Attach' + * + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of an empty data disk in gigabytes. This element can be used to + * overwrite the name of the disk in a virtual machine image.

    This + * value cannot be larger than 1023 GB + * + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed + * disk parameters. + * + * @param {string} + * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies + * the storage account type for the managed disk. Possible values are: + * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id + * + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {object} [parameters.osProfile] Specifies the operating system + * settings for the virtual machine. + * + * @param {string} [parameters.osProfile.computerName] Specifies the host OS + * name of the virtual machine.

    **Max-length (Windows):** 15 + * characters

    **Max-length (Linux):** 64 characters.

    For + * naming conventions and restrictions see [Azure infrastructure services + * implementation + * guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). + * + * @param {string} [parameters.osProfile.adminUsername] Specifies the name of + * the administrator account.

    **Windows-only restriction:** Cannot end + * in "."

    **Disallowed values:** "administrator", "admin", "user", + * "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", + * "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", + * "john", "owner", "root", "server", "sql", "support", "support_388945a0", + * "sys", "test2", "test3", "user4", "user5".

    **Minimum-length + * (Linux):** 1 character

    **Max-length (Linux):** 64 characters + *

    **Max-length (Windows):** 20 characters

  • For root + * access to the Linux VM, see [Using root privileges on Linux virtual machines + * in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in this + * field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {string} [parameters.osProfile.adminPassword] Specifies the password + * of the administrator account.

    **Minimum-length (Windows):** 8 + * characters

    **Minimum-length (Linux):** 6 characters

    + * **Max-length (Windows):** 123 characters

    **Max-length (Linux):** 72 + * characters

    **Complexity requirements:** 3 out of 4 conditions below + * need to be fulfilled
    Has lower characters
    Has upper characters
    + * Has a digit
    Has a special character (Regex match [\W_])

    + * **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", + * "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", + * "iloveyou!"

    For resetting the password, see [How to reset the + * Remote Desktop service or its login password in a Windows + * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    For resetting root password, see [Manage users, SSH, and check or + * repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + * + * @param {string} [parameters.osProfile.customData] Specifies a base-64 + * encoded string of custom data. The base-64 encoded string is decoded to a + * binary array that is saved as a file on the Virtual Machine. The maximum + * length of the binary array is 65535 bytes.

    For using cloud-init for + * your VM, see [Using cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {object} [parameters.osProfile.windowsConfiguration] Specifies + * Windows operating system settings on the virtual machine. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.provisionVMAgent] Indicates + * whether virtual machine agent should be provisioned on the virtual machine. + *

    When this property is not specified in the request body, default + * behavior is to set it to true. This will ensure that VM Agent is installed + * on the VM so that extensions can be added to the VM later. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.enableAutomaticUpdates] Indicates + * whether virtual machine is enabled for automatic updates. + * + * @param {string} [parameters.osProfile.windowsConfiguration.timeZone] + * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" + * + * @param {array} + * [parameters.osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * + * @param {object} [parameters.osProfile.windowsConfiguration.winRM] Specifies + * the Windows Remote Management listeners. This enables remote Windows + * PowerShell. + * + * @param {array} [parameters.osProfile.windowsConfiguration.winRM.listeners] + * The list of Windows Remote Management listeners + * + * @param {object} [parameters.osProfile.linuxConfiguration] Specifies the + * Linux operating system settings on the virtual machine.

    For a list + * of supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @param {boolean} + * [parameters.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * + * @param {object} [parameters.osProfile.linuxConfiguration.ssh] Specifies the + * ssh key configuration for a Linux OS. + * + * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The + * list of SSH public keys used to authenticate with linux based VMs. + * + * @param {array} [parameters.osProfile.secrets] Specifies set of certificates + * that should be installed onto the virtual machine. + * + * @param {object} [parameters.networkProfile] Specifies the network interfaces + * of the virtual machine. + * + * @param {array} [parameters.networkProfile.networkInterfaces] Specifies the + * list of resource Ids for the network interfaces associated with the virtual + * machine. + * + * @param {object} [parameters.diagnosticsProfile] Specifies the boot + * diagnostic settings state.

    Minimum api-version: 2015-06-15. + * + * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, + * you can easily view the output of your console log.

    For both + * Windows and Linux virtual machines, Azure also enables you to see a + * screenshot of the VM from the hypervisor. + * + * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] + * Whether boot diagnostics should be enabled on the Virtual Machine. + * + * @param {string} [parameters.diagnosticsProfile.bootDiagnostics.storageUri] + * Uri of the storage account to use for placing the console output and + * screenshot. + * + * @param {object} [parameters.availabilitySet] Specifies information about the + * availability set that the virtual machine should be assigned to. Virtual + * machines specified in the same availability set are allocated to different + * nodes to maximize availability. For more information about availability + * sets, see [Manage the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    For more information on Azure planned maintainance, see [Planned + * maintenance for virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Currently, a VM can only be added to availability set at creation + * time. An existing VM cannot be added to an availability set. + * + * @param {string} [parameters.availabilitySet.id] Resource Id + * + * @param {string} [parameters.licenseType] Specifies that the image or disk + * that is being used was licensed on-premises. This element is only used for + * images that contain the Windows Server operating system.

    Possible + * values are:

    Windows_Client

    Windows_Server

    If this + * element is included in a request for an update, the value must match the + * initial value. This value cannot be updated.

    For more information, + * see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Minimum api-version: 2015-06-15 + * + * @param {object} [parameters.plan] Specifies information about the + * marketplace image used to create the virtual machine. This element is only + * used for marketplace images. Before you can use a marketplace image from an + * API, you must enable the image for programmatic use. In the Azure portal, + * find the marketplace image that you want to use and then click **Want to + * deploy programmatically, Get Started ->**. Enter any required information + * and then click **Save**. + * + * @param {string} [parameters.plan.name] The plan ID. + * + * @param {string} [parameters.plan.publisher] The publisher ID. + * + * @param {string} [parameters.plan.product] Specifies the product of the image + * from the marketplace. This is the same value as Offer under the + * imageReference element. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @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 {VirtualMachineScaleSetVM} - 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 VirtualMachineScaleSetVM} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginUpdate(resourceGroupName, vmScaleSetName, instanceId, 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._beginUpdate(resourceGroupName, vmScaleSetName, instanceId, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginUpdate(resourceGroupName, vmScaleSetName, instanceId, parameters, options, optionalCallback); + } + } + + /** + * Deletes a virtual machine from a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, vmScaleSetName, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, vmScaleSetName, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes a virtual machine from a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + beginDeleteMethod(resourceGroupName, vmScaleSetName, instanceId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, vmScaleSetName, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, vmScaleSetName, instanceId, options, optionalCallback); + } + } + + /** + * Power off (stop) a virtual machine in a VM scale set. Note that resources + * are still attached and you are getting charged for the resources. Instead, + * use deallocate to release resources and avoid charges. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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. + */ + beginPowerOffWithHttpOperationResponse(resourceGroupName, vmScaleSetName, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginPowerOff(resourceGroupName, vmScaleSetName, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Power off (stop) a virtual machine in a VM scale set. Note that resources + * are still attached and you are getting charged for the resources. Instead, + * use deallocate to release resources and avoid charges. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + beginPowerOff(resourceGroupName, vmScaleSetName, instanceId, 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._beginPowerOff(resourceGroupName, vmScaleSetName, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginPowerOff(resourceGroupName, vmScaleSetName, instanceId, options, optionalCallback); + } + } + + /** + * Restarts a virtual machine in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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. + */ + beginRestartWithHttpOperationResponse(resourceGroupName, vmScaleSetName, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginRestart(resourceGroupName, vmScaleSetName, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Restarts a virtual machine in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + beginRestart(resourceGroupName, vmScaleSetName, instanceId, 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._beginRestart(resourceGroupName, vmScaleSetName, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginRestart(resourceGroupName, vmScaleSetName, instanceId, options, optionalCallback); + } + } + + /** + * Starts a virtual machine in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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. + */ + beginStartWithHttpOperationResponse(resourceGroupName, vmScaleSetName, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginStart(resourceGroupName, vmScaleSetName, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Starts a virtual machine in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + beginStart(resourceGroupName, vmScaleSetName, instanceId, 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._beginStart(resourceGroupName, vmScaleSetName, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginStart(resourceGroupName, vmScaleSetName, instanceId, options, optionalCallback); + } + } + + /** + * Redeploys a virtual machine in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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. + */ + beginRedeployWithHttpOperationResponse(resourceGroupName, vmScaleSetName, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginRedeploy(resourceGroupName, vmScaleSetName, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Redeploys a virtual machine in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + beginRedeploy(resourceGroupName, vmScaleSetName, instanceId, 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._beginRedeploy(resourceGroupName, vmScaleSetName, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginRedeploy(resourceGroupName, vmScaleSetName, instanceId, options, optionalCallback); + } + } + + /** + * Performs maintenance on a virtual machine in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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. + */ + beginPerformMaintenanceWithHttpOperationResponse(resourceGroupName, vmScaleSetName, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginPerformMaintenance(resourceGroupName, vmScaleSetName, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Performs maintenance on a virtual machine in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {string} instanceId The instance ID of the virtual machine. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + beginPerformMaintenance(resourceGroupName, vmScaleSetName, instanceId, 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._beginPerformMaintenance(resourceGroupName, vmScaleSetName, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginPerformMaintenance(resourceGroupName, vmScaleSetName, instanceId, options, optionalCallback); + } + } + + /** + * Gets a list of all virtual machines in a VM scale sets. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a list of all virtual machines in a VM scale sets. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {VirtualMachineScaleSetVMListResult} - 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 VirtualMachineScaleSetVMListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = VirtualMachineScaleSetVMs; diff --git a/lib/services/computeManagement2/lib/lib/operations/virtualMachineScaleSets.js b/lib/services/computeManagement2/lib/lib/operations/virtualMachineScaleSets.js new file mode 100644 index 0000000000..5d2f33b23a --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/operations/virtualMachineScaleSets.js @@ -0,0 +1,12261 @@ +/* + * 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; + + +/** + * Create or update a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set to create or + * update. + * + * @param {object} parameters The scale set object. + * + * @param {object} [parameters.sku] The virtual machine scale set sku. + * + * @param {string} [parameters.sku.name] The sku name. + * + * @param {string} [parameters.sku.tier] Specifies the tier of virtual machines + * in a scale set.

    Possible Values:

    **Standard**

    **Basic** + * + * @param {number} [parameters.sku.capacity] Specifies the number of virtual + * machines in the scale set. + * + * @param {object} [parameters.plan] Specifies information about the + * marketplace image used to create the virtual machine. This element is only + * used for marketplace images. Before you can use a marketplace image from an + * API, you must enable the image for programmatic use. In the Azure portal, + * find the marketplace image that you want to use and then click **Want to + * deploy programmatically, Get Started ->**. Enter any required information + * and then click **Save**. + * + * @param {string} [parameters.plan.name] The plan ID. + * + * @param {string} [parameters.plan.publisher] The publisher ID. + * + * @param {string} [parameters.plan.product] Specifies the product of the image + * from the marketplace. This is the same value as Offer under the + * imageReference element. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {object} [parameters.upgradePolicy] The upgrade policy. + * + * @param {string} [parameters.upgradePolicy.mode] Specifies the mode of an + * upgrade to virtual machines in the scale set.

    Possible values + * are:

    **Manual** - You control the application of updates to + * virtual machines in the scale set. You do this by using the manualUpgrade + * action.

    **Automatic** - All virtual machines in the scale set + * are automatically updated at the same time. Possible values include: + * 'Automatic', 'Manual', 'Rolling' + * + * @param {object} [parameters.upgradePolicy.rollingUpgradePolicy] The + * configuration parameters used while performing a rolling upgrade. + * + * @param {number} + * [parameters.upgradePolicy.rollingUpgradePolicy.maxBatchInstancePercent] The + * maximum percent of total virtual machine instances that will be upgraded + * simultaneously by the rolling upgrade in one batch. As this is a maximum, + * unhealthy instances in previous or future batches can cause the percentage + * of instances in a batch to decrease to ensure higher reliability. The + * default value for this parameter is 20%. + * + * @param {number} + * [parameters.upgradePolicy.rollingUpgradePolicy.maxUnhealthyInstancePercent] + * The maximum percentage of the total virtual machine instances in the scale + * set that can be simultaneously unhealthy, either as a result of being + * upgraded, or by being found in an unhealthy state by the virtual machine + * health checks before the rolling upgrade aborts. This constraint will be + * checked prior to starting any batch. The default value for this parameter is + * 20%. + * + * @param {number} + * [parameters.upgradePolicy.rollingUpgradePolicy.maxUnhealthyUpgradedInstancePercent] + * The maximum percentage of upgraded virtual machine instances that can be + * found to be in an unhealthy state. This check will happen after each batch + * is upgraded. If this percentage is ever exceeded, the rolling update aborts. + * The default value for this parameter is 20%. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradePolicy.pauseTimeBetweenBatches] The + * wait time between completing the update for all virtual machines in one + * batch and starting the next batch. The time duration should be specified in + * ISO 8601 format. The default value is 0 seconds (PT0S). + * + * @param {boolean} [parameters.upgradePolicy.automaticOSUpgrade] Whether OS + * upgrades should automatically be applied to scale set instances in a rolling + * fashion when a newer version of the image becomes available. + * + * @param {object} [parameters.virtualMachineProfile] The virtual machine + * profile. + * + * @param {object} [parameters.virtualMachineProfile.osProfile] Specifies the + * operating system settings for the virtual machines in the scale set. + * + * @param {string} + * [parameters.virtualMachineProfile.osProfile.computerNamePrefix] Specifies + * the computer name prefix for all of the virtual machines in the scale set. + * Computer name prefixes must be 1 to 15 characters long. + * + * @param {string} [parameters.virtualMachineProfile.osProfile.adminUsername] + * Specifies the name of the administrator account.

    **Windows-only + * restriction:** Cannot end in "."

    **Disallowed values:** + * "administrator", "admin", "user", "user1", "test", "user2", "test1", + * "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", + * "backup", "console", "david", "guest", "john", "owner", "root", "server", + * "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", + * "user5".

    **Minimum-length (Linux):** 1 character

    + * **Max-length (Linux):** 64 characters

    **Max-length (Windows):** 20 + * characters

  • For root access to the Linux VM, see [Using root + * privileges on Linux virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in this + * field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {string} [parameters.virtualMachineProfile.osProfile.adminPassword] + * Specifies the password of the administrator account.

    + * **Minimum-length (Windows):** 8 characters

    **Minimum-length + * (Linux):** 6 characters

    **Max-length (Windows):** 123 characters + *

    **Max-length (Linux):** 72 characters

    **Complexity + * requirements:** 3 out of 4 conditions below need to be fulfilled
    Has + * lower characters
    Has upper characters
    Has a digit
    Has a + * special character (Regex match [\W_])

    **Disallowed values:** + * "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", + * "Password!", "Password1", "Password22", "iloveyou!"

    For resetting + * the password, see [How to reset the Remote Desktop service or its login + * password in a Windows + * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    For resetting root password, see [Manage users, SSH, and check or + * repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + * + * @param {string} [parameters.virtualMachineProfile.osProfile.customData] + * Specifies a base-64 encoded string of custom data. The base-64 encoded + * string is decoded to a binary array that is saved as a file on the Virtual + * Machine. The maximum length of the binary array is 65535 bytes.

    For + * using cloud-init for your VM, see [Using cloud-init to customize a Linux VM + * during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration] Specifies + * Windows operating system settings on the virtual machine. + * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.enableAutomaticUpdates] + * Indicates whether virtual machine is enabled for automatic updates. + * + * @param {string} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.timeZone] + * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.winRM] + * Specifies the Windows Remote Management listeners. This enables remote + * Windows PowerShell. + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.winRM.listeners] + * The list of Windows Remote Management listeners + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration] Specifies + * the Linux operating system settings on the virtual machine.

    For a + * list of supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh] + * Specifies the ssh key configuration for a Linux OS. + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh.publicKeys] + * The list of SSH public keys used to authenticate with linux based VMs. + * + * @param {array} [parameters.virtualMachineProfile.osProfile.secrets] + * Specifies set of certificates that should be installed onto the virtual + * machines in the scale set. + * + * @param {object} [parameters.virtualMachineProfile.storageProfile] Specifies + * the storage settings for the virtual machine disks. + * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.imageReference] Specifies + * information about the image to use. You can specify information about + * platform images, marketplace images, or virtual machine images. This element + * is required when you want to use a platform image, marketplace image, or + * virtual machine image, but is not used in other creation operations. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.publisher] + * The image publisher. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.offer] + * Specifies the offer of the platform image or marketplace image used to + * create the virtual machine. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.sku] The + * image SKU. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.version] + * Specifies the version of the platform image or marketplace image used to + * create the virtual machine. The allowed formats are Major.Minor.Build or + * 'latest'. Major, Minor, and Build are decimal numbers. Specify 'latest' to + * use the latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.id] Resource + * Id + * + * @param {object} [parameters.virtualMachineProfile.storageProfile.osDisk] + * Specifies information about the operating system disk used by the virtual + * machines in the scale set.

    For more information about disks, see + * [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.name] The disk name. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.caching] Specifies + * the caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {boolean} + * [parameters.virtualMachineProfile.storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @param {string} + * parameters.virtualMachineProfile.storageProfile.osDisk.createOption + * Specifies how the virtual machines in the scale set should be + * created.

    The only allowed value is: **FromImage** \u2013 This value + * is used when you are using an image to create the virtual machine. If you + * are using a platform image, you also use the imageReference element + * described above. If you are using a marketplace image, you also use the + * plan element previously described. Possible values include: 'FromImage', + * 'Empty', 'Attach' + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.osType] This + * property allows you to specify the type of the OS that is included in the + * disk if creating a VM from user-image or a specialized VHD.

    + * Possible values are:

    **Windows**

    **Linux**. Possible + * values include: 'Windows', 'Linux' + * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.osDisk.image] Specifies + * information about the unmanaged user image to base the scale set on. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.image.uri] Specifies + * the virtual hard disk's uri. + * + * @param {array} + * [parameters.virtualMachineProfile.storageProfile.osDisk.vhdContainers] + * Specifies the container urls that are used to store operating system disks + * for the scale set. + * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.osDisk.managedDisk] The + * managed disk parameters. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.managedDisk.storageAccountType] + * Specifies the storage account type for the managed disk. Possible values + * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {array} [parameters.virtualMachineProfile.storageProfile.dataDisks] + * Specifies the parameters that are used to add data disks to the virtual + * machines in the scale set.

    For more information about disks, see + * [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {object} [parameters.virtualMachineProfile.networkProfile] Specifies + * properties of the network interfaces of the virtual machines in the scale + * set. + * + * @param {object} + * [parameters.virtualMachineProfile.networkProfile.healthProbe] A reference to + * a load balancer probe used to determine the health of an instance in the + * virtual machine scale set. The reference will be in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. + * + * @param {string} + * [parameters.virtualMachineProfile.networkProfile.healthProbe.id] The ARM + * resource id in the form of + * /subscriptions/{SubcriptionId}/resourceGroups/{ResourceGroupName}/... + * + * @param {array} + * [parameters.virtualMachineProfile.networkProfile.networkInterfaceConfigurations] + * The list of network configurations. + * + * @param {object} [parameters.virtualMachineProfile.diagnosticsProfile] + * Specifies the boot diagnostic settings state.

    Minimum api-version: + * 2015-06-15. + * + * @param {object} + * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, + * you can easily view the output of your console log.

    For both + * Windows and Linux virtual machines, Azure also enables you to see a + * screenshot of the VM from the hypervisor. + * + * @param {boolean} + * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics.enabled] + * Whether boot diagnostics should be enabled on the Virtual Machine. + * + * @param {string} + * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics.storageUri] + * Uri of the storage account to use for placing the console output and + * screenshot. + * + * @param {object} [parameters.virtualMachineProfile.extensionProfile] + * Specifies a collection of settings for extensions installed on virtual + * machines in the scale set. + * + * @param {array} + * [parameters.virtualMachineProfile.extensionProfile.extensions] The virtual + * machine scale set child extension resources. + * + * @param {string} [parameters.virtualMachineProfile.licenseType] Specifies + * that the image or disk that is being used was licensed on-premises. This + * element is only used for images that contain the Windows Server operating + * system.

    Possible values are:

    Windows_Client

    + * Windows_Server

    If this element is included in a request for an + * update, the value must match the initial value. This value cannot be + * updated.

    For more information, see [Azure Hybrid Use Benefit for + * Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Minimum api-version: 2015-06-15 + * + * @param {string} [parameters.virtualMachineProfile.priority] Specifies the + * priority for the virtual machines in the scale set.

    Minimum + * api-version: 2017-10-30-preview. Possible values include: 'Regular', 'Low' + * + * @param {boolean} [parameters.overprovision] Specifies whether the Virtual + * Machine Scale Set should be overprovisioned. + * + * @param {boolean} [parameters.singlePlacementGroup] When true this limits the + * scale set to a single placement group, of max size 100 virtual machines. + * + * @param {boolean} [parameters.zoneBalance] Whether to force stictly even + * Virtual Machine distribution cross x-zones in case there is zone outage. + * + * @param {number} [parameters.platformFaultDomainCount] Fault Domain count for + * each placement group. + * + * @param {object} [parameters.identity] The identity of the virtual machine + * scale set, if configured. + * + * @param {string} [parameters.identity.type] The type of identity used for the + * virtual machine scale set. The type 'SystemAssigned, UserAssigned' includes + * both an implicitly created identity and a set of user assigned identities. + * The type 'None' will remove any identities from the virtual machine scale + * set. Possible values include: 'SystemAssigned', 'UserAssigned', + * 'SystemAssigned, UserAssigned', 'None' + * + * @param {array} [parameters.identity.identityIds] The list of user identities + * associated with the virtual machine scale set. The user identity references + * will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * + * @param {array} [parameters.zones] The virtual machine scale set zones. + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @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 VirtualMachineScaleSet} 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 _createOrUpdate(resourceGroupName, vmScaleSetName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginCreateOrUpdate(resourceGroupName, vmScaleSetName, parameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['VirtualMachineScaleSet']().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); + }); + }); +} + + +/** + * Update a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set to create or + * update. + * + * @param {object} parameters The scale set object. + * + * @param {object} [parameters.sku] The virtual machine scale set sku. + * + * @param {string} [parameters.sku.name] The sku name. + * + * @param {string} [parameters.sku.tier] Specifies the tier of virtual machines + * in a scale set.

    Possible Values:

    **Standard**

    **Basic** + * + * @param {number} [parameters.sku.capacity] Specifies the number of virtual + * machines in the scale set. + * + * @param {object} [parameters.plan] The purchase plan when deploying a virtual + * machine scale set from VM Marketplace images. + * + * @param {string} [parameters.plan.name] The plan ID. + * + * @param {string} [parameters.plan.publisher] The publisher ID. + * + * @param {string} [parameters.plan.product] Specifies the product of the image + * from the marketplace. This is the same value as Offer under the + * imageReference element. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {object} [parameters.upgradePolicy] The upgrade policy. + * + * @param {string} [parameters.upgradePolicy.mode] Specifies the mode of an + * upgrade to virtual machines in the scale set.

    Possible values + * are:

    **Manual** - You control the application of updates to + * virtual machines in the scale set. You do this by using the manualUpgrade + * action.

    **Automatic** - All virtual machines in the scale set + * are automatically updated at the same time. Possible values include: + * 'Automatic', 'Manual', 'Rolling' + * + * @param {object} [parameters.upgradePolicy.rollingUpgradePolicy] The + * configuration parameters used while performing a rolling upgrade. + * + * @param {number} + * [parameters.upgradePolicy.rollingUpgradePolicy.maxBatchInstancePercent] The + * maximum percent of total virtual machine instances that will be upgraded + * simultaneously by the rolling upgrade in one batch. As this is a maximum, + * unhealthy instances in previous or future batches can cause the percentage + * of instances in a batch to decrease to ensure higher reliability. The + * default value for this parameter is 20%. + * + * @param {number} + * [parameters.upgradePolicy.rollingUpgradePolicy.maxUnhealthyInstancePercent] + * The maximum percentage of the total virtual machine instances in the scale + * set that can be simultaneously unhealthy, either as a result of being + * upgraded, or by being found in an unhealthy state by the virtual machine + * health checks before the rolling upgrade aborts. This constraint will be + * checked prior to starting any batch. The default value for this parameter is + * 20%. + * + * @param {number} + * [parameters.upgradePolicy.rollingUpgradePolicy.maxUnhealthyUpgradedInstancePercent] + * The maximum percentage of upgraded virtual machine instances that can be + * found to be in an unhealthy state. This check will happen after each batch + * is upgraded. If this percentage is ever exceeded, the rolling update aborts. + * The default value for this parameter is 20%. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradePolicy.pauseTimeBetweenBatches] The + * wait time between completing the update for all virtual machines in one + * batch and starting the next batch. The time duration should be specified in + * ISO 8601 format. The default value is 0 seconds (PT0S). + * + * @param {boolean} [parameters.upgradePolicy.automaticOSUpgrade] Whether OS + * upgrades should automatically be applied to scale set instances in a rolling + * fashion when a newer version of the image becomes available. + * + * @param {object} [parameters.virtualMachineProfile] The virtual machine + * profile. + * + * @param {object} [parameters.virtualMachineProfile.osProfile] The virtual + * machine scale set OS profile. + * + * @param {string} [parameters.virtualMachineProfile.osProfile.customData] A + * base-64 encoded string of custom data. + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration] The + * Windows Configuration of the OS profile. + * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.enableAutomaticUpdates] + * Indicates whether virtual machine is enabled for automatic updates. + * + * @param {string} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.timeZone] + * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.winRM] + * Specifies the Windows Remote Management listeners. This enables remote + * Windows PowerShell. + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.winRM.listeners] + * The list of Windows Remote Management listeners + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration] The Linux + * Configuration of the OS profile. + * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh] + * Specifies the ssh key configuration for a Linux OS. + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh.publicKeys] + * The list of SSH public keys used to authenticate with linux based VMs. + * + * @param {array} [parameters.virtualMachineProfile.osProfile.secrets] The List + * of certificates for addition to the VM. + * + * @param {object} [parameters.virtualMachineProfile.storageProfile] The + * virtual machine scale set storage profile. + * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.imageReference] The image + * reference. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.publisher] + * The image publisher. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.offer] + * Specifies the offer of the platform image or marketplace image used to + * create the virtual machine. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.sku] The + * image SKU. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.version] + * Specifies the version of the platform image or marketplace image used to + * create the virtual machine. The allowed formats are Major.Minor.Build or + * 'latest'. Major, Minor, and Build are decimal numbers. Specify 'latest' to + * use the latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.id] Resource + * Id + * + * @param {object} [parameters.virtualMachineProfile.storageProfile.osDisk] The + * OS disk. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.caching] The caching + * type. Possible values include: 'None', 'ReadOnly', 'ReadWrite' + * + * @param {boolean} + * [parameters.virtualMachineProfile.storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.osDisk.image] The Source + * User Image VirtualHardDisk. This VirtualHardDisk will be copied before using + * it to attach to the Virtual Machine. If SourceImage is provided, the + * destination VirtualHardDisk should not exist. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.image.uri] Specifies + * the virtual hard disk's uri. + * + * @param {array} + * [parameters.virtualMachineProfile.storageProfile.osDisk.vhdContainers] The + * list of virtual hard disk container uris. + * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.osDisk.managedDisk] The + * managed disk parameters. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.managedDisk.storageAccountType] + * Specifies the storage account type for the managed disk. Possible values + * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {array} [parameters.virtualMachineProfile.storageProfile.dataDisks] + * The data disks. + * + * @param {object} [parameters.virtualMachineProfile.networkProfile] The + * virtual machine scale set network profile. + * + * @param {array} + * [parameters.virtualMachineProfile.networkProfile.networkInterfaceConfigurations] + * The list of network configurations. + * + * @param {object} [parameters.virtualMachineProfile.diagnosticsProfile] The + * virtual machine scale set diagnostics profile. + * + * @param {object} + * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, + * you can easily view the output of your console log.

    For both + * Windows and Linux virtual machines, Azure also enables you to see a + * screenshot of the VM from the hypervisor. + * + * @param {boolean} + * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics.enabled] + * Whether boot diagnostics should be enabled on the Virtual Machine. + * + * @param {string} + * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics.storageUri] + * Uri of the storage account to use for placing the console output and + * screenshot. + * + * @param {object} [parameters.virtualMachineProfile.extensionProfile] The + * virtual machine scale set extension profile. + * + * @param {array} + * [parameters.virtualMachineProfile.extensionProfile.extensions] The virtual + * machine scale set child extension resources. + * + * @param {string} [parameters.virtualMachineProfile.licenseType] The license + * type, which is for bring your own license scenario. + * + * @param {boolean} [parameters.overprovision] Specifies whether the Virtual + * Machine Scale Set should be overprovisioned. + * + * @param {boolean} [parameters.singlePlacementGroup] When true this limits the + * scale set to a single placement group, of max size 100 virtual machines. + * + * @param {object} [parameters.identity] The identity of the virtual machine + * scale set, if configured. + * + * @param {string} [parameters.identity.type] The type of identity used for the + * virtual machine scale set. The type 'SystemAssigned, UserAssigned' includes + * both an implicitly created identity and a set of user assigned identities. + * The type 'None' will remove any identities from the virtual machine scale + * set. Possible values include: 'SystemAssigned', 'UserAssigned', + * 'SystemAssigned, UserAssigned', 'None' + * + * @param {array} [parameters.identity.identityIds] The list of user identities + * associated with the virtual machine scale set. The user identity references + * will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * + * @param {object} [parameters.tags] Resource tags + * + * @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 VirtualMachineScaleSet} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _update(resourceGroupName, vmScaleSetName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginUpdate(resourceGroupName, vmScaleSetName, parameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['VirtualMachineScaleSet']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Deletes a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @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 OperationStatusResponse} 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 _deleteMethod(resourceGroupName, vmScaleSetName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginDeleteMethod(resourceGroupName, vmScaleSetName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().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); + }); + }); +} + +/** + * Display information about a virtual machine scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @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 VirtualMachineScaleSet} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, vmScaleSetName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmScaleSetName === null || vmScaleSetName === undefined || typeof vmScaleSetName.valueOf() !== 'string') { + throw new Error('vmScaleSetName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmScaleSetName}', encodeURIComponent(vmScaleSetName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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['VirtualMachineScaleSet']().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); + }); +} + + +/** + * Deallocates specific virtual machines in a VM scale set. Shuts down the + * virtual machines and releases the compute resources. You are not billed for + * the compute resources that this virtual machine scale set deallocates. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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 OperationStatusResponse} 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 _deallocate(resourceGroupName, vmScaleSetName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginDeallocate(resourceGroupName, vmScaleSetName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Deletes virtual machines in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {array} instanceIds The virtual machine scale set instance ids. + * + * @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 OperationStatusResponse} 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 _deleteInstances(resourceGroupName, vmScaleSetName, instanceIds, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginDeleteInstances(resourceGroupName, vmScaleSetName, instanceIds, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().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); + }); + }); +} + +/** + * Gets the status of a VM scale set instance. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @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 VirtualMachineScaleSetInstanceView} 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 _getInstanceView(resourceGroupName, vmScaleSetName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmScaleSetName === null || vmScaleSetName === undefined || typeof vmScaleSetName.valueOf() !== 'string') { + throw new Error('vmScaleSetName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/instanceView'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmScaleSetName}', encodeURIComponent(vmScaleSetName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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['VirtualMachineScaleSetInstanceView']().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); + }); +} + +/** + * Gets a list of all VM scale sets under a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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 VirtualMachineScaleSetListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(resourceGroupName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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['VirtualMachineScaleSetListResult']().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); + }); +} + +/** + * Gets a list of all VM Scale Sets in the subscription, regardless of the + * associated resource group. Use nextLink property in the response to get the + * next page of VM Scale Sets. Do this till nextLink is null to fetch all the + * VM Scale Sets. + * + * @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 VirtualMachineScaleSetListWithLinkResult} + * 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 _listAll(options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // 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.Compute/virtualMachineScaleSets'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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['VirtualMachineScaleSetListWithLinkResult']().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); + }); +} + +/** + * Gets a list of SKUs available for your VM scale set, including the minimum + * and maximum VM instances allowed for each SKU. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @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 VirtualMachineScaleSetListSkusResult} 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 _listSkus(resourceGroupName, vmScaleSetName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmScaleSetName === null || vmScaleSetName === undefined || typeof vmScaleSetName.valueOf() !== 'string') { + throw new Error('vmScaleSetName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/skus'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmScaleSetName}', encodeURIComponent(vmScaleSetName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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['VirtualMachineScaleSetListSkusResult']().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); + }); +} + +/** + * Gets list of OS upgrades on a VM scale set instance. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @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 VirtualMachineScaleSetListOSUpgradeHistory} + * 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 _getOSUpgradeHistory(resourceGroupName, vmScaleSetName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmScaleSetName === null || vmScaleSetName === undefined || typeof vmScaleSetName.valueOf() !== 'string') { + throw new Error('vmScaleSetName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/osUpgradeHistory'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmScaleSetName}', encodeURIComponent(vmScaleSetName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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['VirtualMachineScaleSetListOSUpgradeHistory']().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); + }); +} + + +/** + * Power off (stop) one or more virtual machines in a VM scale set. Note that + * resources are still attached and you are getting charged for the resources. + * Instead, use deallocate to release resources and avoid charges. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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 OperationStatusResponse} 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 _powerOff(resourceGroupName, vmScaleSetName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginPowerOff(resourceGroupName, vmScaleSetName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().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); + }); + }); +} + + +/** + * Restarts one or more virtual machines in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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 OperationStatusResponse} 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 _restart(resourceGroupName, vmScaleSetName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginRestart(resourceGroupName, vmScaleSetName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Starts one or more virtual machines in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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 OperationStatusResponse} 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 _start(resourceGroupName, vmScaleSetName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginStart(resourceGroupName, vmScaleSetName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().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); + }); + }); +} + + +/** + * Redeploy one or more virtual machines in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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 OperationStatusResponse} 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 _redeploy(resourceGroupName, vmScaleSetName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginRedeploy(resourceGroupName, vmScaleSetName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().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); + }); + }); +} + + +/** + * Perform maintenance on one or more virtual machines in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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 OperationStatusResponse} 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 _performMaintenance(resourceGroupName, vmScaleSetName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginPerformMaintenance(resourceGroupName, vmScaleSetName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().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); + }); + }); +} + + +/** + * Upgrades one or more virtual machines to the latest SKU set in the VM scale + * set model. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {array} instanceIds The virtual machine scale set instance ids. + * + * @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 OperationStatusResponse} 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 _updateInstances(resourceGroupName, vmScaleSetName, instanceIds, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginUpdateInstances(resourceGroupName, vmScaleSetName, instanceIds, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().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); + }); + }); +} + + +/** + * Reimages (upgrade the operating system) one or more virtual machines in a VM + * scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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 OperationStatusResponse} 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 _reimage(resourceGroupName, vmScaleSetName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginReimage(resourceGroupName, vmScaleSetName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().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); + }); + }); +} + + +/** + * Reimages all the disks ( including data disks ) in the virtual machines in a + * VM scale set. This operation is only supported for managed disks. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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 OperationStatusResponse} 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 _reimageAll(resourceGroupName, vmScaleSetName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginReimageAll(resourceGroupName, vmScaleSetName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().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); + }); + }); +} + +/** + * Manual platform update domain walk to update virtual machines in a service + * fabric virtual machine scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {number} platformUpdateDomain The platform update domain for which a + * manual recovery walk is requested + * + * @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 RecoveryWalkResponse} 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 _forceRecoveryServiceFabricPlatformUpdateDomainWalk(resourceGroupName, vmScaleSetName, platformUpdateDomain, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmScaleSetName === null || vmScaleSetName === undefined || typeof vmScaleSetName.valueOf() !== 'string') { + throw new Error('vmScaleSetName 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 (platformUpdateDomain === null || platformUpdateDomain === undefined || typeof platformUpdateDomain !== 'number') { + throw new Error('platformUpdateDomain cannot be null or undefined and it must be of type number.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/forceRecoveryServiceFabricPlatformUpdateDomainWalk'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmScaleSetName}', encodeURIComponent(vmScaleSetName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('platformUpdateDomain=' + encodeURIComponent(platformUpdateDomain.toString())); + 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]; + } + } + } + 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['RecoveryWalkResponse']().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); + }); +} + +/** + * Create or update a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set to create or + * update. + * + * @param {object} parameters The scale set object. + * + * @param {object} [parameters.sku] The virtual machine scale set sku. + * + * @param {string} [parameters.sku.name] The sku name. + * + * @param {string} [parameters.sku.tier] Specifies the tier of virtual machines + * in a scale set.

    Possible Values:

    **Standard**

    **Basic** + * + * @param {number} [parameters.sku.capacity] Specifies the number of virtual + * machines in the scale set. + * + * @param {object} [parameters.plan] Specifies information about the + * marketplace image used to create the virtual machine. This element is only + * used for marketplace images. Before you can use a marketplace image from an + * API, you must enable the image for programmatic use. In the Azure portal, + * find the marketplace image that you want to use and then click **Want to + * deploy programmatically, Get Started ->**. Enter any required information + * and then click **Save**. + * + * @param {string} [parameters.plan.name] The plan ID. + * + * @param {string} [parameters.plan.publisher] The publisher ID. + * + * @param {string} [parameters.plan.product] Specifies the product of the image + * from the marketplace. This is the same value as Offer under the + * imageReference element. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {object} [parameters.upgradePolicy] The upgrade policy. + * + * @param {string} [parameters.upgradePolicy.mode] Specifies the mode of an + * upgrade to virtual machines in the scale set.

    Possible values + * are:

    **Manual** - You control the application of updates to + * virtual machines in the scale set. You do this by using the manualUpgrade + * action.

    **Automatic** - All virtual machines in the scale set + * are automatically updated at the same time. Possible values include: + * 'Automatic', 'Manual', 'Rolling' + * + * @param {object} [parameters.upgradePolicy.rollingUpgradePolicy] The + * configuration parameters used while performing a rolling upgrade. + * + * @param {number} + * [parameters.upgradePolicy.rollingUpgradePolicy.maxBatchInstancePercent] The + * maximum percent of total virtual machine instances that will be upgraded + * simultaneously by the rolling upgrade in one batch. As this is a maximum, + * unhealthy instances in previous or future batches can cause the percentage + * of instances in a batch to decrease to ensure higher reliability. The + * default value for this parameter is 20%. + * + * @param {number} + * [parameters.upgradePolicy.rollingUpgradePolicy.maxUnhealthyInstancePercent] + * The maximum percentage of the total virtual machine instances in the scale + * set that can be simultaneously unhealthy, either as a result of being + * upgraded, or by being found in an unhealthy state by the virtual machine + * health checks before the rolling upgrade aborts. This constraint will be + * checked prior to starting any batch. The default value for this parameter is + * 20%. + * + * @param {number} + * [parameters.upgradePolicy.rollingUpgradePolicy.maxUnhealthyUpgradedInstancePercent] + * The maximum percentage of upgraded virtual machine instances that can be + * found to be in an unhealthy state. This check will happen after each batch + * is upgraded. If this percentage is ever exceeded, the rolling update aborts. + * The default value for this parameter is 20%. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradePolicy.pauseTimeBetweenBatches] The + * wait time between completing the update for all virtual machines in one + * batch and starting the next batch. The time duration should be specified in + * ISO 8601 format. The default value is 0 seconds (PT0S). + * + * @param {boolean} [parameters.upgradePolicy.automaticOSUpgrade] Whether OS + * upgrades should automatically be applied to scale set instances in a rolling + * fashion when a newer version of the image becomes available. + * + * @param {object} [parameters.virtualMachineProfile] The virtual machine + * profile. + * + * @param {object} [parameters.virtualMachineProfile.osProfile] Specifies the + * operating system settings for the virtual machines in the scale set. + * + * @param {string} + * [parameters.virtualMachineProfile.osProfile.computerNamePrefix] Specifies + * the computer name prefix for all of the virtual machines in the scale set. + * Computer name prefixes must be 1 to 15 characters long. + * + * @param {string} [parameters.virtualMachineProfile.osProfile.adminUsername] + * Specifies the name of the administrator account.

    **Windows-only + * restriction:** Cannot end in "."

    **Disallowed values:** + * "administrator", "admin", "user", "user1", "test", "user2", "test1", + * "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", + * "backup", "console", "david", "guest", "john", "owner", "root", "server", + * "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", + * "user5".

    **Minimum-length (Linux):** 1 character

    + * **Max-length (Linux):** 64 characters

    **Max-length (Windows):** 20 + * characters

  • For root access to the Linux VM, see [Using root + * privileges on Linux virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in this + * field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {string} [parameters.virtualMachineProfile.osProfile.adminPassword] + * Specifies the password of the administrator account.

    + * **Minimum-length (Windows):** 8 characters

    **Minimum-length + * (Linux):** 6 characters

    **Max-length (Windows):** 123 characters + *

    **Max-length (Linux):** 72 characters

    **Complexity + * requirements:** 3 out of 4 conditions below need to be fulfilled
    Has + * lower characters
    Has upper characters
    Has a digit
    Has a + * special character (Regex match [\W_])

    **Disallowed values:** + * "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", + * "Password!", "Password1", "Password22", "iloveyou!"

    For resetting + * the password, see [How to reset the Remote Desktop service or its login + * password in a Windows + * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    For resetting root password, see [Manage users, SSH, and check or + * repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + * + * @param {string} [parameters.virtualMachineProfile.osProfile.customData] + * Specifies a base-64 encoded string of custom data. The base-64 encoded + * string is decoded to a binary array that is saved as a file on the Virtual + * Machine. The maximum length of the binary array is 65535 bytes.

    For + * using cloud-init for your VM, see [Using cloud-init to customize a Linux VM + * during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration] Specifies + * Windows operating system settings on the virtual machine. + * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.enableAutomaticUpdates] + * Indicates whether virtual machine is enabled for automatic updates. + * + * @param {string} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.timeZone] + * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.winRM] + * Specifies the Windows Remote Management listeners. This enables remote + * Windows PowerShell. + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.winRM.listeners] + * The list of Windows Remote Management listeners + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration] Specifies + * the Linux operating system settings on the virtual machine.

    For a + * list of supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh] + * Specifies the ssh key configuration for a Linux OS. + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh.publicKeys] + * The list of SSH public keys used to authenticate with linux based VMs. + * + * @param {array} [parameters.virtualMachineProfile.osProfile.secrets] + * Specifies set of certificates that should be installed onto the virtual + * machines in the scale set. + * + * @param {object} [parameters.virtualMachineProfile.storageProfile] Specifies + * the storage settings for the virtual machine disks. + * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.imageReference] Specifies + * information about the image to use. You can specify information about + * platform images, marketplace images, or virtual machine images. This element + * is required when you want to use a platform image, marketplace image, or + * virtual machine image, but is not used in other creation operations. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.publisher] + * The image publisher. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.offer] + * Specifies the offer of the platform image or marketplace image used to + * create the virtual machine. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.sku] The + * image SKU. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.version] + * Specifies the version of the platform image or marketplace image used to + * create the virtual machine. The allowed formats are Major.Minor.Build or + * 'latest'. Major, Minor, and Build are decimal numbers. Specify 'latest' to + * use the latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.id] Resource + * Id + * + * @param {object} [parameters.virtualMachineProfile.storageProfile.osDisk] + * Specifies information about the operating system disk used by the virtual + * machines in the scale set.

    For more information about disks, see + * [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.name] The disk name. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.caching] Specifies + * the caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {boolean} + * [parameters.virtualMachineProfile.storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @param {string} + * parameters.virtualMachineProfile.storageProfile.osDisk.createOption + * Specifies how the virtual machines in the scale set should be + * created.

    The only allowed value is: **FromImage** \u2013 This value + * is used when you are using an image to create the virtual machine. If you + * are using a platform image, you also use the imageReference element + * described above. If you are using a marketplace image, you also use the + * plan element previously described. Possible values include: 'FromImage', + * 'Empty', 'Attach' + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.osType] This + * property allows you to specify the type of the OS that is included in the + * disk if creating a VM from user-image or a specialized VHD.

    + * Possible values are:

    **Windows**

    **Linux**. Possible + * values include: 'Windows', 'Linux' + * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.osDisk.image] Specifies + * information about the unmanaged user image to base the scale set on. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.image.uri] Specifies + * the virtual hard disk's uri. + * + * @param {array} + * [parameters.virtualMachineProfile.storageProfile.osDisk.vhdContainers] + * Specifies the container urls that are used to store operating system disks + * for the scale set. + * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.osDisk.managedDisk] The + * managed disk parameters. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.managedDisk.storageAccountType] + * Specifies the storage account type for the managed disk. Possible values + * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {array} [parameters.virtualMachineProfile.storageProfile.dataDisks] + * Specifies the parameters that are used to add data disks to the virtual + * machines in the scale set.

    For more information about disks, see + * [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {object} [parameters.virtualMachineProfile.networkProfile] Specifies + * properties of the network interfaces of the virtual machines in the scale + * set. + * + * @param {object} + * [parameters.virtualMachineProfile.networkProfile.healthProbe] A reference to + * a load balancer probe used to determine the health of an instance in the + * virtual machine scale set. The reference will be in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. + * + * @param {string} + * [parameters.virtualMachineProfile.networkProfile.healthProbe.id] The ARM + * resource id in the form of + * /subscriptions/{SubcriptionId}/resourceGroups/{ResourceGroupName}/... + * + * @param {array} + * [parameters.virtualMachineProfile.networkProfile.networkInterfaceConfigurations] + * The list of network configurations. + * + * @param {object} [parameters.virtualMachineProfile.diagnosticsProfile] + * Specifies the boot diagnostic settings state.

    Minimum api-version: + * 2015-06-15. + * + * @param {object} + * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, + * you can easily view the output of your console log.

    For both + * Windows and Linux virtual machines, Azure also enables you to see a + * screenshot of the VM from the hypervisor. + * + * @param {boolean} + * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics.enabled] + * Whether boot diagnostics should be enabled on the Virtual Machine. + * + * @param {string} + * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics.storageUri] + * Uri of the storage account to use for placing the console output and + * screenshot. + * + * @param {object} [parameters.virtualMachineProfile.extensionProfile] + * Specifies a collection of settings for extensions installed on virtual + * machines in the scale set. + * + * @param {array} + * [parameters.virtualMachineProfile.extensionProfile.extensions] The virtual + * machine scale set child extension resources. + * + * @param {string} [parameters.virtualMachineProfile.licenseType] Specifies + * that the image or disk that is being used was licensed on-premises. This + * element is only used for images that contain the Windows Server operating + * system.

    Possible values are:

    Windows_Client

    + * Windows_Server

    If this element is included in a request for an + * update, the value must match the initial value. This value cannot be + * updated.

    For more information, see [Azure Hybrid Use Benefit for + * Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Minimum api-version: 2015-06-15 + * + * @param {string} [parameters.virtualMachineProfile.priority] Specifies the + * priority for the virtual machines in the scale set.

    Minimum + * api-version: 2017-10-30-preview. Possible values include: 'Regular', 'Low' + * + * @param {boolean} [parameters.overprovision] Specifies whether the Virtual + * Machine Scale Set should be overprovisioned. + * + * @param {boolean} [parameters.singlePlacementGroup] When true this limits the + * scale set to a single placement group, of max size 100 virtual machines. + * + * @param {boolean} [parameters.zoneBalance] Whether to force stictly even + * Virtual Machine distribution cross x-zones in case there is zone outage. + * + * @param {number} [parameters.platformFaultDomainCount] Fault Domain count for + * each placement group. + * + * @param {object} [parameters.identity] The identity of the virtual machine + * scale set, if configured. + * + * @param {string} [parameters.identity.type] The type of identity used for the + * virtual machine scale set. The type 'SystemAssigned, UserAssigned' includes + * both an implicitly created identity and a set of user assigned identities. + * The type 'None' will remove any identities from the virtual machine scale + * set. Possible values include: 'SystemAssigned', 'UserAssigned', + * 'SystemAssigned, UserAssigned', 'None' + * + * @param {array} [parameters.identity.identityIds] The list of user identities + * associated with the virtual machine scale set. The user identity references + * will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * + * @param {array} [parameters.zones] The virtual machine scale set zones. + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @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 VirtualMachineScaleSet} 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 _beginCreateOrUpdate(resourceGroupName, vmScaleSetName, 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.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmScaleSetName === null || vmScaleSetName === undefined || typeof vmScaleSetName.valueOf() !== 'string') { + throw new Error('vmScaleSetName 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.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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmScaleSetName}', encodeURIComponent(vmScaleSetName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['VirtualMachineScaleSet']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + 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['VirtualMachineScaleSet']().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); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['VirtualMachineScaleSet']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Update a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set to create or + * update. + * + * @param {object} parameters The scale set object. + * + * @param {object} [parameters.sku] The virtual machine scale set sku. + * + * @param {string} [parameters.sku.name] The sku name. + * + * @param {string} [parameters.sku.tier] Specifies the tier of virtual machines + * in a scale set.

    Possible Values:

    **Standard**

    **Basic** + * + * @param {number} [parameters.sku.capacity] Specifies the number of virtual + * machines in the scale set. + * + * @param {object} [parameters.plan] The purchase plan when deploying a virtual + * machine scale set from VM Marketplace images. + * + * @param {string} [parameters.plan.name] The plan ID. + * + * @param {string} [parameters.plan.publisher] The publisher ID. + * + * @param {string} [parameters.plan.product] Specifies the product of the image + * from the marketplace. This is the same value as Offer under the + * imageReference element. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {object} [parameters.upgradePolicy] The upgrade policy. + * + * @param {string} [parameters.upgradePolicy.mode] Specifies the mode of an + * upgrade to virtual machines in the scale set.

    Possible values + * are:

    **Manual** - You control the application of updates to + * virtual machines in the scale set. You do this by using the manualUpgrade + * action.

    **Automatic** - All virtual machines in the scale set + * are automatically updated at the same time. Possible values include: + * 'Automatic', 'Manual', 'Rolling' + * + * @param {object} [parameters.upgradePolicy.rollingUpgradePolicy] The + * configuration parameters used while performing a rolling upgrade. + * + * @param {number} + * [parameters.upgradePolicy.rollingUpgradePolicy.maxBatchInstancePercent] The + * maximum percent of total virtual machine instances that will be upgraded + * simultaneously by the rolling upgrade in one batch. As this is a maximum, + * unhealthy instances in previous or future batches can cause the percentage + * of instances in a batch to decrease to ensure higher reliability. The + * default value for this parameter is 20%. + * + * @param {number} + * [parameters.upgradePolicy.rollingUpgradePolicy.maxUnhealthyInstancePercent] + * The maximum percentage of the total virtual machine instances in the scale + * set that can be simultaneously unhealthy, either as a result of being + * upgraded, or by being found in an unhealthy state by the virtual machine + * health checks before the rolling upgrade aborts. This constraint will be + * checked prior to starting any batch. The default value for this parameter is + * 20%. + * + * @param {number} + * [parameters.upgradePolicy.rollingUpgradePolicy.maxUnhealthyUpgradedInstancePercent] + * The maximum percentage of upgraded virtual machine instances that can be + * found to be in an unhealthy state. This check will happen after each batch + * is upgraded. If this percentage is ever exceeded, the rolling update aborts. + * The default value for this parameter is 20%. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradePolicy.pauseTimeBetweenBatches] The + * wait time between completing the update for all virtual machines in one + * batch and starting the next batch. The time duration should be specified in + * ISO 8601 format. The default value is 0 seconds (PT0S). + * + * @param {boolean} [parameters.upgradePolicy.automaticOSUpgrade] Whether OS + * upgrades should automatically be applied to scale set instances in a rolling + * fashion when a newer version of the image becomes available. + * + * @param {object} [parameters.virtualMachineProfile] The virtual machine + * profile. + * + * @param {object} [parameters.virtualMachineProfile.osProfile] The virtual + * machine scale set OS profile. + * + * @param {string} [parameters.virtualMachineProfile.osProfile.customData] A + * base-64 encoded string of custom data. + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration] The + * Windows Configuration of the OS profile. + * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.enableAutomaticUpdates] + * Indicates whether virtual machine is enabled for automatic updates. + * + * @param {string} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.timeZone] + * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.winRM] + * Specifies the Windows Remote Management listeners. This enables remote + * Windows PowerShell. + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.winRM.listeners] + * The list of Windows Remote Management listeners + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration] The Linux + * Configuration of the OS profile. + * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh] + * Specifies the ssh key configuration for a Linux OS. + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh.publicKeys] + * The list of SSH public keys used to authenticate with linux based VMs. + * + * @param {array} [parameters.virtualMachineProfile.osProfile.secrets] The List + * of certificates for addition to the VM. + * + * @param {object} [parameters.virtualMachineProfile.storageProfile] The + * virtual machine scale set storage profile. + * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.imageReference] The image + * reference. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.publisher] + * The image publisher. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.offer] + * Specifies the offer of the platform image or marketplace image used to + * create the virtual machine. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.sku] The + * image SKU. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.version] + * Specifies the version of the platform image or marketplace image used to + * create the virtual machine. The allowed formats are Major.Minor.Build or + * 'latest'. Major, Minor, and Build are decimal numbers. Specify 'latest' to + * use the latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.id] Resource + * Id + * + * @param {object} [parameters.virtualMachineProfile.storageProfile.osDisk] The + * OS disk. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.caching] The caching + * type. Possible values include: 'None', 'ReadOnly', 'ReadWrite' + * + * @param {boolean} + * [parameters.virtualMachineProfile.storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.osDisk.image] The Source + * User Image VirtualHardDisk. This VirtualHardDisk will be copied before using + * it to attach to the Virtual Machine. If SourceImage is provided, the + * destination VirtualHardDisk should not exist. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.image.uri] Specifies + * the virtual hard disk's uri. + * + * @param {array} + * [parameters.virtualMachineProfile.storageProfile.osDisk.vhdContainers] The + * list of virtual hard disk container uris. + * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.osDisk.managedDisk] The + * managed disk parameters. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.managedDisk.storageAccountType] + * Specifies the storage account type for the managed disk. Possible values + * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {array} [parameters.virtualMachineProfile.storageProfile.dataDisks] + * The data disks. + * + * @param {object} [parameters.virtualMachineProfile.networkProfile] The + * virtual machine scale set network profile. + * + * @param {array} + * [parameters.virtualMachineProfile.networkProfile.networkInterfaceConfigurations] + * The list of network configurations. + * + * @param {object} [parameters.virtualMachineProfile.diagnosticsProfile] The + * virtual machine scale set diagnostics profile. + * + * @param {object} + * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, + * you can easily view the output of your console log.

    For both + * Windows and Linux virtual machines, Azure also enables you to see a + * screenshot of the VM from the hypervisor. + * + * @param {boolean} + * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics.enabled] + * Whether boot diagnostics should be enabled on the Virtual Machine. + * + * @param {string} + * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics.storageUri] + * Uri of the storage account to use for placing the console output and + * screenshot. + * + * @param {object} [parameters.virtualMachineProfile.extensionProfile] The + * virtual machine scale set extension profile. + * + * @param {array} + * [parameters.virtualMachineProfile.extensionProfile.extensions] The virtual + * machine scale set child extension resources. + * + * @param {string} [parameters.virtualMachineProfile.licenseType] The license + * type, which is for bring your own license scenario. + * + * @param {boolean} [parameters.overprovision] Specifies whether the Virtual + * Machine Scale Set should be overprovisioned. + * + * @param {boolean} [parameters.singlePlacementGroup] When true this limits the + * scale set to a single placement group, of max size 100 virtual machines. + * + * @param {object} [parameters.identity] The identity of the virtual machine + * scale set, if configured. + * + * @param {string} [parameters.identity.type] The type of identity used for the + * virtual machine scale set. The type 'SystemAssigned, UserAssigned' includes + * both an implicitly created identity and a set of user assigned identities. + * The type 'None' will remove any identities from the virtual machine scale + * set. Possible values include: 'SystemAssigned', 'UserAssigned', + * 'SystemAssigned, UserAssigned', 'None' + * + * @param {array} [parameters.identity.identityIds] The list of user identities + * associated with the virtual machine scale set. The user identity references + * will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * + * @param {object} [parameters.tags] Resource tags + * + * @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 VirtualMachineScaleSet} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginUpdate(resourceGroupName, vmScaleSetName, 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.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmScaleSetName === null || vmScaleSetName === undefined || typeof vmScaleSetName.valueOf() !== 'string') { + throw new Error('vmScaleSetName 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.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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmScaleSetName}', encodeURIComponent(vmScaleSetName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['VirtualMachineScaleSetUpdate']().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['VirtualMachineScaleSet']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Deletes a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @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 OperationStatusResponse} 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 _beginDeleteMethod(resourceGroupName, vmScaleSetName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmScaleSetName === null || vmScaleSetName === undefined || typeof vmScaleSetName.valueOf() !== 'string') { + throw new Error('vmScaleSetName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmScaleSetName}', encodeURIComponent(vmScaleSetName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // 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['OperationStatusResponse']().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); + }); +} + +/** + * Deallocates specific virtual machines in a VM scale set. Shuts down the + * virtual machines and releases the compute resources. You are not billed for + * the compute resources that this virtual machine scale set deallocates. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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 OperationStatusResponse} 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 _beginDeallocate(resourceGroupName, vmScaleSetName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let instanceIds = (options && options.instanceIds !== undefined) ? options.instanceIds : undefined; + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmScaleSetName === null || vmScaleSetName === undefined || typeof vmScaleSetName.valueOf() !== 'string') { + throw new Error('vmScaleSetName 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 (Array.isArray(instanceIds)) { + for (let i = 0; i < instanceIds.length; i++) { + if (instanceIds[i] !== null && instanceIds[i] !== undefined && typeof instanceIds[i].valueOf() !== 'string') { + throw new Error('instanceIds[i] 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); + } + let vmInstanceIDs; + if (instanceIds !== null && instanceIds !== undefined) { + vmInstanceIDs = new client.models['VirtualMachineScaleSetVMInstanceIDs'](); + vmInstanceIDs.instanceIds = instanceIds; + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/deallocate'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmScaleSetName}', encodeURIComponent(vmScaleSetName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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 (vmInstanceIDs !== null && vmInstanceIDs !== undefined) { + let requestModelMapper = new client.models['VirtualMachineScaleSetVMInstanceIDs']().mapper(); + requestModel = client.serialize(requestModelMapper, vmInstanceIDs, 'vmInstanceIDs'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(vmInstanceIDs, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Deletes virtual machines in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {array} instanceIds The virtual machine scale set instance ids. + * + * @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 OperationStatusResponse} 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 _beginDeleteInstances(resourceGroupName, vmScaleSetName, instanceIds, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmScaleSetName === null || vmScaleSetName === undefined || typeof vmScaleSetName.valueOf() !== 'string') { + throw new Error('vmScaleSetName 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 (!Array.isArray(instanceIds)) { + throw new Error('instanceIds cannot be null or undefined and it must be of type array.'); + } + for (let i = 0; i < instanceIds.length; i++) { + if (instanceIds[i] !== null && instanceIds[i] !== undefined && typeof instanceIds[i].valueOf() !== 'string') { + throw new Error('instanceIds[i] 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); + } + let vmInstanceIDs; + if (instanceIds !== null && instanceIds !== undefined) { + vmInstanceIDs = new client.models['VirtualMachineScaleSetVMInstanceRequiredIDs'](); + vmInstanceIDs.instanceIds = instanceIds; + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/delete'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmScaleSetName}', encodeURIComponent(vmScaleSetName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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 (vmInstanceIDs !== null && vmInstanceIDs !== undefined) { + let requestModelMapper = new client.models['VirtualMachineScaleSetVMInstanceRequiredIDs']().mapper(); + requestModel = client.serialize(requestModelMapper, vmInstanceIDs, 'vmInstanceIDs'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(vmInstanceIDs, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().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); + }); +} + +/** + * Power off (stop) one or more virtual machines in a VM scale set. Note that + * resources are still attached and you are getting charged for the resources. + * Instead, use deallocate to release resources and avoid charges. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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 OperationStatusResponse} 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 _beginPowerOff(resourceGroupName, vmScaleSetName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let instanceIds = (options && options.instanceIds !== undefined) ? options.instanceIds : undefined; + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmScaleSetName === null || vmScaleSetName === undefined || typeof vmScaleSetName.valueOf() !== 'string') { + throw new Error('vmScaleSetName 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 (Array.isArray(instanceIds)) { + for (let i = 0; i < instanceIds.length; i++) { + if (instanceIds[i] !== null && instanceIds[i] !== undefined && typeof instanceIds[i].valueOf() !== 'string') { + throw new Error('instanceIds[i] 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); + } + let vmInstanceIDs; + if (instanceIds !== null && instanceIds !== undefined) { + vmInstanceIDs = new client.models['VirtualMachineScaleSetVMInstanceIDs'](); + vmInstanceIDs.instanceIds = instanceIds; + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/poweroff'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmScaleSetName}', encodeURIComponent(vmScaleSetName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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 (vmInstanceIDs !== null && vmInstanceIDs !== undefined) { + let requestModelMapper = new client.models['VirtualMachineScaleSetVMInstanceIDs']().mapper(); + requestModel = client.serialize(requestModelMapper, vmInstanceIDs, 'vmInstanceIDs'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(vmInstanceIDs, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().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); + }); +} + +/** + * Restarts one or more virtual machines in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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 OperationStatusResponse} 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 _beginRestart(resourceGroupName, vmScaleSetName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let instanceIds = (options && options.instanceIds !== undefined) ? options.instanceIds : undefined; + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmScaleSetName === null || vmScaleSetName === undefined || typeof vmScaleSetName.valueOf() !== 'string') { + throw new Error('vmScaleSetName 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 (Array.isArray(instanceIds)) { + for (let i = 0; i < instanceIds.length; i++) { + if (instanceIds[i] !== null && instanceIds[i] !== undefined && typeof instanceIds[i].valueOf() !== 'string') { + throw new Error('instanceIds[i] 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); + } + let vmInstanceIDs; + if (instanceIds !== null && instanceIds !== undefined) { + vmInstanceIDs = new client.models['VirtualMachineScaleSetVMInstanceIDs'](); + vmInstanceIDs.instanceIds = instanceIds; + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/restart'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmScaleSetName}', encodeURIComponent(vmScaleSetName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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 (vmInstanceIDs !== null && vmInstanceIDs !== undefined) { + let requestModelMapper = new client.models['VirtualMachineScaleSetVMInstanceIDs']().mapper(); + requestModel = client.serialize(requestModelMapper, vmInstanceIDs, 'vmInstanceIDs'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(vmInstanceIDs, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Starts one or more virtual machines in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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 OperationStatusResponse} 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 _beginStart(resourceGroupName, vmScaleSetName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let instanceIds = (options && options.instanceIds !== undefined) ? options.instanceIds : undefined; + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmScaleSetName === null || vmScaleSetName === undefined || typeof vmScaleSetName.valueOf() !== 'string') { + throw new Error('vmScaleSetName 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 (Array.isArray(instanceIds)) { + for (let i = 0; i < instanceIds.length; i++) { + if (instanceIds[i] !== null && instanceIds[i] !== undefined && typeof instanceIds[i].valueOf() !== 'string') { + throw new Error('instanceIds[i] 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); + } + let vmInstanceIDs; + if (instanceIds !== null && instanceIds !== undefined) { + vmInstanceIDs = new client.models['VirtualMachineScaleSetVMInstanceIDs'](); + vmInstanceIDs.instanceIds = instanceIds; + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/start'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmScaleSetName}', encodeURIComponent(vmScaleSetName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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 (vmInstanceIDs !== null && vmInstanceIDs !== undefined) { + let requestModelMapper = new client.models['VirtualMachineScaleSetVMInstanceIDs']().mapper(); + requestModel = client.serialize(requestModelMapper, vmInstanceIDs, 'vmInstanceIDs'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(vmInstanceIDs, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().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); + }); +} + +/** + * Redeploy one or more virtual machines in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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 OperationStatusResponse} 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 _beginRedeploy(resourceGroupName, vmScaleSetName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let instanceIds = (options && options.instanceIds !== undefined) ? options.instanceIds : undefined; + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmScaleSetName === null || vmScaleSetName === undefined || typeof vmScaleSetName.valueOf() !== 'string') { + throw new Error('vmScaleSetName 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 (Array.isArray(instanceIds)) { + for (let i = 0; i < instanceIds.length; i++) { + if (instanceIds[i] !== null && instanceIds[i] !== undefined && typeof instanceIds[i].valueOf() !== 'string') { + throw new Error('instanceIds[i] 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); + } + let vmInstanceIDs; + if (instanceIds !== null && instanceIds !== undefined) { + vmInstanceIDs = new client.models['VirtualMachineScaleSetVMInstanceIDs'](); + vmInstanceIDs.instanceIds = instanceIds; + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/redeploy'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmScaleSetName}', encodeURIComponent(vmScaleSetName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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 (vmInstanceIDs !== null && vmInstanceIDs !== undefined) { + let requestModelMapper = new client.models['VirtualMachineScaleSetVMInstanceIDs']().mapper(); + requestModel = client.serialize(requestModelMapper, vmInstanceIDs, 'vmInstanceIDs'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(vmInstanceIDs, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().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); + }); +} + +/** + * Perform maintenance on one or more virtual machines in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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 OperationStatusResponse} 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 _beginPerformMaintenance(resourceGroupName, vmScaleSetName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let instanceIds = (options && options.instanceIds !== undefined) ? options.instanceIds : undefined; + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmScaleSetName === null || vmScaleSetName === undefined || typeof vmScaleSetName.valueOf() !== 'string') { + throw new Error('vmScaleSetName 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 (Array.isArray(instanceIds)) { + for (let i = 0; i < instanceIds.length; i++) { + if (instanceIds[i] !== null && instanceIds[i] !== undefined && typeof instanceIds[i].valueOf() !== 'string') { + throw new Error('instanceIds[i] 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); + } + let vmInstanceIDs; + if (instanceIds !== null && instanceIds !== undefined) { + vmInstanceIDs = new client.models['VirtualMachineScaleSetVMInstanceIDs'](); + vmInstanceIDs.instanceIds = instanceIds; + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/performMaintenance'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmScaleSetName}', encodeURIComponent(vmScaleSetName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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 (vmInstanceIDs !== null && vmInstanceIDs !== undefined) { + let requestModelMapper = new client.models['VirtualMachineScaleSetVMInstanceIDs']().mapper(); + requestModel = client.serialize(requestModelMapper, vmInstanceIDs, 'vmInstanceIDs'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(vmInstanceIDs, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().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); + }); +} + +/** + * Upgrades one or more virtual machines to the latest SKU set in the VM scale + * set model. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {array} instanceIds The virtual machine scale set instance ids. + * + * @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 OperationStatusResponse} 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 _beginUpdateInstances(resourceGroupName, vmScaleSetName, instanceIds, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmScaleSetName === null || vmScaleSetName === undefined || typeof vmScaleSetName.valueOf() !== 'string') { + throw new Error('vmScaleSetName 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 (!Array.isArray(instanceIds)) { + throw new Error('instanceIds cannot be null or undefined and it must be of type array.'); + } + for (let i = 0; i < instanceIds.length; i++) { + if (instanceIds[i] !== null && instanceIds[i] !== undefined && typeof instanceIds[i].valueOf() !== 'string') { + throw new Error('instanceIds[i] 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); + } + let vmInstanceIDs; + if (instanceIds !== null && instanceIds !== undefined) { + vmInstanceIDs = new client.models['VirtualMachineScaleSetVMInstanceRequiredIDs'](); + vmInstanceIDs.instanceIds = instanceIds; + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/manualupgrade'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmScaleSetName}', encodeURIComponent(vmScaleSetName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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 (vmInstanceIDs !== null && vmInstanceIDs !== undefined) { + let requestModelMapper = new client.models['VirtualMachineScaleSetVMInstanceRequiredIDs']().mapper(); + requestModel = client.serialize(requestModelMapper, vmInstanceIDs, 'vmInstanceIDs'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(vmInstanceIDs, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().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); + }); +} + +/** + * Reimages (upgrade the operating system) one or more virtual machines in a VM + * scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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 OperationStatusResponse} 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 _beginReimage(resourceGroupName, vmScaleSetName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let instanceIds = (options && options.instanceIds !== undefined) ? options.instanceIds : undefined; + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmScaleSetName === null || vmScaleSetName === undefined || typeof vmScaleSetName.valueOf() !== 'string') { + throw new Error('vmScaleSetName 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 (Array.isArray(instanceIds)) { + for (let i = 0; i < instanceIds.length; i++) { + if (instanceIds[i] !== null && instanceIds[i] !== undefined && typeof instanceIds[i].valueOf() !== 'string') { + throw new Error('instanceIds[i] 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); + } + let vmInstanceIDs; + if (instanceIds !== null && instanceIds !== undefined) { + vmInstanceIDs = new client.models['VirtualMachineScaleSetVMInstanceIDs'](); + vmInstanceIDs.instanceIds = instanceIds; + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimage'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmScaleSetName}', encodeURIComponent(vmScaleSetName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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 (vmInstanceIDs !== null && vmInstanceIDs !== undefined) { + let requestModelMapper = new client.models['VirtualMachineScaleSetVMInstanceIDs']().mapper(); + requestModel = client.serialize(requestModelMapper, vmInstanceIDs, 'vmInstanceIDs'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(vmInstanceIDs, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().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); + }); +} + +/** + * Reimages all the disks ( including data disks ) in the virtual machines in a + * VM scale set. This operation is only supported for managed disks. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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 OperationStatusResponse} 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 _beginReimageAll(resourceGroupName, vmScaleSetName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let instanceIds = (options && options.instanceIds !== undefined) ? options.instanceIds : undefined; + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmScaleSetName === null || vmScaleSetName === undefined || typeof vmScaleSetName.valueOf() !== 'string') { + throw new Error('vmScaleSetName 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 (Array.isArray(instanceIds)) { + for (let i = 0; i < instanceIds.length; i++) { + if (instanceIds[i] !== null && instanceIds[i] !== undefined && typeof instanceIds[i].valueOf() !== 'string') { + throw new Error('instanceIds[i] 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); + } + let vmInstanceIDs; + if (instanceIds !== null && instanceIds !== undefined) { + vmInstanceIDs = new client.models['VirtualMachineScaleSetVMInstanceIDs'](); + vmInstanceIDs.instanceIds = instanceIds; + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimageall'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmScaleSetName}', encodeURIComponent(vmScaleSetName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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 (vmInstanceIDs !== null && vmInstanceIDs !== undefined) { + let requestModelMapper = new client.models['VirtualMachineScaleSetVMInstanceIDs']().mapper(); + requestModel = client.serialize(requestModelMapper, vmInstanceIDs, 'vmInstanceIDs'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(vmInstanceIDs, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().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); + }); +} + +/** + * Gets a list of all VM scale sets under a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineScaleSetListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['VirtualMachineScaleSetListResult']().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); + }); +} + +/** + * Gets a list of all VM Scale Sets in the subscription, regardless of the + * associated resource group. Use nextLink property in the response to get the + * next page of VM Scale Sets. Do this till nextLink is null to fetch all the + * VM Scale Sets. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineScaleSetListWithLinkResult} + * 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 _listAllNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['VirtualMachineScaleSetListWithLinkResult']().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); + }); +} + +/** + * Gets a list of SKUs available for your VM scale set, including the minimum + * and maximum VM instances allowed for each SKU. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineScaleSetListSkusResult} 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 _listSkusNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['VirtualMachineScaleSetListSkusResult']().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); + }); +} + +/** + * Gets list of OS upgrades on a VM scale set instance. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineScaleSetListOSUpgradeHistory} + * 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 _getOSUpgradeHistoryNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['VirtualMachineScaleSetListOSUpgradeHistory']().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 VirtualMachineScaleSets. */ +class VirtualMachineScaleSets { + /** + * Create a VirtualMachineScaleSets. + * @param {ComputeManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._createOrUpdate = _createOrUpdate; + this._update = _update; + this._deleteMethod = _deleteMethod; + this._get = _get; + this._deallocate = _deallocate; + this._deleteInstances = _deleteInstances; + this._getInstanceView = _getInstanceView; + this._list = _list; + this._listAll = _listAll; + this._listSkus = _listSkus; + this._getOSUpgradeHistory = _getOSUpgradeHistory; + this._powerOff = _powerOff; + this._restart = _restart; + this._start = _start; + this._redeploy = _redeploy; + this._performMaintenance = _performMaintenance; + this._updateInstances = _updateInstances; + this._reimage = _reimage; + this._reimageAll = _reimageAll; + this._forceRecoveryServiceFabricPlatformUpdateDomainWalk = _forceRecoveryServiceFabricPlatformUpdateDomainWalk; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginUpdate = _beginUpdate; + this._beginDeleteMethod = _beginDeleteMethod; + this._beginDeallocate = _beginDeallocate; + this._beginDeleteInstances = _beginDeleteInstances; + this._beginPowerOff = _beginPowerOff; + this._beginRestart = _beginRestart; + this._beginStart = _beginStart; + this._beginRedeploy = _beginRedeploy; + this._beginPerformMaintenance = _beginPerformMaintenance; + this._beginUpdateInstances = _beginUpdateInstances; + this._beginReimage = _beginReimage; + this._beginReimageAll = _beginReimageAll; + this._listNext = _listNext; + this._listAllNext = _listAllNext; + this._listSkusNext = _listSkusNext; + this._getOSUpgradeHistoryNext = _getOSUpgradeHistoryNext; + } + + /** + * Create or update a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set to create or + * update. + * + * @param {object} parameters The scale set object. + * + * @param {object} [parameters.sku] The virtual machine scale set sku. + * + * @param {string} [parameters.sku.name] The sku name. + * + * @param {string} [parameters.sku.tier] Specifies the tier of virtual machines + * in a scale set.

    Possible Values:

    **Standard**

    **Basic** + * + * @param {number} [parameters.sku.capacity] Specifies the number of virtual + * machines in the scale set. + * + * @param {object} [parameters.plan] Specifies information about the + * marketplace image used to create the virtual machine. This element is only + * used for marketplace images. Before you can use a marketplace image from an + * API, you must enable the image for programmatic use. In the Azure portal, + * find the marketplace image that you want to use and then click **Want to + * deploy programmatically, Get Started ->**. Enter any required information + * and then click **Save**. + * + * @param {string} [parameters.plan.name] The plan ID. + * + * @param {string} [parameters.plan.publisher] The publisher ID. + * + * @param {string} [parameters.plan.product] Specifies the product of the image + * from the marketplace. This is the same value as Offer under the + * imageReference element. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {object} [parameters.upgradePolicy] The upgrade policy. + * + * @param {string} [parameters.upgradePolicy.mode] Specifies the mode of an + * upgrade to virtual machines in the scale set.

    Possible values + * are:

    **Manual** - You control the application of updates to + * virtual machines in the scale set. You do this by using the manualUpgrade + * action.

    **Automatic** - All virtual machines in the scale set + * are automatically updated at the same time. Possible values include: + * 'Automatic', 'Manual', 'Rolling' + * + * @param {object} [parameters.upgradePolicy.rollingUpgradePolicy] The + * configuration parameters used while performing a rolling upgrade. + * + * @param {number} + * [parameters.upgradePolicy.rollingUpgradePolicy.maxBatchInstancePercent] The + * maximum percent of total virtual machine instances that will be upgraded + * simultaneously by the rolling upgrade in one batch. As this is a maximum, + * unhealthy instances in previous or future batches can cause the percentage + * of instances in a batch to decrease to ensure higher reliability. The + * default value for this parameter is 20%. + * + * @param {number} + * [parameters.upgradePolicy.rollingUpgradePolicy.maxUnhealthyInstancePercent] + * The maximum percentage of the total virtual machine instances in the scale + * set that can be simultaneously unhealthy, either as a result of being + * upgraded, or by being found in an unhealthy state by the virtual machine + * health checks before the rolling upgrade aborts. This constraint will be + * checked prior to starting any batch. The default value for this parameter is + * 20%. + * + * @param {number} + * [parameters.upgradePolicy.rollingUpgradePolicy.maxUnhealthyUpgradedInstancePercent] + * The maximum percentage of upgraded virtual machine instances that can be + * found to be in an unhealthy state. This check will happen after each batch + * is upgraded. If this percentage is ever exceeded, the rolling update aborts. + * The default value for this parameter is 20%. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradePolicy.pauseTimeBetweenBatches] The + * wait time between completing the update for all virtual machines in one + * batch and starting the next batch. The time duration should be specified in + * ISO 8601 format. The default value is 0 seconds (PT0S). + * + * @param {boolean} [parameters.upgradePolicy.automaticOSUpgrade] Whether OS + * upgrades should automatically be applied to scale set instances in a rolling + * fashion when a newer version of the image becomes available. + * + * @param {object} [parameters.virtualMachineProfile] The virtual machine + * profile. + * + * @param {object} [parameters.virtualMachineProfile.osProfile] Specifies the + * operating system settings for the virtual machines in the scale set. + * + * @param {string} + * [parameters.virtualMachineProfile.osProfile.computerNamePrefix] Specifies + * the computer name prefix for all of the virtual machines in the scale set. + * Computer name prefixes must be 1 to 15 characters long. + * + * @param {string} [parameters.virtualMachineProfile.osProfile.adminUsername] + * Specifies the name of the administrator account.

    **Windows-only + * restriction:** Cannot end in "."

    **Disallowed values:** + * "administrator", "admin", "user", "user1", "test", "user2", "test1", + * "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", + * "backup", "console", "david", "guest", "john", "owner", "root", "server", + * "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", + * "user5".

    **Minimum-length (Linux):** 1 character

    + * **Max-length (Linux):** 64 characters

    **Max-length (Windows):** 20 + * characters

  • For root access to the Linux VM, see [Using root + * privileges on Linux virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in this + * field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {string} [parameters.virtualMachineProfile.osProfile.adminPassword] + * Specifies the password of the administrator account.

    + * **Minimum-length (Windows):** 8 characters

    **Minimum-length + * (Linux):** 6 characters

    **Max-length (Windows):** 123 characters + *

    **Max-length (Linux):** 72 characters

    **Complexity + * requirements:** 3 out of 4 conditions below need to be fulfilled
    Has + * lower characters
    Has upper characters
    Has a digit
    Has a + * special character (Regex match [\W_])

    **Disallowed values:** + * "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", + * "Password!", "Password1", "Password22", "iloveyou!"

    For resetting + * the password, see [How to reset the Remote Desktop service or its login + * password in a Windows + * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    For resetting root password, see [Manage users, SSH, and check or + * repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + * + * @param {string} [parameters.virtualMachineProfile.osProfile.customData] + * Specifies a base-64 encoded string of custom data. The base-64 encoded + * string is decoded to a binary array that is saved as a file on the Virtual + * Machine. The maximum length of the binary array is 65535 bytes.

    For + * using cloud-init for your VM, see [Using cloud-init to customize a Linux VM + * during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration] Specifies + * Windows operating system settings on the virtual machine. + * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.enableAutomaticUpdates] + * Indicates whether virtual machine is enabled for automatic updates. + * + * @param {string} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.timeZone] + * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.winRM] + * Specifies the Windows Remote Management listeners. This enables remote + * Windows PowerShell. + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.winRM.listeners] + * The list of Windows Remote Management listeners + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration] Specifies + * the Linux operating system settings on the virtual machine.

    For a + * list of supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh] + * Specifies the ssh key configuration for a Linux OS. + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh.publicKeys] + * The list of SSH public keys used to authenticate with linux based VMs. + * + * @param {array} [parameters.virtualMachineProfile.osProfile.secrets] + * Specifies set of certificates that should be installed onto the virtual + * machines in the scale set. + * + * @param {object} [parameters.virtualMachineProfile.storageProfile] Specifies + * the storage settings for the virtual machine disks. + * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.imageReference] Specifies + * information about the image to use. You can specify information about + * platform images, marketplace images, or virtual machine images. This element + * is required when you want to use a platform image, marketplace image, or + * virtual machine image, but is not used in other creation operations. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.publisher] + * The image publisher. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.offer] + * Specifies the offer of the platform image or marketplace image used to + * create the virtual machine. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.sku] The + * image SKU. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.version] + * Specifies the version of the platform image or marketplace image used to + * create the virtual machine. The allowed formats are Major.Minor.Build or + * 'latest'. Major, Minor, and Build are decimal numbers. Specify 'latest' to + * use the latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.id] Resource + * Id + * + * @param {object} [parameters.virtualMachineProfile.storageProfile.osDisk] + * Specifies information about the operating system disk used by the virtual + * machines in the scale set.

    For more information about disks, see + * [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.name] The disk name. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.caching] Specifies + * the caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {boolean} + * [parameters.virtualMachineProfile.storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @param {string} + * parameters.virtualMachineProfile.storageProfile.osDisk.createOption + * Specifies how the virtual machines in the scale set should be + * created.

    The only allowed value is: **FromImage** \u2013 This value + * is used when you are using an image to create the virtual machine. If you + * are using a platform image, you also use the imageReference element + * described above. If you are using a marketplace image, you also use the + * plan element previously described. Possible values include: 'FromImage', + * 'Empty', 'Attach' + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.osType] This + * property allows you to specify the type of the OS that is included in the + * disk if creating a VM from user-image or a specialized VHD.

    + * Possible values are:

    **Windows**

    **Linux**. Possible + * values include: 'Windows', 'Linux' + * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.osDisk.image] Specifies + * information about the unmanaged user image to base the scale set on. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.image.uri] Specifies + * the virtual hard disk's uri. + * + * @param {array} + * [parameters.virtualMachineProfile.storageProfile.osDisk.vhdContainers] + * Specifies the container urls that are used to store operating system disks + * for the scale set. + * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.osDisk.managedDisk] The + * managed disk parameters. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.managedDisk.storageAccountType] + * Specifies the storage account type for the managed disk. Possible values + * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {array} [parameters.virtualMachineProfile.storageProfile.dataDisks] + * Specifies the parameters that are used to add data disks to the virtual + * machines in the scale set.

    For more information about disks, see + * [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {object} [parameters.virtualMachineProfile.networkProfile] Specifies + * properties of the network interfaces of the virtual machines in the scale + * set. + * + * @param {object} + * [parameters.virtualMachineProfile.networkProfile.healthProbe] A reference to + * a load balancer probe used to determine the health of an instance in the + * virtual machine scale set. The reference will be in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. + * + * @param {string} + * [parameters.virtualMachineProfile.networkProfile.healthProbe.id] The ARM + * resource id in the form of + * /subscriptions/{SubcriptionId}/resourceGroups/{ResourceGroupName}/... + * + * @param {array} + * [parameters.virtualMachineProfile.networkProfile.networkInterfaceConfigurations] + * The list of network configurations. + * + * @param {object} [parameters.virtualMachineProfile.diagnosticsProfile] + * Specifies the boot diagnostic settings state.

    Minimum api-version: + * 2015-06-15. + * + * @param {object} + * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, + * you can easily view the output of your console log.

    For both + * Windows and Linux virtual machines, Azure also enables you to see a + * screenshot of the VM from the hypervisor. + * + * @param {boolean} + * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics.enabled] + * Whether boot diagnostics should be enabled on the Virtual Machine. + * + * @param {string} + * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics.storageUri] + * Uri of the storage account to use for placing the console output and + * screenshot. + * + * @param {object} [parameters.virtualMachineProfile.extensionProfile] + * Specifies a collection of settings for extensions installed on virtual + * machines in the scale set. + * + * @param {array} + * [parameters.virtualMachineProfile.extensionProfile.extensions] The virtual + * machine scale set child extension resources. + * + * @param {string} [parameters.virtualMachineProfile.licenseType] Specifies + * that the image or disk that is being used was licensed on-premises. This + * element is only used for images that contain the Windows Server operating + * system.

    Possible values are:

    Windows_Client

    + * Windows_Server

    If this element is included in a request for an + * update, the value must match the initial value. This value cannot be + * updated.

    For more information, see [Azure Hybrid Use Benefit for + * Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Minimum api-version: 2015-06-15 + * + * @param {string} [parameters.virtualMachineProfile.priority] Specifies the + * priority for the virtual machines in the scale set.

    Minimum + * api-version: 2017-10-30-preview. Possible values include: 'Regular', 'Low' + * + * @param {boolean} [parameters.overprovision] Specifies whether the Virtual + * Machine Scale Set should be overprovisioned. + * + * @param {boolean} [parameters.singlePlacementGroup] When true this limits the + * scale set to a single placement group, of max size 100 virtual machines. + * + * @param {boolean} [parameters.zoneBalance] Whether to force stictly even + * Virtual Machine distribution cross x-zones in case there is zone outage. + * + * @param {number} [parameters.platformFaultDomainCount] Fault Domain count for + * each placement group. + * + * @param {object} [parameters.identity] The identity of the virtual machine + * scale set, if configured. + * + * @param {string} [parameters.identity.type] The type of identity used for the + * virtual machine scale set. The type 'SystemAssigned, UserAssigned' includes + * both an implicitly created identity and a set of user assigned identities. + * The type 'None' will remove any identities from the virtual machine scale + * set. Possible values include: 'SystemAssigned', 'UserAssigned', + * 'SystemAssigned, UserAssigned', 'None' + * + * @param {array} [parameters.identity.identityIds] The list of user identities + * associated with the virtual machine scale set. The user identity references + * will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * + * @param {array} [parameters.zones] The virtual machine scale set zones. + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @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. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, vmScaleSetName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, vmScaleSetName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Create or update a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set to create or + * update. + * + * @param {object} parameters The scale set object. + * + * @param {object} [parameters.sku] The virtual machine scale set sku. + * + * @param {string} [parameters.sku.name] The sku name. + * + * @param {string} [parameters.sku.tier] Specifies the tier of virtual machines + * in a scale set.

    Possible Values:

    **Standard**

    **Basic** + * + * @param {number} [parameters.sku.capacity] Specifies the number of virtual + * machines in the scale set. + * + * @param {object} [parameters.plan] Specifies information about the + * marketplace image used to create the virtual machine. This element is only + * used for marketplace images. Before you can use a marketplace image from an + * API, you must enable the image for programmatic use. In the Azure portal, + * find the marketplace image that you want to use and then click **Want to + * deploy programmatically, Get Started ->**. Enter any required information + * and then click **Save**. + * + * @param {string} [parameters.plan.name] The plan ID. + * + * @param {string} [parameters.plan.publisher] The publisher ID. + * + * @param {string} [parameters.plan.product] Specifies the product of the image + * from the marketplace. This is the same value as Offer under the + * imageReference element. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {object} [parameters.upgradePolicy] The upgrade policy. + * + * @param {string} [parameters.upgradePolicy.mode] Specifies the mode of an + * upgrade to virtual machines in the scale set.

    Possible values + * are:

    **Manual** - You control the application of updates to + * virtual machines in the scale set. You do this by using the manualUpgrade + * action.

    **Automatic** - All virtual machines in the scale set + * are automatically updated at the same time. Possible values include: + * 'Automatic', 'Manual', 'Rolling' + * + * @param {object} [parameters.upgradePolicy.rollingUpgradePolicy] The + * configuration parameters used while performing a rolling upgrade. + * + * @param {number} + * [parameters.upgradePolicy.rollingUpgradePolicy.maxBatchInstancePercent] The + * maximum percent of total virtual machine instances that will be upgraded + * simultaneously by the rolling upgrade in one batch. As this is a maximum, + * unhealthy instances in previous or future batches can cause the percentage + * of instances in a batch to decrease to ensure higher reliability. The + * default value for this parameter is 20%. + * + * @param {number} + * [parameters.upgradePolicy.rollingUpgradePolicy.maxUnhealthyInstancePercent] + * The maximum percentage of the total virtual machine instances in the scale + * set that can be simultaneously unhealthy, either as a result of being + * upgraded, or by being found in an unhealthy state by the virtual machine + * health checks before the rolling upgrade aborts. This constraint will be + * checked prior to starting any batch. The default value for this parameter is + * 20%. + * + * @param {number} + * [parameters.upgradePolicy.rollingUpgradePolicy.maxUnhealthyUpgradedInstancePercent] + * The maximum percentage of upgraded virtual machine instances that can be + * found to be in an unhealthy state. This check will happen after each batch + * is upgraded. If this percentage is ever exceeded, the rolling update aborts. + * The default value for this parameter is 20%. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradePolicy.pauseTimeBetweenBatches] The + * wait time between completing the update for all virtual machines in one + * batch and starting the next batch. The time duration should be specified in + * ISO 8601 format. The default value is 0 seconds (PT0S). + * + * @param {boolean} [parameters.upgradePolicy.automaticOSUpgrade] Whether OS + * upgrades should automatically be applied to scale set instances in a rolling + * fashion when a newer version of the image becomes available. + * + * @param {object} [parameters.virtualMachineProfile] The virtual machine + * profile. + * + * @param {object} [parameters.virtualMachineProfile.osProfile] Specifies the + * operating system settings for the virtual machines in the scale set. + * + * @param {string} + * [parameters.virtualMachineProfile.osProfile.computerNamePrefix] Specifies + * the computer name prefix for all of the virtual machines in the scale set. + * Computer name prefixes must be 1 to 15 characters long. + * + * @param {string} [parameters.virtualMachineProfile.osProfile.adminUsername] + * Specifies the name of the administrator account.

    **Windows-only + * restriction:** Cannot end in "."

    **Disallowed values:** + * "administrator", "admin", "user", "user1", "test", "user2", "test1", + * "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", + * "backup", "console", "david", "guest", "john", "owner", "root", "server", + * "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", + * "user5".

    **Minimum-length (Linux):** 1 character

    + * **Max-length (Linux):** 64 characters

    **Max-length (Windows):** 20 + * characters

  • For root access to the Linux VM, see [Using root + * privileges on Linux virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in this + * field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {string} [parameters.virtualMachineProfile.osProfile.adminPassword] + * Specifies the password of the administrator account.

    + * **Minimum-length (Windows):** 8 characters

    **Minimum-length + * (Linux):** 6 characters

    **Max-length (Windows):** 123 characters + *

    **Max-length (Linux):** 72 characters

    **Complexity + * requirements:** 3 out of 4 conditions below need to be fulfilled
    Has + * lower characters
    Has upper characters
    Has a digit
    Has a + * special character (Regex match [\W_])

    **Disallowed values:** + * "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", + * "Password!", "Password1", "Password22", "iloveyou!"

    For resetting + * the password, see [How to reset the Remote Desktop service or its login + * password in a Windows + * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    For resetting root password, see [Manage users, SSH, and check or + * repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + * + * @param {string} [parameters.virtualMachineProfile.osProfile.customData] + * Specifies a base-64 encoded string of custom data. The base-64 encoded + * string is decoded to a binary array that is saved as a file on the Virtual + * Machine. The maximum length of the binary array is 65535 bytes.

    For + * using cloud-init for your VM, see [Using cloud-init to customize a Linux VM + * during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration] Specifies + * Windows operating system settings on the virtual machine. + * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.enableAutomaticUpdates] + * Indicates whether virtual machine is enabled for automatic updates. + * + * @param {string} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.timeZone] + * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.winRM] + * Specifies the Windows Remote Management listeners. This enables remote + * Windows PowerShell. + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.winRM.listeners] + * The list of Windows Remote Management listeners + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration] Specifies + * the Linux operating system settings on the virtual machine.

    For a + * list of supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh] + * Specifies the ssh key configuration for a Linux OS. + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh.publicKeys] + * The list of SSH public keys used to authenticate with linux based VMs. + * + * @param {array} [parameters.virtualMachineProfile.osProfile.secrets] + * Specifies set of certificates that should be installed onto the virtual + * machines in the scale set. + * + * @param {object} [parameters.virtualMachineProfile.storageProfile] Specifies + * the storage settings for the virtual machine disks. + * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.imageReference] Specifies + * information about the image to use. You can specify information about + * platform images, marketplace images, or virtual machine images. This element + * is required when you want to use a platform image, marketplace image, or + * virtual machine image, but is not used in other creation operations. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.publisher] + * The image publisher. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.offer] + * Specifies the offer of the platform image or marketplace image used to + * create the virtual machine. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.sku] The + * image SKU. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.version] + * Specifies the version of the platform image or marketplace image used to + * create the virtual machine. The allowed formats are Major.Minor.Build or + * 'latest'. Major, Minor, and Build are decimal numbers. Specify 'latest' to + * use the latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.id] Resource + * Id + * + * @param {object} [parameters.virtualMachineProfile.storageProfile.osDisk] + * Specifies information about the operating system disk used by the virtual + * machines in the scale set.

    For more information about disks, see + * [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.name] The disk name. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.caching] Specifies + * the caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {boolean} + * [parameters.virtualMachineProfile.storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @param {string} + * parameters.virtualMachineProfile.storageProfile.osDisk.createOption + * Specifies how the virtual machines in the scale set should be + * created.

    The only allowed value is: **FromImage** \u2013 This value + * is used when you are using an image to create the virtual machine. If you + * are using a platform image, you also use the imageReference element + * described above. If you are using a marketplace image, you also use the + * plan element previously described. Possible values include: 'FromImage', + * 'Empty', 'Attach' + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.osType] This + * property allows you to specify the type of the OS that is included in the + * disk if creating a VM from user-image or a specialized VHD.

    + * Possible values are:

    **Windows**

    **Linux**. Possible + * values include: 'Windows', 'Linux' + * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.osDisk.image] Specifies + * information about the unmanaged user image to base the scale set on. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.image.uri] Specifies + * the virtual hard disk's uri. + * + * @param {array} + * [parameters.virtualMachineProfile.storageProfile.osDisk.vhdContainers] + * Specifies the container urls that are used to store operating system disks + * for the scale set. + * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.osDisk.managedDisk] The + * managed disk parameters. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.managedDisk.storageAccountType] + * Specifies the storage account type for the managed disk. Possible values + * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {array} [parameters.virtualMachineProfile.storageProfile.dataDisks] + * Specifies the parameters that are used to add data disks to the virtual + * machines in the scale set.

    For more information about disks, see + * [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {object} [parameters.virtualMachineProfile.networkProfile] Specifies + * properties of the network interfaces of the virtual machines in the scale + * set. + * + * @param {object} + * [parameters.virtualMachineProfile.networkProfile.healthProbe] A reference to + * a load balancer probe used to determine the health of an instance in the + * virtual machine scale set. The reference will be in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. + * + * @param {string} + * [parameters.virtualMachineProfile.networkProfile.healthProbe.id] The ARM + * resource id in the form of + * /subscriptions/{SubcriptionId}/resourceGroups/{ResourceGroupName}/... + * + * @param {array} + * [parameters.virtualMachineProfile.networkProfile.networkInterfaceConfigurations] + * The list of network configurations. + * + * @param {object} [parameters.virtualMachineProfile.diagnosticsProfile] + * Specifies the boot diagnostic settings state.

    Minimum api-version: + * 2015-06-15. + * + * @param {object} + * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, + * you can easily view the output of your console log.

    For both + * Windows and Linux virtual machines, Azure also enables you to see a + * screenshot of the VM from the hypervisor. + * + * @param {boolean} + * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics.enabled] + * Whether boot diagnostics should be enabled on the Virtual Machine. + * + * @param {string} + * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics.storageUri] + * Uri of the storage account to use for placing the console output and + * screenshot. + * + * @param {object} [parameters.virtualMachineProfile.extensionProfile] + * Specifies a collection of settings for extensions installed on virtual + * machines in the scale set. + * + * @param {array} + * [parameters.virtualMachineProfile.extensionProfile.extensions] The virtual + * machine scale set child extension resources. + * + * @param {string} [parameters.virtualMachineProfile.licenseType] Specifies + * that the image or disk that is being used was licensed on-premises. This + * element is only used for images that contain the Windows Server operating + * system.

    Possible values are:

    Windows_Client

    + * Windows_Server

    If this element is included in a request for an + * update, the value must match the initial value. This value cannot be + * updated.

    For more information, see [Azure Hybrid Use Benefit for + * Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Minimum api-version: 2015-06-15 + * + * @param {string} [parameters.virtualMachineProfile.priority] Specifies the + * priority for the virtual machines in the scale set.

    Minimum + * api-version: 2017-10-30-preview. Possible values include: 'Regular', 'Low' + * + * @param {boolean} [parameters.overprovision] Specifies whether the Virtual + * Machine Scale Set should be overprovisioned. + * + * @param {boolean} [parameters.singlePlacementGroup] When true this limits the + * scale set to a single placement group, of max size 100 virtual machines. + * + * @param {boolean} [parameters.zoneBalance] Whether to force stictly even + * Virtual Machine distribution cross x-zones in case there is zone outage. + * + * @param {number} [parameters.platformFaultDomainCount] Fault Domain count for + * each placement group. + * + * @param {object} [parameters.identity] The identity of the virtual machine + * scale set, if configured. + * + * @param {string} [parameters.identity.type] The type of identity used for the + * virtual machine scale set. The type 'SystemAssigned, UserAssigned' includes + * both an implicitly created identity and a set of user assigned identities. + * The type 'None' will remove any identities from the virtual machine scale + * set. Possible values include: 'SystemAssigned', 'UserAssigned', + * 'SystemAssigned, UserAssigned', 'None' + * + * @param {array} [parameters.identity.identityIds] The list of user identities + * associated with the virtual machine scale set. The user identity references + * will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * + * @param {array} [parameters.zones] The virtual machine scale set zones. + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @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 {VirtualMachineScaleSet} - 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 VirtualMachineScaleSet} 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. + */ + createOrUpdate(resourceGroupName, vmScaleSetName, 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._createOrUpdate(resourceGroupName, vmScaleSetName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, vmScaleSetName, parameters, options, optionalCallback); + } + } + + /** + * Update a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set to create or + * update. + * + * @param {object} parameters The scale set object. + * + * @param {object} [parameters.sku] The virtual machine scale set sku. + * + * @param {string} [parameters.sku.name] The sku name. + * + * @param {string} [parameters.sku.tier] Specifies the tier of virtual machines + * in a scale set.

    Possible Values:

    **Standard**

    **Basic** + * + * @param {number} [parameters.sku.capacity] Specifies the number of virtual + * machines in the scale set. + * + * @param {object} [parameters.plan] The purchase plan when deploying a virtual + * machine scale set from VM Marketplace images. + * + * @param {string} [parameters.plan.name] The plan ID. + * + * @param {string} [parameters.plan.publisher] The publisher ID. + * + * @param {string} [parameters.plan.product] Specifies the product of the image + * from the marketplace. This is the same value as Offer under the + * imageReference element. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {object} [parameters.upgradePolicy] The upgrade policy. + * + * @param {string} [parameters.upgradePolicy.mode] Specifies the mode of an + * upgrade to virtual machines in the scale set.

    Possible values + * are:

    **Manual** - You control the application of updates to + * virtual machines in the scale set. You do this by using the manualUpgrade + * action.

    **Automatic** - All virtual machines in the scale set + * are automatically updated at the same time. Possible values include: + * 'Automatic', 'Manual', 'Rolling' + * + * @param {object} [parameters.upgradePolicy.rollingUpgradePolicy] The + * configuration parameters used while performing a rolling upgrade. + * + * @param {number} + * [parameters.upgradePolicy.rollingUpgradePolicy.maxBatchInstancePercent] The + * maximum percent of total virtual machine instances that will be upgraded + * simultaneously by the rolling upgrade in one batch. As this is a maximum, + * unhealthy instances in previous or future batches can cause the percentage + * of instances in a batch to decrease to ensure higher reliability. The + * default value for this parameter is 20%. + * + * @param {number} + * [parameters.upgradePolicy.rollingUpgradePolicy.maxUnhealthyInstancePercent] + * The maximum percentage of the total virtual machine instances in the scale + * set that can be simultaneously unhealthy, either as a result of being + * upgraded, or by being found in an unhealthy state by the virtual machine + * health checks before the rolling upgrade aborts. This constraint will be + * checked prior to starting any batch. The default value for this parameter is + * 20%. + * + * @param {number} + * [parameters.upgradePolicy.rollingUpgradePolicy.maxUnhealthyUpgradedInstancePercent] + * The maximum percentage of upgraded virtual machine instances that can be + * found to be in an unhealthy state. This check will happen after each batch + * is upgraded. If this percentage is ever exceeded, the rolling update aborts. + * The default value for this parameter is 20%. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradePolicy.pauseTimeBetweenBatches] The + * wait time between completing the update for all virtual machines in one + * batch and starting the next batch. The time duration should be specified in + * ISO 8601 format. The default value is 0 seconds (PT0S). + * + * @param {boolean} [parameters.upgradePolicy.automaticOSUpgrade] Whether OS + * upgrades should automatically be applied to scale set instances in a rolling + * fashion when a newer version of the image becomes available. + * + * @param {object} [parameters.virtualMachineProfile] The virtual machine + * profile. + * + * @param {object} [parameters.virtualMachineProfile.osProfile] The virtual + * machine scale set OS profile. + * + * @param {string} [parameters.virtualMachineProfile.osProfile.customData] A + * base-64 encoded string of custom data. + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration] The + * Windows Configuration of the OS profile. + * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.enableAutomaticUpdates] + * Indicates whether virtual machine is enabled for automatic updates. + * + * @param {string} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.timeZone] + * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.winRM] + * Specifies the Windows Remote Management listeners. This enables remote + * Windows PowerShell. + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.winRM.listeners] + * The list of Windows Remote Management listeners + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration] The Linux + * Configuration of the OS profile. + * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh] + * Specifies the ssh key configuration for a Linux OS. + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh.publicKeys] + * The list of SSH public keys used to authenticate with linux based VMs. + * + * @param {array} [parameters.virtualMachineProfile.osProfile.secrets] The List + * of certificates for addition to the VM. + * + * @param {object} [parameters.virtualMachineProfile.storageProfile] The + * virtual machine scale set storage profile. + * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.imageReference] The image + * reference. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.publisher] + * The image publisher. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.offer] + * Specifies the offer of the platform image or marketplace image used to + * create the virtual machine. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.sku] The + * image SKU. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.version] + * Specifies the version of the platform image or marketplace image used to + * create the virtual machine. The allowed formats are Major.Minor.Build or + * 'latest'. Major, Minor, and Build are decimal numbers. Specify 'latest' to + * use the latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.id] Resource + * Id + * + * @param {object} [parameters.virtualMachineProfile.storageProfile.osDisk] The + * OS disk. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.caching] The caching + * type. Possible values include: 'None', 'ReadOnly', 'ReadWrite' + * + * @param {boolean} + * [parameters.virtualMachineProfile.storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.osDisk.image] The Source + * User Image VirtualHardDisk. This VirtualHardDisk will be copied before using + * it to attach to the Virtual Machine. If SourceImage is provided, the + * destination VirtualHardDisk should not exist. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.image.uri] Specifies + * the virtual hard disk's uri. + * + * @param {array} + * [parameters.virtualMachineProfile.storageProfile.osDisk.vhdContainers] The + * list of virtual hard disk container uris. + * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.osDisk.managedDisk] The + * managed disk parameters. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.managedDisk.storageAccountType] + * Specifies the storage account type for the managed disk. Possible values + * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {array} [parameters.virtualMachineProfile.storageProfile.dataDisks] + * The data disks. + * + * @param {object} [parameters.virtualMachineProfile.networkProfile] The + * virtual machine scale set network profile. + * + * @param {array} + * [parameters.virtualMachineProfile.networkProfile.networkInterfaceConfigurations] + * The list of network configurations. + * + * @param {object} [parameters.virtualMachineProfile.diagnosticsProfile] The + * virtual machine scale set diagnostics profile. + * + * @param {object} + * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, + * you can easily view the output of your console log.

    For both + * Windows and Linux virtual machines, Azure also enables you to see a + * screenshot of the VM from the hypervisor. + * + * @param {boolean} + * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics.enabled] + * Whether boot diagnostics should be enabled on the Virtual Machine. + * + * @param {string} + * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics.storageUri] + * Uri of the storage account to use for placing the console output and + * screenshot. + * + * @param {object} [parameters.virtualMachineProfile.extensionProfile] The + * virtual machine scale set extension profile. + * + * @param {array} + * [parameters.virtualMachineProfile.extensionProfile.extensions] The virtual + * machine scale set child extension resources. + * + * @param {string} [parameters.virtualMachineProfile.licenseType] The license + * type, which is for bring your own license scenario. + * + * @param {boolean} [parameters.overprovision] Specifies whether the Virtual + * Machine Scale Set should be overprovisioned. + * + * @param {boolean} [parameters.singlePlacementGroup] When true this limits the + * scale set to a single placement group, of max size 100 virtual machines. + * + * @param {object} [parameters.identity] The identity of the virtual machine + * scale set, if configured. + * + * @param {string} [parameters.identity.type] The type of identity used for the + * virtual machine scale set. The type 'SystemAssigned, UserAssigned' includes + * both an implicitly created identity and a set of user assigned identities. + * The type 'None' will remove any identities from the virtual machine scale + * set. Possible values include: 'SystemAssigned', 'UserAssigned', + * 'SystemAssigned, UserAssigned', 'None' + * + * @param {array} [parameters.identity.identityIds] The list of user identities + * associated with the virtual machine scale set. The user identity references + * will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * + * @param {object} [parameters.tags] Resource tags + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateWithHttpOperationResponse(resourceGroupName, vmScaleSetName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._update(resourceGroupName, vmScaleSetName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Update a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set to create or + * update. + * + * @param {object} parameters The scale set object. + * + * @param {object} [parameters.sku] The virtual machine scale set sku. + * + * @param {string} [parameters.sku.name] The sku name. + * + * @param {string} [parameters.sku.tier] Specifies the tier of virtual machines + * in a scale set.

    Possible Values:

    **Standard**

    **Basic** + * + * @param {number} [parameters.sku.capacity] Specifies the number of virtual + * machines in the scale set. + * + * @param {object} [parameters.plan] The purchase plan when deploying a virtual + * machine scale set from VM Marketplace images. + * + * @param {string} [parameters.plan.name] The plan ID. + * + * @param {string} [parameters.plan.publisher] The publisher ID. + * + * @param {string} [parameters.plan.product] Specifies the product of the image + * from the marketplace. This is the same value as Offer under the + * imageReference element. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {object} [parameters.upgradePolicy] The upgrade policy. + * + * @param {string} [parameters.upgradePolicy.mode] Specifies the mode of an + * upgrade to virtual machines in the scale set.

    Possible values + * are:

    **Manual** - You control the application of updates to + * virtual machines in the scale set. You do this by using the manualUpgrade + * action.

    **Automatic** - All virtual machines in the scale set + * are automatically updated at the same time. Possible values include: + * 'Automatic', 'Manual', 'Rolling' + * + * @param {object} [parameters.upgradePolicy.rollingUpgradePolicy] The + * configuration parameters used while performing a rolling upgrade. + * + * @param {number} + * [parameters.upgradePolicy.rollingUpgradePolicy.maxBatchInstancePercent] The + * maximum percent of total virtual machine instances that will be upgraded + * simultaneously by the rolling upgrade in one batch. As this is a maximum, + * unhealthy instances in previous or future batches can cause the percentage + * of instances in a batch to decrease to ensure higher reliability. The + * default value for this parameter is 20%. + * + * @param {number} + * [parameters.upgradePolicy.rollingUpgradePolicy.maxUnhealthyInstancePercent] + * The maximum percentage of the total virtual machine instances in the scale + * set that can be simultaneously unhealthy, either as a result of being + * upgraded, or by being found in an unhealthy state by the virtual machine + * health checks before the rolling upgrade aborts. This constraint will be + * checked prior to starting any batch. The default value for this parameter is + * 20%. + * + * @param {number} + * [parameters.upgradePolicy.rollingUpgradePolicy.maxUnhealthyUpgradedInstancePercent] + * The maximum percentage of upgraded virtual machine instances that can be + * found to be in an unhealthy state. This check will happen after each batch + * is upgraded. If this percentage is ever exceeded, the rolling update aborts. + * The default value for this parameter is 20%. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradePolicy.pauseTimeBetweenBatches] The + * wait time between completing the update for all virtual machines in one + * batch and starting the next batch. The time duration should be specified in + * ISO 8601 format. The default value is 0 seconds (PT0S). + * + * @param {boolean} [parameters.upgradePolicy.automaticOSUpgrade] Whether OS + * upgrades should automatically be applied to scale set instances in a rolling + * fashion when a newer version of the image becomes available. + * + * @param {object} [parameters.virtualMachineProfile] The virtual machine + * profile. + * + * @param {object} [parameters.virtualMachineProfile.osProfile] The virtual + * machine scale set OS profile. + * + * @param {string} [parameters.virtualMachineProfile.osProfile.customData] A + * base-64 encoded string of custom data. + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration] The + * Windows Configuration of the OS profile. + * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.enableAutomaticUpdates] + * Indicates whether virtual machine is enabled for automatic updates. + * + * @param {string} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.timeZone] + * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.winRM] + * Specifies the Windows Remote Management listeners. This enables remote + * Windows PowerShell. + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.winRM.listeners] + * The list of Windows Remote Management listeners + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration] The Linux + * Configuration of the OS profile. + * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh] + * Specifies the ssh key configuration for a Linux OS. + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh.publicKeys] + * The list of SSH public keys used to authenticate with linux based VMs. + * + * @param {array} [parameters.virtualMachineProfile.osProfile.secrets] The List + * of certificates for addition to the VM. + * + * @param {object} [parameters.virtualMachineProfile.storageProfile] The + * virtual machine scale set storage profile. + * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.imageReference] The image + * reference. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.publisher] + * The image publisher. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.offer] + * Specifies the offer of the platform image or marketplace image used to + * create the virtual machine. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.sku] The + * image SKU. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.version] + * Specifies the version of the platform image or marketplace image used to + * create the virtual machine. The allowed formats are Major.Minor.Build or + * 'latest'. Major, Minor, and Build are decimal numbers. Specify 'latest' to + * use the latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.id] Resource + * Id + * + * @param {object} [parameters.virtualMachineProfile.storageProfile.osDisk] The + * OS disk. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.caching] The caching + * type. Possible values include: 'None', 'ReadOnly', 'ReadWrite' + * + * @param {boolean} + * [parameters.virtualMachineProfile.storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.osDisk.image] The Source + * User Image VirtualHardDisk. This VirtualHardDisk will be copied before using + * it to attach to the Virtual Machine. If SourceImage is provided, the + * destination VirtualHardDisk should not exist. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.image.uri] Specifies + * the virtual hard disk's uri. + * + * @param {array} + * [parameters.virtualMachineProfile.storageProfile.osDisk.vhdContainers] The + * list of virtual hard disk container uris. + * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.osDisk.managedDisk] The + * managed disk parameters. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.managedDisk.storageAccountType] + * Specifies the storage account type for the managed disk. Possible values + * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {array} [parameters.virtualMachineProfile.storageProfile.dataDisks] + * The data disks. + * + * @param {object} [parameters.virtualMachineProfile.networkProfile] The + * virtual machine scale set network profile. + * + * @param {array} + * [parameters.virtualMachineProfile.networkProfile.networkInterfaceConfigurations] + * The list of network configurations. + * + * @param {object} [parameters.virtualMachineProfile.diagnosticsProfile] The + * virtual machine scale set diagnostics profile. + * + * @param {object} + * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, + * you can easily view the output of your console log.

    For both + * Windows and Linux virtual machines, Azure also enables you to see a + * screenshot of the VM from the hypervisor. + * + * @param {boolean} + * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics.enabled] + * Whether boot diagnostics should be enabled on the Virtual Machine. + * + * @param {string} + * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics.storageUri] + * Uri of the storage account to use for placing the console output and + * screenshot. + * + * @param {object} [parameters.virtualMachineProfile.extensionProfile] The + * virtual machine scale set extension profile. + * + * @param {array} + * [parameters.virtualMachineProfile.extensionProfile.extensions] The virtual + * machine scale set child extension resources. + * + * @param {string} [parameters.virtualMachineProfile.licenseType] The license + * type, which is for bring your own license scenario. + * + * @param {boolean} [parameters.overprovision] Specifies whether the Virtual + * Machine Scale Set should be overprovisioned. + * + * @param {boolean} [parameters.singlePlacementGroup] When true this limits the + * scale set to a single placement group, of max size 100 virtual machines. + * + * @param {object} [parameters.identity] The identity of the virtual machine + * scale set, if configured. + * + * @param {string} [parameters.identity.type] The type of identity used for the + * virtual machine scale set. The type 'SystemAssigned, UserAssigned' includes + * both an implicitly created identity and a set of user assigned identities. + * The type 'None' will remove any identities from the virtual machine scale + * set. Possible values include: 'SystemAssigned', 'UserAssigned', + * 'SystemAssigned, UserAssigned', 'None' + * + * @param {array} [parameters.identity.identityIds] The list of user identities + * associated with the virtual machine scale set. The user identity references + * will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * + * @param {object} [parameters.tags] Resource tags + * + * @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 {VirtualMachineScaleSet} - 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 VirtualMachineScaleSet} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + update(resourceGroupName, vmScaleSetName, 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._update(resourceGroupName, vmScaleSetName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._update(resourceGroupName, vmScaleSetName, parameters, options, optionalCallback); + } + } + + /** + * Deletes a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, vmScaleSetName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + deleteMethod(resourceGroupName, vmScaleSetName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, vmScaleSetName, options, optionalCallback); + } + } + + /** + * Display information about a virtual machine scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, vmScaleSetName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Display information about a virtual machine scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @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 {VirtualMachineScaleSet} - 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 VirtualMachineScaleSet} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, vmScaleSetName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, vmScaleSetName, options, optionalCallback); + } + } + + /** + * Deallocates specific virtual machines in a VM scale set. Shuts down the + * virtual machines and releases the compute resources. You are not billed for + * the compute resources that this virtual machine scale set deallocates. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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. + */ + deallocateWithHttpOperationResponse(resourceGroupName, vmScaleSetName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deallocate(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deallocates specific virtual machines in a VM scale set. Shuts down the + * virtual machines and releases the compute resources. You are not billed for + * the compute resources that this virtual machine scale set deallocates. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + deallocate(resourceGroupName, vmScaleSetName, 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._deallocate(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deallocate(resourceGroupName, vmScaleSetName, options, optionalCallback); + } + } + + /** + * Deletes virtual machines in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {array} instanceIds The virtual machine scale set instance ids. + * + * @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. + */ + deleteInstancesWithHttpOperationResponse(resourceGroupName, vmScaleSetName, instanceIds, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteInstances(resourceGroupName, vmScaleSetName, instanceIds, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes virtual machines in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {array} instanceIds The virtual machine scale set instance ids. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + deleteInstances(resourceGroupName, vmScaleSetName, instanceIds, 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._deleteInstances(resourceGroupName, vmScaleSetName, instanceIds, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteInstances(resourceGroupName, vmScaleSetName, instanceIds, options, optionalCallback); + } + } + + /** + * Gets the status of a VM scale set instance. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @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. + */ + getInstanceViewWithHttpOperationResponse(resourceGroupName, vmScaleSetName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getInstanceView(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the status of a VM scale set instance. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @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 {VirtualMachineScaleSetInstanceView} - 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 VirtualMachineScaleSetInstanceView} 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. + */ + getInstanceView(resourceGroupName, vmScaleSetName, 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._getInstanceView(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getInstanceView(resourceGroupName, vmScaleSetName, options, optionalCallback); + } + } + + /** + * Gets a list of all VM scale sets under a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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. + */ + listWithHttpOperationResponse(resourceGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(resourceGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a list of all VM scale sets under a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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 {VirtualMachineScaleSetListResult} - 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 VirtualMachineScaleSetListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + list(resourceGroupName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._list(resourceGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(resourceGroupName, options, optionalCallback); + } + } + + /** + * Gets a list of all VM Scale Sets in the subscription, regardless of the + * associated resource group. Use nextLink property in the response to get the + * next page of VM Scale Sets. Do this till nextLink is null to fetch all the + * VM Scale Sets. + * + * @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. + */ + listAllWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listAll(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a list of all VM Scale Sets in the subscription, regardless of the + * associated resource group. Use nextLink property in the response to get the + * next page of VM Scale Sets. Do this till nextLink is null to fetch all the + * VM Scale Sets. + * + * @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 {VirtualMachineScaleSetListWithLinkResult} - 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 VirtualMachineScaleSetListWithLinkResult} + * 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. + */ + listAll(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._listAll(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listAll(options, optionalCallback); + } + } + + /** + * Gets a list of SKUs available for your VM scale set, including the minimum + * and maximum VM instances allowed for each SKU. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @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. + */ + listSkusWithHttpOperationResponse(resourceGroupName, vmScaleSetName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listSkus(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a list of SKUs available for your VM scale set, including the minimum + * and maximum VM instances allowed for each SKU. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @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 {VirtualMachineScaleSetListSkusResult} - 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 VirtualMachineScaleSetListSkusResult} 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. + */ + listSkus(resourceGroupName, vmScaleSetName, 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._listSkus(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSkus(resourceGroupName, vmScaleSetName, options, optionalCallback); + } + } + + /** + * Gets list of OS upgrades on a VM scale set instance. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @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. + */ + getOSUpgradeHistoryWithHttpOperationResponse(resourceGroupName, vmScaleSetName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getOSUpgradeHistory(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets list of OS upgrades on a VM scale set instance. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @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 {VirtualMachineScaleSetListOSUpgradeHistory} - 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 VirtualMachineScaleSetListOSUpgradeHistory} + * 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. + */ + getOSUpgradeHistory(resourceGroupName, vmScaleSetName, 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._getOSUpgradeHistory(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getOSUpgradeHistory(resourceGroupName, vmScaleSetName, options, optionalCallback); + } + } + + /** + * Power off (stop) one or more virtual machines in a VM scale set. Note that + * resources are still attached and you are getting charged for the resources. + * Instead, use deallocate to release resources and avoid charges. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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. + */ + powerOffWithHttpOperationResponse(resourceGroupName, vmScaleSetName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._powerOff(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Power off (stop) one or more virtual machines in a VM scale set. Note that + * resources are still attached and you are getting charged for the resources. + * Instead, use deallocate to release resources and avoid charges. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + powerOff(resourceGroupName, vmScaleSetName, 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._powerOff(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._powerOff(resourceGroupName, vmScaleSetName, options, optionalCallback); + } + } + + /** + * Restarts one or more virtual machines in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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. + */ + restartWithHttpOperationResponse(resourceGroupName, vmScaleSetName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._restart(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Restarts one or more virtual machines in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + restart(resourceGroupName, vmScaleSetName, 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._restart(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._restart(resourceGroupName, vmScaleSetName, options, optionalCallback); + } + } + + /** + * Starts one or more virtual machines in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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. + */ + startWithHttpOperationResponse(resourceGroupName, vmScaleSetName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._start(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Starts one or more virtual machines in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + start(resourceGroupName, vmScaleSetName, 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._start(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._start(resourceGroupName, vmScaleSetName, options, optionalCallback); + } + } + + /** + * Redeploy one or more virtual machines in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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. + */ + redeployWithHttpOperationResponse(resourceGroupName, vmScaleSetName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._redeploy(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Redeploy one or more virtual machines in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + redeploy(resourceGroupName, vmScaleSetName, 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._redeploy(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._redeploy(resourceGroupName, vmScaleSetName, options, optionalCallback); + } + } + + /** + * Perform maintenance on one or more virtual machines in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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. + */ + performMaintenanceWithHttpOperationResponse(resourceGroupName, vmScaleSetName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._performMaintenance(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Perform maintenance on one or more virtual machines in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + performMaintenance(resourceGroupName, vmScaleSetName, 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._performMaintenance(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._performMaintenance(resourceGroupName, vmScaleSetName, options, optionalCallback); + } + } + + /** + * Upgrades one or more virtual machines to the latest SKU set in the VM scale + * set model. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {array} instanceIds The virtual machine scale set instance ids. + * + * @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. + */ + updateInstancesWithHttpOperationResponse(resourceGroupName, vmScaleSetName, instanceIds, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateInstances(resourceGroupName, vmScaleSetName, instanceIds, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Upgrades one or more virtual machines to the latest SKU set in the VM scale + * set model. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {array} instanceIds The virtual machine scale set instance ids. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + updateInstances(resourceGroupName, vmScaleSetName, instanceIds, 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._updateInstances(resourceGroupName, vmScaleSetName, instanceIds, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateInstances(resourceGroupName, vmScaleSetName, instanceIds, options, optionalCallback); + } + } + + /** + * Reimages (upgrade the operating system) one or more virtual machines in a VM + * scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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. + */ + reimageWithHttpOperationResponse(resourceGroupName, vmScaleSetName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._reimage(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Reimages (upgrade the operating system) one or more virtual machines in a VM + * scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + reimage(resourceGroupName, vmScaleSetName, 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._reimage(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._reimage(resourceGroupName, vmScaleSetName, options, optionalCallback); + } + } + + /** + * Reimages all the disks ( including data disks ) in the virtual machines in a + * VM scale set. This operation is only supported for managed disks. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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. + */ + reimageAllWithHttpOperationResponse(resourceGroupName, vmScaleSetName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._reimageAll(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Reimages all the disks ( including data disks ) in the virtual machines in a + * VM scale set. This operation is only supported for managed disks. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + reimageAll(resourceGroupName, vmScaleSetName, 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._reimageAll(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._reimageAll(resourceGroupName, vmScaleSetName, options, optionalCallback); + } + } + + /** + * Manual platform update domain walk to update virtual machines in a service + * fabric virtual machine scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {number} platformUpdateDomain The platform update domain for which a + * manual recovery walk is requested + * + * @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. + */ + forceRecoveryServiceFabricPlatformUpdateDomainWalkWithHttpOperationResponse(resourceGroupName, vmScaleSetName, platformUpdateDomain, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._forceRecoveryServiceFabricPlatformUpdateDomainWalk(resourceGroupName, vmScaleSetName, platformUpdateDomain, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Manual platform update domain walk to update virtual machines in a service + * fabric virtual machine scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {number} platformUpdateDomain The platform update domain for which a + * manual recovery walk is requested + * + * @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 {RecoveryWalkResponse} - 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 RecoveryWalkResponse} 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. + */ + forceRecoveryServiceFabricPlatformUpdateDomainWalk(resourceGroupName, vmScaleSetName, platformUpdateDomain, 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._forceRecoveryServiceFabricPlatformUpdateDomainWalk(resourceGroupName, vmScaleSetName, platformUpdateDomain, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._forceRecoveryServiceFabricPlatformUpdateDomainWalk(resourceGroupName, vmScaleSetName, platformUpdateDomain, options, optionalCallback); + } + } + + /** + * Create or update a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set to create or + * update. + * + * @param {object} parameters The scale set object. + * + * @param {object} [parameters.sku] The virtual machine scale set sku. + * + * @param {string} [parameters.sku.name] The sku name. + * + * @param {string} [parameters.sku.tier] Specifies the tier of virtual machines + * in a scale set.

    Possible Values:

    **Standard**

    **Basic** + * + * @param {number} [parameters.sku.capacity] Specifies the number of virtual + * machines in the scale set. + * + * @param {object} [parameters.plan] Specifies information about the + * marketplace image used to create the virtual machine. This element is only + * used for marketplace images. Before you can use a marketplace image from an + * API, you must enable the image for programmatic use. In the Azure portal, + * find the marketplace image that you want to use and then click **Want to + * deploy programmatically, Get Started ->**. Enter any required information + * and then click **Save**. + * + * @param {string} [parameters.plan.name] The plan ID. + * + * @param {string} [parameters.plan.publisher] The publisher ID. + * + * @param {string} [parameters.plan.product] Specifies the product of the image + * from the marketplace. This is the same value as Offer under the + * imageReference element. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {object} [parameters.upgradePolicy] The upgrade policy. + * + * @param {string} [parameters.upgradePolicy.mode] Specifies the mode of an + * upgrade to virtual machines in the scale set.

    Possible values + * are:

    **Manual** - You control the application of updates to + * virtual machines in the scale set. You do this by using the manualUpgrade + * action.

    **Automatic** - All virtual machines in the scale set + * are automatically updated at the same time. Possible values include: + * 'Automatic', 'Manual', 'Rolling' + * + * @param {object} [parameters.upgradePolicy.rollingUpgradePolicy] The + * configuration parameters used while performing a rolling upgrade. + * + * @param {number} + * [parameters.upgradePolicy.rollingUpgradePolicy.maxBatchInstancePercent] The + * maximum percent of total virtual machine instances that will be upgraded + * simultaneously by the rolling upgrade in one batch. As this is a maximum, + * unhealthy instances in previous or future batches can cause the percentage + * of instances in a batch to decrease to ensure higher reliability. The + * default value for this parameter is 20%. + * + * @param {number} + * [parameters.upgradePolicy.rollingUpgradePolicy.maxUnhealthyInstancePercent] + * The maximum percentage of the total virtual machine instances in the scale + * set that can be simultaneously unhealthy, either as a result of being + * upgraded, or by being found in an unhealthy state by the virtual machine + * health checks before the rolling upgrade aborts. This constraint will be + * checked prior to starting any batch. The default value for this parameter is + * 20%. + * + * @param {number} + * [parameters.upgradePolicy.rollingUpgradePolicy.maxUnhealthyUpgradedInstancePercent] + * The maximum percentage of upgraded virtual machine instances that can be + * found to be in an unhealthy state. This check will happen after each batch + * is upgraded. If this percentage is ever exceeded, the rolling update aborts. + * The default value for this parameter is 20%. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradePolicy.pauseTimeBetweenBatches] The + * wait time between completing the update for all virtual machines in one + * batch and starting the next batch. The time duration should be specified in + * ISO 8601 format. The default value is 0 seconds (PT0S). + * + * @param {boolean} [parameters.upgradePolicy.automaticOSUpgrade] Whether OS + * upgrades should automatically be applied to scale set instances in a rolling + * fashion when a newer version of the image becomes available. + * + * @param {object} [parameters.virtualMachineProfile] The virtual machine + * profile. + * + * @param {object} [parameters.virtualMachineProfile.osProfile] Specifies the + * operating system settings for the virtual machines in the scale set. + * + * @param {string} + * [parameters.virtualMachineProfile.osProfile.computerNamePrefix] Specifies + * the computer name prefix for all of the virtual machines in the scale set. + * Computer name prefixes must be 1 to 15 characters long. + * + * @param {string} [parameters.virtualMachineProfile.osProfile.adminUsername] + * Specifies the name of the administrator account.

    **Windows-only + * restriction:** Cannot end in "."

    **Disallowed values:** + * "administrator", "admin", "user", "user1", "test", "user2", "test1", + * "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", + * "backup", "console", "david", "guest", "john", "owner", "root", "server", + * "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", + * "user5".

    **Minimum-length (Linux):** 1 character

    + * **Max-length (Linux):** 64 characters

    **Max-length (Windows):** 20 + * characters

  • For root access to the Linux VM, see [Using root + * privileges on Linux virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in this + * field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {string} [parameters.virtualMachineProfile.osProfile.adminPassword] + * Specifies the password of the administrator account.

    + * **Minimum-length (Windows):** 8 characters

    **Minimum-length + * (Linux):** 6 characters

    **Max-length (Windows):** 123 characters + *

    **Max-length (Linux):** 72 characters

    **Complexity + * requirements:** 3 out of 4 conditions below need to be fulfilled
    Has + * lower characters
    Has upper characters
    Has a digit
    Has a + * special character (Regex match [\W_])

    **Disallowed values:** + * "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", + * "Password!", "Password1", "Password22", "iloveyou!"

    For resetting + * the password, see [How to reset the Remote Desktop service or its login + * password in a Windows + * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    For resetting root password, see [Manage users, SSH, and check or + * repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + * + * @param {string} [parameters.virtualMachineProfile.osProfile.customData] + * Specifies a base-64 encoded string of custom data. The base-64 encoded + * string is decoded to a binary array that is saved as a file on the Virtual + * Machine. The maximum length of the binary array is 65535 bytes.

    For + * using cloud-init for your VM, see [Using cloud-init to customize a Linux VM + * during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration] Specifies + * Windows operating system settings on the virtual machine. + * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.enableAutomaticUpdates] + * Indicates whether virtual machine is enabled for automatic updates. + * + * @param {string} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.timeZone] + * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.winRM] + * Specifies the Windows Remote Management listeners. This enables remote + * Windows PowerShell. + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.winRM.listeners] + * The list of Windows Remote Management listeners + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration] Specifies + * the Linux operating system settings on the virtual machine.

    For a + * list of supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh] + * Specifies the ssh key configuration for a Linux OS. + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh.publicKeys] + * The list of SSH public keys used to authenticate with linux based VMs. + * + * @param {array} [parameters.virtualMachineProfile.osProfile.secrets] + * Specifies set of certificates that should be installed onto the virtual + * machines in the scale set. + * + * @param {object} [parameters.virtualMachineProfile.storageProfile] Specifies + * the storage settings for the virtual machine disks. + * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.imageReference] Specifies + * information about the image to use. You can specify information about + * platform images, marketplace images, or virtual machine images. This element + * is required when you want to use a platform image, marketplace image, or + * virtual machine image, but is not used in other creation operations. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.publisher] + * The image publisher. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.offer] + * Specifies the offer of the platform image or marketplace image used to + * create the virtual machine. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.sku] The + * image SKU. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.version] + * Specifies the version of the platform image or marketplace image used to + * create the virtual machine. The allowed formats are Major.Minor.Build or + * 'latest'. Major, Minor, and Build are decimal numbers. Specify 'latest' to + * use the latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.id] Resource + * Id + * + * @param {object} [parameters.virtualMachineProfile.storageProfile.osDisk] + * Specifies information about the operating system disk used by the virtual + * machines in the scale set.

    For more information about disks, see + * [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.name] The disk name. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.caching] Specifies + * the caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {boolean} + * [parameters.virtualMachineProfile.storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @param {string} + * parameters.virtualMachineProfile.storageProfile.osDisk.createOption + * Specifies how the virtual machines in the scale set should be + * created.

    The only allowed value is: **FromImage** \u2013 This value + * is used when you are using an image to create the virtual machine. If you + * are using a platform image, you also use the imageReference element + * described above. If you are using a marketplace image, you also use the + * plan element previously described. Possible values include: 'FromImage', + * 'Empty', 'Attach' + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.osType] This + * property allows you to specify the type of the OS that is included in the + * disk if creating a VM from user-image or a specialized VHD.

    + * Possible values are:

    **Windows**

    **Linux**. Possible + * values include: 'Windows', 'Linux' + * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.osDisk.image] Specifies + * information about the unmanaged user image to base the scale set on. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.image.uri] Specifies + * the virtual hard disk's uri. + * + * @param {array} + * [parameters.virtualMachineProfile.storageProfile.osDisk.vhdContainers] + * Specifies the container urls that are used to store operating system disks + * for the scale set. + * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.osDisk.managedDisk] The + * managed disk parameters. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.managedDisk.storageAccountType] + * Specifies the storage account type for the managed disk. Possible values + * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {array} [parameters.virtualMachineProfile.storageProfile.dataDisks] + * Specifies the parameters that are used to add data disks to the virtual + * machines in the scale set.

    For more information about disks, see + * [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {object} [parameters.virtualMachineProfile.networkProfile] Specifies + * properties of the network interfaces of the virtual machines in the scale + * set. + * + * @param {object} + * [parameters.virtualMachineProfile.networkProfile.healthProbe] A reference to + * a load balancer probe used to determine the health of an instance in the + * virtual machine scale set. The reference will be in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. + * + * @param {string} + * [parameters.virtualMachineProfile.networkProfile.healthProbe.id] The ARM + * resource id in the form of + * /subscriptions/{SubcriptionId}/resourceGroups/{ResourceGroupName}/... + * + * @param {array} + * [parameters.virtualMachineProfile.networkProfile.networkInterfaceConfigurations] + * The list of network configurations. + * + * @param {object} [parameters.virtualMachineProfile.diagnosticsProfile] + * Specifies the boot diagnostic settings state.

    Minimum api-version: + * 2015-06-15. + * + * @param {object} + * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, + * you can easily view the output of your console log.

    For both + * Windows and Linux virtual machines, Azure also enables you to see a + * screenshot of the VM from the hypervisor. + * + * @param {boolean} + * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics.enabled] + * Whether boot diagnostics should be enabled on the Virtual Machine. + * + * @param {string} + * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics.storageUri] + * Uri of the storage account to use for placing the console output and + * screenshot. + * + * @param {object} [parameters.virtualMachineProfile.extensionProfile] + * Specifies a collection of settings for extensions installed on virtual + * machines in the scale set. + * + * @param {array} + * [parameters.virtualMachineProfile.extensionProfile.extensions] The virtual + * machine scale set child extension resources. + * + * @param {string} [parameters.virtualMachineProfile.licenseType] Specifies + * that the image or disk that is being used was licensed on-premises. This + * element is only used for images that contain the Windows Server operating + * system.

    Possible values are:

    Windows_Client

    + * Windows_Server

    If this element is included in a request for an + * update, the value must match the initial value. This value cannot be + * updated.

    For more information, see [Azure Hybrid Use Benefit for + * Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Minimum api-version: 2015-06-15 + * + * @param {string} [parameters.virtualMachineProfile.priority] Specifies the + * priority for the virtual machines in the scale set.

    Minimum + * api-version: 2017-10-30-preview. Possible values include: 'Regular', 'Low' + * + * @param {boolean} [parameters.overprovision] Specifies whether the Virtual + * Machine Scale Set should be overprovisioned. + * + * @param {boolean} [parameters.singlePlacementGroup] When true this limits the + * scale set to a single placement group, of max size 100 virtual machines. + * + * @param {boolean} [parameters.zoneBalance] Whether to force stictly even + * Virtual Machine distribution cross x-zones in case there is zone outage. + * + * @param {number} [parameters.platformFaultDomainCount] Fault Domain count for + * each placement group. + * + * @param {object} [parameters.identity] The identity of the virtual machine + * scale set, if configured. + * + * @param {string} [parameters.identity.type] The type of identity used for the + * virtual machine scale set. The type 'SystemAssigned, UserAssigned' includes + * both an implicitly created identity and a set of user assigned identities. + * The type 'None' will remove any identities from the virtual machine scale + * set. Possible values include: 'SystemAssigned', 'UserAssigned', + * 'SystemAssigned, UserAssigned', 'None' + * + * @param {array} [parameters.identity.identityIds] The list of user identities + * associated with the virtual machine scale set. The user identity references + * will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * + * @param {array} [parameters.zones] The virtual machine scale set zones. + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @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. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, vmScaleSetName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, vmScaleSetName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Create or update a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set to create or + * update. + * + * @param {object} parameters The scale set object. + * + * @param {object} [parameters.sku] The virtual machine scale set sku. + * + * @param {string} [parameters.sku.name] The sku name. + * + * @param {string} [parameters.sku.tier] Specifies the tier of virtual machines + * in a scale set.

    Possible Values:

    **Standard**

    **Basic** + * + * @param {number} [parameters.sku.capacity] Specifies the number of virtual + * machines in the scale set. + * + * @param {object} [parameters.plan] Specifies information about the + * marketplace image used to create the virtual machine. This element is only + * used for marketplace images. Before you can use a marketplace image from an + * API, you must enable the image for programmatic use. In the Azure portal, + * find the marketplace image that you want to use and then click **Want to + * deploy programmatically, Get Started ->**. Enter any required information + * and then click **Save**. + * + * @param {string} [parameters.plan.name] The plan ID. + * + * @param {string} [parameters.plan.publisher] The publisher ID. + * + * @param {string} [parameters.plan.product] Specifies the product of the image + * from the marketplace. This is the same value as Offer under the + * imageReference element. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {object} [parameters.upgradePolicy] The upgrade policy. + * + * @param {string} [parameters.upgradePolicy.mode] Specifies the mode of an + * upgrade to virtual machines in the scale set.

    Possible values + * are:

    **Manual** - You control the application of updates to + * virtual machines in the scale set. You do this by using the manualUpgrade + * action.

    **Automatic** - All virtual machines in the scale set + * are automatically updated at the same time. Possible values include: + * 'Automatic', 'Manual', 'Rolling' + * + * @param {object} [parameters.upgradePolicy.rollingUpgradePolicy] The + * configuration parameters used while performing a rolling upgrade. + * + * @param {number} + * [parameters.upgradePolicy.rollingUpgradePolicy.maxBatchInstancePercent] The + * maximum percent of total virtual machine instances that will be upgraded + * simultaneously by the rolling upgrade in one batch. As this is a maximum, + * unhealthy instances in previous or future batches can cause the percentage + * of instances in a batch to decrease to ensure higher reliability. The + * default value for this parameter is 20%. + * + * @param {number} + * [parameters.upgradePolicy.rollingUpgradePolicy.maxUnhealthyInstancePercent] + * The maximum percentage of the total virtual machine instances in the scale + * set that can be simultaneously unhealthy, either as a result of being + * upgraded, or by being found in an unhealthy state by the virtual machine + * health checks before the rolling upgrade aborts. This constraint will be + * checked prior to starting any batch. The default value for this parameter is + * 20%. + * + * @param {number} + * [parameters.upgradePolicy.rollingUpgradePolicy.maxUnhealthyUpgradedInstancePercent] + * The maximum percentage of upgraded virtual machine instances that can be + * found to be in an unhealthy state. This check will happen after each batch + * is upgraded. If this percentage is ever exceeded, the rolling update aborts. + * The default value for this parameter is 20%. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradePolicy.pauseTimeBetweenBatches] The + * wait time between completing the update for all virtual machines in one + * batch and starting the next batch. The time duration should be specified in + * ISO 8601 format. The default value is 0 seconds (PT0S). + * + * @param {boolean} [parameters.upgradePolicy.automaticOSUpgrade] Whether OS + * upgrades should automatically be applied to scale set instances in a rolling + * fashion when a newer version of the image becomes available. + * + * @param {object} [parameters.virtualMachineProfile] The virtual machine + * profile. + * + * @param {object} [parameters.virtualMachineProfile.osProfile] Specifies the + * operating system settings for the virtual machines in the scale set. + * + * @param {string} + * [parameters.virtualMachineProfile.osProfile.computerNamePrefix] Specifies + * the computer name prefix for all of the virtual machines in the scale set. + * Computer name prefixes must be 1 to 15 characters long. + * + * @param {string} [parameters.virtualMachineProfile.osProfile.adminUsername] + * Specifies the name of the administrator account.

    **Windows-only + * restriction:** Cannot end in "."

    **Disallowed values:** + * "administrator", "admin", "user", "user1", "test", "user2", "test1", + * "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", + * "backup", "console", "david", "guest", "john", "owner", "root", "server", + * "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", + * "user5".

    **Minimum-length (Linux):** 1 character

    + * **Max-length (Linux):** 64 characters

    **Max-length (Windows):** 20 + * characters

  • For root access to the Linux VM, see [Using root + * privileges on Linux virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in this + * field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {string} [parameters.virtualMachineProfile.osProfile.adminPassword] + * Specifies the password of the administrator account.

    + * **Minimum-length (Windows):** 8 characters

    **Minimum-length + * (Linux):** 6 characters

    **Max-length (Windows):** 123 characters + *

    **Max-length (Linux):** 72 characters

    **Complexity + * requirements:** 3 out of 4 conditions below need to be fulfilled
    Has + * lower characters
    Has upper characters
    Has a digit
    Has a + * special character (Regex match [\W_])

    **Disallowed values:** + * "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", + * "Password!", "Password1", "Password22", "iloveyou!"

    For resetting + * the password, see [How to reset the Remote Desktop service or its login + * password in a Windows + * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    For resetting root password, see [Manage users, SSH, and check or + * repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + * + * @param {string} [parameters.virtualMachineProfile.osProfile.customData] + * Specifies a base-64 encoded string of custom data. The base-64 encoded + * string is decoded to a binary array that is saved as a file on the Virtual + * Machine. The maximum length of the binary array is 65535 bytes.

    For + * using cloud-init for your VM, see [Using cloud-init to customize a Linux VM + * during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration] Specifies + * Windows operating system settings on the virtual machine. + * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.enableAutomaticUpdates] + * Indicates whether virtual machine is enabled for automatic updates. + * + * @param {string} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.timeZone] + * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.winRM] + * Specifies the Windows Remote Management listeners. This enables remote + * Windows PowerShell. + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.winRM.listeners] + * The list of Windows Remote Management listeners + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration] Specifies + * the Linux operating system settings on the virtual machine.

    For a + * list of supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh] + * Specifies the ssh key configuration for a Linux OS. + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh.publicKeys] + * The list of SSH public keys used to authenticate with linux based VMs. + * + * @param {array} [parameters.virtualMachineProfile.osProfile.secrets] + * Specifies set of certificates that should be installed onto the virtual + * machines in the scale set. + * + * @param {object} [parameters.virtualMachineProfile.storageProfile] Specifies + * the storage settings for the virtual machine disks. + * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.imageReference] Specifies + * information about the image to use. You can specify information about + * platform images, marketplace images, or virtual machine images. This element + * is required when you want to use a platform image, marketplace image, or + * virtual machine image, but is not used in other creation operations. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.publisher] + * The image publisher. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.offer] + * Specifies the offer of the platform image or marketplace image used to + * create the virtual machine. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.sku] The + * image SKU. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.version] + * Specifies the version of the platform image or marketplace image used to + * create the virtual machine. The allowed formats are Major.Minor.Build or + * 'latest'. Major, Minor, and Build are decimal numbers. Specify 'latest' to + * use the latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.id] Resource + * Id + * + * @param {object} [parameters.virtualMachineProfile.storageProfile.osDisk] + * Specifies information about the operating system disk used by the virtual + * machines in the scale set.

    For more information about disks, see + * [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.name] The disk name. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.caching] Specifies + * the caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {boolean} + * [parameters.virtualMachineProfile.storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @param {string} + * parameters.virtualMachineProfile.storageProfile.osDisk.createOption + * Specifies how the virtual machines in the scale set should be + * created.

    The only allowed value is: **FromImage** \u2013 This value + * is used when you are using an image to create the virtual machine. If you + * are using a platform image, you also use the imageReference element + * described above. If you are using a marketplace image, you also use the + * plan element previously described. Possible values include: 'FromImage', + * 'Empty', 'Attach' + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.osType] This + * property allows you to specify the type of the OS that is included in the + * disk if creating a VM from user-image or a specialized VHD.

    + * Possible values are:

    **Windows**

    **Linux**. Possible + * values include: 'Windows', 'Linux' + * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.osDisk.image] Specifies + * information about the unmanaged user image to base the scale set on. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.image.uri] Specifies + * the virtual hard disk's uri. + * + * @param {array} + * [parameters.virtualMachineProfile.storageProfile.osDisk.vhdContainers] + * Specifies the container urls that are used to store operating system disks + * for the scale set. + * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.osDisk.managedDisk] The + * managed disk parameters. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.managedDisk.storageAccountType] + * Specifies the storage account type for the managed disk. Possible values + * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {array} [parameters.virtualMachineProfile.storageProfile.dataDisks] + * Specifies the parameters that are used to add data disks to the virtual + * machines in the scale set.

    For more information about disks, see + * [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {object} [parameters.virtualMachineProfile.networkProfile] Specifies + * properties of the network interfaces of the virtual machines in the scale + * set. + * + * @param {object} + * [parameters.virtualMachineProfile.networkProfile.healthProbe] A reference to + * a load balancer probe used to determine the health of an instance in the + * virtual machine scale set. The reference will be in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. + * + * @param {string} + * [parameters.virtualMachineProfile.networkProfile.healthProbe.id] The ARM + * resource id in the form of + * /subscriptions/{SubcriptionId}/resourceGroups/{ResourceGroupName}/... + * + * @param {array} + * [parameters.virtualMachineProfile.networkProfile.networkInterfaceConfigurations] + * The list of network configurations. + * + * @param {object} [parameters.virtualMachineProfile.diagnosticsProfile] + * Specifies the boot diagnostic settings state.

    Minimum api-version: + * 2015-06-15. + * + * @param {object} + * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, + * you can easily view the output of your console log.

    For both + * Windows and Linux virtual machines, Azure also enables you to see a + * screenshot of the VM from the hypervisor. + * + * @param {boolean} + * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics.enabled] + * Whether boot diagnostics should be enabled on the Virtual Machine. + * + * @param {string} + * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics.storageUri] + * Uri of the storage account to use for placing the console output and + * screenshot. + * + * @param {object} [parameters.virtualMachineProfile.extensionProfile] + * Specifies a collection of settings for extensions installed on virtual + * machines in the scale set. + * + * @param {array} + * [parameters.virtualMachineProfile.extensionProfile.extensions] The virtual + * machine scale set child extension resources. + * + * @param {string} [parameters.virtualMachineProfile.licenseType] Specifies + * that the image or disk that is being used was licensed on-premises. This + * element is only used for images that contain the Windows Server operating + * system.

    Possible values are:

    Windows_Client

    + * Windows_Server

    If this element is included in a request for an + * update, the value must match the initial value. This value cannot be + * updated.

    For more information, see [Azure Hybrid Use Benefit for + * Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Minimum api-version: 2015-06-15 + * + * @param {string} [parameters.virtualMachineProfile.priority] Specifies the + * priority for the virtual machines in the scale set.

    Minimum + * api-version: 2017-10-30-preview. Possible values include: 'Regular', 'Low' + * + * @param {boolean} [parameters.overprovision] Specifies whether the Virtual + * Machine Scale Set should be overprovisioned. + * + * @param {boolean} [parameters.singlePlacementGroup] When true this limits the + * scale set to a single placement group, of max size 100 virtual machines. + * + * @param {boolean} [parameters.zoneBalance] Whether to force stictly even + * Virtual Machine distribution cross x-zones in case there is zone outage. + * + * @param {number} [parameters.platformFaultDomainCount] Fault Domain count for + * each placement group. + * + * @param {object} [parameters.identity] The identity of the virtual machine + * scale set, if configured. + * + * @param {string} [parameters.identity.type] The type of identity used for the + * virtual machine scale set. The type 'SystemAssigned, UserAssigned' includes + * both an implicitly created identity and a set of user assigned identities. + * The type 'None' will remove any identities from the virtual machine scale + * set. Possible values include: 'SystemAssigned', 'UserAssigned', + * 'SystemAssigned, UserAssigned', 'None' + * + * @param {array} [parameters.identity.identityIds] The list of user identities + * associated with the virtual machine scale set. The user identity references + * will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * + * @param {array} [parameters.zones] The virtual machine scale set zones. + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @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 {VirtualMachineScaleSet} - 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 VirtualMachineScaleSet} 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. + */ + beginCreateOrUpdate(resourceGroupName, vmScaleSetName, 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._beginCreateOrUpdate(resourceGroupName, vmScaleSetName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, vmScaleSetName, parameters, options, optionalCallback); + } + } + + /** + * Update a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set to create or + * update. + * + * @param {object} parameters The scale set object. + * + * @param {object} [parameters.sku] The virtual machine scale set sku. + * + * @param {string} [parameters.sku.name] The sku name. + * + * @param {string} [parameters.sku.tier] Specifies the tier of virtual machines + * in a scale set.

    Possible Values:

    **Standard**

    **Basic** + * + * @param {number} [parameters.sku.capacity] Specifies the number of virtual + * machines in the scale set. + * + * @param {object} [parameters.plan] The purchase plan when deploying a virtual + * machine scale set from VM Marketplace images. + * + * @param {string} [parameters.plan.name] The plan ID. + * + * @param {string} [parameters.plan.publisher] The publisher ID. + * + * @param {string} [parameters.plan.product] Specifies the product of the image + * from the marketplace. This is the same value as Offer under the + * imageReference element. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {object} [parameters.upgradePolicy] The upgrade policy. + * + * @param {string} [parameters.upgradePolicy.mode] Specifies the mode of an + * upgrade to virtual machines in the scale set.

    Possible values + * are:

    **Manual** - You control the application of updates to + * virtual machines in the scale set. You do this by using the manualUpgrade + * action.

    **Automatic** - All virtual machines in the scale set + * are automatically updated at the same time. Possible values include: + * 'Automatic', 'Manual', 'Rolling' + * + * @param {object} [parameters.upgradePolicy.rollingUpgradePolicy] The + * configuration parameters used while performing a rolling upgrade. + * + * @param {number} + * [parameters.upgradePolicy.rollingUpgradePolicy.maxBatchInstancePercent] The + * maximum percent of total virtual machine instances that will be upgraded + * simultaneously by the rolling upgrade in one batch. As this is a maximum, + * unhealthy instances in previous or future batches can cause the percentage + * of instances in a batch to decrease to ensure higher reliability. The + * default value for this parameter is 20%. + * + * @param {number} + * [parameters.upgradePolicy.rollingUpgradePolicy.maxUnhealthyInstancePercent] + * The maximum percentage of the total virtual machine instances in the scale + * set that can be simultaneously unhealthy, either as a result of being + * upgraded, or by being found in an unhealthy state by the virtual machine + * health checks before the rolling upgrade aborts. This constraint will be + * checked prior to starting any batch. The default value for this parameter is + * 20%. + * + * @param {number} + * [parameters.upgradePolicy.rollingUpgradePolicy.maxUnhealthyUpgradedInstancePercent] + * The maximum percentage of upgraded virtual machine instances that can be + * found to be in an unhealthy state. This check will happen after each batch + * is upgraded. If this percentage is ever exceeded, the rolling update aborts. + * The default value for this parameter is 20%. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradePolicy.pauseTimeBetweenBatches] The + * wait time between completing the update for all virtual machines in one + * batch and starting the next batch. The time duration should be specified in + * ISO 8601 format. The default value is 0 seconds (PT0S). + * + * @param {boolean} [parameters.upgradePolicy.automaticOSUpgrade] Whether OS + * upgrades should automatically be applied to scale set instances in a rolling + * fashion when a newer version of the image becomes available. + * + * @param {object} [parameters.virtualMachineProfile] The virtual machine + * profile. + * + * @param {object} [parameters.virtualMachineProfile.osProfile] The virtual + * machine scale set OS profile. + * + * @param {string} [parameters.virtualMachineProfile.osProfile.customData] A + * base-64 encoded string of custom data. + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration] The + * Windows Configuration of the OS profile. + * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.enableAutomaticUpdates] + * Indicates whether virtual machine is enabled for automatic updates. + * + * @param {string} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.timeZone] + * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.winRM] + * Specifies the Windows Remote Management listeners. This enables remote + * Windows PowerShell. + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.winRM.listeners] + * The list of Windows Remote Management listeners + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration] The Linux + * Configuration of the OS profile. + * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh] + * Specifies the ssh key configuration for a Linux OS. + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh.publicKeys] + * The list of SSH public keys used to authenticate with linux based VMs. + * + * @param {array} [parameters.virtualMachineProfile.osProfile.secrets] The List + * of certificates for addition to the VM. + * + * @param {object} [parameters.virtualMachineProfile.storageProfile] The + * virtual machine scale set storage profile. + * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.imageReference] The image + * reference. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.publisher] + * The image publisher. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.offer] + * Specifies the offer of the platform image or marketplace image used to + * create the virtual machine. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.sku] The + * image SKU. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.version] + * Specifies the version of the platform image or marketplace image used to + * create the virtual machine. The allowed formats are Major.Minor.Build or + * 'latest'. Major, Minor, and Build are decimal numbers. Specify 'latest' to + * use the latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.id] Resource + * Id + * + * @param {object} [parameters.virtualMachineProfile.storageProfile.osDisk] The + * OS disk. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.caching] The caching + * type. Possible values include: 'None', 'ReadOnly', 'ReadWrite' + * + * @param {boolean} + * [parameters.virtualMachineProfile.storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.osDisk.image] The Source + * User Image VirtualHardDisk. This VirtualHardDisk will be copied before using + * it to attach to the Virtual Machine. If SourceImage is provided, the + * destination VirtualHardDisk should not exist. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.image.uri] Specifies + * the virtual hard disk's uri. + * + * @param {array} + * [parameters.virtualMachineProfile.storageProfile.osDisk.vhdContainers] The + * list of virtual hard disk container uris. + * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.osDisk.managedDisk] The + * managed disk parameters. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.managedDisk.storageAccountType] + * Specifies the storage account type for the managed disk. Possible values + * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {array} [parameters.virtualMachineProfile.storageProfile.dataDisks] + * The data disks. + * + * @param {object} [parameters.virtualMachineProfile.networkProfile] The + * virtual machine scale set network profile. + * + * @param {array} + * [parameters.virtualMachineProfile.networkProfile.networkInterfaceConfigurations] + * The list of network configurations. + * + * @param {object} [parameters.virtualMachineProfile.diagnosticsProfile] The + * virtual machine scale set diagnostics profile. + * + * @param {object} + * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, + * you can easily view the output of your console log.

    For both + * Windows and Linux virtual machines, Azure also enables you to see a + * screenshot of the VM from the hypervisor. + * + * @param {boolean} + * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics.enabled] + * Whether boot diagnostics should be enabled on the Virtual Machine. + * + * @param {string} + * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics.storageUri] + * Uri of the storage account to use for placing the console output and + * screenshot. + * + * @param {object} [parameters.virtualMachineProfile.extensionProfile] The + * virtual machine scale set extension profile. + * + * @param {array} + * [parameters.virtualMachineProfile.extensionProfile.extensions] The virtual + * machine scale set child extension resources. + * + * @param {string} [parameters.virtualMachineProfile.licenseType] The license + * type, which is for bring your own license scenario. + * + * @param {boolean} [parameters.overprovision] Specifies whether the Virtual + * Machine Scale Set should be overprovisioned. + * + * @param {boolean} [parameters.singlePlacementGroup] When true this limits the + * scale set to a single placement group, of max size 100 virtual machines. + * + * @param {object} [parameters.identity] The identity of the virtual machine + * scale set, if configured. + * + * @param {string} [parameters.identity.type] The type of identity used for the + * virtual machine scale set. The type 'SystemAssigned, UserAssigned' includes + * both an implicitly created identity and a set of user assigned identities. + * The type 'None' will remove any identities from the virtual machine scale + * set. Possible values include: 'SystemAssigned', 'UserAssigned', + * 'SystemAssigned, UserAssigned', 'None' + * + * @param {array} [parameters.identity.identityIds] The list of user identities + * associated with the virtual machine scale set. The user identity references + * will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * + * @param {object} [parameters.tags] Resource tags + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginUpdateWithHttpOperationResponse(resourceGroupName, vmScaleSetName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginUpdate(resourceGroupName, vmScaleSetName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Update a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set to create or + * update. + * + * @param {object} parameters The scale set object. + * + * @param {object} [parameters.sku] The virtual machine scale set sku. + * + * @param {string} [parameters.sku.name] The sku name. + * + * @param {string} [parameters.sku.tier] Specifies the tier of virtual machines + * in a scale set.

    Possible Values:

    **Standard**

    **Basic** + * + * @param {number} [parameters.sku.capacity] Specifies the number of virtual + * machines in the scale set. + * + * @param {object} [parameters.plan] The purchase plan when deploying a virtual + * machine scale set from VM Marketplace images. + * + * @param {string} [parameters.plan.name] The plan ID. + * + * @param {string} [parameters.plan.publisher] The publisher ID. + * + * @param {string} [parameters.plan.product] Specifies the product of the image + * from the marketplace. This is the same value as Offer under the + * imageReference element. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {object} [parameters.upgradePolicy] The upgrade policy. + * + * @param {string} [parameters.upgradePolicy.mode] Specifies the mode of an + * upgrade to virtual machines in the scale set.

    Possible values + * are:

    **Manual** - You control the application of updates to + * virtual machines in the scale set. You do this by using the manualUpgrade + * action.

    **Automatic** - All virtual machines in the scale set + * are automatically updated at the same time. Possible values include: + * 'Automatic', 'Manual', 'Rolling' + * + * @param {object} [parameters.upgradePolicy.rollingUpgradePolicy] The + * configuration parameters used while performing a rolling upgrade. + * + * @param {number} + * [parameters.upgradePolicy.rollingUpgradePolicy.maxBatchInstancePercent] The + * maximum percent of total virtual machine instances that will be upgraded + * simultaneously by the rolling upgrade in one batch. As this is a maximum, + * unhealthy instances in previous or future batches can cause the percentage + * of instances in a batch to decrease to ensure higher reliability. The + * default value for this parameter is 20%. + * + * @param {number} + * [parameters.upgradePolicy.rollingUpgradePolicy.maxUnhealthyInstancePercent] + * The maximum percentage of the total virtual machine instances in the scale + * set that can be simultaneously unhealthy, either as a result of being + * upgraded, or by being found in an unhealthy state by the virtual machine + * health checks before the rolling upgrade aborts. This constraint will be + * checked prior to starting any batch. The default value for this parameter is + * 20%. + * + * @param {number} + * [parameters.upgradePolicy.rollingUpgradePolicy.maxUnhealthyUpgradedInstancePercent] + * The maximum percentage of upgraded virtual machine instances that can be + * found to be in an unhealthy state. This check will happen after each batch + * is upgraded. If this percentage is ever exceeded, the rolling update aborts. + * The default value for this parameter is 20%. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradePolicy.pauseTimeBetweenBatches] The + * wait time between completing the update for all virtual machines in one + * batch and starting the next batch. The time duration should be specified in + * ISO 8601 format. The default value is 0 seconds (PT0S). + * + * @param {boolean} [parameters.upgradePolicy.automaticOSUpgrade] Whether OS + * upgrades should automatically be applied to scale set instances in a rolling + * fashion when a newer version of the image becomes available. + * + * @param {object} [parameters.virtualMachineProfile] The virtual machine + * profile. + * + * @param {object} [parameters.virtualMachineProfile.osProfile] The virtual + * machine scale set OS profile. + * + * @param {string} [parameters.virtualMachineProfile.osProfile.customData] A + * base-64 encoded string of custom data. + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration] The + * Windows Configuration of the OS profile. + * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.provisionVMAgent] + * Indicates whether virtual machine agent should be provisioned on the virtual + * machine.

    When this property is not specified in the request body, + * default behavior is to set it to true. This will ensure that VM Agent is + * installed on the VM so that extensions can be added to the VM later. + * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.enableAutomaticUpdates] + * Indicates whether virtual machine is enabled for automatic updates. + * + * @param {string} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.timeZone] + * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.winRM] + * Specifies the Windows Remote Management listeners. This enables remote + * Windows PowerShell. + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.winRM.listeners] + * The list of Windows Remote Management listeners + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration] The Linux + * Configuration of the OS profile. + * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh] + * Specifies the ssh key configuration for a Linux OS. + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh.publicKeys] + * The list of SSH public keys used to authenticate with linux based VMs. + * + * @param {array} [parameters.virtualMachineProfile.osProfile.secrets] The List + * of certificates for addition to the VM. + * + * @param {object} [parameters.virtualMachineProfile.storageProfile] The + * virtual machine scale set storage profile. + * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.imageReference] The image + * reference. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.publisher] + * The image publisher. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.offer] + * Specifies the offer of the platform image or marketplace image used to + * create the virtual machine. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.sku] The + * image SKU. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.version] + * Specifies the version of the platform image or marketplace image used to + * create the virtual machine. The allowed formats are Major.Minor.Build or + * 'latest'. Major, Minor, and Build are decimal numbers. Specify 'latest' to + * use the latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.id] Resource + * Id + * + * @param {object} [parameters.virtualMachineProfile.storageProfile.osDisk] The + * OS disk. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.caching] The caching + * type. Possible values include: 'None', 'ReadOnly', 'ReadWrite' + * + * @param {boolean} + * [parameters.virtualMachineProfile.storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.osDisk.image] The Source + * User Image VirtualHardDisk. This VirtualHardDisk will be copied before using + * it to attach to the Virtual Machine. If SourceImage is provided, the + * destination VirtualHardDisk should not exist. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.image.uri] Specifies + * the virtual hard disk's uri. + * + * @param {array} + * [parameters.virtualMachineProfile.storageProfile.osDisk.vhdContainers] The + * list of virtual hard disk container uris. + * + * @param {object} + * [parameters.virtualMachineProfile.storageProfile.osDisk.managedDisk] The + * managed disk parameters. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.managedDisk.storageAccountType] + * Specifies the storage account type for the managed disk. Possible values + * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {array} [parameters.virtualMachineProfile.storageProfile.dataDisks] + * The data disks. + * + * @param {object} [parameters.virtualMachineProfile.networkProfile] The + * virtual machine scale set network profile. + * + * @param {array} + * [parameters.virtualMachineProfile.networkProfile.networkInterfaceConfigurations] + * The list of network configurations. + * + * @param {object} [parameters.virtualMachineProfile.diagnosticsProfile] The + * virtual machine scale set diagnostics profile. + * + * @param {object} + * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, + * you can easily view the output of your console log.

    For both + * Windows and Linux virtual machines, Azure also enables you to see a + * screenshot of the VM from the hypervisor. + * + * @param {boolean} + * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics.enabled] + * Whether boot diagnostics should be enabled on the Virtual Machine. + * + * @param {string} + * [parameters.virtualMachineProfile.diagnosticsProfile.bootDiagnostics.storageUri] + * Uri of the storage account to use for placing the console output and + * screenshot. + * + * @param {object} [parameters.virtualMachineProfile.extensionProfile] The + * virtual machine scale set extension profile. + * + * @param {array} + * [parameters.virtualMachineProfile.extensionProfile.extensions] The virtual + * machine scale set child extension resources. + * + * @param {string} [parameters.virtualMachineProfile.licenseType] The license + * type, which is for bring your own license scenario. + * + * @param {boolean} [parameters.overprovision] Specifies whether the Virtual + * Machine Scale Set should be overprovisioned. + * + * @param {boolean} [parameters.singlePlacementGroup] When true this limits the + * scale set to a single placement group, of max size 100 virtual machines. + * + * @param {object} [parameters.identity] The identity of the virtual machine + * scale set, if configured. + * + * @param {string} [parameters.identity.type] The type of identity used for the + * virtual machine scale set. The type 'SystemAssigned, UserAssigned' includes + * both an implicitly created identity and a set of user assigned identities. + * The type 'None' will remove any identities from the virtual machine scale + * set. Possible values include: 'SystemAssigned', 'UserAssigned', + * 'SystemAssigned, UserAssigned', 'None' + * + * @param {array} [parameters.identity.identityIds] The list of user identities + * associated with the virtual machine scale set. The user identity references + * will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * + * @param {object} [parameters.tags] Resource tags + * + * @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 {VirtualMachineScaleSet} - 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 VirtualMachineScaleSet} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginUpdate(resourceGroupName, vmScaleSetName, 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._beginUpdate(resourceGroupName, vmScaleSetName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginUpdate(resourceGroupName, vmScaleSetName, parameters, options, optionalCallback); + } + } + + /** + * Deletes a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @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. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, vmScaleSetName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + beginDeleteMethod(resourceGroupName, vmScaleSetName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, vmScaleSetName, options, optionalCallback); + } + } + + /** + * Deallocates specific virtual machines in a VM scale set. Shuts down the + * virtual machines and releases the compute resources. You are not billed for + * the compute resources that this virtual machine scale set deallocates. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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. + */ + beginDeallocateWithHttpOperationResponse(resourceGroupName, vmScaleSetName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeallocate(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deallocates specific virtual machines in a VM scale set. Shuts down the + * virtual machines and releases the compute resources. You are not billed for + * the compute resources that this virtual machine scale set deallocates. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + beginDeallocate(resourceGroupName, vmScaleSetName, 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._beginDeallocate(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeallocate(resourceGroupName, vmScaleSetName, options, optionalCallback); + } + } + + /** + * Deletes virtual machines in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {array} instanceIds The virtual machine scale set instance ids. + * + * @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. + */ + beginDeleteInstancesWithHttpOperationResponse(resourceGroupName, vmScaleSetName, instanceIds, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteInstances(resourceGroupName, vmScaleSetName, instanceIds, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes virtual machines in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {array} instanceIds The virtual machine scale set instance ids. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + beginDeleteInstances(resourceGroupName, vmScaleSetName, instanceIds, 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._beginDeleteInstances(resourceGroupName, vmScaleSetName, instanceIds, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteInstances(resourceGroupName, vmScaleSetName, instanceIds, options, optionalCallback); + } + } + + /** + * Power off (stop) one or more virtual machines in a VM scale set. Note that + * resources are still attached and you are getting charged for the resources. + * Instead, use deallocate to release resources and avoid charges. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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. + */ + beginPowerOffWithHttpOperationResponse(resourceGroupName, vmScaleSetName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginPowerOff(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Power off (stop) one or more virtual machines in a VM scale set. Note that + * resources are still attached and you are getting charged for the resources. + * Instead, use deallocate to release resources and avoid charges. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + beginPowerOff(resourceGroupName, vmScaleSetName, 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._beginPowerOff(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginPowerOff(resourceGroupName, vmScaleSetName, options, optionalCallback); + } + } + + /** + * Restarts one or more virtual machines in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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. + */ + beginRestartWithHttpOperationResponse(resourceGroupName, vmScaleSetName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginRestart(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Restarts one or more virtual machines in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + beginRestart(resourceGroupName, vmScaleSetName, 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._beginRestart(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginRestart(resourceGroupName, vmScaleSetName, options, optionalCallback); + } + } + + /** + * Starts one or more virtual machines in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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. + */ + beginStartWithHttpOperationResponse(resourceGroupName, vmScaleSetName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginStart(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Starts one or more virtual machines in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + beginStart(resourceGroupName, vmScaleSetName, 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._beginStart(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginStart(resourceGroupName, vmScaleSetName, options, optionalCallback); + } + } + + /** + * Redeploy one or more virtual machines in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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. + */ + beginRedeployWithHttpOperationResponse(resourceGroupName, vmScaleSetName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginRedeploy(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Redeploy one or more virtual machines in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + beginRedeploy(resourceGroupName, vmScaleSetName, 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._beginRedeploy(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginRedeploy(resourceGroupName, vmScaleSetName, options, optionalCallback); + } + } + + /** + * Perform maintenance on one or more virtual machines in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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. + */ + beginPerformMaintenanceWithHttpOperationResponse(resourceGroupName, vmScaleSetName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginPerformMaintenance(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Perform maintenance on one or more virtual machines in a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + beginPerformMaintenance(resourceGroupName, vmScaleSetName, 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._beginPerformMaintenance(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginPerformMaintenance(resourceGroupName, vmScaleSetName, options, optionalCallback); + } + } + + /** + * Upgrades one or more virtual machines to the latest SKU set in the VM scale + * set model. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {array} instanceIds The virtual machine scale set instance ids. + * + * @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. + */ + beginUpdateInstancesWithHttpOperationResponse(resourceGroupName, vmScaleSetName, instanceIds, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginUpdateInstances(resourceGroupName, vmScaleSetName, instanceIds, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Upgrades one or more virtual machines to the latest SKU set in the VM scale + * set model. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {array} instanceIds The virtual machine scale set instance ids. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + beginUpdateInstances(resourceGroupName, vmScaleSetName, instanceIds, 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._beginUpdateInstances(resourceGroupName, vmScaleSetName, instanceIds, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginUpdateInstances(resourceGroupName, vmScaleSetName, instanceIds, options, optionalCallback); + } + } + + /** + * Reimages (upgrade the operating system) one or more virtual machines in a VM + * scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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. + */ + beginReimageWithHttpOperationResponse(resourceGroupName, vmScaleSetName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginReimage(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Reimages (upgrade the operating system) one or more virtual machines in a VM + * scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + beginReimage(resourceGroupName, vmScaleSetName, 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._beginReimage(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginReimage(resourceGroupName, vmScaleSetName, options, optionalCallback); + } + } + + /** + * Reimages all the disks ( including data disks ) in the virtual machines in a + * VM scale set. This operation is only supported for managed disks. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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. + */ + beginReimageAllWithHttpOperationResponse(resourceGroupName, vmScaleSetName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginReimageAll(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Reimages all the disks ( including data disks ) in the virtual machines in a + * VM scale set. This operation is only supported for managed disks. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.instanceIds] The virtual machine scale set instance + * ids. Omitting the virtual machine scale set instance ids will result in the + * operation being performed on all virtual machines in the virtual machine + * scale set. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + beginReimageAll(resourceGroupName, vmScaleSetName, 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._beginReimageAll(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginReimageAll(resourceGroupName, vmScaleSetName, options, optionalCallback); + } + } + + /** + * Gets a list of all VM scale sets under a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a list of all VM scale sets under a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {VirtualMachineScaleSetListResult} - 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 VirtualMachineScaleSetListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + + /** + * Gets a list of all VM Scale Sets in the subscription, regardless of the + * associated resource group. Use nextLink property in the response to get the + * next page of VM Scale Sets. Do this till nextLink is null to fetch all the + * VM Scale Sets. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listAllNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listAllNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a list of all VM Scale Sets in the subscription, regardless of the + * associated resource group. Use nextLink property in the response to get the + * next page of VM Scale Sets. Do this till nextLink is null to fetch all the + * VM Scale Sets. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {VirtualMachineScaleSetListWithLinkResult} - 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 VirtualMachineScaleSetListWithLinkResult} + * 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. + */ + listAllNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listAllNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listAllNext(nextPageLink, options, optionalCallback); + } + } + + /** + * Gets a list of SKUs available for your VM scale set, including the minimum + * and maximum VM instances allowed for each SKU. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listSkusNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listSkusNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a list of SKUs available for your VM scale set, including the minimum + * and maximum VM instances allowed for each SKU. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {VirtualMachineScaleSetListSkusResult} - 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 VirtualMachineScaleSetListSkusResult} 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. + */ + listSkusNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listSkusNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSkusNext(nextPageLink, options, optionalCallback); + } + } + + /** + * Gets list of OS upgrades on a VM scale set instance. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getOSUpgradeHistoryNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getOSUpgradeHistoryNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets list of OS upgrades on a VM scale set instance. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {VirtualMachineScaleSetListOSUpgradeHistory} - 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 VirtualMachineScaleSetListOSUpgradeHistory} + * 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. + */ + getOSUpgradeHistoryNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getOSUpgradeHistoryNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getOSUpgradeHistoryNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = VirtualMachineScaleSets; diff --git a/lib/services/computeManagement2/lib/lib/operations/virtualMachineSizes.js b/lib/services/computeManagement2/lib/lib/operations/virtualMachineSizes.js new file mode 100644 index 0000000000..f56a070623 --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/operations/virtualMachineSizes.js @@ -0,0 +1,260 @@ +/* + * 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; + +/** + * Lists all available virtual machine sizes for a subscription in a location. + * + * @param {string} location The location upon which virtual-machine-sizes is + * queried. + * + * @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 VirtualMachineSizeListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(location, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (location === null || location === undefined || typeof location.valueOf() !== 'string') { + throw new Error('location cannot be null or undefined and it must be of type string.'); + } + if (location !== null && location !== undefined) { + if (location.match(/^[-\w\._]+$/) === null) + { + throw new Error('"location" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + } + } + 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.Compute/locations/{location}/vmSizes'; + requestUrl = requestUrl.replace('{location}', encodeURIComponent(location)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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['VirtualMachineSizeListResult']().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 VirtualMachineSizes. */ +class VirtualMachineSizes { + /** + * Create a VirtualMachineSizes. + * @param {ComputeManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + } + + /** + * Lists all available virtual machine sizes for a subscription in a location. + * + * @param {string} location The location upon which virtual-machine-sizes is + * queried. + * + * @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. + */ + listWithHttpOperationResponse(location, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(location, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all available virtual machine sizes for a subscription in a location. + * + * @param {string} location The location upon which virtual-machine-sizes is + * queried. + * + * @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 {VirtualMachineSizeListResult} - 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 VirtualMachineSizeListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + list(location, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._list(location, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(location, options, optionalCallback); + } + } + +} + +module.exports = VirtualMachineSizes; diff --git a/lib/services/computeManagement2/lib/lib/operations/virtualMachines.js b/lib/services/computeManagement2/lib/lib/operations/virtualMachines.js new file mode 100644 index 0000000000..4c966c853c --- /dev/null +++ b/lib/services/computeManagement2/lib/lib/operations/virtualMachines.js @@ -0,0 +1,11418 @@ +/* + * 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; + + +/** + * Captures the VM by copying virtual hard disks of the VM and outputs a + * template that can be used to create similar VMs. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Capture Virtual + * Machine operation. + * + * @param {string} parameters.vhdPrefix The captured virtual hard disk's name + * prefix. + * + * @param {string} parameters.destinationContainerName The destination + * container name. + * + * @param {boolean} parameters.overwriteVhds Specifies whether to overwrite the + * destination virtual hard disk, in case of conflict. + * + * @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 VirtualMachineCaptureResult} 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 _capture(resourceGroupName, vmName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginCapture(resourceGroupName, vmName, parameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['VirtualMachineCaptureResult']().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); + }); + }); +} + + +/** + * The operation to create or update a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Create Virtual Machine + * operation. + * + * @param {object} [parameters.plan] Specifies information about the + * marketplace image used to create the virtual machine. This element is only + * used for marketplace images. Before you can use a marketplace image from an + * API, you must enable the image for programmatic use. In the Azure portal, + * find the marketplace image that you want to use and then click **Want to + * deploy programmatically, Get Started ->**. Enter any required information + * and then click **Save**. + * + * @param {string} [parameters.plan.name] The plan ID. + * + * @param {string} [parameters.plan.publisher] The publisher ID. + * + * @param {string} [parameters.plan.product] Specifies the product of the image + * from the marketplace. This is the same value as Offer under the + * imageReference element. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {object} [parameters.hardwareProfile] Specifies the hardware settings + * for the virtual machine. + * + * @param {string} [parameters.hardwareProfile.vmSize] Specifies the size of + * the virtual machine. For more information about virtual machine sizes, see + * [Sizes for virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    The available VM sizes depend on region and availability set. For a + * list of available sizes use these APIs:

    [List all available + * virtual machine sizes in an availability + * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) + *

    [List all available virtual machine sizes in a + * region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) + *

    [List all available virtual machine sizes for + * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). + * Possible values include: '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_B1s', 'Standard_B1ms', + * 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', + * '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_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', + * 'Standard_D32_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', + * 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', + * 'Standard_D64s_v3', '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_DS13-4_v2', 'Standard_DS13-2_v2', + * 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', 'Standard_E2_v3', + * 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', 'Standard_E32_v3', + * 'Standard_E64_v3', 'Standard_E2s_v3', 'Standard_E4s_v3', 'Standard_E8s_v3', + * 'Standard_E16s_v3', 'Standard_E32s_v3', 'Standard_E64s_v3', + * 'Standard_E32-16_v3', 'Standard_E32-8s_v3', 'Standard_E64-32s_v3', + * 'Standard_E64-16s_v3', 'Standard_F1', 'Standard_F2', 'Standard_F4', + * 'Standard_F8', 'Standard_F16', 'Standard_F1s', 'Standard_F2s', + * 'Standard_F4s', 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2', + * 'Standard_F4s_v2', 'Standard_F8s_v2', 'Standard_F16s_v2', + * 'Standard_F32s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1', + * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', + * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', + * 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8', + * 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m', + * 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', + * 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms', + * 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms', + * 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms', + * 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', + * 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2', + * 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3', + * 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s', + * 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6', + * 'Standard_NV12', 'Standard_NV24' + * + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. + * + * @param {object} [parameters.storageProfile.imageReference] Specifies + * information about the image to use. You can specify information about + * platform images, marketplace images, or virtual machine images. This element + * is required when you want to use a platform image, marketplace image, or + * virtual machine image, but is not used in other creation operations. + * + * @param {string} [parameters.storageProfile.imageReference.publisher] The + * image publisher. + * + * @param {string} [parameters.storageProfile.imageReference.offer] Specifies + * the offer of the platform image or marketplace image used to create the + * virtual machine. + * + * @param {string} [parameters.storageProfile.imageReference.sku] The image + * SKU. + * + * @param {string} [parameters.storageProfile.imageReference.version] Specifies + * the version of the platform image or marketplace image used to create the + * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the + * latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. + * + * @param {string} [parameters.storageProfile.imageReference.id] Resource Id + * + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} [parameters.storageProfile.osDisk.osType] This property + * allows you to specify the type of the OS that is included in the disk if + * creating a VM from user-image or a specialized VHD.

    Possible values + * are:

    **Windows**

    **Linux**. Possible values include: + * 'Windows', 'Linux' + * + * @param {object} [parameters.storageProfile.osDisk.encryptionSettings] + * Specifies the encryption settings for the OS Disk.

    Minimum + * api-version: 2015-06-15 + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey] + * Specifies the location of the disk encryption key, which is a Key Vault + * Secret. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.secretUrl + * The URL referencing a secret in a Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the secret. + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey] + * Specifies the location of the key encryption key in Key Vault. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.keyUrl + * The URL referencing a key encryption key in Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the key. + * + * @param {boolean} + * [parameters.storageProfile.osDisk.encryptionSettings.enabled] Specifies + * whether disk encryption should be enabled on the virtual machine. + * + * @param {string} [parameters.storageProfile.osDisk.name] The disk name. + * + * @param {object} [parameters.storageProfile.osDisk.vhd] The virtual hard + * disk. + * + * @param {object} [parameters.storageProfile.osDisk.image] The source user + * image virtual hard disk. The virtual hard disk will be copied before being + * attached to the virtual machine. If SourceImage is provided, the destination + * virtual hard drive must not exist. + * + * @param {string} [parameters.storageProfile.osDisk.image.uri] Specifies the + * virtual hard disk's uri. + * + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {boolean} [parameters.storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @param {string} parameters.storageProfile.osDisk.createOption Specifies how + * the virtual machine should be created.

    Possible values are:

    + * **Attach** \u2013 This value is used when you are using a specialized disk + * to create the virtual machine.

    **FromImage** \u2013 This value is + * used when you are using an image to create the virtual machine. If you are + * using a platform image, you also use the imageReference element described + * above. If you are using a marketplace image, you also use the plan element + * previously described. Possible values include: 'FromImage', 'Empty', + * 'Attach' + * + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of an empty data disk in gigabytes. This element can be used to + * overwrite the name of the disk in a virtual machine image.

    This + * value cannot be larger than 1023 GB + * + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed + * disk parameters. + * + * @param {string} + * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies + * the storage account type for the managed disk. Possible values are: + * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id + * + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {object} [parameters.osProfile] Specifies the operating system + * settings for the virtual machine. + * + * @param {string} [parameters.osProfile.computerName] Specifies the host OS + * name of the virtual machine.

    **Max-length (Windows):** 15 + * characters

    **Max-length (Linux):** 64 characters.

    For + * naming conventions and restrictions see [Azure infrastructure services + * implementation + * guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). + * + * @param {string} [parameters.osProfile.adminUsername] Specifies the name of + * the administrator account.

    **Windows-only restriction:** Cannot end + * in "."

    **Disallowed values:** "administrator", "admin", "user", + * "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", + * "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", + * "john", "owner", "root", "server", "sql", "support", "support_388945a0", + * "sys", "test2", "test3", "user4", "user5".

    **Minimum-length + * (Linux):** 1 character

    **Max-length (Linux):** 64 characters + *

    **Max-length (Windows):** 20 characters

  • For root + * access to the Linux VM, see [Using root privileges on Linux virtual machines + * in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in this + * field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {string} [parameters.osProfile.adminPassword] Specifies the password + * of the administrator account.

    **Minimum-length (Windows):** 8 + * characters

    **Minimum-length (Linux):** 6 characters

    + * **Max-length (Windows):** 123 characters

    **Max-length (Linux):** 72 + * characters

    **Complexity requirements:** 3 out of 4 conditions below + * need to be fulfilled
    Has lower characters
    Has upper characters
    + * Has a digit
    Has a special character (Regex match [\W_])

    + * **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", + * "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", + * "iloveyou!"

    For resetting the password, see [How to reset the + * Remote Desktop service or its login password in a Windows + * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    For resetting root password, see [Manage users, SSH, and check or + * repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + * + * @param {string} [parameters.osProfile.customData] Specifies a base-64 + * encoded string of custom data. The base-64 encoded string is decoded to a + * binary array that is saved as a file on the Virtual Machine. The maximum + * length of the binary array is 65535 bytes.

    For using cloud-init for + * your VM, see [Using cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {object} [parameters.osProfile.windowsConfiguration] Specifies + * Windows operating system settings on the virtual machine. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.provisionVMAgent] Indicates + * whether virtual machine agent should be provisioned on the virtual machine. + *

    When this property is not specified in the request body, default + * behavior is to set it to true. This will ensure that VM Agent is installed + * on the VM so that extensions can be added to the VM later. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.enableAutomaticUpdates] Indicates + * whether virtual machine is enabled for automatic updates. + * + * @param {string} [parameters.osProfile.windowsConfiguration.timeZone] + * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" + * + * @param {array} + * [parameters.osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * + * @param {object} [parameters.osProfile.windowsConfiguration.winRM] Specifies + * the Windows Remote Management listeners. This enables remote Windows + * PowerShell. + * + * @param {array} [parameters.osProfile.windowsConfiguration.winRM.listeners] + * The list of Windows Remote Management listeners + * + * @param {object} [parameters.osProfile.linuxConfiguration] Specifies the + * Linux operating system settings on the virtual machine.

    For a list + * of supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @param {boolean} + * [parameters.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * + * @param {object} [parameters.osProfile.linuxConfiguration.ssh] Specifies the + * ssh key configuration for a Linux OS. + * + * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The + * list of SSH public keys used to authenticate with linux based VMs. + * + * @param {array} [parameters.osProfile.secrets] Specifies set of certificates + * that should be installed onto the virtual machine. + * + * @param {object} [parameters.networkProfile] Specifies the network interfaces + * of the virtual machine. + * + * @param {array} [parameters.networkProfile.networkInterfaces] Specifies the + * list of resource Ids for the network interfaces associated with the virtual + * machine. + * + * @param {object} [parameters.diagnosticsProfile] Specifies the boot + * diagnostic settings state.

    Minimum api-version: 2015-06-15. + * + * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, + * you can easily view the output of your console log.

    For both + * Windows and Linux virtual machines, Azure also enables you to see a + * screenshot of the VM from the hypervisor. + * + * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] + * Whether boot diagnostics should be enabled on the Virtual Machine. + * + * @param {string} [parameters.diagnosticsProfile.bootDiagnostics.storageUri] + * Uri of the storage account to use for placing the console output and + * screenshot. + * + * @param {object} [parameters.availabilitySet] Specifies information about the + * availability set that the virtual machine should be assigned to. Virtual + * machines specified in the same availability set are allocated to different + * nodes to maximize availability. For more information about availability + * sets, see [Manage the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    For more information on Azure planned maintainance, see [Planned + * maintenance for virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Currently, a VM can only be added to availability set at creation + * time. An existing VM cannot be added to an availability set. + * + * @param {string} [parameters.availabilitySet.id] Resource Id + * + * @param {string} [parameters.licenseType] Specifies that the image or disk + * that is being used was licensed on-premises. This element is only used for + * images that contain the Windows Server operating system.

    Possible + * values are:

    Windows_Client

    Windows_Server

    If this + * element is included in a request for an update, the value must match the + * initial value. This value cannot be updated.

    For more information, + * see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Minimum api-version: 2015-06-15 + * + * @param {object} [parameters.identity] The identity of the virtual machine, + * if configured. + * + * @param {string} [parameters.identity.type] The type of identity used for the + * virtual machine. The type 'SystemAssigned, UserAssigned' includes both an + * implicitly created identity and a set of user assigned identities. The type + * 'None' will remove any identities from the virtual machine. Possible values + * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', + * 'None' + * + * @param {array} [parameters.identity.identityIds] The list of user identities + * associated with the Virtual Machine. The user identity references will be + * ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * + * @param {array} [parameters.zones] The virtual machine zones. + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @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 VirtualMachine} 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 _createOrUpdate(resourceGroupName, vmName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginCreateOrUpdate(resourceGroupName, vmName, parameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['VirtualMachine']().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); + }); + }); +} + + +/** + * The operation to update a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Update Virtual Machine + * operation. + * + * @param {object} [parameters.plan] Specifies information about the + * marketplace image used to create the virtual machine. This element is only + * used for marketplace images. Before you can use a marketplace image from an + * API, you must enable the image for programmatic use. In the Azure portal, + * find the marketplace image that you want to use and then click **Want to + * deploy programmatically, Get Started ->**. Enter any required information + * and then click **Save**. + * + * @param {string} [parameters.plan.name] The plan ID. + * + * @param {string} [parameters.plan.publisher] The publisher ID. + * + * @param {string} [parameters.plan.product] Specifies the product of the image + * from the marketplace. This is the same value as Offer under the + * imageReference element. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {object} [parameters.hardwareProfile] Specifies the hardware settings + * for the virtual machine. + * + * @param {string} [parameters.hardwareProfile.vmSize] Specifies the size of + * the virtual machine. For more information about virtual machine sizes, see + * [Sizes for virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    The available VM sizes depend on region and availability set. For a + * list of available sizes use these APIs:

    [List all available + * virtual machine sizes in an availability + * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) + *

    [List all available virtual machine sizes in a + * region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) + *

    [List all available virtual machine sizes for + * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). + * Possible values include: '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_B1s', 'Standard_B1ms', + * 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', + * '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_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', + * 'Standard_D32_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', + * 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', + * 'Standard_D64s_v3', '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_DS13-4_v2', 'Standard_DS13-2_v2', + * 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', 'Standard_E2_v3', + * 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', 'Standard_E32_v3', + * 'Standard_E64_v3', 'Standard_E2s_v3', 'Standard_E4s_v3', 'Standard_E8s_v3', + * 'Standard_E16s_v3', 'Standard_E32s_v3', 'Standard_E64s_v3', + * 'Standard_E32-16_v3', 'Standard_E32-8s_v3', 'Standard_E64-32s_v3', + * 'Standard_E64-16s_v3', 'Standard_F1', 'Standard_F2', 'Standard_F4', + * 'Standard_F8', 'Standard_F16', 'Standard_F1s', 'Standard_F2s', + * 'Standard_F4s', 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2', + * 'Standard_F4s_v2', 'Standard_F8s_v2', 'Standard_F16s_v2', + * 'Standard_F32s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1', + * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', + * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', + * 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8', + * 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m', + * 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', + * 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms', + * 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms', + * 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms', + * 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', + * 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2', + * 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3', + * 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s', + * 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6', + * 'Standard_NV12', 'Standard_NV24' + * + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. + * + * @param {object} [parameters.storageProfile.imageReference] Specifies + * information about the image to use. You can specify information about + * platform images, marketplace images, or virtual machine images. This element + * is required when you want to use a platform image, marketplace image, or + * virtual machine image, but is not used in other creation operations. + * + * @param {string} [parameters.storageProfile.imageReference.publisher] The + * image publisher. + * + * @param {string} [parameters.storageProfile.imageReference.offer] Specifies + * the offer of the platform image or marketplace image used to create the + * virtual machine. + * + * @param {string} [parameters.storageProfile.imageReference.sku] The image + * SKU. + * + * @param {string} [parameters.storageProfile.imageReference.version] Specifies + * the version of the platform image or marketplace image used to create the + * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the + * latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. + * + * @param {string} [parameters.storageProfile.imageReference.id] Resource Id + * + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} [parameters.storageProfile.osDisk.osType] This property + * allows you to specify the type of the OS that is included in the disk if + * creating a VM from user-image or a specialized VHD.

    Possible values + * are:

    **Windows**

    **Linux**. Possible values include: + * 'Windows', 'Linux' + * + * @param {object} [parameters.storageProfile.osDisk.encryptionSettings] + * Specifies the encryption settings for the OS Disk.

    Minimum + * api-version: 2015-06-15 + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey] + * Specifies the location of the disk encryption key, which is a Key Vault + * Secret. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.secretUrl + * The URL referencing a secret in a Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the secret. + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey] + * Specifies the location of the key encryption key in Key Vault. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.keyUrl + * The URL referencing a key encryption key in Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the key. + * + * @param {boolean} + * [parameters.storageProfile.osDisk.encryptionSettings.enabled] Specifies + * whether disk encryption should be enabled on the virtual machine. + * + * @param {string} [parameters.storageProfile.osDisk.name] The disk name. + * + * @param {object} [parameters.storageProfile.osDisk.vhd] The virtual hard + * disk. + * + * @param {object} [parameters.storageProfile.osDisk.image] The source user + * image virtual hard disk. The virtual hard disk will be copied before being + * attached to the virtual machine. If SourceImage is provided, the destination + * virtual hard drive must not exist. + * + * @param {string} [parameters.storageProfile.osDisk.image.uri] Specifies the + * virtual hard disk's uri. + * + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {boolean} [parameters.storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @param {string} parameters.storageProfile.osDisk.createOption Specifies how + * the virtual machine should be created.

    Possible values are:

    + * **Attach** \u2013 This value is used when you are using a specialized disk + * to create the virtual machine.

    **FromImage** \u2013 This value is + * used when you are using an image to create the virtual machine. If you are + * using a platform image, you also use the imageReference element described + * above. If you are using a marketplace image, you also use the plan element + * previously described. Possible values include: 'FromImage', 'Empty', + * 'Attach' + * + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of an empty data disk in gigabytes. This element can be used to + * overwrite the name of the disk in a virtual machine image.

    This + * value cannot be larger than 1023 GB + * + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed + * disk parameters. + * + * @param {string} + * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies + * the storage account type for the managed disk. Possible values are: + * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id + * + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {object} [parameters.osProfile] Specifies the operating system + * settings for the virtual machine. + * + * @param {string} [parameters.osProfile.computerName] Specifies the host OS + * name of the virtual machine.

    **Max-length (Windows):** 15 + * characters

    **Max-length (Linux):** 64 characters.

    For + * naming conventions and restrictions see [Azure infrastructure services + * implementation + * guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). + * + * @param {string} [parameters.osProfile.adminUsername] Specifies the name of + * the administrator account.

    **Windows-only restriction:** Cannot end + * in "."

    **Disallowed values:** "administrator", "admin", "user", + * "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", + * "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", + * "john", "owner", "root", "server", "sql", "support", "support_388945a0", + * "sys", "test2", "test3", "user4", "user5".

    **Minimum-length + * (Linux):** 1 character

    **Max-length (Linux):** 64 characters + *

    **Max-length (Windows):** 20 characters

  • For root + * access to the Linux VM, see [Using root privileges on Linux virtual machines + * in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in this + * field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {string} [parameters.osProfile.adminPassword] Specifies the password + * of the administrator account.

    **Minimum-length (Windows):** 8 + * characters

    **Minimum-length (Linux):** 6 characters

    + * **Max-length (Windows):** 123 characters

    **Max-length (Linux):** 72 + * characters

    **Complexity requirements:** 3 out of 4 conditions below + * need to be fulfilled
    Has lower characters
    Has upper characters
    + * Has a digit
    Has a special character (Regex match [\W_])

    + * **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", + * "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", + * "iloveyou!"

    For resetting the password, see [How to reset the + * Remote Desktop service or its login password in a Windows + * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    For resetting root password, see [Manage users, SSH, and check or + * repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + * + * @param {string} [parameters.osProfile.customData] Specifies a base-64 + * encoded string of custom data. The base-64 encoded string is decoded to a + * binary array that is saved as a file on the Virtual Machine. The maximum + * length of the binary array is 65535 bytes.

    For using cloud-init for + * your VM, see [Using cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {object} [parameters.osProfile.windowsConfiguration] Specifies + * Windows operating system settings on the virtual machine. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.provisionVMAgent] Indicates + * whether virtual machine agent should be provisioned on the virtual machine. + *

    When this property is not specified in the request body, default + * behavior is to set it to true. This will ensure that VM Agent is installed + * on the VM so that extensions can be added to the VM later. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.enableAutomaticUpdates] Indicates + * whether virtual machine is enabled for automatic updates. + * + * @param {string} [parameters.osProfile.windowsConfiguration.timeZone] + * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" + * + * @param {array} + * [parameters.osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * + * @param {object} [parameters.osProfile.windowsConfiguration.winRM] Specifies + * the Windows Remote Management listeners. This enables remote Windows + * PowerShell. + * + * @param {array} [parameters.osProfile.windowsConfiguration.winRM.listeners] + * The list of Windows Remote Management listeners + * + * @param {object} [parameters.osProfile.linuxConfiguration] Specifies the + * Linux operating system settings on the virtual machine.

    For a list + * of supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @param {boolean} + * [parameters.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * + * @param {object} [parameters.osProfile.linuxConfiguration.ssh] Specifies the + * ssh key configuration for a Linux OS. + * + * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The + * list of SSH public keys used to authenticate with linux based VMs. + * + * @param {array} [parameters.osProfile.secrets] Specifies set of certificates + * that should be installed onto the virtual machine. + * + * @param {object} [parameters.networkProfile] Specifies the network interfaces + * of the virtual machine. + * + * @param {array} [parameters.networkProfile.networkInterfaces] Specifies the + * list of resource Ids for the network interfaces associated with the virtual + * machine. + * + * @param {object} [parameters.diagnosticsProfile] Specifies the boot + * diagnostic settings state.

    Minimum api-version: 2015-06-15. + * + * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, + * you can easily view the output of your console log.

    For both + * Windows and Linux virtual machines, Azure also enables you to see a + * screenshot of the VM from the hypervisor. + * + * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] + * Whether boot diagnostics should be enabled on the Virtual Machine. + * + * @param {string} [parameters.diagnosticsProfile.bootDiagnostics.storageUri] + * Uri of the storage account to use for placing the console output and + * screenshot. + * + * @param {object} [parameters.availabilitySet] Specifies information about the + * availability set that the virtual machine should be assigned to. Virtual + * machines specified in the same availability set are allocated to different + * nodes to maximize availability. For more information about availability + * sets, see [Manage the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    For more information on Azure planned maintainance, see [Planned + * maintenance for virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Currently, a VM can only be added to availability set at creation + * time. An existing VM cannot be added to an availability set. + * + * @param {string} [parameters.availabilitySet.id] Resource Id + * + * @param {string} [parameters.licenseType] Specifies that the image or disk + * that is being used was licensed on-premises. This element is only used for + * images that contain the Windows Server operating system.

    Possible + * values are:

    Windows_Client

    Windows_Server

    If this + * element is included in a request for an update, the value must match the + * initial value. This value cannot be updated.

    For more information, + * see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Minimum api-version: 2015-06-15 + * + * @param {object} [parameters.identity] The identity of the virtual machine, + * if configured. + * + * @param {string} [parameters.identity.type] The type of identity used for the + * virtual machine. The type 'SystemAssigned, UserAssigned' includes both an + * implicitly created identity and a set of user assigned identities. The type + * 'None' will remove any identities from the virtual machine. Possible values + * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', + * 'None' + * + * @param {array} [parameters.identity.identityIds] The list of user identities + * associated with the Virtual Machine. The user identity references will be + * ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * + * @param {array} [parameters.zones] The virtual machine zones. + * + * @param {object} [parameters.tags] Resource tags + * + * @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 VirtualMachine} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _update(resourceGroupName, vmName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginUpdate(resourceGroupName, vmName, parameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['VirtualMachine']().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); + }); + }); +} + + +/** + * The operation to delete a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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 OperationStatusResponse} 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 _deleteMethod(resourceGroupName, vmName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginDeleteMethod(resourceGroupName, vmName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().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); + }); + }); +} + +/** + * Retrieves information about the model view or the instance view of a virtual + * machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] The expand expression to apply on the + * operation. Possible values include: 'instanceView' + * + * @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 VirtualMachine} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, vmName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let expand = (options && options.expand !== undefined) ? options.expand : undefined; + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmName === null || vmName === undefined || typeof vmName.valueOf() !== 'string') { + throw new Error('vmName cannot be null or undefined and it must be of type string.'); + } + if (expand) { + let allowedValues = [ 'instanceView' ]; + if (!allowedValues.some( function(item) { return item === expand; })) { + throw new Error(expand + ' is not a valid value. The valid values are: ' + allowedValues); + } + } + 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmName}', encodeURIComponent(vmName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (expand !== null && expand !== undefined) { + queryParameters.push('$expand=' + encodeURIComponent(expand)); + } + queryParameters.push('api-version=' + encodeURIComponent(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['VirtualMachine']().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); + }); +} + +/** + * Retrieves information about the run-time state of a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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 VirtualMachineInstanceView} 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 _instanceView(resourceGroupName, vmName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmName === null || vmName === undefined || typeof vmName.valueOf() !== 'string') { + throw new Error('vmName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/instanceView'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmName}', encodeURIComponent(vmName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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['VirtualMachineInstanceView']().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); + }); +} + + +/** + * Converts virtual machine disks from blob-based to managed disks. Virtual + * machine must be stop-deallocated before invoking this operation. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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 OperationStatusResponse} 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 _convertToManagedDisks(resourceGroupName, vmName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginConvertToManagedDisks(resourceGroupName, vmName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().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); + }); + }); +} + + +/** + * Shuts down the virtual machine and releases the compute resources. You are + * not billed for the compute resources that this virtual machine uses. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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 OperationStatusResponse} 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 _deallocate(resourceGroupName, vmName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginDeallocate(resourceGroupName, vmName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().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); + }); + }); +} + +/** + * Sets the state of the virtual machine to generalized. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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 OperationStatusResponse} 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 _generalize(resourceGroupName, vmName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmName === null || vmName === undefined || typeof vmName.valueOf() !== 'string') { + throw new Error('vmName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/generalize'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmName}', encodeURIComponent(vmName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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]; + } + } + } + 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['OperationStatusResponse']().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); + }); +} + +/** + * Lists all of the virtual machines in the specified resource group. Use the + * nextLink property in the response to get the next page of virtual machines. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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 VirtualMachineListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(resourceGroupName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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['VirtualMachineListResult']().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); + }); +} + +/** + * Lists all of the virtual machines in the specified subscription. Use the + * nextLink property in the response to get the next page of virtual machines. + * + * @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 VirtualMachineListResult} 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 _listAll(options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // 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.Compute/virtualMachines'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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['VirtualMachineListResult']().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); + }); +} + +/** + * Lists all available virtual machine sizes to which the specified virtual + * machine can be resized. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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 VirtualMachineSizeListResult} 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 _listAvailableSizes(resourceGroupName, vmName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmName === null || vmName === undefined || typeof vmName.valueOf() !== 'string') { + throw new Error('vmName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/vmSizes'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmName}', encodeURIComponent(vmName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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['VirtualMachineSizeListResult']().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); + }); +} + + +/** + * The operation to power off (stop) a virtual machine. The virtual machine can + * be restarted with the same provisioned resources. You are still charged for + * this virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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 OperationStatusResponse} 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 _powerOff(resourceGroupName, vmName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginPowerOff(resourceGroupName, vmName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().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); + }); + }); +} + + +/** + * The operation to restart a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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 OperationStatusResponse} 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 _restart(resourceGroupName, vmName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginRestart(resourceGroupName, vmName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().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); + }); + }); +} + + +/** + * The operation to start a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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 OperationStatusResponse} 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 _start(resourceGroupName, vmName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginStart(resourceGroupName, vmName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().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); + }); + }); +} + + +/** + * The operation to redeploy a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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 OperationStatusResponse} 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 _redeploy(resourceGroupName, vmName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginRedeploy(resourceGroupName, vmName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().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); + }); + }); +} + + +/** + * The operation to perform maintenance on a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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 OperationStatusResponse} 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 _performMaintenance(resourceGroupName, vmName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginPerformMaintenance(resourceGroupName, vmName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().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); + }); + }); +} + + +/** + * Run command on the VM. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Run command operation. + * + * @param {string} parameters.commandId The run command id. + * + * @param {array} [parameters.script] Optional. The script to be executed. + * When this value is given, the given script will override the default script + * of the command. + * + * @param {array} [parameters.parameters] The run command parameters. + * + * @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 RunCommandResult} 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 _runCommand(resourceGroupName, vmName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginRunCommand(resourceGroupName, vmName, parameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['RunCommandResult']().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); + }); + }); +} + +/** + * Captures the VM by copying virtual hard disks of the VM and outputs a + * template that can be used to create similar VMs. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Capture Virtual + * Machine operation. + * + * @param {string} parameters.vhdPrefix The captured virtual hard disk's name + * prefix. + * + * @param {string} parameters.destinationContainerName The destination + * container name. + * + * @param {boolean} parameters.overwriteVhds Specifies whether to overwrite the + * destination virtual hard disk, in case of conflict. + * + * @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 VirtualMachineCaptureResult} 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 _beginCapture(resourceGroupName, vmName, 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.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmName === null || vmName === undefined || typeof vmName.valueOf() !== 'string') { + throw new Error('vmName 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.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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/capture'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmName}', encodeURIComponent(vmName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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['VirtualMachineCaptureParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + 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['VirtualMachineCaptureResult']().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); + }); +} + +/** + * The operation to create or update a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Create Virtual Machine + * operation. + * + * @param {object} [parameters.plan] Specifies information about the + * marketplace image used to create the virtual machine. This element is only + * used for marketplace images. Before you can use a marketplace image from an + * API, you must enable the image for programmatic use. In the Azure portal, + * find the marketplace image that you want to use and then click **Want to + * deploy programmatically, Get Started ->**. Enter any required information + * and then click **Save**. + * + * @param {string} [parameters.plan.name] The plan ID. + * + * @param {string} [parameters.plan.publisher] The publisher ID. + * + * @param {string} [parameters.plan.product] Specifies the product of the image + * from the marketplace. This is the same value as Offer under the + * imageReference element. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {object} [parameters.hardwareProfile] Specifies the hardware settings + * for the virtual machine. + * + * @param {string} [parameters.hardwareProfile.vmSize] Specifies the size of + * the virtual machine. For more information about virtual machine sizes, see + * [Sizes for virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    The available VM sizes depend on region and availability set. For a + * list of available sizes use these APIs:

    [List all available + * virtual machine sizes in an availability + * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) + *

    [List all available virtual machine sizes in a + * region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) + *

    [List all available virtual machine sizes for + * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). + * Possible values include: '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_B1s', 'Standard_B1ms', + * 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', + * '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_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', + * 'Standard_D32_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', + * 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', + * 'Standard_D64s_v3', '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_DS13-4_v2', 'Standard_DS13-2_v2', + * 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', 'Standard_E2_v3', + * 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', 'Standard_E32_v3', + * 'Standard_E64_v3', 'Standard_E2s_v3', 'Standard_E4s_v3', 'Standard_E8s_v3', + * 'Standard_E16s_v3', 'Standard_E32s_v3', 'Standard_E64s_v3', + * 'Standard_E32-16_v3', 'Standard_E32-8s_v3', 'Standard_E64-32s_v3', + * 'Standard_E64-16s_v3', 'Standard_F1', 'Standard_F2', 'Standard_F4', + * 'Standard_F8', 'Standard_F16', 'Standard_F1s', 'Standard_F2s', + * 'Standard_F4s', 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2', + * 'Standard_F4s_v2', 'Standard_F8s_v2', 'Standard_F16s_v2', + * 'Standard_F32s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1', + * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', + * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', + * 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8', + * 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m', + * 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', + * 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms', + * 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms', + * 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms', + * 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', + * 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2', + * 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3', + * 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s', + * 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6', + * 'Standard_NV12', 'Standard_NV24' + * + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. + * + * @param {object} [parameters.storageProfile.imageReference] Specifies + * information about the image to use. You can specify information about + * platform images, marketplace images, or virtual machine images. This element + * is required when you want to use a platform image, marketplace image, or + * virtual machine image, but is not used in other creation operations. + * + * @param {string} [parameters.storageProfile.imageReference.publisher] The + * image publisher. + * + * @param {string} [parameters.storageProfile.imageReference.offer] Specifies + * the offer of the platform image or marketplace image used to create the + * virtual machine. + * + * @param {string} [parameters.storageProfile.imageReference.sku] The image + * SKU. + * + * @param {string} [parameters.storageProfile.imageReference.version] Specifies + * the version of the platform image or marketplace image used to create the + * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the + * latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. + * + * @param {string} [parameters.storageProfile.imageReference.id] Resource Id + * + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} [parameters.storageProfile.osDisk.osType] This property + * allows you to specify the type of the OS that is included in the disk if + * creating a VM from user-image or a specialized VHD.

    Possible values + * are:

    **Windows**

    **Linux**. Possible values include: + * 'Windows', 'Linux' + * + * @param {object} [parameters.storageProfile.osDisk.encryptionSettings] + * Specifies the encryption settings for the OS Disk.

    Minimum + * api-version: 2015-06-15 + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey] + * Specifies the location of the disk encryption key, which is a Key Vault + * Secret. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.secretUrl + * The URL referencing a secret in a Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the secret. + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey] + * Specifies the location of the key encryption key in Key Vault. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.keyUrl + * The URL referencing a key encryption key in Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the key. + * + * @param {boolean} + * [parameters.storageProfile.osDisk.encryptionSettings.enabled] Specifies + * whether disk encryption should be enabled on the virtual machine. + * + * @param {string} [parameters.storageProfile.osDisk.name] The disk name. + * + * @param {object} [parameters.storageProfile.osDisk.vhd] The virtual hard + * disk. + * + * @param {object} [parameters.storageProfile.osDisk.image] The source user + * image virtual hard disk. The virtual hard disk will be copied before being + * attached to the virtual machine. If SourceImage is provided, the destination + * virtual hard drive must not exist. + * + * @param {string} [parameters.storageProfile.osDisk.image.uri] Specifies the + * virtual hard disk's uri. + * + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {boolean} [parameters.storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @param {string} parameters.storageProfile.osDisk.createOption Specifies how + * the virtual machine should be created.

    Possible values are:

    + * **Attach** \u2013 This value is used when you are using a specialized disk + * to create the virtual machine.

    **FromImage** \u2013 This value is + * used when you are using an image to create the virtual machine. If you are + * using a platform image, you also use the imageReference element described + * above. If you are using a marketplace image, you also use the plan element + * previously described. Possible values include: 'FromImage', 'Empty', + * 'Attach' + * + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of an empty data disk in gigabytes. This element can be used to + * overwrite the name of the disk in a virtual machine image.

    This + * value cannot be larger than 1023 GB + * + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed + * disk parameters. + * + * @param {string} + * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies + * the storage account type for the managed disk. Possible values are: + * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id + * + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {object} [parameters.osProfile] Specifies the operating system + * settings for the virtual machine. + * + * @param {string} [parameters.osProfile.computerName] Specifies the host OS + * name of the virtual machine.

    **Max-length (Windows):** 15 + * characters

    **Max-length (Linux):** 64 characters.

    For + * naming conventions and restrictions see [Azure infrastructure services + * implementation + * guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). + * + * @param {string} [parameters.osProfile.adminUsername] Specifies the name of + * the administrator account.

    **Windows-only restriction:** Cannot end + * in "."

    **Disallowed values:** "administrator", "admin", "user", + * "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", + * "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", + * "john", "owner", "root", "server", "sql", "support", "support_388945a0", + * "sys", "test2", "test3", "user4", "user5".

    **Minimum-length + * (Linux):** 1 character

    **Max-length (Linux):** 64 characters + *

    **Max-length (Windows):** 20 characters

  • For root + * access to the Linux VM, see [Using root privileges on Linux virtual machines + * in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in this + * field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {string} [parameters.osProfile.adminPassword] Specifies the password + * of the administrator account.

    **Minimum-length (Windows):** 8 + * characters

    **Minimum-length (Linux):** 6 characters

    + * **Max-length (Windows):** 123 characters

    **Max-length (Linux):** 72 + * characters

    **Complexity requirements:** 3 out of 4 conditions below + * need to be fulfilled
    Has lower characters
    Has upper characters
    + * Has a digit
    Has a special character (Regex match [\W_])

    + * **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", + * "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", + * "iloveyou!"

    For resetting the password, see [How to reset the + * Remote Desktop service or its login password in a Windows + * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    For resetting root password, see [Manage users, SSH, and check or + * repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + * + * @param {string} [parameters.osProfile.customData] Specifies a base-64 + * encoded string of custom data. The base-64 encoded string is decoded to a + * binary array that is saved as a file on the Virtual Machine. The maximum + * length of the binary array is 65535 bytes.

    For using cloud-init for + * your VM, see [Using cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {object} [parameters.osProfile.windowsConfiguration] Specifies + * Windows operating system settings on the virtual machine. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.provisionVMAgent] Indicates + * whether virtual machine agent should be provisioned on the virtual machine. + *

    When this property is not specified in the request body, default + * behavior is to set it to true. This will ensure that VM Agent is installed + * on the VM so that extensions can be added to the VM later. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.enableAutomaticUpdates] Indicates + * whether virtual machine is enabled for automatic updates. + * + * @param {string} [parameters.osProfile.windowsConfiguration.timeZone] + * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" + * + * @param {array} + * [parameters.osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * + * @param {object} [parameters.osProfile.windowsConfiguration.winRM] Specifies + * the Windows Remote Management listeners. This enables remote Windows + * PowerShell. + * + * @param {array} [parameters.osProfile.windowsConfiguration.winRM.listeners] + * The list of Windows Remote Management listeners + * + * @param {object} [parameters.osProfile.linuxConfiguration] Specifies the + * Linux operating system settings on the virtual machine.

    For a list + * of supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @param {boolean} + * [parameters.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * + * @param {object} [parameters.osProfile.linuxConfiguration.ssh] Specifies the + * ssh key configuration for a Linux OS. + * + * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The + * list of SSH public keys used to authenticate with linux based VMs. + * + * @param {array} [parameters.osProfile.secrets] Specifies set of certificates + * that should be installed onto the virtual machine. + * + * @param {object} [parameters.networkProfile] Specifies the network interfaces + * of the virtual machine. + * + * @param {array} [parameters.networkProfile.networkInterfaces] Specifies the + * list of resource Ids for the network interfaces associated with the virtual + * machine. + * + * @param {object} [parameters.diagnosticsProfile] Specifies the boot + * diagnostic settings state.

    Minimum api-version: 2015-06-15. + * + * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, + * you can easily view the output of your console log.

    For both + * Windows and Linux virtual machines, Azure also enables you to see a + * screenshot of the VM from the hypervisor. + * + * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] + * Whether boot diagnostics should be enabled on the Virtual Machine. + * + * @param {string} [parameters.diagnosticsProfile.bootDiagnostics.storageUri] + * Uri of the storage account to use for placing the console output and + * screenshot. + * + * @param {object} [parameters.availabilitySet] Specifies information about the + * availability set that the virtual machine should be assigned to. Virtual + * machines specified in the same availability set are allocated to different + * nodes to maximize availability. For more information about availability + * sets, see [Manage the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    For more information on Azure planned maintainance, see [Planned + * maintenance for virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Currently, a VM can only be added to availability set at creation + * time. An existing VM cannot be added to an availability set. + * + * @param {string} [parameters.availabilitySet.id] Resource Id + * + * @param {string} [parameters.licenseType] Specifies that the image or disk + * that is being used was licensed on-premises. This element is only used for + * images that contain the Windows Server operating system.

    Possible + * values are:

    Windows_Client

    Windows_Server

    If this + * element is included in a request for an update, the value must match the + * initial value. This value cannot be updated.

    For more information, + * see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Minimum api-version: 2015-06-15 + * + * @param {object} [parameters.identity] The identity of the virtual machine, + * if configured. + * + * @param {string} [parameters.identity.type] The type of identity used for the + * virtual machine. The type 'SystemAssigned, UserAssigned' includes both an + * implicitly created identity and a set of user assigned identities. The type + * 'None' will remove any identities from the virtual machine. Possible values + * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', + * 'None' + * + * @param {array} [parameters.identity.identityIds] The list of user identities + * associated with the Virtual Machine. The user identity references will be + * ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * + * @param {array} [parameters.zones] The virtual machine zones. + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @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 VirtualMachine} 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 _beginCreateOrUpdate(resourceGroupName, vmName, 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.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmName === null || vmName === undefined || typeof vmName.valueOf() !== 'string') { + throw new Error('vmName 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.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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmName}', encodeURIComponent(vmName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['VirtualMachine']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + 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['VirtualMachine']().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); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['VirtualMachine']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * The operation to update a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Update Virtual Machine + * operation. + * + * @param {object} [parameters.plan] Specifies information about the + * marketplace image used to create the virtual machine. This element is only + * used for marketplace images. Before you can use a marketplace image from an + * API, you must enable the image for programmatic use. In the Azure portal, + * find the marketplace image that you want to use and then click **Want to + * deploy programmatically, Get Started ->**. Enter any required information + * and then click **Save**. + * + * @param {string} [parameters.plan.name] The plan ID. + * + * @param {string} [parameters.plan.publisher] The publisher ID. + * + * @param {string} [parameters.plan.product] Specifies the product of the image + * from the marketplace. This is the same value as Offer under the + * imageReference element. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {object} [parameters.hardwareProfile] Specifies the hardware settings + * for the virtual machine. + * + * @param {string} [parameters.hardwareProfile.vmSize] Specifies the size of + * the virtual machine. For more information about virtual machine sizes, see + * [Sizes for virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    The available VM sizes depend on region and availability set. For a + * list of available sizes use these APIs:

    [List all available + * virtual machine sizes in an availability + * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) + *

    [List all available virtual machine sizes in a + * region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) + *

    [List all available virtual machine sizes for + * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). + * Possible values include: '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_B1s', 'Standard_B1ms', + * 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', + * '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_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', + * 'Standard_D32_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', + * 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', + * 'Standard_D64s_v3', '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_DS13-4_v2', 'Standard_DS13-2_v2', + * 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', 'Standard_E2_v3', + * 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', 'Standard_E32_v3', + * 'Standard_E64_v3', 'Standard_E2s_v3', 'Standard_E4s_v3', 'Standard_E8s_v3', + * 'Standard_E16s_v3', 'Standard_E32s_v3', 'Standard_E64s_v3', + * 'Standard_E32-16_v3', 'Standard_E32-8s_v3', 'Standard_E64-32s_v3', + * 'Standard_E64-16s_v3', 'Standard_F1', 'Standard_F2', 'Standard_F4', + * 'Standard_F8', 'Standard_F16', 'Standard_F1s', 'Standard_F2s', + * 'Standard_F4s', 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2', + * 'Standard_F4s_v2', 'Standard_F8s_v2', 'Standard_F16s_v2', + * 'Standard_F32s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1', + * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', + * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', + * 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8', + * 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m', + * 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', + * 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms', + * 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms', + * 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms', + * 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', + * 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2', + * 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3', + * 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s', + * 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6', + * 'Standard_NV12', 'Standard_NV24' + * + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. + * + * @param {object} [parameters.storageProfile.imageReference] Specifies + * information about the image to use. You can specify information about + * platform images, marketplace images, or virtual machine images. This element + * is required when you want to use a platform image, marketplace image, or + * virtual machine image, but is not used in other creation operations. + * + * @param {string} [parameters.storageProfile.imageReference.publisher] The + * image publisher. + * + * @param {string} [parameters.storageProfile.imageReference.offer] Specifies + * the offer of the platform image or marketplace image used to create the + * virtual machine. + * + * @param {string} [parameters.storageProfile.imageReference.sku] The image + * SKU. + * + * @param {string} [parameters.storageProfile.imageReference.version] Specifies + * the version of the platform image or marketplace image used to create the + * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the + * latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. + * + * @param {string} [parameters.storageProfile.imageReference.id] Resource Id + * + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} [parameters.storageProfile.osDisk.osType] This property + * allows you to specify the type of the OS that is included in the disk if + * creating a VM from user-image or a specialized VHD.

    Possible values + * are:

    **Windows**

    **Linux**. Possible values include: + * 'Windows', 'Linux' + * + * @param {object} [parameters.storageProfile.osDisk.encryptionSettings] + * Specifies the encryption settings for the OS Disk.

    Minimum + * api-version: 2015-06-15 + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey] + * Specifies the location of the disk encryption key, which is a Key Vault + * Secret. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.secretUrl + * The URL referencing a secret in a Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the secret. + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey] + * Specifies the location of the key encryption key in Key Vault. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.keyUrl + * The URL referencing a key encryption key in Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the key. + * + * @param {boolean} + * [parameters.storageProfile.osDisk.encryptionSettings.enabled] Specifies + * whether disk encryption should be enabled on the virtual machine. + * + * @param {string} [parameters.storageProfile.osDisk.name] The disk name. + * + * @param {object} [parameters.storageProfile.osDisk.vhd] The virtual hard + * disk. + * + * @param {object} [parameters.storageProfile.osDisk.image] The source user + * image virtual hard disk. The virtual hard disk will be copied before being + * attached to the virtual machine. If SourceImage is provided, the destination + * virtual hard drive must not exist. + * + * @param {string} [parameters.storageProfile.osDisk.image.uri] Specifies the + * virtual hard disk's uri. + * + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {boolean} [parameters.storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @param {string} parameters.storageProfile.osDisk.createOption Specifies how + * the virtual machine should be created.

    Possible values are:

    + * **Attach** \u2013 This value is used when you are using a specialized disk + * to create the virtual machine.

    **FromImage** \u2013 This value is + * used when you are using an image to create the virtual machine. If you are + * using a platform image, you also use the imageReference element described + * above. If you are using a marketplace image, you also use the plan element + * previously described. Possible values include: 'FromImage', 'Empty', + * 'Attach' + * + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of an empty data disk in gigabytes. This element can be used to + * overwrite the name of the disk in a virtual machine image.

    This + * value cannot be larger than 1023 GB + * + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed + * disk parameters. + * + * @param {string} + * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies + * the storage account type for the managed disk. Possible values are: + * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id + * + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {object} [parameters.osProfile] Specifies the operating system + * settings for the virtual machine. + * + * @param {string} [parameters.osProfile.computerName] Specifies the host OS + * name of the virtual machine.

    **Max-length (Windows):** 15 + * characters

    **Max-length (Linux):** 64 characters.

    For + * naming conventions and restrictions see [Azure infrastructure services + * implementation + * guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). + * + * @param {string} [parameters.osProfile.adminUsername] Specifies the name of + * the administrator account.

    **Windows-only restriction:** Cannot end + * in "."

    **Disallowed values:** "administrator", "admin", "user", + * "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", + * "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", + * "john", "owner", "root", "server", "sql", "support", "support_388945a0", + * "sys", "test2", "test3", "user4", "user5".

    **Minimum-length + * (Linux):** 1 character

    **Max-length (Linux):** 64 characters + *

    **Max-length (Windows):** 20 characters

  • For root + * access to the Linux VM, see [Using root privileges on Linux virtual machines + * in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in this + * field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {string} [parameters.osProfile.adminPassword] Specifies the password + * of the administrator account.

    **Minimum-length (Windows):** 8 + * characters

    **Minimum-length (Linux):** 6 characters

    + * **Max-length (Windows):** 123 characters

    **Max-length (Linux):** 72 + * characters

    **Complexity requirements:** 3 out of 4 conditions below + * need to be fulfilled
    Has lower characters
    Has upper characters
    + * Has a digit
    Has a special character (Regex match [\W_])

    + * **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", + * "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", + * "iloveyou!"

    For resetting the password, see [How to reset the + * Remote Desktop service or its login password in a Windows + * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    For resetting root password, see [Manage users, SSH, and check or + * repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + * + * @param {string} [parameters.osProfile.customData] Specifies a base-64 + * encoded string of custom data. The base-64 encoded string is decoded to a + * binary array that is saved as a file on the Virtual Machine. The maximum + * length of the binary array is 65535 bytes.

    For using cloud-init for + * your VM, see [Using cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {object} [parameters.osProfile.windowsConfiguration] Specifies + * Windows operating system settings on the virtual machine. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.provisionVMAgent] Indicates + * whether virtual machine agent should be provisioned on the virtual machine. + *

    When this property is not specified in the request body, default + * behavior is to set it to true. This will ensure that VM Agent is installed + * on the VM so that extensions can be added to the VM later. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.enableAutomaticUpdates] Indicates + * whether virtual machine is enabled for automatic updates. + * + * @param {string} [parameters.osProfile.windowsConfiguration.timeZone] + * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" + * + * @param {array} + * [parameters.osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * + * @param {object} [parameters.osProfile.windowsConfiguration.winRM] Specifies + * the Windows Remote Management listeners. This enables remote Windows + * PowerShell. + * + * @param {array} [parameters.osProfile.windowsConfiguration.winRM.listeners] + * The list of Windows Remote Management listeners + * + * @param {object} [parameters.osProfile.linuxConfiguration] Specifies the + * Linux operating system settings on the virtual machine.

    For a list + * of supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @param {boolean} + * [parameters.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * + * @param {object} [parameters.osProfile.linuxConfiguration.ssh] Specifies the + * ssh key configuration for a Linux OS. + * + * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The + * list of SSH public keys used to authenticate with linux based VMs. + * + * @param {array} [parameters.osProfile.secrets] Specifies set of certificates + * that should be installed onto the virtual machine. + * + * @param {object} [parameters.networkProfile] Specifies the network interfaces + * of the virtual machine. + * + * @param {array} [parameters.networkProfile.networkInterfaces] Specifies the + * list of resource Ids for the network interfaces associated with the virtual + * machine. + * + * @param {object} [parameters.diagnosticsProfile] Specifies the boot + * diagnostic settings state.

    Minimum api-version: 2015-06-15. + * + * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, + * you can easily view the output of your console log.

    For both + * Windows and Linux virtual machines, Azure also enables you to see a + * screenshot of the VM from the hypervisor. + * + * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] + * Whether boot diagnostics should be enabled on the Virtual Machine. + * + * @param {string} [parameters.diagnosticsProfile.bootDiagnostics.storageUri] + * Uri of the storage account to use for placing the console output and + * screenshot. + * + * @param {object} [parameters.availabilitySet] Specifies information about the + * availability set that the virtual machine should be assigned to. Virtual + * machines specified in the same availability set are allocated to different + * nodes to maximize availability. For more information about availability + * sets, see [Manage the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    For more information on Azure planned maintainance, see [Planned + * maintenance for virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Currently, a VM can only be added to availability set at creation + * time. An existing VM cannot be added to an availability set. + * + * @param {string} [parameters.availabilitySet.id] Resource Id + * + * @param {string} [parameters.licenseType] Specifies that the image or disk + * that is being used was licensed on-premises. This element is only used for + * images that contain the Windows Server operating system.

    Possible + * values are:

    Windows_Client

    Windows_Server

    If this + * element is included in a request for an update, the value must match the + * initial value. This value cannot be updated.

    For more information, + * see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Minimum api-version: 2015-06-15 + * + * @param {object} [parameters.identity] The identity of the virtual machine, + * if configured. + * + * @param {string} [parameters.identity.type] The type of identity used for the + * virtual machine. The type 'SystemAssigned, UserAssigned' includes both an + * implicitly created identity and a set of user assigned identities. The type + * 'None' will remove any identities from the virtual machine. Possible values + * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', + * 'None' + * + * @param {array} [parameters.identity.identityIds] The list of user identities + * associated with the Virtual Machine. The user identity references will be + * ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * + * @param {array} [parameters.zones] The virtual machine zones. + * + * @param {object} [parameters.tags] Resource tags + * + * @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 VirtualMachine} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginUpdate(resourceGroupName, vmName, 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.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmName === null || vmName === undefined || typeof vmName.valueOf() !== 'string') { + throw new Error('vmName 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.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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmName}', encodeURIComponent(vmName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['VirtualMachineUpdate']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + 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['VirtualMachine']().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); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['VirtualMachine']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * The operation to delete a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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 OperationStatusResponse} 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 _beginDeleteMethod(resourceGroupName, vmName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmName === null || vmName === undefined || typeof vmName.valueOf() !== 'string') { + throw new Error('vmName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmName}', encodeURIComponent(vmName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // 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['OperationStatusResponse']().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); + }); +} + +/** + * Converts virtual machine disks from blob-based to managed disks. Virtual + * machine must be stop-deallocated before invoking this operation. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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 OperationStatusResponse} 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 _beginConvertToManagedDisks(resourceGroupName, vmName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmName === null || vmName === undefined || typeof vmName.valueOf() !== 'string') { + throw new Error('vmName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/convertToManagedDisks'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmName}', encodeURIComponent(vmName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().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); + }); +} + +/** + * Shuts down the virtual machine and releases the compute resources. You are + * not billed for the compute resources that this virtual machine uses. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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 OperationStatusResponse} 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 _beginDeallocate(resourceGroupName, vmName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmName === null || vmName === undefined || typeof vmName.valueOf() !== 'string') { + throw new Error('vmName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/deallocate'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmName}', encodeURIComponent(vmName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().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); + }); +} + +/** + * The operation to power off (stop) a virtual machine. The virtual machine can + * be restarted with the same provisioned resources. You are still charged for + * this virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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 OperationStatusResponse} 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 _beginPowerOff(resourceGroupName, vmName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmName === null || vmName === undefined || typeof vmName.valueOf() !== 'string') { + throw new Error('vmName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/powerOff'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmName}', encodeURIComponent(vmName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().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); + }); +} + +/** + * The operation to restart a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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 OperationStatusResponse} 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 _beginRestart(resourceGroupName, vmName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmName === null || vmName === undefined || typeof vmName.valueOf() !== 'string') { + throw new Error('vmName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/restart'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmName}', encodeURIComponent(vmName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().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); + }); +} + +/** + * The operation to start a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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 OperationStatusResponse} 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 _beginStart(resourceGroupName, vmName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmName === null || vmName === undefined || typeof vmName.valueOf() !== 'string') { + throw new Error('vmName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/start'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmName}', encodeURIComponent(vmName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().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); + }); +} + +/** + * The operation to redeploy a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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 OperationStatusResponse} 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 _beginRedeploy(resourceGroupName, vmName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmName === null || vmName === undefined || typeof vmName.valueOf() !== 'string') { + throw new Error('vmName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/redeploy'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmName}', encodeURIComponent(vmName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().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); + }); +} + +/** + * The operation to perform maintenance on a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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 OperationStatusResponse} 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 _beginPerformMaintenance(resourceGroupName, vmName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmName === null || vmName === undefined || typeof vmName.valueOf() !== 'string') { + throw new Error('vmName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/performMaintenance'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmName}', encodeURIComponent(vmName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatusResponse']().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); + }); +} + +/** + * Run command on the VM. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Run command operation. + * + * @param {string} parameters.commandId The run command id. + * + * @param {array} [parameters.script] Optional. The script to be executed. + * When this value is given, the given script will override the default script + * of the command. + * + * @param {array} [parameters.parameters] The run command parameters. + * + * @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 RunCommandResult} 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 _beginRunCommand(resourceGroupName, vmName, 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.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmName === null || vmName === undefined || typeof vmName.valueOf() !== 'string') { + throw new Error('vmName 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.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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommand'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmName}', encodeURIComponent(vmName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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['RunCommandInput']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + 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['RunCommandResult']().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); + }); +} + +/** + * Lists all of the virtual machines in the specified resource group. Use the + * nextLink property in the response to get the next page of virtual machines. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['VirtualMachineListResult']().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); + }); +} + +/** + * Lists all of the virtual machines in the specified subscription. Use the + * nextLink property in the response to get the next page of virtual machines. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineListResult} 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 _listAllNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['VirtualMachineListResult']().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 VirtualMachines. */ +class VirtualMachines { + /** + * Create a VirtualMachines. + * @param {ComputeManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._capture = _capture; + this._createOrUpdate = _createOrUpdate; + this._update = _update; + this._deleteMethod = _deleteMethod; + this._get = _get; + this._instanceView = _instanceView; + this._convertToManagedDisks = _convertToManagedDisks; + this._deallocate = _deallocate; + this._generalize = _generalize; + this._list = _list; + this._listAll = _listAll; + this._listAvailableSizes = _listAvailableSizes; + this._powerOff = _powerOff; + this._restart = _restart; + this._start = _start; + this._redeploy = _redeploy; + this._performMaintenance = _performMaintenance; + this._runCommand = _runCommand; + this._beginCapture = _beginCapture; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginUpdate = _beginUpdate; + this._beginDeleteMethod = _beginDeleteMethod; + this._beginConvertToManagedDisks = _beginConvertToManagedDisks; + this._beginDeallocate = _beginDeallocate; + this._beginPowerOff = _beginPowerOff; + this._beginRestart = _beginRestart; + this._beginStart = _beginStart; + this._beginRedeploy = _beginRedeploy; + this._beginPerformMaintenance = _beginPerformMaintenance; + this._beginRunCommand = _beginRunCommand; + this._listNext = _listNext; + this._listAllNext = _listAllNext; + } + + /** + * Captures the VM by copying virtual hard disks of the VM and outputs a + * template that can be used to create similar VMs. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Capture Virtual + * Machine operation. + * + * @param {string} parameters.vhdPrefix The captured virtual hard disk's name + * prefix. + * + * @param {string} parameters.destinationContainerName The destination + * container name. + * + * @param {boolean} parameters.overwriteVhds Specifies whether to overwrite the + * destination virtual hard disk, in case of conflict. + * + * @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. + */ + captureWithHttpOperationResponse(resourceGroupName, vmName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._capture(resourceGroupName, vmName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Captures the VM by copying virtual hard disks of the VM and outputs a + * template that can be used to create similar VMs. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Capture Virtual + * Machine operation. + * + * @param {string} parameters.vhdPrefix The captured virtual hard disk's name + * prefix. + * + * @param {string} parameters.destinationContainerName The destination + * container name. + * + * @param {boolean} parameters.overwriteVhds Specifies whether to overwrite the + * destination virtual hard disk, in case of conflict. + * + * @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 {VirtualMachineCaptureResult} - 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 VirtualMachineCaptureResult} 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. + */ + capture(resourceGroupName, vmName, 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._capture(resourceGroupName, vmName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._capture(resourceGroupName, vmName, parameters, options, optionalCallback); + } + } + + /** + * The operation to create or update a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Create Virtual Machine + * operation. + * + * @param {object} [parameters.plan] Specifies information about the + * marketplace image used to create the virtual machine. This element is only + * used for marketplace images. Before you can use a marketplace image from an + * API, you must enable the image for programmatic use. In the Azure portal, + * find the marketplace image that you want to use and then click **Want to + * deploy programmatically, Get Started ->**. Enter any required information + * and then click **Save**. + * + * @param {string} [parameters.plan.name] The plan ID. + * + * @param {string} [parameters.plan.publisher] The publisher ID. + * + * @param {string} [parameters.plan.product] Specifies the product of the image + * from the marketplace. This is the same value as Offer under the + * imageReference element. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {object} [parameters.hardwareProfile] Specifies the hardware settings + * for the virtual machine. + * + * @param {string} [parameters.hardwareProfile.vmSize] Specifies the size of + * the virtual machine. For more information about virtual machine sizes, see + * [Sizes for virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    The available VM sizes depend on region and availability set. For a + * list of available sizes use these APIs:

    [List all available + * virtual machine sizes in an availability + * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) + *

    [List all available virtual machine sizes in a + * region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) + *

    [List all available virtual machine sizes for + * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). + * Possible values include: '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_B1s', 'Standard_B1ms', + * 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', + * '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_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', + * 'Standard_D32_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', + * 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', + * 'Standard_D64s_v3', '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_DS13-4_v2', 'Standard_DS13-2_v2', + * 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', 'Standard_E2_v3', + * 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', 'Standard_E32_v3', + * 'Standard_E64_v3', 'Standard_E2s_v3', 'Standard_E4s_v3', 'Standard_E8s_v3', + * 'Standard_E16s_v3', 'Standard_E32s_v3', 'Standard_E64s_v3', + * 'Standard_E32-16_v3', 'Standard_E32-8s_v3', 'Standard_E64-32s_v3', + * 'Standard_E64-16s_v3', 'Standard_F1', 'Standard_F2', 'Standard_F4', + * 'Standard_F8', 'Standard_F16', 'Standard_F1s', 'Standard_F2s', + * 'Standard_F4s', 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2', + * 'Standard_F4s_v2', 'Standard_F8s_v2', 'Standard_F16s_v2', + * 'Standard_F32s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1', + * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', + * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', + * 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8', + * 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m', + * 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', + * 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms', + * 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms', + * 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms', + * 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', + * 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2', + * 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3', + * 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s', + * 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6', + * 'Standard_NV12', 'Standard_NV24' + * + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. + * + * @param {object} [parameters.storageProfile.imageReference] Specifies + * information about the image to use. You can specify information about + * platform images, marketplace images, or virtual machine images. This element + * is required when you want to use a platform image, marketplace image, or + * virtual machine image, but is not used in other creation operations. + * + * @param {string} [parameters.storageProfile.imageReference.publisher] The + * image publisher. + * + * @param {string} [parameters.storageProfile.imageReference.offer] Specifies + * the offer of the platform image or marketplace image used to create the + * virtual machine. + * + * @param {string} [parameters.storageProfile.imageReference.sku] The image + * SKU. + * + * @param {string} [parameters.storageProfile.imageReference.version] Specifies + * the version of the platform image or marketplace image used to create the + * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the + * latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. + * + * @param {string} [parameters.storageProfile.imageReference.id] Resource Id + * + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} [parameters.storageProfile.osDisk.osType] This property + * allows you to specify the type of the OS that is included in the disk if + * creating a VM from user-image or a specialized VHD.

    Possible values + * are:

    **Windows**

    **Linux**. Possible values include: + * 'Windows', 'Linux' + * + * @param {object} [parameters.storageProfile.osDisk.encryptionSettings] + * Specifies the encryption settings for the OS Disk.

    Minimum + * api-version: 2015-06-15 + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey] + * Specifies the location of the disk encryption key, which is a Key Vault + * Secret. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.secretUrl + * The URL referencing a secret in a Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the secret. + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey] + * Specifies the location of the key encryption key in Key Vault. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.keyUrl + * The URL referencing a key encryption key in Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the key. + * + * @param {boolean} + * [parameters.storageProfile.osDisk.encryptionSettings.enabled] Specifies + * whether disk encryption should be enabled on the virtual machine. + * + * @param {string} [parameters.storageProfile.osDisk.name] The disk name. + * + * @param {object} [parameters.storageProfile.osDisk.vhd] The virtual hard + * disk. + * + * @param {object} [parameters.storageProfile.osDisk.image] The source user + * image virtual hard disk. The virtual hard disk will be copied before being + * attached to the virtual machine. If SourceImage is provided, the destination + * virtual hard drive must not exist. + * + * @param {string} [parameters.storageProfile.osDisk.image.uri] Specifies the + * virtual hard disk's uri. + * + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {boolean} [parameters.storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @param {string} parameters.storageProfile.osDisk.createOption Specifies how + * the virtual machine should be created.

    Possible values are:

    + * **Attach** \u2013 This value is used when you are using a specialized disk + * to create the virtual machine.

    **FromImage** \u2013 This value is + * used when you are using an image to create the virtual machine. If you are + * using a platform image, you also use the imageReference element described + * above. If you are using a marketplace image, you also use the plan element + * previously described. Possible values include: 'FromImage', 'Empty', + * 'Attach' + * + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of an empty data disk in gigabytes. This element can be used to + * overwrite the name of the disk in a virtual machine image.

    This + * value cannot be larger than 1023 GB + * + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed + * disk parameters. + * + * @param {string} + * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies + * the storage account type for the managed disk. Possible values are: + * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id + * + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {object} [parameters.osProfile] Specifies the operating system + * settings for the virtual machine. + * + * @param {string} [parameters.osProfile.computerName] Specifies the host OS + * name of the virtual machine.

    **Max-length (Windows):** 15 + * characters

    **Max-length (Linux):** 64 characters.

    For + * naming conventions and restrictions see [Azure infrastructure services + * implementation + * guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). + * + * @param {string} [parameters.osProfile.adminUsername] Specifies the name of + * the administrator account.

    **Windows-only restriction:** Cannot end + * in "."

    **Disallowed values:** "administrator", "admin", "user", + * "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", + * "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", + * "john", "owner", "root", "server", "sql", "support", "support_388945a0", + * "sys", "test2", "test3", "user4", "user5".

    **Minimum-length + * (Linux):** 1 character

    **Max-length (Linux):** 64 characters + *

    **Max-length (Windows):** 20 characters

  • For root + * access to the Linux VM, see [Using root privileges on Linux virtual machines + * in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in this + * field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {string} [parameters.osProfile.adminPassword] Specifies the password + * of the administrator account.

    **Minimum-length (Windows):** 8 + * characters

    **Minimum-length (Linux):** 6 characters

    + * **Max-length (Windows):** 123 characters

    **Max-length (Linux):** 72 + * characters

    **Complexity requirements:** 3 out of 4 conditions below + * need to be fulfilled
    Has lower characters
    Has upper characters
    + * Has a digit
    Has a special character (Regex match [\W_])

    + * **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", + * "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", + * "iloveyou!"

    For resetting the password, see [How to reset the + * Remote Desktop service or its login password in a Windows + * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    For resetting root password, see [Manage users, SSH, and check or + * repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + * + * @param {string} [parameters.osProfile.customData] Specifies a base-64 + * encoded string of custom data. The base-64 encoded string is decoded to a + * binary array that is saved as a file on the Virtual Machine. The maximum + * length of the binary array is 65535 bytes.

    For using cloud-init for + * your VM, see [Using cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {object} [parameters.osProfile.windowsConfiguration] Specifies + * Windows operating system settings on the virtual machine. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.provisionVMAgent] Indicates + * whether virtual machine agent should be provisioned on the virtual machine. + *

    When this property is not specified in the request body, default + * behavior is to set it to true. This will ensure that VM Agent is installed + * on the VM so that extensions can be added to the VM later. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.enableAutomaticUpdates] Indicates + * whether virtual machine is enabled for automatic updates. + * + * @param {string} [parameters.osProfile.windowsConfiguration.timeZone] + * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" + * + * @param {array} + * [parameters.osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * + * @param {object} [parameters.osProfile.windowsConfiguration.winRM] Specifies + * the Windows Remote Management listeners. This enables remote Windows + * PowerShell. + * + * @param {array} [parameters.osProfile.windowsConfiguration.winRM.listeners] + * The list of Windows Remote Management listeners + * + * @param {object} [parameters.osProfile.linuxConfiguration] Specifies the + * Linux operating system settings on the virtual machine.

    For a list + * of supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @param {boolean} + * [parameters.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * + * @param {object} [parameters.osProfile.linuxConfiguration.ssh] Specifies the + * ssh key configuration for a Linux OS. + * + * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The + * list of SSH public keys used to authenticate with linux based VMs. + * + * @param {array} [parameters.osProfile.secrets] Specifies set of certificates + * that should be installed onto the virtual machine. + * + * @param {object} [parameters.networkProfile] Specifies the network interfaces + * of the virtual machine. + * + * @param {array} [parameters.networkProfile.networkInterfaces] Specifies the + * list of resource Ids for the network interfaces associated with the virtual + * machine. + * + * @param {object} [parameters.diagnosticsProfile] Specifies the boot + * diagnostic settings state.

    Minimum api-version: 2015-06-15. + * + * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, + * you can easily view the output of your console log.

    For both + * Windows and Linux virtual machines, Azure also enables you to see a + * screenshot of the VM from the hypervisor. + * + * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] + * Whether boot diagnostics should be enabled on the Virtual Machine. + * + * @param {string} [parameters.diagnosticsProfile.bootDiagnostics.storageUri] + * Uri of the storage account to use for placing the console output and + * screenshot. + * + * @param {object} [parameters.availabilitySet] Specifies information about the + * availability set that the virtual machine should be assigned to. Virtual + * machines specified in the same availability set are allocated to different + * nodes to maximize availability. For more information about availability + * sets, see [Manage the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    For more information on Azure planned maintainance, see [Planned + * maintenance for virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Currently, a VM can only be added to availability set at creation + * time. An existing VM cannot be added to an availability set. + * + * @param {string} [parameters.availabilitySet.id] Resource Id + * + * @param {string} [parameters.licenseType] Specifies that the image or disk + * that is being used was licensed on-premises. This element is only used for + * images that contain the Windows Server operating system.

    Possible + * values are:

    Windows_Client

    Windows_Server

    If this + * element is included in a request for an update, the value must match the + * initial value. This value cannot be updated.

    For more information, + * see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Minimum api-version: 2015-06-15 + * + * @param {object} [parameters.identity] The identity of the virtual machine, + * if configured. + * + * @param {string} [parameters.identity.type] The type of identity used for the + * virtual machine. The type 'SystemAssigned, UserAssigned' includes both an + * implicitly created identity and a set of user assigned identities. The type + * 'None' will remove any identities from the virtual machine. Possible values + * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', + * 'None' + * + * @param {array} [parameters.identity.identityIds] The list of user identities + * associated with the Virtual Machine. The user identity references will be + * ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * + * @param {array} [parameters.zones] The virtual machine zones. + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @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. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, vmName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, vmName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * The operation to create or update a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Create Virtual Machine + * operation. + * + * @param {object} [parameters.plan] Specifies information about the + * marketplace image used to create the virtual machine. This element is only + * used for marketplace images. Before you can use a marketplace image from an + * API, you must enable the image for programmatic use. In the Azure portal, + * find the marketplace image that you want to use and then click **Want to + * deploy programmatically, Get Started ->**. Enter any required information + * and then click **Save**. + * + * @param {string} [parameters.plan.name] The plan ID. + * + * @param {string} [parameters.plan.publisher] The publisher ID. + * + * @param {string} [parameters.plan.product] Specifies the product of the image + * from the marketplace. This is the same value as Offer under the + * imageReference element. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {object} [parameters.hardwareProfile] Specifies the hardware settings + * for the virtual machine. + * + * @param {string} [parameters.hardwareProfile.vmSize] Specifies the size of + * the virtual machine. For more information about virtual machine sizes, see + * [Sizes for virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    The available VM sizes depend on region and availability set. For a + * list of available sizes use these APIs:

    [List all available + * virtual machine sizes in an availability + * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) + *

    [List all available virtual machine sizes in a + * region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) + *

    [List all available virtual machine sizes for + * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). + * Possible values include: '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_B1s', 'Standard_B1ms', + * 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', + * '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_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', + * 'Standard_D32_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', + * 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', + * 'Standard_D64s_v3', '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_DS13-4_v2', 'Standard_DS13-2_v2', + * 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', 'Standard_E2_v3', + * 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', 'Standard_E32_v3', + * 'Standard_E64_v3', 'Standard_E2s_v3', 'Standard_E4s_v3', 'Standard_E8s_v3', + * 'Standard_E16s_v3', 'Standard_E32s_v3', 'Standard_E64s_v3', + * 'Standard_E32-16_v3', 'Standard_E32-8s_v3', 'Standard_E64-32s_v3', + * 'Standard_E64-16s_v3', 'Standard_F1', 'Standard_F2', 'Standard_F4', + * 'Standard_F8', 'Standard_F16', 'Standard_F1s', 'Standard_F2s', + * 'Standard_F4s', 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2', + * 'Standard_F4s_v2', 'Standard_F8s_v2', 'Standard_F16s_v2', + * 'Standard_F32s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1', + * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', + * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', + * 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8', + * 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m', + * 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', + * 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms', + * 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms', + * 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms', + * 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', + * 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2', + * 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3', + * 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s', + * 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6', + * 'Standard_NV12', 'Standard_NV24' + * + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. + * + * @param {object} [parameters.storageProfile.imageReference] Specifies + * information about the image to use. You can specify information about + * platform images, marketplace images, or virtual machine images. This element + * is required when you want to use a platform image, marketplace image, or + * virtual machine image, but is not used in other creation operations. + * + * @param {string} [parameters.storageProfile.imageReference.publisher] The + * image publisher. + * + * @param {string} [parameters.storageProfile.imageReference.offer] Specifies + * the offer of the platform image or marketplace image used to create the + * virtual machine. + * + * @param {string} [parameters.storageProfile.imageReference.sku] The image + * SKU. + * + * @param {string} [parameters.storageProfile.imageReference.version] Specifies + * the version of the platform image or marketplace image used to create the + * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the + * latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. + * + * @param {string} [parameters.storageProfile.imageReference.id] Resource Id + * + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} [parameters.storageProfile.osDisk.osType] This property + * allows you to specify the type of the OS that is included in the disk if + * creating a VM from user-image or a specialized VHD.

    Possible values + * are:

    **Windows**

    **Linux**. Possible values include: + * 'Windows', 'Linux' + * + * @param {object} [parameters.storageProfile.osDisk.encryptionSettings] + * Specifies the encryption settings for the OS Disk.

    Minimum + * api-version: 2015-06-15 + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey] + * Specifies the location of the disk encryption key, which is a Key Vault + * Secret. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.secretUrl + * The URL referencing a secret in a Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the secret. + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey] + * Specifies the location of the key encryption key in Key Vault. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.keyUrl + * The URL referencing a key encryption key in Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the key. + * + * @param {boolean} + * [parameters.storageProfile.osDisk.encryptionSettings.enabled] Specifies + * whether disk encryption should be enabled on the virtual machine. + * + * @param {string} [parameters.storageProfile.osDisk.name] The disk name. + * + * @param {object} [parameters.storageProfile.osDisk.vhd] The virtual hard + * disk. + * + * @param {object} [parameters.storageProfile.osDisk.image] The source user + * image virtual hard disk. The virtual hard disk will be copied before being + * attached to the virtual machine. If SourceImage is provided, the destination + * virtual hard drive must not exist. + * + * @param {string} [parameters.storageProfile.osDisk.image.uri] Specifies the + * virtual hard disk's uri. + * + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {boolean} [parameters.storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @param {string} parameters.storageProfile.osDisk.createOption Specifies how + * the virtual machine should be created.

    Possible values are:

    + * **Attach** \u2013 This value is used when you are using a specialized disk + * to create the virtual machine.

    **FromImage** \u2013 This value is + * used when you are using an image to create the virtual machine. If you are + * using a platform image, you also use the imageReference element described + * above. If you are using a marketplace image, you also use the plan element + * previously described. Possible values include: 'FromImage', 'Empty', + * 'Attach' + * + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of an empty data disk in gigabytes. This element can be used to + * overwrite the name of the disk in a virtual machine image.

    This + * value cannot be larger than 1023 GB + * + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed + * disk parameters. + * + * @param {string} + * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies + * the storage account type for the managed disk. Possible values are: + * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id + * + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {object} [parameters.osProfile] Specifies the operating system + * settings for the virtual machine. + * + * @param {string} [parameters.osProfile.computerName] Specifies the host OS + * name of the virtual machine.

    **Max-length (Windows):** 15 + * characters

    **Max-length (Linux):** 64 characters.

    For + * naming conventions and restrictions see [Azure infrastructure services + * implementation + * guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). + * + * @param {string} [parameters.osProfile.adminUsername] Specifies the name of + * the administrator account.

    **Windows-only restriction:** Cannot end + * in "."

    **Disallowed values:** "administrator", "admin", "user", + * "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", + * "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", + * "john", "owner", "root", "server", "sql", "support", "support_388945a0", + * "sys", "test2", "test3", "user4", "user5".

    **Minimum-length + * (Linux):** 1 character

    **Max-length (Linux):** 64 characters + *

    **Max-length (Windows):** 20 characters

  • For root + * access to the Linux VM, see [Using root privileges on Linux virtual machines + * in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in this + * field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {string} [parameters.osProfile.adminPassword] Specifies the password + * of the administrator account.

    **Minimum-length (Windows):** 8 + * characters

    **Minimum-length (Linux):** 6 characters

    + * **Max-length (Windows):** 123 characters

    **Max-length (Linux):** 72 + * characters

    **Complexity requirements:** 3 out of 4 conditions below + * need to be fulfilled
    Has lower characters
    Has upper characters
    + * Has a digit
    Has a special character (Regex match [\W_])

    + * **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", + * "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", + * "iloveyou!"

    For resetting the password, see [How to reset the + * Remote Desktop service or its login password in a Windows + * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    For resetting root password, see [Manage users, SSH, and check or + * repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + * + * @param {string} [parameters.osProfile.customData] Specifies a base-64 + * encoded string of custom data. The base-64 encoded string is decoded to a + * binary array that is saved as a file on the Virtual Machine. The maximum + * length of the binary array is 65535 bytes.

    For using cloud-init for + * your VM, see [Using cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {object} [parameters.osProfile.windowsConfiguration] Specifies + * Windows operating system settings on the virtual machine. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.provisionVMAgent] Indicates + * whether virtual machine agent should be provisioned on the virtual machine. + *

    When this property is not specified in the request body, default + * behavior is to set it to true. This will ensure that VM Agent is installed + * on the VM so that extensions can be added to the VM later. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.enableAutomaticUpdates] Indicates + * whether virtual machine is enabled for automatic updates. + * + * @param {string} [parameters.osProfile.windowsConfiguration.timeZone] + * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" + * + * @param {array} + * [parameters.osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * + * @param {object} [parameters.osProfile.windowsConfiguration.winRM] Specifies + * the Windows Remote Management listeners. This enables remote Windows + * PowerShell. + * + * @param {array} [parameters.osProfile.windowsConfiguration.winRM.listeners] + * The list of Windows Remote Management listeners + * + * @param {object} [parameters.osProfile.linuxConfiguration] Specifies the + * Linux operating system settings on the virtual machine.

    For a list + * of supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @param {boolean} + * [parameters.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * + * @param {object} [parameters.osProfile.linuxConfiguration.ssh] Specifies the + * ssh key configuration for a Linux OS. + * + * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The + * list of SSH public keys used to authenticate with linux based VMs. + * + * @param {array} [parameters.osProfile.secrets] Specifies set of certificates + * that should be installed onto the virtual machine. + * + * @param {object} [parameters.networkProfile] Specifies the network interfaces + * of the virtual machine. + * + * @param {array} [parameters.networkProfile.networkInterfaces] Specifies the + * list of resource Ids for the network interfaces associated with the virtual + * machine. + * + * @param {object} [parameters.diagnosticsProfile] Specifies the boot + * diagnostic settings state.

    Minimum api-version: 2015-06-15. + * + * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, + * you can easily view the output of your console log.

    For both + * Windows and Linux virtual machines, Azure also enables you to see a + * screenshot of the VM from the hypervisor. + * + * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] + * Whether boot diagnostics should be enabled on the Virtual Machine. + * + * @param {string} [parameters.diagnosticsProfile.bootDiagnostics.storageUri] + * Uri of the storage account to use for placing the console output and + * screenshot. + * + * @param {object} [parameters.availabilitySet] Specifies information about the + * availability set that the virtual machine should be assigned to. Virtual + * machines specified in the same availability set are allocated to different + * nodes to maximize availability. For more information about availability + * sets, see [Manage the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    For more information on Azure planned maintainance, see [Planned + * maintenance for virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Currently, a VM can only be added to availability set at creation + * time. An existing VM cannot be added to an availability set. + * + * @param {string} [parameters.availabilitySet.id] Resource Id + * + * @param {string} [parameters.licenseType] Specifies that the image or disk + * that is being used was licensed on-premises. This element is only used for + * images that contain the Windows Server operating system.

    Possible + * values are:

    Windows_Client

    Windows_Server

    If this + * element is included in a request for an update, the value must match the + * initial value. This value cannot be updated.

    For more information, + * see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Minimum api-version: 2015-06-15 + * + * @param {object} [parameters.identity] The identity of the virtual machine, + * if configured. + * + * @param {string} [parameters.identity.type] The type of identity used for the + * virtual machine. The type 'SystemAssigned, UserAssigned' includes both an + * implicitly created identity and a set of user assigned identities. The type + * 'None' will remove any identities from the virtual machine. Possible values + * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', + * 'None' + * + * @param {array} [parameters.identity.identityIds] The list of user identities + * associated with the Virtual Machine. The user identity references will be + * ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * + * @param {array} [parameters.zones] The virtual machine zones. + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @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 {VirtualMachine} - 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 VirtualMachine} 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. + */ + createOrUpdate(resourceGroupName, vmName, 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._createOrUpdate(resourceGroupName, vmName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, vmName, parameters, options, optionalCallback); + } + } + + /** + * The operation to update a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Update Virtual Machine + * operation. + * + * @param {object} [parameters.plan] Specifies information about the + * marketplace image used to create the virtual machine. This element is only + * used for marketplace images. Before you can use a marketplace image from an + * API, you must enable the image for programmatic use. In the Azure portal, + * find the marketplace image that you want to use and then click **Want to + * deploy programmatically, Get Started ->**. Enter any required information + * and then click **Save**. + * + * @param {string} [parameters.plan.name] The plan ID. + * + * @param {string} [parameters.plan.publisher] The publisher ID. + * + * @param {string} [parameters.plan.product] Specifies the product of the image + * from the marketplace. This is the same value as Offer under the + * imageReference element. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {object} [parameters.hardwareProfile] Specifies the hardware settings + * for the virtual machine. + * + * @param {string} [parameters.hardwareProfile.vmSize] Specifies the size of + * the virtual machine. For more information about virtual machine sizes, see + * [Sizes for virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    The available VM sizes depend on region and availability set. For a + * list of available sizes use these APIs:

    [List all available + * virtual machine sizes in an availability + * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) + *

    [List all available virtual machine sizes in a + * region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) + *

    [List all available virtual machine sizes for + * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). + * Possible values include: '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_B1s', 'Standard_B1ms', + * 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', + * '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_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', + * 'Standard_D32_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', + * 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', + * 'Standard_D64s_v3', '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_DS13-4_v2', 'Standard_DS13-2_v2', + * 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', 'Standard_E2_v3', + * 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', 'Standard_E32_v3', + * 'Standard_E64_v3', 'Standard_E2s_v3', 'Standard_E4s_v3', 'Standard_E8s_v3', + * 'Standard_E16s_v3', 'Standard_E32s_v3', 'Standard_E64s_v3', + * 'Standard_E32-16_v3', 'Standard_E32-8s_v3', 'Standard_E64-32s_v3', + * 'Standard_E64-16s_v3', 'Standard_F1', 'Standard_F2', 'Standard_F4', + * 'Standard_F8', 'Standard_F16', 'Standard_F1s', 'Standard_F2s', + * 'Standard_F4s', 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2', + * 'Standard_F4s_v2', 'Standard_F8s_v2', 'Standard_F16s_v2', + * 'Standard_F32s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1', + * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', + * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', + * 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8', + * 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m', + * 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', + * 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms', + * 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms', + * 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms', + * 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', + * 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2', + * 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3', + * 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s', + * 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6', + * 'Standard_NV12', 'Standard_NV24' + * + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. + * + * @param {object} [parameters.storageProfile.imageReference] Specifies + * information about the image to use. You can specify information about + * platform images, marketplace images, or virtual machine images. This element + * is required when you want to use a platform image, marketplace image, or + * virtual machine image, but is not used in other creation operations. + * + * @param {string} [parameters.storageProfile.imageReference.publisher] The + * image publisher. + * + * @param {string} [parameters.storageProfile.imageReference.offer] Specifies + * the offer of the platform image or marketplace image used to create the + * virtual machine. + * + * @param {string} [parameters.storageProfile.imageReference.sku] The image + * SKU. + * + * @param {string} [parameters.storageProfile.imageReference.version] Specifies + * the version of the platform image or marketplace image used to create the + * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the + * latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. + * + * @param {string} [parameters.storageProfile.imageReference.id] Resource Id + * + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} [parameters.storageProfile.osDisk.osType] This property + * allows you to specify the type of the OS that is included in the disk if + * creating a VM from user-image or a specialized VHD.

    Possible values + * are:

    **Windows**

    **Linux**. Possible values include: + * 'Windows', 'Linux' + * + * @param {object} [parameters.storageProfile.osDisk.encryptionSettings] + * Specifies the encryption settings for the OS Disk.

    Minimum + * api-version: 2015-06-15 + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey] + * Specifies the location of the disk encryption key, which is a Key Vault + * Secret. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.secretUrl + * The URL referencing a secret in a Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the secret. + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey] + * Specifies the location of the key encryption key in Key Vault. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.keyUrl + * The URL referencing a key encryption key in Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the key. + * + * @param {boolean} + * [parameters.storageProfile.osDisk.encryptionSettings.enabled] Specifies + * whether disk encryption should be enabled on the virtual machine. + * + * @param {string} [parameters.storageProfile.osDisk.name] The disk name. + * + * @param {object} [parameters.storageProfile.osDisk.vhd] The virtual hard + * disk. + * + * @param {object} [parameters.storageProfile.osDisk.image] The source user + * image virtual hard disk. The virtual hard disk will be copied before being + * attached to the virtual machine. If SourceImage is provided, the destination + * virtual hard drive must not exist. + * + * @param {string} [parameters.storageProfile.osDisk.image.uri] Specifies the + * virtual hard disk's uri. + * + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {boolean} [parameters.storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @param {string} parameters.storageProfile.osDisk.createOption Specifies how + * the virtual machine should be created.

    Possible values are:

    + * **Attach** \u2013 This value is used when you are using a specialized disk + * to create the virtual machine.

    **FromImage** \u2013 This value is + * used when you are using an image to create the virtual machine. If you are + * using a platform image, you also use the imageReference element described + * above. If you are using a marketplace image, you also use the plan element + * previously described. Possible values include: 'FromImage', 'Empty', + * 'Attach' + * + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of an empty data disk in gigabytes. This element can be used to + * overwrite the name of the disk in a virtual machine image.

    This + * value cannot be larger than 1023 GB + * + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed + * disk parameters. + * + * @param {string} + * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies + * the storage account type for the managed disk. Possible values are: + * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id + * + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {object} [parameters.osProfile] Specifies the operating system + * settings for the virtual machine. + * + * @param {string} [parameters.osProfile.computerName] Specifies the host OS + * name of the virtual machine.

    **Max-length (Windows):** 15 + * characters

    **Max-length (Linux):** 64 characters.

    For + * naming conventions and restrictions see [Azure infrastructure services + * implementation + * guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). + * + * @param {string} [parameters.osProfile.adminUsername] Specifies the name of + * the administrator account.

    **Windows-only restriction:** Cannot end + * in "."

    **Disallowed values:** "administrator", "admin", "user", + * "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", + * "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", + * "john", "owner", "root", "server", "sql", "support", "support_388945a0", + * "sys", "test2", "test3", "user4", "user5".

    **Minimum-length + * (Linux):** 1 character

    **Max-length (Linux):** 64 characters + *

    **Max-length (Windows):** 20 characters

  • For root + * access to the Linux VM, see [Using root privileges on Linux virtual machines + * in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in this + * field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {string} [parameters.osProfile.adminPassword] Specifies the password + * of the administrator account.

    **Minimum-length (Windows):** 8 + * characters

    **Minimum-length (Linux):** 6 characters

    + * **Max-length (Windows):** 123 characters

    **Max-length (Linux):** 72 + * characters

    **Complexity requirements:** 3 out of 4 conditions below + * need to be fulfilled
    Has lower characters
    Has upper characters
    + * Has a digit
    Has a special character (Regex match [\W_])

    + * **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", + * "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", + * "iloveyou!"

    For resetting the password, see [How to reset the + * Remote Desktop service or its login password in a Windows + * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    For resetting root password, see [Manage users, SSH, and check or + * repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + * + * @param {string} [parameters.osProfile.customData] Specifies a base-64 + * encoded string of custom data. The base-64 encoded string is decoded to a + * binary array that is saved as a file on the Virtual Machine. The maximum + * length of the binary array is 65535 bytes.

    For using cloud-init for + * your VM, see [Using cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {object} [parameters.osProfile.windowsConfiguration] Specifies + * Windows operating system settings on the virtual machine. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.provisionVMAgent] Indicates + * whether virtual machine agent should be provisioned on the virtual machine. + *

    When this property is not specified in the request body, default + * behavior is to set it to true. This will ensure that VM Agent is installed + * on the VM so that extensions can be added to the VM later. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.enableAutomaticUpdates] Indicates + * whether virtual machine is enabled for automatic updates. + * + * @param {string} [parameters.osProfile.windowsConfiguration.timeZone] + * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" + * + * @param {array} + * [parameters.osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * + * @param {object} [parameters.osProfile.windowsConfiguration.winRM] Specifies + * the Windows Remote Management listeners. This enables remote Windows + * PowerShell. + * + * @param {array} [parameters.osProfile.windowsConfiguration.winRM.listeners] + * The list of Windows Remote Management listeners + * + * @param {object} [parameters.osProfile.linuxConfiguration] Specifies the + * Linux operating system settings on the virtual machine.

    For a list + * of supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @param {boolean} + * [parameters.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * + * @param {object} [parameters.osProfile.linuxConfiguration.ssh] Specifies the + * ssh key configuration for a Linux OS. + * + * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The + * list of SSH public keys used to authenticate with linux based VMs. + * + * @param {array} [parameters.osProfile.secrets] Specifies set of certificates + * that should be installed onto the virtual machine. + * + * @param {object} [parameters.networkProfile] Specifies the network interfaces + * of the virtual machine. + * + * @param {array} [parameters.networkProfile.networkInterfaces] Specifies the + * list of resource Ids for the network interfaces associated with the virtual + * machine. + * + * @param {object} [parameters.diagnosticsProfile] Specifies the boot + * diagnostic settings state.

    Minimum api-version: 2015-06-15. + * + * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, + * you can easily view the output of your console log.

    For both + * Windows and Linux virtual machines, Azure also enables you to see a + * screenshot of the VM from the hypervisor. + * + * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] + * Whether boot diagnostics should be enabled on the Virtual Machine. + * + * @param {string} [parameters.diagnosticsProfile.bootDiagnostics.storageUri] + * Uri of the storage account to use for placing the console output and + * screenshot. + * + * @param {object} [parameters.availabilitySet] Specifies information about the + * availability set that the virtual machine should be assigned to. Virtual + * machines specified in the same availability set are allocated to different + * nodes to maximize availability. For more information about availability + * sets, see [Manage the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    For more information on Azure planned maintainance, see [Planned + * maintenance for virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Currently, a VM can only be added to availability set at creation + * time. An existing VM cannot be added to an availability set. + * + * @param {string} [parameters.availabilitySet.id] Resource Id + * + * @param {string} [parameters.licenseType] Specifies that the image or disk + * that is being used was licensed on-premises. This element is only used for + * images that contain the Windows Server operating system.

    Possible + * values are:

    Windows_Client

    Windows_Server

    If this + * element is included in a request for an update, the value must match the + * initial value. This value cannot be updated.

    For more information, + * see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Minimum api-version: 2015-06-15 + * + * @param {object} [parameters.identity] The identity of the virtual machine, + * if configured. + * + * @param {string} [parameters.identity.type] The type of identity used for the + * virtual machine. The type 'SystemAssigned, UserAssigned' includes both an + * implicitly created identity and a set of user assigned identities. The type + * 'None' will remove any identities from the virtual machine. Possible values + * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', + * 'None' + * + * @param {array} [parameters.identity.identityIds] The list of user identities + * associated with the Virtual Machine. The user identity references will be + * ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * + * @param {array} [parameters.zones] The virtual machine zones. + * + * @param {object} [parameters.tags] Resource tags + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateWithHttpOperationResponse(resourceGroupName, vmName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._update(resourceGroupName, vmName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * The operation to update a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Update Virtual Machine + * operation. + * + * @param {object} [parameters.plan] Specifies information about the + * marketplace image used to create the virtual machine. This element is only + * used for marketplace images. Before you can use a marketplace image from an + * API, you must enable the image for programmatic use. In the Azure portal, + * find the marketplace image that you want to use and then click **Want to + * deploy programmatically, Get Started ->**. Enter any required information + * and then click **Save**. + * + * @param {string} [parameters.plan.name] The plan ID. + * + * @param {string} [parameters.plan.publisher] The publisher ID. + * + * @param {string} [parameters.plan.product] Specifies the product of the image + * from the marketplace. This is the same value as Offer under the + * imageReference element. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {object} [parameters.hardwareProfile] Specifies the hardware settings + * for the virtual machine. + * + * @param {string} [parameters.hardwareProfile.vmSize] Specifies the size of + * the virtual machine. For more information about virtual machine sizes, see + * [Sizes for virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    The available VM sizes depend on region and availability set. For a + * list of available sizes use these APIs:

    [List all available + * virtual machine sizes in an availability + * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) + *

    [List all available virtual machine sizes in a + * region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) + *

    [List all available virtual machine sizes for + * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). + * Possible values include: '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_B1s', 'Standard_B1ms', + * 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', + * '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_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', + * 'Standard_D32_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', + * 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', + * 'Standard_D64s_v3', '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_DS13-4_v2', 'Standard_DS13-2_v2', + * 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', 'Standard_E2_v3', + * 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', 'Standard_E32_v3', + * 'Standard_E64_v3', 'Standard_E2s_v3', 'Standard_E4s_v3', 'Standard_E8s_v3', + * 'Standard_E16s_v3', 'Standard_E32s_v3', 'Standard_E64s_v3', + * 'Standard_E32-16_v3', 'Standard_E32-8s_v3', 'Standard_E64-32s_v3', + * 'Standard_E64-16s_v3', 'Standard_F1', 'Standard_F2', 'Standard_F4', + * 'Standard_F8', 'Standard_F16', 'Standard_F1s', 'Standard_F2s', + * 'Standard_F4s', 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2', + * 'Standard_F4s_v2', 'Standard_F8s_v2', 'Standard_F16s_v2', + * 'Standard_F32s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1', + * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', + * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', + * 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8', + * 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m', + * 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', + * 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms', + * 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms', + * 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms', + * 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', + * 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2', + * 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3', + * 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s', + * 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6', + * 'Standard_NV12', 'Standard_NV24' + * + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. + * + * @param {object} [parameters.storageProfile.imageReference] Specifies + * information about the image to use. You can specify information about + * platform images, marketplace images, or virtual machine images. This element + * is required when you want to use a platform image, marketplace image, or + * virtual machine image, but is not used in other creation operations. + * + * @param {string} [parameters.storageProfile.imageReference.publisher] The + * image publisher. + * + * @param {string} [parameters.storageProfile.imageReference.offer] Specifies + * the offer of the platform image or marketplace image used to create the + * virtual machine. + * + * @param {string} [parameters.storageProfile.imageReference.sku] The image + * SKU. + * + * @param {string} [parameters.storageProfile.imageReference.version] Specifies + * the version of the platform image or marketplace image used to create the + * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the + * latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. + * + * @param {string} [parameters.storageProfile.imageReference.id] Resource Id + * + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} [parameters.storageProfile.osDisk.osType] This property + * allows you to specify the type of the OS that is included in the disk if + * creating a VM from user-image or a specialized VHD.

    Possible values + * are:

    **Windows**

    **Linux**. Possible values include: + * 'Windows', 'Linux' + * + * @param {object} [parameters.storageProfile.osDisk.encryptionSettings] + * Specifies the encryption settings for the OS Disk.

    Minimum + * api-version: 2015-06-15 + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey] + * Specifies the location of the disk encryption key, which is a Key Vault + * Secret. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.secretUrl + * The URL referencing a secret in a Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the secret. + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey] + * Specifies the location of the key encryption key in Key Vault. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.keyUrl + * The URL referencing a key encryption key in Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the key. + * + * @param {boolean} + * [parameters.storageProfile.osDisk.encryptionSettings.enabled] Specifies + * whether disk encryption should be enabled on the virtual machine. + * + * @param {string} [parameters.storageProfile.osDisk.name] The disk name. + * + * @param {object} [parameters.storageProfile.osDisk.vhd] The virtual hard + * disk. + * + * @param {object} [parameters.storageProfile.osDisk.image] The source user + * image virtual hard disk. The virtual hard disk will be copied before being + * attached to the virtual machine. If SourceImage is provided, the destination + * virtual hard drive must not exist. + * + * @param {string} [parameters.storageProfile.osDisk.image.uri] Specifies the + * virtual hard disk's uri. + * + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {boolean} [parameters.storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @param {string} parameters.storageProfile.osDisk.createOption Specifies how + * the virtual machine should be created.

    Possible values are:

    + * **Attach** \u2013 This value is used when you are using a specialized disk + * to create the virtual machine.

    **FromImage** \u2013 This value is + * used when you are using an image to create the virtual machine. If you are + * using a platform image, you also use the imageReference element described + * above. If you are using a marketplace image, you also use the plan element + * previously described. Possible values include: 'FromImage', 'Empty', + * 'Attach' + * + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of an empty data disk in gigabytes. This element can be used to + * overwrite the name of the disk in a virtual machine image.

    This + * value cannot be larger than 1023 GB + * + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed + * disk parameters. + * + * @param {string} + * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies + * the storage account type for the managed disk. Possible values are: + * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id + * + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {object} [parameters.osProfile] Specifies the operating system + * settings for the virtual machine. + * + * @param {string} [parameters.osProfile.computerName] Specifies the host OS + * name of the virtual machine.

    **Max-length (Windows):** 15 + * characters

    **Max-length (Linux):** 64 characters.

    For + * naming conventions and restrictions see [Azure infrastructure services + * implementation + * guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). + * + * @param {string} [parameters.osProfile.adminUsername] Specifies the name of + * the administrator account.

    **Windows-only restriction:** Cannot end + * in "."

    **Disallowed values:** "administrator", "admin", "user", + * "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", + * "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", + * "john", "owner", "root", "server", "sql", "support", "support_388945a0", + * "sys", "test2", "test3", "user4", "user5".

    **Minimum-length + * (Linux):** 1 character

    **Max-length (Linux):** 64 characters + *

    **Max-length (Windows):** 20 characters

  • For root + * access to the Linux VM, see [Using root privileges on Linux virtual machines + * in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in this + * field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {string} [parameters.osProfile.adminPassword] Specifies the password + * of the administrator account.

    **Minimum-length (Windows):** 8 + * characters

    **Minimum-length (Linux):** 6 characters

    + * **Max-length (Windows):** 123 characters

    **Max-length (Linux):** 72 + * characters

    **Complexity requirements:** 3 out of 4 conditions below + * need to be fulfilled
    Has lower characters
    Has upper characters
    + * Has a digit
    Has a special character (Regex match [\W_])

    + * **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", + * "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", + * "iloveyou!"

    For resetting the password, see [How to reset the + * Remote Desktop service or its login password in a Windows + * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    For resetting root password, see [Manage users, SSH, and check or + * repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + * + * @param {string} [parameters.osProfile.customData] Specifies a base-64 + * encoded string of custom data. The base-64 encoded string is decoded to a + * binary array that is saved as a file on the Virtual Machine. The maximum + * length of the binary array is 65535 bytes.

    For using cloud-init for + * your VM, see [Using cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {object} [parameters.osProfile.windowsConfiguration] Specifies + * Windows operating system settings on the virtual machine. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.provisionVMAgent] Indicates + * whether virtual machine agent should be provisioned on the virtual machine. + *

    When this property is not specified in the request body, default + * behavior is to set it to true. This will ensure that VM Agent is installed + * on the VM so that extensions can be added to the VM later. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.enableAutomaticUpdates] Indicates + * whether virtual machine is enabled for automatic updates. + * + * @param {string} [parameters.osProfile.windowsConfiguration.timeZone] + * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" + * + * @param {array} + * [parameters.osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * + * @param {object} [parameters.osProfile.windowsConfiguration.winRM] Specifies + * the Windows Remote Management listeners. This enables remote Windows + * PowerShell. + * + * @param {array} [parameters.osProfile.windowsConfiguration.winRM.listeners] + * The list of Windows Remote Management listeners + * + * @param {object} [parameters.osProfile.linuxConfiguration] Specifies the + * Linux operating system settings on the virtual machine.

    For a list + * of supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @param {boolean} + * [parameters.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * + * @param {object} [parameters.osProfile.linuxConfiguration.ssh] Specifies the + * ssh key configuration for a Linux OS. + * + * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The + * list of SSH public keys used to authenticate with linux based VMs. + * + * @param {array} [parameters.osProfile.secrets] Specifies set of certificates + * that should be installed onto the virtual machine. + * + * @param {object} [parameters.networkProfile] Specifies the network interfaces + * of the virtual machine. + * + * @param {array} [parameters.networkProfile.networkInterfaces] Specifies the + * list of resource Ids for the network interfaces associated with the virtual + * machine. + * + * @param {object} [parameters.diagnosticsProfile] Specifies the boot + * diagnostic settings state.

    Minimum api-version: 2015-06-15. + * + * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, + * you can easily view the output of your console log.

    For both + * Windows and Linux virtual machines, Azure also enables you to see a + * screenshot of the VM from the hypervisor. + * + * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] + * Whether boot diagnostics should be enabled on the Virtual Machine. + * + * @param {string} [parameters.diagnosticsProfile.bootDiagnostics.storageUri] + * Uri of the storage account to use for placing the console output and + * screenshot. + * + * @param {object} [parameters.availabilitySet] Specifies information about the + * availability set that the virtual machine should be assigned to. Virtual + * machines specified in the same availability set are allocated to different + * nodes to maximize availability. For more information about availability + * sets, see [Manage the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    For more information on Azure planned maintainance, see [Planned + * maintenance for virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Currently, a VM can only be added to availability set at creation + * time. An existing VM cannot be added to an availability set. + * + * @param {string} [parameters.availabilitySet.id] Resource Id + * + * @param {string} [parameters.licenseType] Specifies that the image or disk + * that is being used was licensed on-premises. This element is only used for + * images that contain the Windows Server operating system.

    Possible + * values are:

    Windows_Client

    Windows_Server

    If this + * element is included in a request for an update, the value must match the + * initial value. This value cannot be updated.

    For more information, + * see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Minimum api-version: 2015-06-15 + * + * @param {object} [parameters.identity] The identity of the virtual machine, + * if configured. + * + * @param {string} [parameters.identity.type] The type of identity used for the + * virtual machine. The type 'SystemAssigned, UserAssigned' includes both an + * implicitly created identity and a set of user assigned identities. The type + * 'None' will remove any identities from the virtual machine. Possible values + * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', + * 'None' + * + * @param {array} [parameters.identity.identityIds] The list of user identities + * associated with the Virtual Machine. The user identity references will be + * ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * + * @param {array} [parameters.zones] The virtual machine zones. + * + * @param {object} [parameters.tags] Resource tags + * + * @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 {VirtualMachine} - 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 VirtualMachine} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + update(resourceGroupName, vmName, 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._update(resourceGroupName, vmName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._update(resourceGroupName, vmName, parameters, options, optionalCallback); + } + } + + /** + * The operation to delete a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, vmName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, vmName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * The operation to delete a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + deleteMethod(resourceGroupName, vmName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, vmName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, vmName, options, optionalCallback); + } + } + + /** + * Retrieves information about the model view or the instance view of a virtual + * machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] The expand expression to apply on the + * operation. Possible values include: 'instanceView' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, vmName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, vmName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Retrieves information about the model view or the instance view of a virtual + * machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] The expand expression to apply on the + * operation. Possible values include: 'instanceView' + * + * @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 {VirtualMachine} - 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 VirtualMachine} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, vmName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(resourceGroupName, vmName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, vmName, options, optionalCallback); + } + } + + /** + * Retrieves information about the run-time state of a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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. + */ + instanceViewWithHttpOperationResponse(resourceGroupName, vmName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._instanceView(resourceGroupName, vmName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Retrieves information about the run-time state of a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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 {VirtualMachineInstanceView} - 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 VirtualMachineInstanceView} 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. + */ + instanceView(resourceGroupName, vmName, 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._instanceView(resourceGroupName, vmName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._instanceView(resourceGroupName, vmName, options, optionalCallback); + } + } + + /** + * Converts virtual machine disks from blob-based to managed disks. Virtual + * machine must be stop-deallocated before invoking this operation. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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. + */ + convertToManagedDisksWithHttpOperationResponse(resourceGroupName, vmName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._convertToManagedDisks(resourceGroupName, vmName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Converts virtual machine disks from blob-based to managed disks. Virtual + * machine must be stop-deallocated before invoking this operation. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + convertToManagedDisks(resourceGroupName, vmName, 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._convertToManagedDisks(resourceGroupName, vmName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._convertToManagedDisks(resourceGroupName, vmName, options, optionalCallback); + } + } + + /** + * Shuts down the virtual machine and releases the compute resources. You are + * not billed for the compute resources that this virtual machine uses. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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. + */ + deallocateWithHttpOperationResponse(resourceGroupName, vmName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deallocate(resourceGroupName, vmName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Shuts down the virtual machine and releases the compute resources. You are + * not billed for the compute resources that this virtual machine uses. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + deallocate(resourceGroupName, vmName, 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._deallocate(resourceGroupName, vmName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deallocate(resourceGroupName, vmName, options, optionalCallback); + } + } + + /** + * Sets the state of the virtual machine to generalized. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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. + */ + generalizeWithHttpOperationResponse(resourceGroupName, vmName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._generalize(resourceGroupName, vmName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Sets the state of the virtual machine to generalized. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + generalize(resourceGroupName, vmName, 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._generalize(resourceGroupName, vmName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._generalize(resourceGroupName, vmName, options, optionalCallback); + } + } + + /** + * Lists all of the virtual machines in the specified resource group. Use the + * nextLink property in the response to get the next page of virtual machines. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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. + */ + listWithHttpOperationResponse(resourceGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(resourceGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all of the virtual machines in the specified resource group. Use the + * nextLink property in the response to get the next page of virtual machines. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @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 {VirtualMachineListResult} - 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 VirtualMachineListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + list(resourceGroupName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._list(resourceGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(resourceGroupName, options, optionalCallback); + } + } + + /** + * Lists all of the virtual machines in the specified subscription. Use the + * nextLink property in the response to get the next page of virtual machines. + * + * @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. + */ + listAllWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listAll(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all of the virtual machines in the specified subscription. Use the + * nextLink property in the response to get the next page of virtual machines. + * + * @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 {VirtualMachineListResult} - 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 VirtualMachineListResult} 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. + */ + listAll(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._listAll(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listAll(options, optionalCallback); + } + } + + /** + * Lists all available virtual machine sizes to which the specified virtual + * machine can be resized. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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. + */ + listAvailableSizesWithHttpOperationResponse(resourceGroupName, vmName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listAvailableSizes(resourceGroupName, vmName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all available virtual machine sizes to which the specified virtual + * machine can be resized. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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 {VirtualMachineSizeListResult} - 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 VirtualMachineSizeListResult} 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. + */ + listAvailableSizes(resourceGroupName, vmName, 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._listAvailableSizes(resourceGroupName, vmName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listAvailableSizes(resourceGroupName, vmName, options, optionalCallback); + } + } + + /** + * The operation to power off (stop) a virtual machine. The virtual machine can + * be restarted with the same provisioned resources. You are still charged for + * this virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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. + */ + powerOffWithHttpOperationResponse(resourceGroupName, vmName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._powerOff(resourceGroupName, vmName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * The operation to power off (stop) a virtual machine. The virtual machine can + * be restarted with the same provisioned resources. You are still charged for + * this virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + powerOff(resourceGroupName, vmName, 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._powerOff(resourceGroupName, vmName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._powerOff(resourceGroupName, vmName, options, optionalCallback); + } + } + + /** + * The operation to restart a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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. + */ + restartWithHttpOperationResponse(resourceGroupName, vmName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._restart(resourceGroupName, vmName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * The operation to restart a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + restart(resourceGroupName, vmName, 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._restart(resourceGroupName, vmName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._restart(resourceGroupName, vmName, options, optionalCallback); + } + } + + /** + * The operation to start a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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. + */ + startWithHttpOperationResponse(resourceGroupName, vmName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._start(resourceGroupName, vmName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * The operation to start a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + start(resourceGroupName, vmName, 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._start(resourceGroupName, vmName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._start(resourceGroupName, vmName, options, optionalCallback); + } + } + + /** + * The operation to redeploy a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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. + */ + redeployWithHttpOperationResponse(resourceGroupName, vmName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._redeploy(resourceGroupName, vmName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * The operation to redeploy a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + redeploy(resourceGroupName, vmName, 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._redeploy(resourceGroupName, vmName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._redeploy(resourceGroupName, vmName, options, optionalCallback); + } + } + + /** + * The operation to perform maintenance on a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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. + */ + performMaintenanceWithHttpOperationResponse(resourceGroupName, vmName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._performMaintenance(resourceGroupName, vmName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * The operation to perform maintenance on a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + performMaintenance(resourceGroupName, vmName, 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._performMaintenance(resourceGroupName, vmName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._performMaintenance(resourceGroupName, vmName, options, optionalCallback); + } + } + + /** + * Run command on the VM. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Run command operation. + * + * @param {string} parameters.commandId The run command id. + * + * @param {array} [parameters.script] Optional. The script to be executed. + * When this value is given, the given script will override the default script + * of the command. + * + * @param {array} [parameters.parameters] The run command parameters. + * + * @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. + */ + runCommandWithHttpOperationResponse(resourceGroupName, vmName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._runCommand(resourceGroupName, vmName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Run command on the VM. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Run command operation. + * + * @param {string} parameters.commandId The run command id. + * + * @param {array} [parameters.script] Optional. The script to be executed. + * When this value is given, the given script will override the default script + * of the command. + * + * @param {array} [parameters.parameters] The run command parameters. + * + * @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 {RunCommandResult} - 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 RunCommandResult} 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. + */ + runCommand(resourceGroupName, vmName, 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._runCommand(resourceGroupName, vmName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._runCommand(resourceGroupName, vmName, parameters, options, optionalCallback); + } + } + + /** + * Captures the VM by copying virtual hard disks of the VM and outputs a + * template that can be used to create similar VMs. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Capture Virtual + * Machine operation. + * + * @param {string} parameters.vhdPrefix The captured virtual hard disk's name + * prefix. + * + * @param {string} parameters.destinationContainerName The destination + * container name. + * + * @param {boolean} parameters.overwriteVhds Specifies whether to overwrite the + * destination virtual hard disk, in case of conflict. + * + * @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. + */ + beginCaptureWithHttpOperationResponse(resourceGroupName, vmName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCapture(resourceGroupName, vmName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Captures the VM by copying virtual hard disks of the VM and outputs a + * template that can be used to create similar VMs. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Capture Virtual + * Machine operation. + * + * @param {string} parameters.vhdPrefix The captured virtual hard disk's name + * prefix. + * + * @param {string} parameters.destinationContainerName The destination + * container name. + * + * @param {boolean} parameters.overwriteVhds Specifies whether to overwrite the + * destination virtual hard disk, in case of conflict. + * + * @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 {VirtualMachineCaptureResult} - 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 VirtualMachineCaptureResult} 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. + */ + beginCapture(resourceGroupName, vmName, 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._beginCapture(resourceGroupName, vmName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCapture(resourceGroupName, vmName, parameters, options, optionalCallback); + } + } + + /** + * The operation to create or update a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Create Virtual Machine + * operation. + * + * @param {object} [parameters.plan] Specifies information about the + * marketplace image used to create the virtual machine. This element is only + * used for marketplace images. Before you can use a marketplace image from an + * API, you must enable the image for programmatic use. In the Azure portal, + * find the marketplace image that you want to use and then click **Want to + * deploy programmatically, Get Started ->**. Enter any required information + * and then click **Save**. + * + * @param {string} [parameters.plan.name] The plan ID. + * + * @param {string} [parameters.plan.publisher] The publisher ID. + * + * @param {string} [parameters.plan.product] Specifies the product of the image + * from the marketplace. This is the same value as Offer under the + * imageReference element. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {object} [parameters.hardwareProfile] Specifies the hardware settings + * for the virtual machine. + * + * @param {string} [parameters.hardwareProfile.vmSize] Specifies the size of + * the virtual machine. For more information about virtual machine sizes, see + * [Sizes for virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    The available VM sizes depend on region and availability set. For a + * list of available sizes use these APIs:

    [List all available + * virtual machine sizes in an availability + * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) + *

    [List all available virtual machine sizes in a + * region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) + *

    [List all available virtual machine sizes for + * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). + * Possible values include: '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_B1s', 'Standard_B1ms', + * 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', + * '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_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', + * 'Standard_D32_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', + * 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', + * 'Standard_D64s_v3', '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_DS13-4_v2', 'Standard_DS13-2_v2', + * 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', 'Standard_E2_v3', + * 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', 'Standard_E32_v3', + * 'Standard_E64_v3', 'Standard_E2s_v3', 'Standard_E4s_v3', 'Standard_E8s_v3', + * 'Standard_E16s_v3', 'Standard_E32s_v3', 'Standard_E64s_v3', + * 'Standard_E32-16_v3', 'Standard_E32-8s_v3', 'Standard_E64-32s_v3', + * 'Standard_E64-16s_v3', 'Standard_F1', 'Standard_F2', 'Standard_F4', + * 'Standard_F8', 'Standard_F16', 'Standard_F1s', 'Standard_F2s', + * 'Standard_F4s', 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2', + * 'Standard_F4s_v2', 'Standard_F8s_v2', 'Standard_F16s_v2', + * 'Standard_F32s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1', + * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', + * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', + * 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8', + * 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m', + * 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', + * 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms', + * 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms', + * 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms', + * 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', + * 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2', + * 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3', + * 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s', + * 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6', + * 'Standard_NV12', 'Standard_NV24' + * + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. + * + * @param {object} [parameters.storageProfile.imageReference] Specifies + * information about the image to use. You can specify information about + * platform images, marketplace images, or virtual machine images. This element + * is required when you want to use a platform image, marketplace image, or + * virtual machine image, but is not used in other creation operations. + * + * @param {string} [parameters.storageProfile.imageReference.publisher] The + * image publisher. + * + * @param {string} [parameters.storageProfile.imageReference.offer] Specifies + * the offer of the platform image or marketplace image used to create the + * virtual machine. + * + * @param {string} [parameters.storageProfile.imageReference.sku] The image + * SKU. + * + * @param {string} [parameters.storageProfile.imageReference.version] Specifies + * the version of the platform image or marketplace image used to create the + * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the + * latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. + * + * @param {string} [parameters.storageProfile.imageReference.id] Resource Id + * + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} [parameters.storageProfile.osDisk.osType] This property + * allows you to specify the type of the OS that is included in the disk if + * creating a VM from user-image or a specialized VHD.

    Possible values + * are:

    **Windows**

    **Linux**. Possible values include: + * 'Windows', 'Linux' + * + * @param {object} [parameters.storageProfile.osDisk.encryptionSettings] + * Specifies the encryption settings for the OS Disk.

    Minimum + * api-version: 2015-06-15 + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey] + * Specifies the location of the disk encryption key, which is a Key Vault + * Secret. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.secretUrl + * The URL referencing a secret in a Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the secret. + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey] + * Specifies the location of the key encryption key in Key Vault. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.keyUrl + * The URL referencing a key encryption key in Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the key. + * + * @param {boolean} + * [parameters.storageProfile.osDisk.encryptionSettings.enabled] Specifies + * whether disk encryption should be enabled on the virtual machine. + * + * @param {string} [parameters.storageProfile.osDisk.name] The disk name. + * + * @param {object} [parameters.storageProfile.osDisk.vhd] The virtual hard + * disk. + * + * @param {object} [parameters.storageProfile.osDisk.image] The source user + * image virtual hard disk. The virtual hard disk will be copied before being + * attached to the virtual machine. If SourceImage is provided, the destination + * virtual hard drive must not exist. + * + * @param {string} [parameters.storageProfile.osDisk.image.uri] Specifies the + * virtual hard disk's uri. + * + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {boolean} [parameters.storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @param {string} parameters.storageProfile.osDisk.createOption Specifies how + * the virtual machine should be created.

    Possible values are:

    + * **Attach** \u2013 This value is used when you are using a specialized disk + * to create the virtual machine.

    **FromImage** \u2013 This value is + * used when you are using an image to create the virtual machine. If you are + * using a platform image, you also use the imageReference element described + * above. If you are using a marketplace image, you also use the plan element + * previously described. Possible values include: 'FromImage', 'Empty', + * 'Attach' + * + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of an empty data disk in gigabytes. This element can be used to + * overwrite the name of the disk in a virtual machine image.

    This + * value cannot be larger than 1023 GB + * + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed + * disk parameters. + * + * @param {string} + * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies + * the storage account type for the managed disk. Possible values are: + * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id + * + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {object} [parameters.osProfile] Specifies the operating system + * settings for the virtual machine. + * + * @param {string} [parameters.osProfile.computerName] Specifies the host OS + * name of the virtual machine.

    **Max-length (Windows):** 15 + * characters

    **Max-length (Linux):** 64 characters.

    For + * naming conventions and restrictions see [Azure infrastructure services + * implementation + * guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). + * + * @param {string} [parameters.osProfile.adminUsername] Specifies the name of + * the administrator account.

    **Windows-only restriction:** Cannot end + * in "."

    **Disallowed values:** "administrator", "admin", "user", + * "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", + * "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", + * "john", "owner", "root", "server", "sql", "support", "support_388945a0", + * "sys", "test2", "test3", "user4", "user5".

    **Minimum-length + * (Linux):** 1 character

    **Max-length (Linux):** 64 characters + *

    **Max-length (Windows):** 20 characters

  • For root + * access to the Linux VM, see [Using root privileges on Linux virtual machines + * in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in this + * field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {string} [parameters.osProfile.adminPassword] Specifies the password + * of the administrator account.

    **Minimum-length (Windows):** 8 + * characters

    **Minimum-length (Linux):** 6 characters

    + * **Max-length (Windows):** 123 characters

    **Max-length (Linux):** 72 + * characters

    **Complexity requirements:** 3 out of 4 conditions below + * need to be fulfilled
    Has lower characters
    Has upper characters
    + * Has a digit
    Has a special character (Regex match [\W_])

    + * **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", + * "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", + * "iloveyou!"

    For resetting the password, see [How to reset the + * Remote Desktop service or its login password in a Windows + * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    For resetting root password, see [Manage users, SSH, and check or + * repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + * + * @param {string} [parameters.osProfile.customData] Specifies a base-64 + * encoded string of custom data. The base-64 encoded string is decoded to a + * binary array that is saved as a file on the Virtual Machine. The maximum + * length of the binary array is 65535 bytes.

    For using cloud-init for + * your VM, see [Using cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {object} [parameters.osProfile.windowsConfiguration] Specifies + * Windows operating system settings on the virtual machine. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.provisionVMAgent] Indicates + * whether virtual machine agent should be provisioned on the virtual machine. + *

    When this property is not specified in the request body, default + * behavior is to set it to true. This will ensure that VM Agent is installed + * on the VM so that extensions can be added to the VM later. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.enableAutomaticUpdates] Indicates + * whether virtual machine is enabled for automatic updates. + * + * @param {string} [parameters.osProfile.windowsConfiguration.timeZone] + * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" + * + * @param {array} + * [parameters.osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * + * @param {object} [parameters.osProfile.windowsConfiguration.winRM] Specifies + * the Windows Remote Management listeners. This enables remote Windows + * PowerShell. + * + * @param {array} [parameters.osProfile.windowsConfiguration.winRM.listeners] + * The list of Windows Remote Management listeners + * + * @param {object} [parameters.osProfile.linuxConfiguration] Specifies the + * Linux operating system settings on the virtual machine.

    For a list + * of supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @param {boolean} + * [parameters.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * + * @param {object} [parameters.osProfile.linuxConfiguration.ssh] Specifies the + * ssh key configuration for a Linux OS. + * + * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The + * list of SSH public keys used to authenticate with linux based VMs. + * + * @param {array} [parameters.osProfile.secrets] Specifies set of certificates + * that should be installed onto the virtual machine. + * + * @param {object} [parameters.networkProfile] Specifies the network interfaces + * of the virtual machine. + * + * @param {array} [parameters.networkProfile.networkInterfaces] Specifies the + * list of resource Ids for the network interfaces associated with the virtual + * machine. + * + * @param {object} [parameters.diagnosticsProfile] Specifies the boot + * diagnostic settings state.

    Minimum api-version: 2015-06-15. + * + * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, + * you can easily view the output of your console log.

    For both + * Windows and Linux virtual machines, Azure also enables you to see a + * screenshot of the VM from the hypervisor. + * + * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] + * Whether boot diagnostics should be enabled on the Virtual Machine. + * + * @param {string} [parameters.diagnosticsProfile.bootDiagnostics.storageUri] + * Uri of the storage account to use for placing the console output and + * screenshot. + * + * @param {object} [parameters.availabilitySet] Specifies information about the + * availability set that the virtual machine should be assigned to. Virtual + * machines specified in the same availability set are allocated to different + * nodes to maximize availability. For more information about availability + * sets, see [Manage the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    For more information on Azure planned maintainance, see [Planned + * maintenance for virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Currently, a VM can only be added to availability set at creation + * time. An existing VM cannot be added to an availability set. + * + * @param {string} [parameters.availabilitySet.id] Resource Id + * + * @param {string} [parameters.licenseType] Specifies that the image or disk + * that is being used was licensed on-premises. This element is only used for + * images that contain the Windows Server operating system.

    Possible + * values are:

    Windows_Client

    Windows_Server

    If this + * element is included in a request for an update, the value must match the + * initial value. This value cannot be updated.

    For more information, + * see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Minimum api-version: 2015-06-15 + * + * @param {object} [parameters.identity] The identity of the virtual machine, + * if configured. + * + * @param {string} [parameters.identity.type] The type of identity used for the + * virtual machine. The type 'SystemAssigned, UserAssigned' includes both an + * implicitly created identity and a set of user assigned identities. The type + * 'None' will remove any identities from the virtual machine. Possible values + * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', + * 'None' + * + * @param {array} [parameters.identity.identityIds] The list of user identities + * associated with the Virtual Machine. The user identity references will be + * ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * + * @param {array} [parameters.zones] The virtual machine zones. + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @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. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, vmName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, vmName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * The operation to create or update a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Create Virtual Machine + * operation. + * + * @param {object} [parameters.plan] Specifies information about the + * marketplace image used to create the virtual machine. This element is only + * used for marketplace images. Before you can use a marketplace image from an + * API, you must enable the image for programmatic use. In the Azure portal, + * find the marketplace image that you want to use and then click **Want to + * deploy programmatically, Get Started ->**. Enter any required information + * and then click **Save**. + * + * @param {string} [parameters.plan.name] The plan ID. + * + * @param {string} [parameters.plan.publisher] The publisher ID. + * + * @param {string} [parameters.plan.product] Specifies the product of the image + * from the marketplace. This is the same value as Offer under the + * imageReference element. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {object} [parameters.hardwareProfile] Specifies the hardware settings + * for the virtual machine. + * + * @param {string} [parameters.hardwareProfile.vmSize] Specifies the size of + * the virtual machine. For more information about virtual machine sizes, see + * [Sizes for virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    The available VM sizes depend on region and availability set. For a + * list of available sizes use these APIs:

    [List all available + * virtual machine sizes in an availability + * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) + *

    [List all available virtual machine sizes in a + * region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) + *

    [List all available virtual machine sizes for + * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). + * Possible values include: '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_B1s', 'Standard_B1ms', + * 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', + * '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_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', + * 'Standard_D32_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', + * 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', + * 'Standard_D64s_v3', '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_DS13-4_v2', 'Standard_DS13-2_v2', + * 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', 'Standard_E2_v3', + * 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', 'Standard_E32_v3', + * 'Standard_E64_v3', 'Standard_E2s_v3', 'Standard_E4s_v3', 'Standard_E8s_v3', + * 'Standard_E16s_v3', 'Standard_E32s_v3', 'Standard_E64s_v3', + * 'Standard_E32-16_v3', 'Standard_E32-8s_v3', 'Standard_E64-32s_v3', + * 'Standard_E64-16s_v3', 'Standard_F1', 'Standard_F2', 'Standard_F4', + * 'Standard_F8', 'Standard_F16', 'Standard_F1s', 'Standard_F2s', + * 'Standard_F4s', 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2', + * 'Standard_F4s_v2', 'Standard_F8s_v2', 'Standard_F16s_v2', + * 'Standard_F32s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1', + * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', + * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', + * 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8', + * 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m', + * 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', + * 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms', + * 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms', + * 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms', + * 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', + * 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2', + * 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3', + * 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s', + * 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6', + * 'Standard_NV12', 'Standard_NV24' + * + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. + * + * @param {object} [parameters.storageProfile.imageReference] Specifies + * information about the image to use. You can specify information about + * platform images, marketplace images, or virtual machine images. This element + * is required when you want to use a platform image, marketplace image, or + * virtual machine image, but is not used in other creation operations. + * + * @param {string} [parameters.storageProfile.imageReference.publisher] The + * image publisher. + * + * @param {string} [parameters.storageProfile.imageReference.offer] Specifies + * the offer of the platform image or marketplace image used to create the + * virtual machine. + * + * @param {string} [parameters.storageProfile.imageReference.sku] The image + * SKU. + * + * @param {string} [parameters.storageProfile.imageReference.version] Specifies + * the version of the platform image or marketplace image used to create the + * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the + * latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. + * + * @param {string} [parameters.storageProfile.imageReference.id] Resource Id + * + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} [parameters.storageProfile.osDisk.osType] This property + * allows you to specify the type of the OS that is included in the disk if + * creating a VM from user-image or a specialized VHD.

    Possible values + * are:

    **Windows**

    **Linux**. Possible values include: + * 'Windows', 'Linux' + * + * @param {object} [parameters.storageProfile.osDisk.encryptionSettings] + * Specifies the encryption settings for the OS Disk.

    Minimum + * api-version: 2015-06-15 + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey] + * Specifies the location of the disk encryption key, which is a Key Vault + * Secret. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.secretUrl + * The URL referencing a secret in a Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the secret. + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey] + * Specifies the location of the key encryption key in Key Vault. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.keyUrl + * The URL referencing a key encryption key in Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the key. + * + * @param {boolean} + * [parameters.storageProfile.osDisk.encryptionSettings.enabled] Specifies + * whether disk encryption should be enabled on the virtual machine. + * + * @param {string} [parameters.storageProfile.osDisk.name] The disk name. + * + * @param {object} [parameters.storageProfile.osDisk.vhd] The virtual hard + * disk. + * + * @param {object} [parameters.storageProfile.osDisk.image] The source user + * image virtual hard disk. The virtual hard disk will be copied before being + * attached to the virtual machine. If SourceImage is provided, the destination + * virtual hard drive must not exist. + * + * @param {string} [parameters.storageProfile.osDisk.image.uri] Specifies the + * virtual hard disk's uri. + * + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {boolean} [parameters.storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @param {string} parameters.storageProfile.osDisk.createOption Specifies how + * the virtual machine should be created.

    Possible values are:

    + * **Attach** \u2013 This value is used when you are using a specialized disk + * to create the virtual machine.

    **FromImage** \u2013 This value is + * used when you are using an image to create the virtual machine. If you are + * using a platform image, you also use the imageReference element described + * above. If you are using a marketplace image, you also use the plan element + * previously described. Possible values include: 'FromImage', 'Empty', + * 'Attach' + * + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of an empty data disk in gigabytes. This element can be used to + * overwrite the name of the disk in a virtual machine image.

    This + * value cannot be larger than 1023 GB + * + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed + * disk parameters. + * + * @param {string} + * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies + * the storage account type for the managed disk. Possible values are: + * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id + * + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {object} [parameters.osProfile] Specifies the operating system + * settings for the virtual machine. + * + * @param {string} [parameters.osProfile.computerName] Specifies the host OS + * name of the virtual machine.

    **Max-length (Windows):** 15 + * characters

    **Max-length (Linux):** 64 characters.

    For + * naming conventions and restrictions see [Azure infrastructure services + * implementation + * guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). + * + * @param {string} [parameters.osProfile.adminUsername] Specifies the name of + * the administrator account.

    **Windows-only restriction:** Cannot end + * in "."

    **Disallowed values:** "administrator", "admin", "user", + * "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", + * "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", + * "john", "owner", "root", "server", "sql", "support", "support_388945a0", + * "sys", "test2", "test3", "user4", "user5".

    **Minimum-length + * (Linux):** 1 character

    **Max-length (Linux):** 64 characters + *

    **Max-length (Windows):** 20 characters

  • For root + * access to the Linux VM, see [Using root privileges on Linux virtual machines + * in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in this + * field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {string} [parameters.osProfile.adminPassword] Specifies the password + * of the administrator account.

    **Minimum-length (Windows):** 8 + * characters

    **Minimum-length (Linux):** 6 characters

    + * **Max-length (Windows):** 123 characters

    **Max-length (Linux):** 72 + * characters

    **Complexity requirements:** 3 out of 4 conditions below + * need to be fulfilled
    Has lower characters
    Has upper characters
    + * Has a digit
    Has a special character (Regex match [\W_])

    + * **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", + * "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", + * "iloveyou!"

    For resetting the password, see [How to reset the + * Remote Desktop service or its login password in a Windows + * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    For resetting root password, see [Manage users, SSH, and check or + * repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + * + * @param {string} [parameters.osProfile.customData] Specifies a base-64 + * encoded string of custom data. The base-64 encoded string is decoded to a + * binary array that is saved as a file on the Virtual Machine. The maximum + * length of the binary array is 65535 bytes.

    For using cloud-init for + * your VM, see [Using cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {object} [parameters.osProfile.windowsConfiguration] Specifies + * Windows operating system settings on the virtual machine. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.provisionVMAgent] Indicates + * whether virtual machine agent should be provisioned on the virtual machine. + *

    When this property is not specified in the request body, default + * behavior is to set it to true. This will ensure that VM Agent is installed + * on the VM so that extensions can be added to the VM later. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.enableAutomaticUpdates] Indicates + * whether virtual machine is enabled for automatic updates. + * + * @param {string} [parameters.osProfile.windowsConfiguration.timeZone] + * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" + * + * @param {array} + * [parameters.osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * + * @param {object} [parameters.osProfile.windowsConfiguration.winRM] Specifies + * the Windows Remote Management listeners. This enables remote Windows + * PowerShell. + * + * @param {array} [parameters.osProfile.windowsConfiguration.winRM.listeners] + * The list of Windows Remote Management listeners + * + * @param {object} [parameters.osProfile.linuxConfiguration] Specifies the + * Linux operating system settings on the virtual machine.

    For a list + * of supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @param {boolean} + * [parameters.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * + * @param {object} [parameters.osProfile.linuxConfiguration.ssh] Specifies the + * ssh key configuration for a Linux OS. + * + * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The + * list of SSH public keys used to authenticate with linux based VMs. + * + * @param {array} [parameters.osProfile.secrets] Specifies set of certificates + * that should be installed onto the virtual machine. + * + * @param {object} [parameters.networkProfile] Specifies the network interfaces + * of the virtual machine. + * + * @param {array} [parameters.networkProfile.networkInterfaces] Specifies the + * list of resource Ids for the network interfaces associated with the virtual + * machine. + * + * @param {object} [parameters.diagnosticsProfile] Specifies the boot + * diagnostic settings state.

    Minimum api-version: 2015-06-15. + * + * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, + * you can easily view the output of your console log.

    For both + * Windows and Linux virtual machines, Azure also enables you to see a + * screenshot of the VM from the hypervisor. + * + * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] + * Whether boot diagnostics should be enabled on the Virtual Machine. + * + * @param {string} [parameters.diagnosticsProfile.bootDiagnostics.storageUri] + * Uri of the storage account to use for placing the console output and + * screenshot. + * + * @param {object} [parameters.availabilitySet] Specifies information about the + * availability set that the virtual machine should be assigned to. Virtual + * machines specified in the same availability set are allocated to different + * nodes to maximize availability. For more information about availability + * sets, see [Manage the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    For more information on Azure planned maintainance, see [Planned + * maintenance for virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Currently, a VM can only be added to availability set at creation + * time. An existing VM cannot be added to an availability set. + * + * @param {string} [parameters.availabilitySet.id] Resource Id + * + * @param {string} [parameters.licenseType] Specifies that the image or disk + * that is being used was licensed on-premises. This element is only used for + * images that contain the Windows Server operating system.

    Possible + * values are:

    Windows_Client

    Windows_Server

    If this + * element is included in a request for an update, the value must match the + * initial value. This value cannot be updated.

    For more information, + * see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Minimum api-version: 2015-06-15 + * + * @param {object} [parameters.identity] The identity of the virtual machine, + * if configured. + * + * @param {string} [parameters.identity.type] The type of identity used for the + * virtual machine. The type 'SystemAssigned, UserAssigned' includes both an + * implicitly created identity and a set of user assigned identities. The type + * 'None' will remove any identities from the virtual machine. Possible values + * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', + * 'None' + * + * @param {array} [parameters.identity.identityIds] The list of user identities + * associated with the Virtual Machine. The user identity references will be + * ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * + * @param {array} [parameters.zones] The virtual machine zones. + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @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 {VirtualMachine} - 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 VirtualMachine} 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. + */ + beginCreateOrUpdate(resourceGroupName, vmName, 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._beginCreateOrUpdate(resourceGroupName, vmName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, vmName, parameters, options, optionalCallback); + } + } + + /** + * The operation to update a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Update Virtual Machine + * operation. + * + * @param {object} [parameters.plan] Specifies information about the + * marketplace image used to create the virtual machine. This element is only + * used for marketplace images. Before you can use a marketplace image from an + * API, you must enable the image for programmatic use. In the Azure portal, + * find the marketplace image that you want to use and then click **Want to + * deploy programmatically, Get Started ->**. Enter any required information + * and then click **Save**. + * + * @param {string} [parameters.plan.name] The plan ID. + * + * @param {string} [parameters.plan.publisher] The publisher ID. + * + * @param {string} [parameters.plan.product] Specifies the product of the image + * from the marketplace. This is the same value as Offer under the + * imageReference element. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {object} [parameters.hardwareProfile] Specifies the hardware settings + * for the virtual machine. + * + * @param {string} [parameters.hardwareProfile.vmSize] Specifies the size of + * the virtual machine. For more information about virtual machine sizes, see + * [Sizes for virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    The available VM sizes depend on region and availability set. For a + * list of available sizes use these APIs:

    [List all available + * virtual machine sizes in an availability + * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) + *

    [List all available virtual machine sizes in a + * region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) + *

    [List all available virtual machine sizes for + * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). + * Possible values include: '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_B1s', 'Standard_B1ms', + * 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', + * '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_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', + * 'Standard_D32_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', + * 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', + * 'Standard_D64s_v3', '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_DS13-4_v2', 'Standard_DS13-2_v2', + * 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', 'Standard_E2_v3', + * 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', 'Standard_E32_v3', + * 'Standard_E64_v3', 'Standard_E2s_v3', 'Standard_E4s_v3', 'Standard_E8s_v3', + * 'Standard_E16s_v3', 'Standard_E32s_v3', 'Standard_E64s_v3', + * 'Standard_E32-16_v3', 'Standard_E32-8s_v3', 'Standard_E64-32s_v3', + * 'Standard_E64-16s_v3', 'Standard_F1', 'Standard_F2', 'Standard_F4', + * 'Standard_F8', 'Standard_F16', 'Standard_F1s', 'Standard_F2s', + * 'Standard_F4s', 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2', + * 'Standard_F4s_v2', 'Standard_F8s_v2', 'Standard_F16s_v2', + * 'Standard_F32s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1', + * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', + * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', + * 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8', + * 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m', + * 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', + * 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms', + * 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms', + * 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms', + * 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', + * 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2', + * 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3', + * 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s', + * 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6', + * 'Standard_NV12', 'Standard_NV24' + * + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. + * + * @param {object} [parameters.storageProfile.imageReference] Specifies + * information about the image to use. You can specify information about + * platform images, marketplace images, or virtual machine images. This element + * is required when you want to use a platform image, marketplace image, or + * virtual machine image, but is not used in other creation operations. + * + * @param {string} [parameters.storageProfile.imageReference.publisher] The + * image publisher. + * + * @param {string} [parameters.storageProfile.imageReference.offer] Specifies + * the offer of the platform image or marketplace image used to create the + * virtual machine. + * + * @param {string} [parameters.storageProfile.imageReference.sku] The image + * SKU. + * + * @param {string} [parameters.storageProfile.imageReference.version] Specifies + * the version of the platform image or marketplace image used to create the + * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the + * latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. + * + * @param {string} [parameters.storageProfile.imageReference.id] Resource Id + * + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} [parameters.storageProfile.osDisk.osType] This property + * allows you to specify the type of the OS that is included in the disk if + * creating a VM from user-image or a specialized VHD.

    Possible values + * are:

    **Windows**

    **Linux**. Possible values include: + * 'Windows', 'Linux' + * + * @param {object} [parameters.storageProfile.osDisk.encryptionSettings] + * Specifies the encryption settings for the OS Disk.

    Minimum + * api-version: 2015-06-15 + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey] + * Specifies the location of the disk encryption key, which is a Key Vault + * Secret. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.secretUrl + * The URL referencing a secret in a Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the secret. + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey] + * Specifies the location of the key encryption key in Key Vault. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.keyUrl + * The URL referencing a key encryption key in Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the key. + * + * @param {boolean} + * [parameters.storageProfile.osDisk.encryptionSettings.enabled] Specifies + * whether disk encryption should be enabled on the virtual machine. + * + * @param {string} [parameters.storageProfile.osDisk.name] The disk name. + * + * @param {object} [parameters.storageProfile.osDisk.vhd] The virtual hard + * disk. + * + * @param {object} [parameters.storageProfile.osDisk.image] The source user + * image virtual hard disk. The virtual hard disk will be copied before being + * attached to the virtual machine. If SourceImage is provided, the destination + * virtual hard drive must not exist. + * + * @param {string} [parameters.storageProfile.osDisk.image.uri] Specifies the + * virtual hard disk's uri. + * + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {boolean} [parameters.storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @param {string} parameters.storageProfile.osDisk.createOption Specifies how + * the virtual machine should be created.

    Possible values are:

    + * **Attach** \u2013 This value is used when you are using a specialized disk + * to create the virtual machine.

    **FromImage** \u2013 This value is + * used when you are using an image to create the virtual machine. If you are + * using a platform image, you also use the imageReference element described + * above. If you are using a marketplace image, you also use the plan element + * previously described. Possible values include: 'FromImage', 'Empty', + * 'Attach' + * + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of an empty data disk in gigabytes. This element can be used to + * overwrite the name of the disk in a virtual machine image.

    This + * value cannot be larger than 1023 GB + * + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed + * disk parameters. + * + * @param {string} + * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies + * the storage account type for the managed disk. Possible values are: + * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id + * + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {object} [parameters.osProfile] Specifies the operating system + * settings for the virtual machine. + * + * @param {string} [parameters.osProfile.computerName] Specifies the host OS + * name of the virtual machine.

    **Max-length (Windows):** 15 + * characters

    **Max-length (Linux):** 64 characters.

    For + * naming conventions and restrictions see [Azure infrastructure services + * implementation + * guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). + * + * @param {string} [parameters.osProfile.adminUsername] Specifies the name of + * the administrator account.

    **Windows-only restriction:** Cannot end + * in "."

    **Disallowed values:** "administrator", "admin", "user", + * "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", + * "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", + * "john", "owner", "root", "server", "sql", "support", "support_388945a0", + * "sys", "test2", "test3", "user4", "user5".

    **Minimum-length + * (Linux):** 1 character

    **Max-length (Linux):** 64 characters + *

    **Max-length (Windows):** 20 characters

  • For root + * access to the Linux VM, see [Using root privileges on Linux virtual machines + * in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in this + * field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {string} [parameters.osProfile.adminPassword] Specifies the password + * of the administrator account.

    **Minimum-length (Windows):** 8 + * characters

    **Minimum-length (Linux):** 6 characters

    + * **Max-length (Windows):** 123 characters

    **Max-length (Linux):** 72 + * characters

    **Complexity requirements:** 3 out of 4 conditions below + * need to be fulfilled
    Has lower characters
    Has upper characters
    + * Has a digit
    Has a special character (Regex match [\W_])

    + * **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", + * "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", + * "iloveyou!"

    For resetting the password, see [How to reset the + * Remote Desktop service or its login password in a Windows + * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    For resetting root password, see [Manage users, SSH, and check or + * repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + * + * @param {string} [parameters.osProfile.customData] Specifies a base-64 + * encoded string of custom data. The base-64 encoded string is decoded to a + * binary array that is saved as a file on the Virtual Machine. The maximum + * length of the binary array is 65535 bytes.

    For using cloud-init for + * your VM, see [Using cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {object} [parameters.osProfile.windowsConfiguration] Specifies + * Windows operating system settings on the virtual machine. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.provisionVMAgent] Indicates + * whether virtual machine agent should be provisioned on the virtual machine. + *

    When this property is not specified in the request body, default + * behavior is to set it to true. This will ensure that VM Agent is installed + * on the VM so that extensions can be added to the VM later. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.enableAutomaticUpdates] Indicates + * whether virtual machine is enabled for automatic updates. + * + * @param {string} [parameters.osProfile.windowsConfiguration.timeZone] + * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" + * + * @param {array} + * [parameters.osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * + * @param {object} [parameters.osProfile.windowsConfiguration.winRM] Specifies + * the Windows Remote Management listeners. This enables remote Windows + * PowerShell. + * + * @param {array} [parameters.osProfile.windowsConfiguration.winRM.listeners] + * The list of Windows Remote Management listeners + * + * @param {object} [parameters.osProfile.linuxConfiguration] Specifies the + * Linux operating system settings on the virtual machine.

    For a list + * of supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @param {boolean} + * [parameters.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * + * @param {object} [parameters.osProfile.linuxConfiguration.ssh] Specifies the + * ssh key configuration for a Linux OS. + * + * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The + * list of SSH public keys used to authenticate with linux based VMs. + * + * @param {array} [parameters.osProfile.secrets] Specifies set of certificates + * that should be installed onto the virtual machine. + * + * @param {object} [parameters.networkProfile] Specifies the network interfaces + * of the virtual machine. + * + * @param {array} [parameters.networkProfile.networkInterfaces] Specifies the + * list of resource Ids for the network interfaces associated with the virtual + * machine. + * + * @param {object} [parameters.diagnosticsProfile] Specifies the boot + * diagnostic settings state.

    Minimum api-version: 2015-06-15. + * + * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, + * you can easily view the output of your console log.

    For both + * Windows and Linux virtual machines, Azure also enables you to see a + * screenshot of the VM from the hypervisor. + * + * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] + * Whether boot diagnostics should be enabled on the Virtual Machine. + * + * @param {string} [parameters.diagnosticsProfile.bootDiagnostics.storageUri] + * Uri of the storage account to use for placing the console output and + * screenshot. + * + * @param {object} [parameters.availabilitySet] Specifies information about the + * availability set that the virtual machine should be assigned to. Virtual + * machines specified in the same availability set are allocated to different + * nodes to maximize availability. For more information about availability + * sets, see [Manage the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    For more information on Azure planned maintainance, see [Planned + * maintenance for virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Currently, a VM can only be added to availability set at creation + * time. An existing VM cannot be added to an availability set. + * + * @param {string} [parameters.availabilitySet.id] Resource Id + * + * @param {string} [parameters.licenseType] Specifies that the image or disk + * that is being used was licensed on-premises. This element is only used for + * images that contain the Windows Server operating system.

    Possible + * values are:

    Windows_Client

    Windows_Server

    If this + * element is included in a request for an update, the value must match the + * initial value. This value cannot be updated.

    For more information, + * see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Minimum api-version: 2015-06-15 + * + * @param {object} [parameters.identity] The identity of the virtual machine, + * if configured. + * + * @param {string} [parameters.identity.type] The type of identity used for the + * virtual machine. The type 'SystemAssigned, UserAssigned' includes both an + * implicitly created identity and a set of user assigned identities. The type + * 'None' will remove any identities from the virtual machine. Possible values + * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', + * 'None' + * + * @param {array} [parameters.identity.identityIds] The list of user identities + * associated with the Virtual Machine. The user identity references will be + * ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * + * @param {array} [parameters.zones] The virtual machine zones. + * + * @param {object} [parameters.tags] Resource tags + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginUpdateWithHttpOperationResponse(resourceGroupName, vmName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginUpdate(resourceGroupName, vmName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * The operation to update a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Update Virtual Machine + * operation. + * + * @param {object} [parameters.plan] Specifies information about the + * marketplace image used to create the virtual machine. This element is only + * used for marketplace images. Before you can use a marketplace image from an + * API, you must enable the image for programmatic use. In the Azure portal, + * find the marketplace image that you want to use and then click **Want to + * deploy programmatically, Get Started ->**. Enter any required information + * and then click **Save**. + * + * @param {string} [parameters.plan.name] The plan ID. + * + * @param {string} [parameters.plan.publisher] The publisher ID. + * + * @param {string} [parameters.plan.product] Specifies the product of the image + * from the marketplace. This is the same value as Offer under the + * imageReference element. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {object} [parameters.hardwareProfile] Specifies the hardware settings + * for the virtual machine. + * + * @param {string} [parameters.hardwareProfile.vmSize] Specifies the size of + * the virtual machine. For more information about virtual machine sizes, see + * [Sizes for virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    The available VM sizes depend on region and availability set. For a + * list of available sizes use these APIs:

    [List all available + * virtual machine sizes in an availability + * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) + *

    [List all available virtual machine sizes in a + * region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) + *

    [List all available virtual machine sizes for + * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). + * Possible values include: '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_B1s', 'Standard_B1ms', + * 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', + * '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_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', + * 'Standard_D32_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', + * 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', + * 'Standard_D64s_v3', '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_DS13-4_v2', 'Standard_DS13-2_v2', + * 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', 'Standard_E2_v3', + * 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', 'Standard_E32_v3', + * 'Standard_E64_v3', 'Standard_E2s_v3', 'Standard_E4s_v3', 'Standard_E8s_v3', + * 'Standard_E16s_v3', 'Standard_E32s_v3', 'Standard_E64s_v3', + * 'Standard_E32-16_v3', 'Standard_E32-8s_v3', 'Standard_E64-32s_v3', + * 'Standard_E64-16s_v3', 'Standard_F1', 'Standard_F2', 'Standard_F4', + * 'Standard_F8', 'Standard_F16', 'Standard_F1s', 'Standard_F2s', + * 'Standard_F4s', 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2', + * 'Standard_F4s_v2', 'Standard_F8s_v2', 'Standard_F16s_v2', + * 'Standard_F32s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1', + * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', + * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', + * 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8', + * 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m', + * 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', + * 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms', + * 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms', + * 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms', + * 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', + * 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2', + * 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3', + * 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s', + * 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6', + * 'Standard_NV12', 'Standard_NV24' + * + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. + * + * @param {object} [parameters.storageProfile.imageReference] Specifies + * information about the image to use. You can specify information about + * platform images, marketplace images, or virtual machine images. This element + * is required when you want to use a platform image, marketplace image, or + * virtual machine image, but is not used in other creation operations. + * + * @param {string} [parameters.storageProfile.imageReference.publisher] The + * image publisher. + * + * @param {string} [parameters.storageProfile.imageReference.offer] Specifies + * the offer of the platform image or marketplace image used to create the + * virtual machine. + * + * @param {string} [parameters.storageProfile.imageReference.sku] The image + * SKU. + * + * @param {string} [parameters.storageProfile.imageReference.version] Specifies + * the version of the platform image or marketplace image used to create the + * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the + * latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. + * + * @param {string} [parameters.storageProfile.imageReference.id] Resource Id + * + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} [parameters.storageProfile.osDisk.osType] This property + * allows you to specify the type of the OS that is included in the disk if + * creating a VM from user-image or a specialized VHD.

    Possible values + * are:

    **Windows**

    **Linux**. Possible values include: + * 'Windows', 'Linux' + * + * @param {object} [parameters.storageProfile.osDisk.encryptionSettings] + * Specifies the encryption settings for the OS Disk.

    Minimum + * api-version: 2015-06-15 + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey] + * Specifies the location of the disk encryption key, which is a Key Vault + * Secret. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.secretUrl + * The URL referencing a secret in a Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the secret. + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey] + * Specifies the location of the key encryption key in Key Vault. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.keyUrl + * The URL referencing a key encryption key in Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the key. + * + * @param {boolean} + * [parameters.storageProfile.osDisk.encryptionSettings.enabled] Specifies + * whether disk encryption should be enabled on the virtual machine. + * + * @param {string} [parameters.storageProfile.osDisk.name] The disk name. + * + * @param {object} [parameters.storageProfile.osDisk.vhd] The virtual hard + * disk. + * + * @param {object} [parameters.storageProfile.osDisk.image] The source user + * image virtual hard disk. The virtual hard disk will be copied before being + * attached to the virtual machine. If SourceImage is provided, the destination + * virtual hard drive must not exist. + * + * @param {string} [parameters.storageProfile.osDisk.image.uri] Specifies the + * virtual hard disk's uri. + * + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {boolean} [parameters.storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @param {string} parameters.storageProfile.osDisk.createOption Specifies how + * the virtual machine should be created.

    Possible values are:

    + * **Attach** \u2013 This value is used when you are using a specialized disk + * to create the virtual machine.

    **FromImage** \u2013 This value is + * used when you are using an image to create the virtual machine. If you are + * using a platform image, you also use the imageReference element described + * above. If you are using a marketplace image, you also use the plan element + * previously described. Possible values include: 'FromImage', 'Empty', + * 'Attach' + * + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of an empty data disk in gigabytes. This element can be used to + * overwrite the name of the disk in a virtual machine image.

    This + * value cannot be larger than 1023 GB + * + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed + * disk parameters. + * + * @param {string} + * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies + * the storage account type for the managed disk. Possible values are: + * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id + * + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {object} [parameters.osProfile] Specifies the operating system + * settings for the virtual machine. + * + * @param {string} [parameters.osProfile.computerName] Specifies the host OS + * name of the virtual machine.

    **Max-length (Windows):** 15 + * characters

    **Max-length (Linux):** 64 characters.

    For + * naming conventions and restrictions see [Azure infrastructure services + * implementation + * guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). + * + * @param {string} [parameters.osProfile.adminUsername] Specifies the name of + * the administrator account.

    **Windows-only restriction:** Cannot end + * in "."

    **Disallowed values:** "administrator", "admin", "user", + * "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", + * "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", + * "john", "owner", "root", "server", "sql", "support", "support_388945a0", + * "sys", "test2", "test3", "user4", "user5".

    **Minimum-length + * (Linux):** 1 character

    **Max-length (Linux):** 64 characters + *

    **Max-length (Windows):** 20 characters

  • For root + * access to the Linux VM, see [Using root privileges on Linux virtual machines + * in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in this + * field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {string} [parameters.osProfile.adminPassword] Specifies the password + * of the administrator account.

    **Minimum-length (Windows):** 8 + * characters

    **Minimum-length (Linux):** 6 characters

    + * **Max-length (Windows):** 123 characters

    **Max-length (Linux):** 72 + * characters

    **Complexity requirements:** 3 out of 4 conditions below + * need to be fulfilled
    Has lower characters
    Has upper characters
    + * Has a digit
    Has a special character (Regex match [\W_])

    + * **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", + * "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", + * "iloveyou!"

    For resetting the password, see [How to reset the + * Remote Desktop service or its login password in a Windows + * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    For resetting root password, see [Manage users, SSH, and check or + * repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + * + * @param {string} [parameters.osProfile.customData] Specifies a base-64 + * encoded string of custom data. The base-64 encoded string is decoded to a + * binary array that is saved as a file on the Virtual Machine. The maximum + * length of the binary array is 65535 bytes.

    For using cloud-init for + * your VM, see [Using cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {object} [parameters.osProfile.windowsConfiguration] Specifies + * Windows operating system settings on the virtual machine. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.provisionVMAgent] Indicates + * whether virtual machine agent should be provisioned on the virtual machine. + *

    When this property is not specified in the request body, default + * behavior is to set it to true. This will ensure that VM Agent is installed + * on the VM so that extensions can be added to the VM later. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.enableAutomaticUpdates] Indicates + * whether virtual machine is enabled for automatic updates. + * + * @param {string} [parameters.osProfile.windowsConfiguration.timeZone] + * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" + * + * @param {array} + * [parameters.osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * + * @param {object} [parameters.osProfile.windowsConfiguration.winRM] Specifies + * the Windows Remote Management listeners. This enables remote Windows + * PowerShell. + * + * @param {array} [parameters.osProfile.windowsConfiguration.winRM.listeners] + * The list of Windows Remote Management listeners + * + * @param {object} [parameters.osProfile.linuxConfiguration] Specifies the + * Linux operating system settings on the virtual machine.

    For a list + * of supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @param {boolean} + * [parameters.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * + * @param {object} [parameters.osProfile.linuxConfiguration.ssh] Specifies the + * ssh key configuration for a Linux OS. + * + * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The + * list of SSH public keys used to authenticate with linux based VMs. + * + * @param {array} [parameters.osProfile.secrets] Specifies set of certificates + * that should be installed onto the virtual machine. + * + * @param {object} [parameters.networkProfile] Specifies the network interfaces + * of the virtual machine. + * + * @param {array} [parameters.networkProfile.networkInterfaces] Specifies the + * list of resource Ids for the network interfaces associated with the virtual + * machine. + * + * @param {object} [parameters.diagnosticsProfile] Specifies the boot + * diagnostic settings state.

    Minimum api-version: 2015-06-15. + * + * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, + * you can easily view the output of your console log.

    For both + * Windows and Linux virtual machines, Azure also enables you to see a + * screenshot of the VM from the hypervisor. + * + * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] + * Whether boot diagnostics should be enabled on the Virtual Machine. + * + * @param {string} [parameters.diagnosticsProfile.bootDiagnostics.storageUri] + * Uri of the storage account to use for placing the console output and + * screenshot. + * + * @param {object} [parameters.availabilitySet] Specifies information about the + * availability set that the virtual machine should be assigned to. Virtual + * machines specified in the same availability set are allocated to different + * nodes to maximize availability. For more information about availability + * sets, see [Manage the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    For more information on Azure planned maintainance, see [Planned + * maintenance for virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Currently, a VM can only be added to availability set at creation + * time. An existing VM cannot be added to an availability set. + * + * @param {string} [parameters.availabilitySet.id] Resource Id + * + * @param {string} [parameters.licenseType] Specifies that the image or disk + * that is being used was licensed on-premises. This element is only used for + * images that contain the Windows Server operating system.

    Possible + * values are:

    Windows_Client

    Windows_Server

    If this + * element is included in a request for an update, the value must match the + * initial value. This value cannot be updated.

    For more information, + * see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Minimum api-version: 2015-06-15 + * + * @param {object} [parameters.identity] The identity of the virtual machine, + * if configured. + * + * @param {string} [parameters.identity.type] The type of identity used for the + * virtual machine. The type 'SystemAssigned, UserAssigned' includes both an + * implicitly created identity and a set of user assigned identities. The type + * 'None' will remove any identities from the virtual machine. Possible values + * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', + * 'None' + * + * @param {array} [parameters.identity.identityIds] The list of user identities + * associated with the Virtual Machine. The user identity references will be + * ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * + * @param {array} [parameters.zones] The virtual machine zones. + * + * @param {object} [parameters.tags] Resource tags + * + * @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 {VirtualMachine} - 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 VirtualMachine} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginUpdate(resourceGroupName, vmName, 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._beginUpdate(resourceGroupName, vmName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginUpdate(resourceGroupName, vmName, parameters, options, optionalCallback); + } + } + + /** + * The operation to delete a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, vmName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, vmName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * The operation to delete a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + beginDeleteMethod(resourceGroupName, vmName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, vmName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, vmName, options, optionalCallback); + } + } + + /** + * Converts virtual machine disks from blob-based to managed disks. Virtual + * machine must be stop-deallocated before invoking this operation. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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. + */ + beginConvertToManagedDisksWithHttpOperationResponse(resourceGroupName, vmName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginConvertToManagedDisks(resourceGroupName, vmName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Converts virtual machine disks from blob-based to managed disks. Virtual + * machine must be stop-deallocated before invoking this operation. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + beginConvertToManagedDisks(resourceGroupName, vmName, 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._beginConvertToManagedDisks(resourceGroupName, vmName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginConvertToManagedDisks(resourceGroupName, vmName, options, optionalCallback); + } + } + + /** + * Shuts down the virtual machine and releases the compute resources. You are + * not billed for the compute resources that this virtual machine uses. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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. + */ + beginDeallocateWithHttpOperationResponse(resourceGroupName, vmName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeallocate(resourceGroupName, vmName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Shuts down the virtual machine and releases the compute resources. You are + * not billed for the compute resources that this virtual machine uses. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + beginDeallocate(resourceGroupName, vmName, 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._beginDeallocate(resourceGroupName, vmName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeallocate(resourceGroupName, vmName, options, optionalCallback); + } + } + + /** + * The operation to power off (stop) a virtual machine. The virtual machine can + * be restarted with the same provisioned resources. You are still charged for + * this virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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. + */ + beginPowerOffWithHttpOperationResponse(resourceGroupName, vmName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginPowerOff(resourceGroupName, vmName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * The operation to power off (stop) a virtual machine. The virtual machine can + * be restarted with the same provisioned resources. You are still charged for + * this virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + beginPowerOff(resourceGroupName, vmName, 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._beginPowerOff(resourceGroupName, vmName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginPowerOff(resourceGroupName, vmName, options, optionalCallback); + } + } + + /** + * The operation to restart a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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. + */ + beginRestartWithHttpOperationResponse(resourceGroupName, vmName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginRestart(resourceGroupName, vmName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * The operation to restart a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + beginRestart(resourceGroupName, vmName, 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._beginRestart(resourceGroupName, vmName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginRestart(resourceGroupName, vmName, options, optionalCallback); + } + } + + /** + * The operation to start a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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. + */ + beginStartWithHttpOperationResponse(resourceGroupName, vmName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginStart(resourceGroupName, vmName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * The operation to start a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + beginStart(resourceGroupName, vmName, 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._beginStart(resourceGroupName, vmName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginStart(resourceGroupName, vmName, options, optionalCallback); + } + } + + /** + * The operation to redeploy a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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. + */ + beginRedeployWithHttpOperationResponse(resourceGroupName, vmName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginRedeploy(resourceGroupName, vmName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * The operation to redeploy a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + beginRedeploy(resourceGroupName, vmName, 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._beginRedeploy(resourceGroupName, vmName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginRedeploy(resourceGroupName, vmName, options, optionalCallback); + } + } + + /** + * The operation to perform maintenance on a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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. + */ + beginPerformMaintenanceWithHttpOperationResponse(resourceGroupName, vmName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginPerformMaintenance(resourceGroupName, vmName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * The operation to perform maintenance on a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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 {OperationStatusResponse} - 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 OperationStatusResponse} 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. + */ + beginPerformMaintenance(resourceGroupName, vmName, 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._beginPerformMaintenance(resourceGroupName, vmName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginPerformMaintenance(resourceGroupName, vmName, options, optionalCallback); + } + } + + /** + * Run command on the VM. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Run command operation. + * + * @param {string} parameters.commandId The run command id. + * + * @param {array} [parameters.script] Optional. The script to be executed. + * When this value is given, the given script will override the default script + * of the command. + * + * @param {array} [parameters.parameters] The run command parameters. + * + * @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. + */ + beginRunCommandWithHttpOperationResponse(resourceGroupName, vmName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginRunCommand(resourceGroupName, vmName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Run command on the VM. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Run command operation. + * + * @param {string} parameters.commandId The run command id. + * + * @param {array} [parameters.script] Optional. The script to be executed. + * When this value is given, the given script will override the default script + * of the command. + * + * @param {array} [parameters.parameters] The run command parameters. + * + * @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 {RunCommandResult} - 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 RunCommandResult} 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. + */ + beginRunCommand(resourceGroupName, vmName, 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._beginRunCommand(resourceGroupName, vmName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginRunCommand(resourceGroupName, vmName, parameters, options, optionalCallback); + } + } + + /** + * Lists all of the virtual machines in the specified resource group. Use the + * nextLink property in the response to get the next page of virtual machines. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all of the virtual machines in the specified resource group. Use the + * nextLink property in the response to get the next page of virtual machines. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {VirtualMachineListResult} - 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 VirtualMachineListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + + /** + * Lists all of the virtual machines in the specified subscription. Use the + * nextLink property in the response to get the next page of virtual machines. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listAllNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listAllNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all of the virtual machines in the specified subscription. Use the + * nextLink property in the response to get the next page of virtual machines. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {VirtualMachineListResult} - 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 VirtualMachineListResult} 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. + */ + listAllNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listAllNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listAllNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = VirtualMachines; diff --git a/lib/services/computeManagement2/lib/models/index.d.ts b/lib/services/computeManagement2/lib/models/index.d.ts index 448a4fd1d2..8ef388bbb5 100644 --- a/lib/services/computeManagement2/lib/models/index.d.ts +++ b/lib/services/computeManagement2/lib/models/index.d.ts @@ -334,6 +334,51 @@ export interface VirtualMachineExtension extends Resource { instanceView?: VirtualMachineExtensionInstanceView; } +/** + * @class + * Initializes a new instance of the VirtualMachineExtensionUpdate class. + * @constructor + * Describes a Virtual Machine Extension. + * + * @member {string} [forceUpdateTag] How the extension handler should be forced + * to update even if the extension configuration has not changed. + * @member {string} [publisher] The name of the extension handler publisher. + * @member {string} [type] Specifies the type of the extension; an example is + * "CustomScriptExtension". + * @member {string} [typeHandlerVersion] Specifies the version of the script + * handler. + * @member {boolean} [autoUpgradeMinorVersion] Indicates whether the extension + * should use a newer minor version if one is available at deployment time. + * Once deployed, however, the extension will not upgrade minor versions unless + * redeployed, even with this property set to true. + * @member {object} [settings] Json formatted public settings for the + * extension. + * @member {object} [protectedSettings] The extension can contain either + * protectedSettings or protectedSettingsFromKeyVault or no protected settings + * at all. + */ +export interface VirtualMachineExtensionUpdate extends UpdateResource { + forceUpdateTag?: string; + publisher?: string; + type?: string; + typeHandlerVersion?: string; + autoUpgradeMinorVersion?: boolean; + settings?: any; + protectedSettings?: any; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineExtensionsListResult class. + * @constructor + * The List Extension operation response + * + * @member {array} [value] The list of extensions + */ +export interface VirtualMachineExtensionsListResult { + value?: VirtualMachineExtension[]; +} + /** * @class * Initializes a new instance of the PurchasePlan class. @@ -3445,6 +3490,9 @@ export interface VirtualMachineScaleSetExtensionProfile { * @member {string} [priority] Specifies the priority for the virtual machines * in the scale set.

    Minimum api-version: 2017-10-30-preview. Possible * values include: 'Regular', 'Low' + * @member {string} [evictionPolicy] Specifies the eviction policy for virtual + * machines in the low priority scale set.

    Minimum api-version: + * 2017-10-30-preview. Possible values include: 'Deallocate', 'Delete' */ export interface VirtualMachineScaleSetVMProfile { osProfile?: VirtualMachineScaleSetOSProfile; @@ -3454,6 +3502,7 @@ export interface VirtualMachineScaleSetVMProfile { extensionProfile?: VirtualMachineScaleSetExtensionProfile; licenseType?: string; priority?: string; + evictionPolicy?: string; } /** @@ -3829,6 +3878,10 @@ export interface VirtualMachineScaleSetUpdateVMProfile { * @member {string} [virtualMachineProfile.priority] Specifies the priority for * the virtual machines in the scale set.

    Minimum api-version: * 2017-10-30-preview. Possible values include: 'Regular', 'Low' + * @member {string} [virtualMachineProfile.evictionPolicy] Specifies the + * eviction policy for virtual machines in the low priority scale set. + *

    Minimum api-version: 2017-10-30-preview. Possible values include: + * 'Deallocate', 'Delete' * @member {string} [provisioningState] The provisioning state, which only * appears in the response. * @member {boolean} [overprovision] Specifies whether the Virtual Machine @@ -4213,6 +4266,216 @@ export interface VirtualMachineScaleSetSku { readonly capacity?: VirtualMachineScaleSetSkuCapacity; } +/** + * @class + * Initializes a new instance of the UpgradeOperationHistoryStatus class. + * @constructor + * Information about the current running state of the overall upgrade. + * + * @member {string} [code] Code indicating the current status of the upgrade. + * Possible values include: 'RollingForward', 'Cancelled', 'Completed', + * 'Faulted' + * @member {date} [startTime] Start time of the upgrade. + * @member {date} [endTime] End time of the upgrade. + */ +export interface UpgradeOperationHistoryStatus { + readonly code?: string; + readonly startTime?: Date; + readonly endTime?: Date; +} + +/** + * @class + * Initializes a new instance of the RollingUpgradeProgressInfo class. + * @constructor + * Information about the number of virtual machine instances in each upgrade + * state. + * + * @member {number} [successfulInstanceCount] The number of instances that have + * been successfully upgraded. + * @member {number} [failedInstanceCount] The number of instances that have + * failed to be upgraded successfully. + * @member {number} [inProgressInstanceCount] The number of instances that are + * currently being upgraded. + * @member {number} [pendingInstanceCount] The number of instances that have + * not yet begun to be upgraded. + */ +export interface RollingUpgradeProgressInfo { + readonly successfulInstanceCount?: number; + readonly failedInstanceCount?: number; + readonly inProgressInstanceCount?: number; + readonly pendingInstanceCount?: number; +} + +/** + * @class + * Initializes a new instance of the ApiErrorBase class. + * @constructor + * Api error base. + * + * @member {string} [code] The error code. + * @member {string} [target] The target of the particular error. + * @member {string} [message] The error message. + */ +export interface ApiErrorBase { + code?: string; + target?: string; + message?: string; +} + +/** + * @class + * Initializes a new instance of the InnerError class. + * @constructor + * Inner error details. + * + * @member {string} [exceptiontype] The exception type. + * @member {string} [errordetail] The internal error message or exception dump. + */ +export interface InnerError { + exceptiontype?: string; + errordetail?: string; +} + +/** + * @class + * Initializes a new instance of the ApiError class. + * @constructor + * Api error. + * + * @member {array} [details] The Api error details + * @member {object} [innererror] The Api inner error + * @member {string} [innererror.exceptiontype] The exception type. + * @member {string} [innererror.errordetail] The internal error message or + * exception dump. + * @member {string} [code] The error code. + * @member {string} [target] The target of the particular error. + * @member {string} [message] The error message. + */ +export interface ApiError { + details?: ApiErrorBase[]; + innererror?: InnerError; + code?: string; + target?: string; + message?: string; +} + +/** + * @class + * Initializes a new instance of the UpgradeOperationHistoricalStatusInfoProperties class. + * @constructor + * Describes each OS upgrade on the Virtual Machine Scale Set. + * + * @member {object} [runningStatus] Information about the overall status of the + * upgrade operation. + * @member {string} [runningStatus.code] Code indicating the current status of + * the upgrade. Possible values include: 'RollingForward', 'Cancelled', + * 'Completed', 'Faulted' + * @member {date} [runningStatus.startTime] Start time of the upgrade. + * @member {date} [runningStatus.endTime] End time of the upgrade. + * @member {object} [progress] Counts of the VM's in each state. + * @member {number} [progress.successfulInstanceCount] The number of instances + * that have been successfully upgraded. + * @member {number} [progress.failedInstanceCount] The number of instances that + * have failed to be upgraded successfully. + * @member {number} [progress.inProgressInstanceCount] The number of instances + * that are currently being upgraded. + * @member {number} [progress.pendingInstanceCount] The number of instances + * that have not yet begun to be upgraded. + * @member {object} [error] Error Details for this upgrade if there are any. + * @member {array} [error.details] The Api error details + * @member {object} [error.innererror] The Api inner error + * @member {string} [error.innererror.exceptiontype] The exception type. + * @member {string} [error.innererror.errordetail] The internal error message + * or exception dump. + * @member {string} [error.code] The error code. + * @member {string} [error.target] The target of the particular error. + * @member {string} [error.message] The error message. + * @member {string} [startedBy] Invoker of the Upgrade Operation. Possible + * values include: 'Unknown', 'User', 'Platform' + * @member {object} [targetImageReference] Image Reference details + * @member {string} [targetImageReference.publisher] The image publisher. + * @member {string} [targetImageReference.offer] Specifies the offer of the + * platform image or marketplace image used to create the virtual machine. + * @member {string} [targetImageReference.sku] The image SKU. + * @member {string} [targetImageReference.version] Specifies the version of the + * platform image or marketplace image used to create the virtual machine. The + * allowed formats are Major.Minor.Build or 'latest'. Major, Minor, and Build + * are decimal numbers. Specify 'latest' to use the latest version of an image + * available at deploy time. Even if you use 'latest', the VM image will not + * automatically update after deploy time even if a new version becomes + * available. + */ +export interface UpgradeOperationHistoricalStatusInfoProperties { + readonly runningStatus?: UpgradeOperationHistoryStatus; + readonly progress?: RollingUpgradeProgressInfo; + readonly error?: ApiError; + readonly startedBy?: string; + readonly targetImageReference?: ImageReference; +} + +/** + * @class + * Initializes a new instance of the UpgradeOperationHistoricalStatusInfo class. + * @constructor + * Virtual Machine Scale Set OS Upgrade History operation response. + * + * @member {object} [properties] Information about the properties of the + * upgrade operation. + * @member {object} [properties.runningStatus] Information about the overall + * status of the upgrade operation. + * @member {string} [properties.runningStatus.code] Code indicating the current + * status of the upgrade. Possible values include: 'RollingForward', + * 'Cancelled', 'Completed', 'Faulted' + * @member {date} [properties.runningStatus.startTime] Start time of the + * upgrade. + * @member {date} [properties.runningStatus.endTime] End time of the upgrade. + * @member {object} [properties.progress] Counts of the VM's in each state. + * @member {number} [properties.progress.successfulInstanceCount] The number of + * instances that have been successfully upgraded. + * @member {number} [properties.progress.failedInstanceCount] The number of + * instances that have failed to be upgraded successfully. + * @member {number} [properties.progress.inProgressInstanceCount] The number of + * instances that are currently being upgraded. + * @member {number} [properties.progress.pendingInstanceCount] The number of + * instances that have not yet begun to be upgraded. + * @member {object} [properties.error] Error Details for this upgrade if there + * are any. + * @member {array} [properties.error.details] The Api error details + * @member {object} [properties.error.innererror] The Api inner error + * @member {string} [properties.error.innererror.exceptiontype] The exception + * type. + * @member {string} [properties.error.innererror.errordetail] The internal + * error message or exception dump. + * @member {string} [properties.error.code] The error code. + * @member {string} [properties.error.target] The target of the particular + * error. + * @member {string} [properties.error.message] The error message. + * @member {string} [properties.startedBy] Invoker of the Upgrade Operation. + * Possible values include: 'Unknown', 'User', 'Platform' + * @member {object} [properties.targetImageReference] Image Reference details + * @member {string} [properties.targetImageReference.publisher] The image + * publisher. + * @member {string} [properties.targetImageReference.offer] Specifies the offer + * of the platform image or marketplace image used to create the virtual + * machine. + * @member {string} [properties.targetImageReference.sku] The image SKU. + * @member {string} [properties.targetImageReference.version] Specifies the + * version of the platform image or marketplace image used to create the + * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the + * latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. + * @member {string} [type] Resource type + * @member {string} [location] Resource location + */ +export interface UpgradeOperationHistoricalStatusInfo { + readonly properties?: UpgradeOperationHistoricalStatusInfoProperties; + readonly type?: string; + readonly location?: string; +} + /** * @class * Initializes a new instance of the VirtualMachineScaleSetVM class. @@ -4703,82 +4966,6 @@ export interface RollingUpgradeRunningStatus { readonly lastActionTime?: Date; } -/** - * @class - * Initializes a new instance of the RollingUpgradeProgressInfo class. - * @constructor - * Information about the number of virtual machine instances in each upgrade - * state. - * - * @member {number} [successfulInstanceCount] The number of instances that have - * been successfully upgraded. - * @member {number} [failedInstanceCount] The number of instances that have - * failed to be upgraded successfully. - * @member {number} [inProgressInstanceCount] The number of instances that are - * currently being upgraded. - * @member {number} [pendingInstanceCount] The number of instances that have - * not yet begun to be upgraded. - */ -export interface RollingUpgradeProgressInfo { - readonly successfulInstanceCount?: number; - readonly failedInstanceCount?: number; - readonly inProgressInstanceCount?: number; - readonly pendingInstanceCount?: number; -} - -/** - * @class - * Initializes a new instance of the ApiErrorBase class. - * @constructor - * Api error base. - * - * @member {string} [code] The error code. - * @member {string} [target] The target of the particular error. - * @member {string} [message] The error message. - */ -export interface ApiErrorBase { - code?: string; - target?: string; - message?: string; -} - -/** - * @class - * Initializes a new instance of the InnerError class. - * @constructor - * Inner error details. - * - * @member {string} [exceptiontype] The exception type. - * @member {string} [errordetail] The internal error message or exception dump. - */ -export interface InnerError { - exceptiontype?: string; - errordetail?: string; -} - -/** - * @class - * Initializes a new instance of the ApiError class. - * @constructor - * Api error. - * - * @member {array} [details] The Api error details - * @member {object} [innererror] The Api inner error - * @member {string} [innererror.exceptiontype] The exception type. - * @member {string} [innererror.errordetail] The internal error message or - * exception dump. - * @member {string} [code] The error code. - * @member {string} [target] The target of the particular error. - * @member {string} [message] The error message. - */ -export interface ApiError { - details?: ApiErrorBase[]; - innererror?: InnerError; - code?: string; - target?: string; - message?: string; -} - /** * @class * Initializes a new instance of the RollingUpgradeStatusInfo class. @@ -5940,6 +6127,19 @@ export interface AvailabilitySetListResult extends Array { export interface VirtualMachineSizeListResult extends Array { } +/** + * @class + * Initializes a new instance of the VirtualMachineListResult class. + * @constructor + * The List Virtual Machine operation response. + * + * @member {string} [nextLink] The URI to fetch the next page of VMs. Call + * ListNext() with this URI to fetch the next page of Virtual Machines. + */ +export interface VirtualMachineListResult extends Array { + nextLink?: string; +} + /** * @class * Initializes a new instance of the ListUsagesResult class. @@ -5967,19 +6167,6 @@ export interface ImageListResult extends Array { nextLink?: string; } -/** - * @class - * Initializes a new instance of the VirtualMachineListResult class. - * @constructor - * The List Virtual Machine operation response. - * - * @member {string} [nextLink] The URI to fetch the next page of VMs. Call - * ListNext() with this URI to fetch the next page of Virtual Machines. - */ -export interface VirtualMachineListResult extends Array { - nextLink?: string; -} - /** * @class * Initializes a new instance of the VirtualMachineScaleSetListResult class. @@ -6022,6 +6209,20 @@ export interface VirtualMachineScaleSetListSkusResult extends Array { + nextLink?: string; +} + /** * @class * Initializes a new instance of the VirtualMachineScaleSetExtensionListResult class. diff --git a/lib/services/computeManagement2/lib/models/index.js b/lib/services/computeManagement2/lib/models/index.js index 72bacd7a1f..b15efc8b72 100644 --- a/lib/services/computeManagement2/lib/models/index.js +++ b/lib/services/computeManagement2/lib/models/index.js @@ -31,6 +31,8 @@ exports.VirtualMachineExtensionImage = require('./virtualMachineExtensionImage') exports.VirtualMachineImageResource = require('./virtualMachineImageResource'); exports.VirtualMachineExtensionInstanceView = require('./virtualMachineExtensionInstanceView'); exports.VirtualMachineExtension = require('./virtualMachineExtension'); +exports.VirtualMachineExtensionUpdate = require('./virtualMachineExtensionUpdate'); +exports.VirtualMachineExtensionsListResult = require('./virtualMachineExtensionsListResult'); exports.PurchasePlan = require('./purchasePlan'); exports.OSDiskImage = require('./oSDiskImage'); exports.DataDiskImage = require('./dataDiskImage'); @@ -115,14 +117,17 @@ exports.VirtualMachineScaleSetVMExtensionsSummary = require('./virtualMachineSca exports.VirtualMachineScaleSetInstanceView = require('./virtualMachineScaleSetInstanceView'); exports.VirtualMachineScaleSetSkuCapacity = require('./virtualMachineScaleSetSkuCapacity'); exports.VirtualMachineScaleSetSku = require('./virtualMachineScaleSetSku'); -exports.VirtualMachineScaleSetVM = require('./virtualMachineScaleSetVM'); -exports.VirtualMachineHealthStatus = require('./virtualMachineHealthStatus'); -exports.VirtualMachineScaleSetVMInstanceView = require('./virtualMachineScaleSetVMInstanceView'); -exports.RollingUpgradeRunningStatus = require('./rollingUpgradeRunningStatus'); +exports.UpgradeOperationHistoryStatus = require('./upgradeOperationHistoryStatus'); exports.RollingUpgradeProgressInfo = require('./rollingUpgradeProgressInfo'); exports.ApiErrorBase = require('./apiErrorBase'); exports.InnerError = require('./innerError'); exports.ApiError = require('./apiError'); +exports.UpgradeOperationHistoricalStatusInfoProperties = require('./upgradeOperationHistoricalStatusInfoProperties'); +exports.UpgradeOperationHistoricalStatusInfo = require('./upgradeOperationHistoricalStatusInfo'); +exports.VirtualMachineScaleSetVM = require('./virtualMachineScaleSetVM'); +exports.VirtualMachineHealthStatus = require('./virtualMachineHealthStatus'); +exports.VirtualMachineScaleSetVMInstanceView = require('./virtualMachineScaleSetVMInstanceView'); +exports.RollingUpgradeRunningStatus = require('./rollingUpgradeRunningStatus'); exports.RollingUpgradeStatusInfo = require('./rollingUpgradeStatusInfo'); exports.ComputeLongRunningOperationProperties = require('./computeLongRunningOperationProperties'); exports.RecoveryWalkResponse = require('./recoveryWalkResponse'); @@ -175,12 +180,13 @@ exports.ContainerService = require('./containerService'); exports.ComputeOperationListResult = require('./computeOperationListResult'); exports.AvailabilitySetListResult = require('./availabilitySetListResult'); exports.VirtualMachineSizeListResult = require('./virtualMachineSizeListResult'); +exports.VirtualMachineListResult = require('./virtualMachineListResult'); exports.ListUsagesResult = require('./listUsagesResult'); exports.ImageListResult = require('./imageListResult'); -exports.VirtualMachineListResult = require('./virtualMachineListResult'); exports.VirtualMachineScaleSetListResult = require('./virtualMachineScaleSetListResult'); exports.VirtualMachineScaleSetListWithLinkResult = require('./virtualMachineScaleSetListWithLinkResult'); exports.VirtualMachineScaleSetListSkusResult = require('./virtualMachineScaleSetListSkusResult'); +exports.VirtualMachineScaleSetListOSUpgradeHistory = require('./virtualMachineScaleSetListOSUpgradeHistory'); exports.VirtualMachineScaleSetExtensionListResult = require('./virtualMachineScaleSetExtensionListResult'); exports.VirtualMachineScaleSetVMListResult = require('./virtualMachineScaleSetVMListResult'); exports.RunCommandListResult = require('./runCommandListResult'); diff --git a/lib/services/computeManagement2/lib/models/platformImageReference.js b/lib/services/computeManagement2/lib/models/platformImageReference.js new file mode 100644 index 0000000000..142d177af5 --- /dev/null +++ b/lib/services/computeManagement2/lib/models/platformImageReference.js @@ -0,0 +1,89 @@ +/* + * 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'; + +/** + * A reference that identifies a CRP-PIR image or a UserVMImage. + * + */ +class PlatformImageReference { + /** + * Create a PlatformImageReference. + * @member {string} [publisher] Image publisher + * @member {string} [offer] Offer type + * @member {string} [sku] Sku type + * @member {string} [version] Version of the image + * @member {string} [uri] Specifies the virtual hard disk's uri. + */ + constructor() { + } + + /** + * Defines the metadata of PlatformImageReference + * + * @returns {object} metadata of PlatformImageReference + * + */ + mapper() { + return { + required: false, + serializedName: 'PlatformImageReference', + type: { + name: 'Composite', + className: 'PlatformImageReference', + modelProperties: { + publisher: { + required: false, + readOnly: true, + serializedName: 'publisher', + type: { + name: 'String' + } + }, + offer: { + required: false, + readOnly: true, + serializedName: 'offer', + type: { + name: 'String' + } + }, + sku: { + required: false, + readOnly: true, + serializedName: 'sku', + type: { + name: 'String' + } + }, + version: { + required: false, + readOnly: true, + serializedName: 'version', + type: { + name: 'String' + } + }, + uri: { + required: false, + readOnly: true, + serializedName: 'uri', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = PlatformImageReference; diff --git a/lib/services/computeManagement2/lib/models/upgradeOperationHistoricalStatusInfo.js b/lib/services/computeManagement2/lib/models/upgradeOperationHistoricalStatusInfo.js new file mode 100644 index 0000000000..daf419ea2b --- /dev/null +++ b/lib/services/computeManagement2/lib/models/upgradeOperationHistoricalStatusInfo.js @@ -0,0 +1,120 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Virtual Machine Scale Set OS Upgrade History operation response. + * + */ +class UpgradeOperationHistoricalStatusInfo { + /** + * Create a UpgradeOperationHistoricalStatusInfo. + * @member {object} [properties] Information about the properties of the + * upgrade operation. + * @member {object} [properties.runningStatus] Information about the overall + * status of the upgrade operation. + * @member {string} [properties.runningStatus.code] Code indicating the + * current status of the upgrade. Possible values include: 'RollingForward', + * 'Cancelled', 'Completed', 'Faulted' + * @member {date} [properties.runningStatus.startTime] Start time of the + * upgrade. + * @member {date} [properties.runningStatus.endTime] End time of the upgrade. + * @member {object} [properties.progress] Counts of the VM's in each state. + * @member {number} [properties.progress.successfulInstanceCount] The number + * of instances that have been successfully upgraded. + * @member {number} [properties.progress.failedInstanceCount] The number of + * instances that have failed to be upgraded successfully. + * @member {number} [properties.progress.inProgressInstanceCount] The number + * of instances that are currently being upgraded. + * @member {number} [properties.progress.pendingInstanceCount] The number of + * instances that have not yet begun to be upgraded. + * @member {object} [properties.error] Error Details for this upgrade if + * there are any. + * @member {array} [properties.error.details] The Api error details + * @member {object} [properties.error.innererror] The Api inner error + * @member {string} [properties.error.innererror.exceptiontype] The exception + * type. + * @member {string} [properties.error.innererror.errordetail] The internal + * error message or exception dump. + * @member {string} [properties.error.code] The error code. + * @member {string} [properties.error.target] The target of the particular + * error. + * @member {string} [properties.error.message] The error message. + * @member {string} [properties.startedBy] Invoker of the Upgrade Operation. + * Possible values include: 'Unknown', 'User', 'Platform' + * @member {object} [properties.targetImageReference] Image Reference details + * @member {string} [properties.targetImageReference.publisher] The image + * publisher. + * @member {string} [properties.targetImageReference.offer] Specifies the + * offer of the platform image or marketplace image used to create the + * virtual machine. + * @member {string} [properties.targetImageReference.sku] The image SKU. + * @member {string} [properties.targetImageReference.version] Specifies the + * version of the platform image or marketplace image used to create the + * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the + * latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time + * even if a new version becomes available. + * @member {string} [type] Resource type + * @member {string} [location] Resource location + */ + constructor() { + } + + /** + * Defines the metadata of UpgradeOperationHistoricalStatusInfo + * + * @returns {object} metadata of UpgradeOperationHistoricalStatusInfo + * + */ + mapper() { + return { + required: false, + serializedName: 'UpgradeOperationHistoricalStatusInfo', + type: { + name: 'Composite', + className: 'UpgradeOperationHistoricalStatusInfo', + modelProperties: { + properties: { + required: false, + readOnly: true, + serializedName: 'properties', + type: { + name: 'Composite', + className: 'UpgradeOperationHistoricalStatusInfoProperties' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: false, + readOnly: true, + serializedName: 'location', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = UpgradeOperationHistoricalStatusInfo; diff --git a/lib/services/computeManagement2/lib/models/upgradeOperationHistoricalStatusInfoProperties.js b/lib/services/computeManagement2/lib/models/upgradeOperationHistoricalStatusInfoProperties.js new file mode 100644 index 0000000000..caea20f210 --- /dev/null +++ b/lib/services/computeManagement2/lib/models/upgradeOperationHistoricalStatusInfoProperties.js @@ -0,0 +1,130 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Describes each OS upgrade on the Virtual Machine Scale Set. + * + */ +class UpgradeOperationHistoricalStatusInfoProperties { + /** + * Create a UpgradeOperationHistoricalStatusInfoProperties. + * @member {object} [runningStatus] Information about the overall status of + * the upgrade operation. + * @member {string} [runningStatus.code] Code indicating the current status + * of the upgrade. Possible values include: 'RollingForward', 'Cancelled', + * 'Completed', 'Faulted' + * @member {date} [runningStatus.startTime] Start time of the upgrade. + * @member {date} [runningStatus.endTime] End time of the upgrade. + * @member {object} [progress] Counts of the VM's in each state. + * @member {number} [progress.successfulInstanceCount] The number of + * instances that have been successfully upgraded. + * @member {number} [progress.failedInstanceCount] The number of instances + * that have failed to be upgraded successfully. + * @member {number} [progress.inProgressInstanceCount] The number of + * instances that are currently being upgraded. + * @member {number} [progress.pendingInstanceCount] The number of instances + * that have not yet begun to be upgraded. + * @member {object} [error] Error Details for this upgrade if there are any. + * @member {array} [error.details] The Api error details + * @member {object} [error.innererror] The Api inner error + * @member {string} [error.innererror.exceptiontype] The exception type. + * @member {string} [error.innererror.errordetail] The internal error message + * or exception dump. + * @member {string} [error.code] The error code. + * @member {string} [error.target] The target of the particular error. + * @member {string} [error.message] The error message. + * @member {string} [startedBy] Invoker of the Upgrade Operation. Possible + * values include: 'Unknown', 'User', 'Platform' + * @member {object} [targetImageReference] Image Reference details + * @member {string} [targetImageReference.publisher] The image publisher. + * @member {string} [targetImageReference.offer] Specifies the offer of the + * platform image or marketplace image used to create the virtual machine. + * @member {string} [targetImageReference.sku] The image SKU. + * @member {string} [targetImageReference.version] Specifies the version of + * the platform image or marketplace image used to create the virtual + * machine. The allowed formats are Major.Minor.Build or 'latest'. Major, + * Minor, and Build are decimal numbers. Specify 'latest' to use the latest + * version of an image available at deploy time. Even if you use 'latest', + * the VM image will not automatically update after deploy time even if a new + * version becomes available. + */ + constructor() { + } + + /** + * Defines the metadata of UpgradeOperationHistoricalStatusInfoProperties + * + * @returns {object} metadata of UpgradeOperationHistoricalStatusInfoProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'UpgradeOperationHistoricalStatusInfoProperties', + type: { + name: 'Composite', + className: 'UpgradeOperationHistoricalStatusInfoProperties', + modelProperties: { + runningStatus: { + required: false, + readOnly: true, + serializedName: 'runningStatus', + type: { + name: 'Composite', + className: 'UpgradeOperationHistoryStatus' + } + }, + progress: { + required: false, + readOnly: true, + serializedName: 'progress', + type: { + name: 'Composite', + className: 'RollingUpgradeProgressInfo' + } + }, + error: { + required: false, + readOnly: true, + serializedName: 'error', + type: { + name: 'Composite', + className: 'ApiError' + } + }, + startedBy: { + required: false, + readOnly: true, + serializedName: 'startedBy', + type: { + name: 'Enum', + allowedValues: [ 'Unknown', 'User', 'Platform' ] + } + }, + targetImageReference: { + required: false, + readOnly: true, + serializedName: 'targetImageReference', + type: { + name: 'Composite', + className: 'ImageReference' + } + } + } + } + }; + } +} + +module.exports = UpgradeOperationHistoricalStatusInfoProperties; diff --git a/lib/services/computeManagement2/lib/models/upgradeOperationHistoryStatus.js b/lib/services/computeManagement2/lib/models/upgradeOperationHistoryStatus.js new file mode 100644 index 0000000000..989c1480d4 --- /dev/null +++ b/lib/services/computeManagement2/lib/models/upgradeOperationHistoryStatus.js @@ -0,0 +1,74 @@ +/* + * 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'; + +/** + * Information about the current running state of the overall upgrade. + * + */ +class UpgradeOperationHistoryStatus { + /** + * Create a UpgradeOperationHistoryStatus. + * @member {string} [code] Code indicating the current status of the upgrade. + * Possible values include: 'RollingForward', 'Cancelled', 'Completed', + * 'Faulted' + * @member {date} [startTime] Start time of the upgrade. + * @member {date} [endTime] End time of the upgrade. + */ + constructor() { + } + + /** + * Defines the metadata of UpgradeOperationHistoryStatus + * + * @returns {object} metadata of UpgradeOperationHistoryStatus + * + */ + mapper() { + return { + required: false, + serializedName: 'UpgradeOperationHistoryStatus', + type: { + name: 'Composite', + className: 'UpgradeOperationHistoryStatus', + modelProperties: { + code: { + required: false, + readOnly: true, + serializedName: 'code', + type: { + name: 'Enum', + allowedValues: [ 'RollingForward', 'Cancelled', 'Completed', 'Faulted' ] + } + }, + startTime: { + required: false, + readOnly: true, + serializedName: 'startTime', + type: { + name: 'DateTime' + } + }, + endTime: { + required: false, + readOnly: true, + serializedName: 'endTime', + type: { + name: 'DateTime' + } + } + } + } + }; + } +} + +module.exports = UpgradeOperationHistoryStatus; diff --git a/lib/services/computeManagement2/lib/models/virtualMachineExtensionUpdate.js b/lib/services/computeManagement2/lib/models/virtualMachineExtensionUpdate.js new file mode 100644 index 0000000000..4e7ec262f9 --- /dev/null +++ b/lib/services/computeManagement2/lib/models/virtualMachineExtensionUpdate.js @@ -0,0 +1,127 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Describes a Virtual Machine Extension. + * + * @extends models['UpdateResource'] + */ +class VirtualMachineExtensionUpdate extends models['UpdateResource'] { + /** + * Create a VirtualMachineExtensionUpdate. + * @member {string} [forceUpdateTag] How the extension handler should be + * forced to update even if the extension configuration has not changed. + * @member {string} [publisher] The name of the extension handler publisher. + * @member {string} [type] Specifies the type of the extension; an example is + * "CustomScriptExtension". + * @member {string} [typeHandlerVersion] Specifies the version of the script + * handler. + * @member {boolean} [autoUpgradeMinorVersion] Indicates whether the + * extension should use a newer minor version if one is available at + * deployment time. Once deployed, however, the extension will not upgrade + * minor versions unless redeployed, even with this property set to true. + * @member {object} [settings] Json formatted public settings for the + * extension. + * @member {object} [protectedSettings] The extension can contain either + * protectedSettings or protectedSettingsFromKeyVault or no protected + * settings at all. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VirtualMachineExtensionUpdate + * + * @returns {object} metadata of VirtualMachineExtensionUpdate + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineExtensionUpdate', + type: { + name: 'Composite', + className: 'VirtualMachineExtensionUpdate', + modelProperties: { + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + forceUpdateTag: { + required: false, + serializedName: 'properties.forceUpdateTag', + type: { + name: 'String' + } + }, + publisher: { + required: false, + serializedName: 'properties.publisher', + type: { + name: 'String' + } + }, + type: { + required: false, + serializedName: 'properties.type', + type: { + name: 'String' + } + }, + typeHandlerVersion: { + required: false, + serializedName: 'properties.typeHandlerVersion', + type: { + name: 'String' + } + }, + autoUpgradeMinorVersion: { + required: false, + serializedName: 'properties.autoUpgradeMinorVersion', + type: { + name: 'Boolean' + } + }, + settings: { + required: false, + serializedName: 'properties.settings', + type: { + name: 'Object' + } + }, + protectedSettings: { + required: false, + serializedName: 'properties.protectedSettings', + type: { + name: 'Object' + } + } + } + } + }; + } +} + +module.exports = VirtualMachineExtensionUpdate; diff --git a/lib/services/computeManagement2/lib/models/virtualMachineExtensionsListResult.js b/lib/services/computeManagement2/lib/models/virtualMachineExtensionsListResult.js new file mode 100644 index 0000000000..f3d08ea382 --- /dev/null +++ b/lib/services/computeManagement2/lib/models/virtualMachineExtensionsListResult.js @@ -0,0 +1,62 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The List Extension operation response + * + */ +class VirtualMachineExtensionsListResult { + /** + * Create a VirtualMachineExtensionsListResult. + * @member {array} [value] The list of extensions + */ + constructor() { + } + + /** + * Defines the metadata of VirtualMachineExtensionsListResult + * + * @returns {object} metadata of VirtualMachineExtensionsListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineExtensionsListResult', + type: { + name: 'Composite', + className: 'VirtualMachineExtensionsListResult', + modelProperties: { + value: { + required: false, + serializedName: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VirtualMachineExtensionElementType', + type: { + name: 'Composite', + className: 'VirtualMachineExtension' + } + } + } + } + } + } + }; + } +} + +module.exports = VirtualMachineExtensionsListResult; diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSet.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSet.js index 58136094b6..d85a4e7c6f 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSet.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSet.js @@ -291,6 +291,10 @@ class VirtualMachineScaleSet extends models['Resource'] { * @member {string} [virtualMachineProfile.priority] Specifies the priority * for the virtual machines in the scale set.

    Minimum api-version: * 2017-10-30-preview. Possible values include: 'Regular', 'Low' + * @member {string} [virtualMachineProfile.evictionPolicy] Specifies the + * eviction policy for virtual machines in the low priority scale set. + *

    Minimum api-version: 2017-10-30-preview. Possible values include: + * 'Deallocate', 'Delete' * @member {string} [provisioningState] The provisioning state, which only * appears in the response. * @member {boolean} [overprovision] Specifies whether the Virtual Machine diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetListOSUpgradeHistory.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetListOSUpgradeHistory.js new file mode 100644 index 0000000000..67be7c8893 --- /dev/null +++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetListOSUpgradeHistory.js @@ -0,0 +1,69 @@ +/* + * 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 Virtual Machine Scale Set OS Upgrade History operation response. + */ +class VirtualMachineScaleSetListOSUpgradeHistory extends Array { + /** + * Create a VirtualMachineScaleSetListOSUpgradeHistory. + * @member {string} [nextLink] The uri to fetch the next page of OS Upgrade + * History. Call ListNext() with this to fetch the next page of history of + * upgrades. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VirtualMachineScaleSetListOSUpgradeHistory + * + * @returns {object} metadata of VirtualMachineScaleSetListOSUpgradeHistory + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineScaleSetListOSUpgradeHistory', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetListOSUpgradeHistory', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'UpgradeOperationHistoricalStatusInfoElementType', + type: { + name: 'Composite', + className: 'UpgradeOperationHistoricalStatusInfo' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VirtualMachineScaleSetListOSUpgradeHistory; diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetOSUpgradeHistory.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetOSUpgradeHistory.js new file mode 100644 index 0000000000..011548aa8c --- /dev/null +++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetOSUpgradeHistory.js @@ -0,0 +1,128 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Describes each OS upgrade on the Virtual Machine Scale Set. + * + */ +class VirtualMachineScaleSetOSUpgradeHistory { + /** + * Create a VirtualMachineScaleSetOSUpgradeHistory. + * @member {object} [runningStatus] Information about the overall status of + * the upgrade operation. + * @member {string} [runningStatus.code] Code indicating the current status + * of the upgrade. Possible values include: 'RollingForward', 'Cancelled', + * 'Completed', 'Faulted' + * @member {date} [runningStatus.startTime] Start time of the upgrade. + * @member {string} [runningStatus.lastAction] The last action performed on + * the rolling upgrade. Possible values include: 'Start', 'Cancel' + * @member {date} [runningStatus.lastActionTime] Last action time of the + * upgrade. + * @member {object} [progressInfo] Counts of the VM's in each state. + * @member {number} [progressInfo.successfulInstanceCount] The number of + * instances that have been successfully upgraded. + * @member {number} [progressInfo.failedInstanceCount] The number of + * instances that have failed to be upgraded successfully. + * @member {number} [progressInfo.inProgressInstanceCount] The number of + * instances that are currently being upgraded. + * @member {number} [progressInfo.pendingInstanceCount] The number of + * instances that have not yet begun to be upgraded. + * @member {object} [error] Error Details for this upgrade if there are any. + * @member {array} [error.details] The Api error details + * @member {object} [error.innererror] The Api inner error + * @member {string} [error.innererror.exceptiontype] The exception type. + * @member {string} [error.innererror.errordetail] The internal error message + * or exception dump. + * @member {string} [error.code] The error code. + * @member {string} [error.target] The target of the particular error. + * @member {string} [error.message] The error message. + * @member {string} [startedBy] Error Details for this upgrade if there are + * any. Possible values include: 'Unknown', 'User', 'Platform' + * @member {object} [targetImageReference] Error Details for this upgrade if + * there are any. + * @member {string} [targetImageReference.publisher] Publisher + * @member {string} [targetImageReference.offer] Offer + * @member {string} [targetImageReference.sku] Sku + * @member {string} [targetImageReference.version] Version + * @member {string} [targetImageReference.uri] Specifies the virtual hard + * disk's uri. + */ + constructor() { + } + + /** + * Defines the metadata of VirtualMachineScaleSetOSUpgradeHistory + * + * @returns {object} metadata of VirtualMachineScaleSetOSUpgradeHistory + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualMachineScaleSetOSUpgradeHistory', + type: { + name: 'Composite', + className: 'VirtualMachineScaleSetOSUpgradeHistory', + modelProperties: { + runningStatus: { + required: false, + readOnly: true, + serializedName: 'runningStatus', + type: { + name: 'Composite', + className: 'RollingUpgradeRunningStatus' + } + }, + progressInfo: { + required: false, + readOnly: true, + serializedName: 'progressInfo', + type: { + name: 'Composite', + className: 'RollingUpgradeProgressInfo' + } + }, + error: { + required: false, + readOnly: true, + serializedName: 'error', + type: { + name: 'Composite', + className: 'ApiError' + } + }, + startedBy: { + required: false, + readOnly: true, + serializedName: 'startedBy', + type: { + name: 'String' + } + }, + targetImageReference: { + required: false, + readOnly: true, + serializedName: 'targetImageReference', + type: { + name: 'Composite', + className: 'PlatformImageReference' + } + } + } + } + }; + } +} + +module.exports = VirtualMachineScaleSetOSUpgradeHistory; diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVMProfile.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVMProfile.js index 59d202754a..e95c329133 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVMProfile.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVMProfile.js @@ -199,6 +199,10 @@ class VirtualMachineScaleSetVMProfile { * @member {string} [priority] Specifies the priority for the virtual * machines in the scale set.

    Minimum api-version: * 2017-10-30-preview. Possible values include: 'Regular', 'Low' + * @member {string} [evictionPolicy] Specifies the eviction policy for + * virtual machines in the low priority scale set.

    Minimum + * api-version: 2017-10-30-preview. Possible values include: 'Deallocate', + * 'Delete' */ constructor() { } @@ -270,6 +274,13 @@ class VirtualMachineScaleSetVMProfile { type: { name: 'String' } + }, + evictionPolicy: { + required: false, + serializedName: 'evictionPolicy', + type: { + name: 'String' + } } } } diff --git a/lib/services/computeManagement2/lib/operations/index.d.ts b/lib/services/computeManagement2/lib/operations/index.d.ts index 1f87baf8f6..4859331c76 100644 --- a/lib/services/computeManagement2/lib/operations/index.d.ts +++ b/lib/services/computeManagement2/lib/operations/index.d.ts @@ -757,7 +757,7 @@ export interface VirtualMachineExtensions { * @param {string} resourceGroupName The name of the resource group. * * @param {string} vmName The name of the virtual machine where the extension - * should be create or updated. + * should be created or updated. * * @param {string} vmExtensionName The name of the virtual machine extension. * @@ -830,7 +830,7 @@ export interface VirtualMachineExtensions { * @param {string} resourceGroupName The name of the resource group. * * @param {string} vmName The name of the virtual machine where the extension - * should be create or updated. + * should be created or updated. * * @param {string} vmExtensionName The name of the virtual machine extension. * @@ -917,6 +917,132 @@ export interface VirtualMachineExtensions { createOrUpdate(resourceGroupName: string, vmName: string, vmExtensionName: string, extensionParameters: models.VirtualMachineExtension, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** + * The operation to update the extension. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine where the extension + * should be updated. + * + * @param {string} vmExtensionName The name of the virtual machine extension. + * + * @param {object} extensionParameters Parameters supplied to the Update + * Virtual Machine Extension operation. + * + * @param {string} [extensionParameters.forceUpdateTag] How the extension + * handler should be forced to update even if the extension configuration has + * not changed. + * + * @param {string} [extensionParameters.publisher] The name of the extension + * handler publisher. + * + * @param {string} [extensionParameters.type] Specifies the type of the + * extension; an example is "CustomScriptExtension". + * + * @param {string} [extensionParameters.typeHandlerVersion] Specifies the + * version of the script handler. + * + * @param {boolean} [extensionParameters.autoUpgradeMinorVersion] Indicates + * whether the extension should use a newer minor version if one is available + * at deployment time. Once deployed, however, the extension will not upgrade + * minor versions unless redeployed, even with this property set to true. + * + * @param {object} [extensionParameters.settings] Json formatted public + * settings for the extension. + * + * @param {object} [extensionParameters.protectedSettings] The extension can + * contain either protectedSettings or protectedSettingsFromKeyVault or no + * protected settings at all. + * + * @param {object} [extensionParameters.tags] Resource tags + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + updateWithHttpOperationResponse(resourceGroupName: string, vmName: string, vmExtensionName: string, extensionParameters: models.VirtualMachineExtensionUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * The operation to update the extension. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine where the extension + * should be updated. + * + * @param {string} vmExtensionName The name of the virtual machine extension. + * + * @param {object} extensionParameters Parameters supplied to the Update + * Virtual Machine Extension operation. + * + * @param {string} [extensionParameters.forceUpdateTag] How the extension + * handler should be forced to update even if the extension configuration has + * not changed. + * + * @param {string} [extensionParameters.publisher] The name of the extension + * handler publisher. + * + * @param {string} [extensionParameters.type] Specifies the type of the + * extension; an example is "CustomScriptExtension". + * + * @param {string} [extensionParameters.typeHandlerVersion] Specifies the + * version of the script handler. + * + * @param {boolean} [extensionParameters.autoUpgradeMinorVersion] Indicates + * whether the extension should use a newer minor version if one is available + * at deployment time. Once deployed, however, the extension will not upgrade + * minor versions unless redeployed, even with this property set to true. + * + * @param {object} [extensionParameters.settings] Json formatted public + * settings for the extension. + * + * @param {object} [extensionParameters.protectedSettings] The extension can + * contain either protectedSettings or protectedSettingsFromKeyVault or no + * protected settings at all. + * + * @param {object} [extensionParameters.tags] Resource tags + * + * @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 {VirtualMachineExtension} - 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. + * + * {VirtualMachineExtension} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineExtension} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + update(resourceGroupName: string, vmName: string, vmExtensionName: string, extensionParameters: models.VirtualMachineExtensionUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, vmName: string, vmExtensionName: string, extensionParameters: models.VirtualMachineExtensionUpdate, callback: ServiceCallback): void; + update(resourceGroupName: string, vmName: string, vmExtensionName: string, extensionParameters: models.VirtualMachineExtensionUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * The operation to delete the extension. * @@ -1061,7 +1187,7 @@ export interface VirtualMachineExtensions { * @param {string} resourceGroupName The name of the resource group. * * @param {string} vmName The name of the virtual machine where the extension - * should be create or updated. + * should be created or updated. * * @param {string} vmExtensionName The name of the virtual machine extension. * @@ -1134,7 +1260,7 @@ export interface VirtualMachineExtensions { * @param {string} resourceGroupName The name of the resource group. * * @param {string} vmName The name of the virtual machine where the extension - * should be create or updated. + * should be created or updated. * * @param {string} vmExtensionName The name of the virtual machine extension. * @@ -1222,15 +1348,45 @@ export interface VirtualMachineExtensions { /** - * The operation to delete the extension. + * The operation to update the extension. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} vmName The name of the virtual machine where the extension - * should be deleted. + * should be updated. * * @param {string} vmExtensionName The name of the virtual machine extension. * + * @param {object} extensionParameters Parameters supplied to the Update + * Virtual Machine Extension operation. + * + * @param {string} [extensionParameters.forceUpdateTag] How the extension + * handler should be forced to update even if the extension configuration has + * not changed. + * + * @param {string} [extensionParameters.publisher] The name of the extension + * handler publisher. + * + * @param {string} [extensionParameters.type] Specifies the type of the + * extension; an example is "CustomScriptExtension". + * + * @param {string} [extensionParameters.typeHandlerVersion] Specifies the + * version of the script handler. + * + * @param {boolean} [extensionParameters.autoUpgradeMinorVersion] Indicates + * whether the extension should use a newer minor version if one is available + * at deployment time. Once deployed, however, the extension will not upgrade + * minor versions unless redeployed, even with this property set to true. + * + * @param {object} [extensionParameters.settings] Json formatted public + * settings for the extension. + * + * @param {object} [extensionParameters.protectedSettings] The extension can + * contain either protectedSettings or protectedSettingsFromKeyVault or no + * protected settings at all. + * + * @param {object} [extensionParameters.tags] Resource tags + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -1238,22 +1394,52 @@ export interface VirtualMachineExtensions { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, vmName: string, vmExtensionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginUpdateWithHttpOperationResponse(resourceGroupName: string, vmName: string, vmExtensionName: string, extensionParameters: models.VirtualMachineExtensionUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * The operation to delete the extension. + * The operation to update the extension. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} vmName The name of the virtual machine where the extension - * should be deleted. + * should be updated. * * @param {string} vmExtensionName The name of the virtual machine extension. * + * @param {object} extensionParameters Parameters supplied to the Update + * Virtual Machine Extension operation. + * + * @param {string} [extensionParameters.forceUpdateTag] How the extension + * handler should be forced to update even if the extension configuration has + * not changed. + * + * @param {string} [extensionParameters.publisher] The name of the extension + * handler publisher. + * + * @param {string} [extensionParameters.type] Specifies the type of the + * extension; an example is "CustomScriptExtension". + * + * @param {string} [extensionParameters.typeHandlerVersion] Specifies the + * version of the script handler. + * + * @param {boolean} [extensionParameters.autoUpgradeMinorVersion] Indicates + * whether the extension should use a newer minor version if one is available + * at deployment time. Once deployed, however, the extension will not upgrade + * minor versions unless redeployed, even with this property set to true. + * + * @param {object} [extensionParameters.settings] Json formatted public + * settings for the extension. + * + * @param {object} [extensionParameters.protectedSettings] The extension can + * contain either protectedSettings or protectedSettingsFromKeyVault or no + * protected settings at all. + * + * @param {object} [extensionParameters.tags] Resource tags + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -1266,7 +1452,7 @@ export interface VirtualMachineExtensions { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {VirtualMachineExtension} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1274,40 +1460,28 @@ export interface VirtualMachineExtensions { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more + * {VirtualMachineExtension} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineExtension} 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. */ - beginDeleteMethod(resourceGroupName: string, vmName: string, vmExtensionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, vmName: string, vmExtensionName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, vmName: string, vmExtensionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * VirtualMachineImages - * __NOTE__: An instance of this class is automatically created for an - * instance of the ComputeManagementClient. - */ -export interface VirtualMachineImages { + beginUpdate(resourceGroupName: string, vmName: string, vmExtensionName: string, extensionParameters: models.VirtualMachineExtensionUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdate(resourceGroupName: string, vmName: string, vmExtensionName: string, extensionParameters: models.VirtualMachineExtensionUpdate, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, vmName: string, vmExtensionName: string, extensionParameters: models.VirtualMachineExtensionUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a virtual machine image. - * - * @param {string} location The name of a supported Azure region. - * - * @param {string} publisherName A valid image publisher. + * The operation to delete the extension. * - * @param {string} offer A valid image publisher offer. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} skus A valid image SKU. + * @param {string} vmName The name of the virtual machine where the extension + * should be deleted. * - * @param {string} version A valid image SKU version. + * @param {string} vmExtensionName The name of the virtual machine extension. * * @param {object} [options] Optional Parameters. * @@ -1316,24 +1490,21 @@ export interface VirtualMachineImages { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(location: string, publisherName: string, offer: string, skus: string, version: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, vmName: string, vmExtensionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a virtual machine image. - * - * @param {string} location The name of a supported Azure region. - * - * @param {string} publisherName A valid image publisher. + * The operation to delete the extension. * - * @param {string} offer A valid image publisher offer. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} skus A valid image SKU. + * @param {string} vmName The name of the virtual machine where the extension + * should be deleted. * - * @param {string} version A valid image SKU version. + * @param {string} vmExtensionName The name of the virtual machine extension. * * @param {object} [options] Optional Parameters. * @@ -1347,7 +1518,7 @@ export interface VirtualMachineImages { * * {Promise} A promise is returned. * - * @resolve {VirtualMachineImage} - The deserialized result object. + * @resolve {OperationStatusResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1355,68 +1526,64 @@ export interface VirtualMachineImages { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VirtualMachineImage} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualMachineImage} for more information. + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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(location: string, publisherName: string, offer: string, skus: string, version: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(location: string, publisherName: string, offer: string, skus: string, version: string, callback: ServiceCallback): void; - get(location: string, publisherName: string, offer: string, skus: string, version: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, vmName: string, vmExtensionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, vmName: string, vmExtensionName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, vmName: string, vmExtensionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * VirtualMachines + * __NOTE__: An instance of this class is automatically created for an + * instance of the ComputeManagementClient. + */ +export interface VirtualMachines { /** - * Gets a list of all virtual machine image versions for the specified - * location, publisher, offer, and SKU. + * The operation to get all extensions of a Virtual Machine. * - * @param {string} location The name of a supported Azure region. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} publisherName A valid image publisher. - * - * @param {string} offer A valid image publisher offer. - * - * @param {string} skus A valid image SKU. + * @param {string} vmName The name of the virtual machine containing the + * extension. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.filter] The filter to apply on the operation. - * - * @param {number} [options.top] - * - * @param {string} [options.orderby] + * @param {string} [options.expand] The expand expression to apply on the + * operation. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(location: string, publisherName: string, offer: string, skus: string, options?: { filter? : string, top? : number, orderby? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + getExtensionsWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of all virtual machine image versions for the specified - * location, publisher, offer, and SKU. - * - * @param {string} location The name of a supported Azure region. - * - * @param {string} publisherName A valid image publisher. + * The operation to get all extensions of a Virtual Machine. * - * @param {string} offer A valid image publisher offer. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} skus A valid image SKU. + * @param {string} vmName The name of the virtual machine containing the + * extension. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.filter] The filter to apply on the operation. - * - * @param {number} [options.top] - * - * @param {string} [options.orderby] + * @param {string} [options.expand] The expand expression to apply on the + * operation. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -1428,7 +1595,7 @@ export interface VirtualMachineImages { * * {Promise} A promise is returned. * - * @resolve {Array} - The deserialized result object. + * @resolve {VirtualMachineExtensionsListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1436,24 +1603,38 @@ export interface VirtualMachineImages { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Array} [result] - The deserialized result object if an error did not occur. + * {VirtualMachineExtensionsListResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineExtensionsListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - list(location: string, publisherName: string, offer: string, skus: string, options?: { filter? : string, top? : number, orderby? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - list(location: string, publisherName: string, offer: string, skus: string, callback: ServiceCallback): void; - list(location: string, publisherName: string, offer: string, skus: string, options: { filter? : string, top? : number, orderby? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getExtensions(resourceGroupName: string, vmName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + getExtensions(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + getExtensions(resourceGroupName: string, vmName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a list of virtual machine image offers for the specified location and - * publisher. + * Captures the VM by copying virtual hard disks of the VM and outputs a + * template that can be used to create similar VMs. * - * @param {string} location The name of a supported Azure region. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} publisherName A valid image publisher. + * @param {string} vmName The name of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Capture Virtual + * Machine operation. + * + * @param {string} parameters.vhdPrefix The captured virtual hard disk's name + * prefix. + * + * @param {string} parameters.destinationContainerName The destination + * container name. + * + * @param {boolean} parameters.overwriteVhds Specifies whether to overwrite the + * destination virtual hard disk, in case of conflict. * * @param {object} [options] Optional Parameters. * @@ -1462,19 +1643,31 @@ export interface VirtualMachineImages { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listOffersWithHttpOperationResponse(location: string, publisherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + captureWithHttpOperationResponse(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineCaptureParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of virtual machine image offers for the specified location and - * publisher. + * Captures the VM by copying virtual hard disks of the VM and outputs a + * template that can be used to create similar VMs. * - * @param {string} location The name of a supported Azure region. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} publisherName A valid image publisher. + * @param {string} vmName The name of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Capture Virtual + * Machine operation. + * + * @param {string} parameters.vhdPrefix The captured virtual hard disk's name + * prefix. + * + * @param {string} parameters.destinationContainerName The destination + * container name. + * + * @param {boolean} parameters.overwriteVhds Specifies whether to overwrite the + * destination virtual hard disk, in case of conflict. * * @param {object} [options] Optional Parameters. * @@ -1488,7 +1681,7 @@ export interface VirtualMachineImages { * * {Promise} A promise is returned. * - * @resolve {Array} - The deserialized result object. + * @resolve {VirtualMachineCaptureResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1496,280 +1689,403 @@ export interface VirtualMachineImages { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Array} [result] - The deserialized result object if an error did not occur. + * {VirtualMachineCaptureResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineCaptureResult} 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. */ - listOffers(location: string, publisherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listOffers(location: string, publisherName: string, callback: ServiceCallback): void; - listOffers(location: string, publisherName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + capture(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineCaptureParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + capture(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineCaptureParameters, callback: ServiceCallback): void; + capture(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineCaptureParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a list of virtual machine image publishers for the specified Azure - * location. - * - * @param {string} location The name of a supported Azure region. + * The operation to create or update a virtual machine. * - * @param {object} [options] Optional Parameters. + * @param {string} resourceGroupName The name of the resource group. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} vmName The name of the virtual machine. * - * @returns {Promise} A promise is returned + * @param {object} parameters Parameters supplied to the Create Virtual Machine + * operation. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {object} [parameters.plan] Specifies information about the + * marketplace image used to create the virtual machine. This element is only + * used for marketplace images. Before you can use a marketplace image from an + * API, you must enable the image for programmatic use. In the Azure portal, + * find the marketplace image that you want to use and then click **Want to + * deploy programmatically, Get Started ->**. Enter any required information + * and then click **Save**. * - * @reject {Error|ServiceError} - The error object. - */ - listPublishersWithHttpOperationResponse(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets a list of virtual machine image publishers for the specified Azure - * location. + * @param {string} [parameters.plan.name] The plan ID. * - * @param {string} location The name of a supported Azure region. + * @param {string} [parameters.plan.publisher] The publisher ID. * - * @param {object} [options] Optional Parameters. + * @param {string} [parameters.plan.product] Specifies the product of the image + * from the marketplace. This is the same value as Offer under the + * imageReference element. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [parameters.plan.promotionCode] The promotion code. * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {object} [parameters.hardwareProfile] Specifies the hardware settings + * for the virtual machine. * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @param {string} [parameters.hardwareProfile.vmSize] Specifies the size of + * the virtual machine. For more information about virtual machine sizes, see + * [Sizes for virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    The available VM sizes depend on region and availability set. For a + * list of available sizes use these APIs:

    [List all available + * virtual machine sizes in an availability + * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) + *

    [List all available virtual machine sizes in a + * region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) + *

    [List all available virtual machine sizes for + * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). + * Possible values include: '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_B1s', 'Standard_B1ms', + * 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', + * '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_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', + * 'Standard_D32_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', + * 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', + * 'Standard_D64s_v3', '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_DS13-4_v2', 'Standard_DS13-2_v2', + * 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', 'Standard_E2_v3', + * 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', 'Standard_E32_v3', + * 'Standard_E64_v3', 'Standard_E2s_v3', 'Standard_E4s_v3', 'Standard_E8s_v3', + * 'Standard_E16s_v3', 'Standard_E32s_v3', 'Standard_E64s_v3', + * 'Standard_E32-16_v3', 'Standard_E32-8s_v3', 'Standard_E64-32s_v3', + * 'Standard_E64-16s_v3', 'Standard_F1', 'Standard_F2', 'Standard_F4', + * 'Standard_F8', 'Standard_F16', 'Standard_F1s', 'Standard_F2s', + * 'Standard_F4s', 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2', + * 'Standard_F4s_v2', 'Standard_F8s_v2', 'Standard_F16s_v2', + * 'Standard_F32s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1', + * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', + * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', + * 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8', + * 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m', + * 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', + * 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms', + * 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms', + * 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms', + * 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', + * 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2', + * 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3', + * 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s', + * 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6', + * 'Standard_NV12', 'Standard_NV24' * - * {Promise} A promise is returned. + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. * - * @resolve {Array} - The deserialized result object. + * @param {object} [parameters.storageProfile.imageReference] Specifies + * information about the image to use. You can specify information about + * platform images, marketplace images, or virtual machine images. This element + * is required when you want to use a platform image, marketplace image, or + * virtual machine image, but is not used in other creation operations. * - * @reject {Error|ServiceError} - The error object. + * @param {string} [parameters.storageProfile.imageReference.publisher] The + * image publisher. * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {string} [parameters.storageProfile.imageReference.offer] Specifies + * the offer of the platform image or marketplace image used to create the + * virtual machine. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {string} [parameters.storageProfile.imageReference.sku] The image + * SKU. * - * {Array} [result] - The deserialized result object if an error did not occur. + * @param {string} [parameters.storageProfile.imageReference.version] Specifies + * the version of the platform image or marketplace image used to create the + * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the + * latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {string} [parameters.storageProfile.imageReference.id] Resource Id * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listPublishers(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listPublishers(location: string, callback: ServiceCallback): void; - listPublishers(location: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets a list of virtual machine image SKUs for the specified location, - * publisher, and offer. + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * - * @param {string} location The name of a supported Azure region. + * @param {string} [parameters.storageProfile.osDisk.osType] This property + * allows you to specify the type of the OS that is included in the disk if + * creating a VM from user-image or a specialized VHD.

    Possible values + * are:

    **Windows**

    **Linux**. Possible values include: + * 'Windows', 'Linux' * - * @param {string} publisherName A valid image publisher. + * @param {object} [parameters.storageProfile.osDisk.encryptionSettings] + * Specifies the encryption settings for the OS Disk.

    Minimum + * api-version: 2015-06-15 * - * @param {string} offer A valid image publisher offer. + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey] + * Specifies the location of the disk encryption key, which is a Key Vault + * Secret. * - * @param {object} [options] Optional Parameters. + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.secretUrl + * The URL referencing a secret in a Key Vault. * - * @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. - */ - listSkusWithHttpOperationResponse(location: string, publisherName: string, offer: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets a list of virtual machine image SKUs for the specified location, - * publisher, and offer. + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the secret. * - * @param {string} location The name of a supported Azure region. + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey] + * Specifies the location of the key encryption key in Key Vault. * - * @param {string} publisherName A valid image publisher. + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.keyUrl + * The URL referencing a key encryption key in Key Vault. * - * @param {string} offer A valid image publisher offer. + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the key. * - * @param {object} [options] Optional Parameters. + * @param {boolean} + * [parameters.storageProfile.osDisk.encryptionSettings.enabled] Specifies + * whether disk encryption should be enabled on the virtual machine. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [parameters.storageProfile.osDisk.name] The disk name. * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {object} [parameters.storageProfile.osDisk.vhd] The virtual hard + * disk. * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @param {object} [parameters.storageProfile.osDisk.image] The source user + * image virtual hard disk. The virtual hard disk will be copied before being + * attached to the virtual machine. If SourceImage is provided, the destination + * virtual hard drive must not exist. * - * {Promise} A promise is returned. + * @param {string} [parameters.storageProfile.osDisk.image.uri] Specifies the + * virtual hard disk's uri. * - * @resolve {Array} - The deserialized result object. + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' * - * @reject {Error|ServiceError} - The error object. + * @param {boolean} [parameters.storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {string} parameters.storageProfile.osDisk.createOption Specifies how + * the virtual machine should be created.

    Possible values are:

    + * **Attach** \u2013 This value is used when you are using a specialized disk + * to create the virtual machine.

    **FromImage** \u2013 This value is + * used when you are using an image to create the virtual machine. If you are + * using a platform image, you also use the imageReference element described + * above. If you are using a marketplace image, you also use the plan element + * previously described. Possible values include: 'FromImage', 'Empty', + * 'Attach' * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of an empty data disk in gigabytes. This element can be used to + * overwrite the name of the disk in a virtual machine image.

    This + * value cannot be larger than 1023 GB * - * {Array} [result] - The deserialized result object if an error did not occur. + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed + * disk parameters. * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {string} + * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies + * the storage account type for the managed disk. Possible values are: + * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listSkus(location: string, publisherName: string, offer: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listSkus(location: string, publisherName: string, offer: string, callback: ServiceCallback): void; - listSkus(location: string, publisherName: string, offer: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * UsageOperations - * __NOTE__: An instance of this class is automatically created for an - * instance of the ComputeManagementClient. - */ -export interface UsageOperations { - - - /** - * Gets, for the specified location, the current compute resource usage - * information as well as the limits for compute resources under the - * subscription. + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id * - * @param {string} location The location for which resource usage is queried. + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * - * @param {object} [options] Optional Parameters. + * @param {object} [parameters.osProfile] Specifies the operating system + * settings for the virtual machine. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [parameters.osProfile.computerName] Specifies the host OS + * name of the virtual machine.

    **Max-length (Windows):** 15 + * characters

    **Max-length (Linux):** 64 characters.

    For + * naming conventions and restrictions see [Azure infrastructure services + * implementation + * guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). * - * @returns {Promise} A promise is returned + * @param {string} [parameters.osProfile.adminUsername] Specifies the name of + * the administrator account.

    **Windows-only restriction:** Cannot end + * in "."

    **Disallowed values:** "administrator", "admin", "user", + * "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", + * "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", + * "john", "owner", "root", "server", "sql", "support", "support_388945a0", + * "sys", "test2", "test3", "user4", "user5".

    **Minimum-length + * (Linux):** 1 character

    **Max-length (Linux):** 64 characters + *

    **Max-length (Windows):** 20 characters

  • For root + * access to the Linux VM, see [Using root privileges on Linux virtual machines + * in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in this + * field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} [parameters.osProfile.adminPassword] Specifies the password + * of the administrator account.

    **Minimum-length (Windows):** 8 + * characters

    **Minimum-length (Linux):** 6 characters

    + * **Max-length (Windows):** 123 characters

    **Max-length (Linux):** 72 + * characters

    **Complexity requirements:** 3 out of 4 conditions below + * need to be fulfilled
    Has lower characters
    Has upper characters
    + * Has a digit
    Has a special character (Regex match [\W_])

    + * **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", + * "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", + * "iloveyou!"

    For resetting the password, see [How to reset the + * Remote Desktop service or its login password in a Windows + * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    For resetting root password, see [Manage users, SSH, and check or + * repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) * - * @reject {Error|ServiceError} - The error object. - */ - listWithHttpOperationResponse(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets, for the specified location, the current compute resource usage - * information as well as the limits for compute resources under the - * subscription. + * @param {string} [parameters.osProfile.customData] Specifies a base-64 + * encoded string of custom data. The base-64 encoded string is decoded to a + * binary array that is saved as a file on the Virtual Machine. The maximum + * length of the binary array is 65535 bytes.

    For using cloud-init for + * your VM, see [Using cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) * - * @param {string} location The location for which resource usage is queried. + * @param {object} [parameters.osProfile.windowsConfiguration] Specifies + * Windows operating system settings on the virtual machine. * - * @param {object} [options] Optional Parameters. + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.provisionVMAgent] Indicates + * whether virtual machine agent should be provisioned on the virtual machine. + *

    When this property is not specified in the request body, default + * behavior is to set it to true. This will ensure that VM Agent is installed + * on the VM so that extensions can be added to the VM later. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.enableAutomaticUpdates] Indicates + * whether virtual machine is enabled for automatic updates. * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {string} [parameters.osProfile.windowsConfiguration.timeZone] + * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @param {array} + * [parameters.osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. * - * {Promise} A promise is returned. + * @param {object} [parameters.osProfile.windowsConfiguration.winRM] Specifies + * the Windows Remote Management listeners. This enables remote Windows + * PowerShell. * - * @resolve {ListUsagesResult} - The deserialized result object. + * @param {array} [parameters.osProfile.windowsConfiguration.winRM.listeners] + * The list of Windows Remote Management listeners * - * @reject {Error|ServiceError} - The error object. + * @param {object} [parameters.osProfile.linuxConfiguration] Specifies the + * Linux operating system settings on the virtual machine.

    For a list + * of supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {boolean} + * [parameters.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {object} [parameters.osProfile.linuxConfiguration.ssh] Specifies the + * ssh key configuration for a Linux OS. * - * {ListUsagesResult} [result] - The deserialized result object if an error did not occur. - * See {@link ListUsagesResult} for more information. + * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The + * list of SSH public keys used to authenticate with linux based VMs. * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {array} [parameters.osProfile.secrets] Specifies set of certificates + * that should be installed onto the virtual machine. * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - list(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(location: string, callback: ServiceCallback): void; - list(location: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets, for the specified location, the current compute resource usage - * information as well as the limits for compute resources under the - * subscription. + * @param {object} [parameters.networkProfile] Specifies the network interfaces + * of the virtual machine. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {array} [parameters.networkProfile.networkInterfaces] Specifies the + * list of resource Ids for the network interfaces associated with the virtual + * machine. * - * @param {object} [options] Optional Parameters. + * @param {object} [parameters.diagnosticsProfile] Specifies the boot + * diagnostic settings state.

    Minimum api-version: 2015-06-15. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, + * you can easily view the output of your console log.

    For both + * Windows and Linux virtual machines, Azure also enables you to see a + * screenshot of the VM from the hypervisor. * - * @returns {Promise} A promise is returned + * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] + * Whether boot diagnostics should be enabled on the Virtual Machine. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} [parameters.diagnosticsProfile.bootDiagnostics.storageUri] + * Uri of the storage account to use for placing the console output and + * screenshot. * - * @reject {Error|ServiceError} - The error object. - */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets, for the specified location, the current compute resource usage - * information as well as the limits for compute resources under the - * subscription. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. + * @param {object} [parameters.availabilitySet] Specifies information about the + * availability set that the virtual machine should be assigned to. Virtual + * machines specified in the same availability set are allocated to different + * nodes to maximize availability. For more information about availability + * sets, see [Manage the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    For more information on Azure planned maintainance, see [Planned + * maintenance for virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Currently, a VM can only be added to availability set at creation + * time. An existing VM cannot be added to an availability set. * - * @resolve {ListUsagesResult} - The deserialized result object. + * @param {string} [parameters.availabilitySet.id] Resource Id * - * @reject {Error|ServiceError} - The error object. + * @param {string} [parameters.licenseType] Specifies that the image or disk + * that is being used was licensed on-premises. This element is only used for + * images that contain the Windows Server operating system.

    Possible + * values are:

    Windows_Client

    Windows_Server

    If this + * element is included in a request for an update, the value must match the + * initial value. This value cannot be updated.

    For more information, + * see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Minimum api-version: 2015-06-15 * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {object} [parameters.identity] The identity of the virtual machine, + * if configured. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {string} [parameters.identity.type] The type of identity used for the + * virtual machine. The type 'SystemAssigned, UserAssigned' includes both an + * implicitly created identity and a set of user assigned identities. The type + * 'None' will remove any identities from the virtual machine. Possible values + * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', + * 'None' * - * {ListUsagesResult} [result] - The deserialized result object if an error did not occur. - * See {@link ListUsagesResult} for more information. + * @param {array} [parameters.identity.identityIds] The list of user identities + * associated with the Virtual Machine. The user identity references will be + * ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {array} [parameters.zones] The virtual machine zones. * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * VirtualMachineSizes - * __NOTE__: An instance of this class is automatically created for an - * instance of the ComputeManagementClient. - */ -export interface VirtualMachineSizes { - - - /** - * Lists all available virtual machine sizes for a subscription in a location. + * @param {string} parameters.location Resource location * - * @param {string} location The location upon which virtual-machine-sizes is - * queried. + * @param {object} [parameters.tags] Resource tags * * @param {object} [options] Optional Parameters. * @@ -1778,182 +2094,185 @@ export interface VirtualMachineSizes { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, vmName: string, parameters: models.VirtualMachine, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists all available virtual machine sizes for a subscription in a location. - * - * @param {string} location The location upon which virtual-machine-sizes is - * queried. + * The operation to create or update a virtual machine. * - * @param {object} [options] Optional Parameters. + * @param {string} resourceGroupName The name of the resource group. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} vmName The name of the virtual machine. * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {object} parameters Parameters supplied to the Create Virtual Machine + * operation. * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @param {object} [parameters.plan] Specifies information about the + * marketplace image used to create the virtual machine. This element is only + * used for marketplace images. Before you can use a marketplace image from an + * API, you must enable the image for programmatic use. In the Azure portal, + * find the marketplace image that you want to use and then click **Want to + * deploy programmatically, Get Started ->**. Enter any required information + * and then click **Save**. * - * {Promise} A promise is returned. + * @param {string} [parameters.plan.name] The plan ID. * - * @resolve {VirtualMachineSizeListResult} - The deserialized result object. + * @param {string} [parameters.plan.publisher] The publisher ID. * - * @reject {Error|ServiceError} - The error object. + * @param {string} [parameters.plan.product] Specifies the product of the image + * from the marketplace. This is the same value as Offer under the + * imageReference element. * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {string} [parameters.plan.promotionCode] The promotion code. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {object} [parameters.hardwareProfile] Specifies the hardware settings + * for the virtual machine. * - * {VirtualMachineSizeListResult} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualMachineSizeListResult} for more - * information. + * @param {string} [parameters.hardwareProfile.vmSize] Specifies the size of + * the virtual machine. For more information about virtual machine sizes, see + * [Sizes for virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    The available VM sizes depend on region and availability set. For a + * list of available sizes use these APIs:

    [List all available + * virtual machine sizes in an availability + * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) + *

    [List all available virtual machine sizes in a + * region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) + *

    [List all available virtual machine sizes for + * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). + * Possible values include: '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_B1s', 'Standard_B1ms', + * 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', + * '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_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', + * 'Standard_D32_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', + * 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', + * 'Standard_D64s_v3', '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_DS13-4_v2', 'Standard_DS13-2_v2', + * 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', 'Standard_E2_v3', + * 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', 'Standard_E32_v3', + * 'Standard_E64_v3', 'Standard_E2s_v3', 'Standard_E4s_v3', 'Standard_E8s_v3', + * 'Standard_E16s_v3', 'Standard_E32s_v3', 'Standard_E64s_v3', + * 'Standard_E32-16_v3', 'Standard_E32-8s_v3', 'Standard_E64-32s_v3', + * 'Standard_E64-16s_v3', 'Standard_F1', 'Standard_F2', 'Standard_F4', + * 'Standard_F8', 'Standard_F16', 'Standard_F1s', 'Standard_F2s', + * 'Standard_F4s', 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2', + * 'Standard_F4s_v2', 'Standard_F8s_v2', 'Standard_F16s_v2', + * 'Standard_F32s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1', + * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', + * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', + * 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8', + * 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m', + * 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', + * 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms', + * 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms', + * 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms', + * 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', + * 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2', + * 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3', + * 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s', + * 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6', + * 'Standard_NV12', 'Standard_NV24' * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - list(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(location: string, callback: ServiceCallback): void; - list(location: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * Images - * __NOTE__: An instance of this class is automatically created for an - * instance of the ComputeManagementClient. - */ -export interface Images { - - - /** - * Create or update an image. + * @param {object} [parameters.storageProfile.imageReference] Specifies + * information about the image to use. You can specify information about + * platform images, marketplace images, or virtual machine images. This element + * is required when you want to use a platform image, marketplace image, or + * virtual machine image, but is not used in other creation operations. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} [parameters.storageProfile.imageReference.publisher] The + * image publisher. * - * @param {string} imageName The name of the image. + * @param {string} [parameters.storageProfile.imageReference.offer] Specifies + * the offer of the platform image or marketplace image used to create the + * virtual machine. * - * @param {object} parameters Parameters supplied to the Create Image - * operation. + * @param {string} [parameters.storageProfile.imageReference.sku] The image + * SKU. * - * @param {object} [parameters.sourceVirtualMachine] The source virtual machine - * from which Image is created. + * @param {string} [parameters.storageProfile.imageReference.version] Specifies + * the version of the platform image or marketplace image used to create the + * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the + * latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. * - * @param {object} [parameters.storageProfile] Specifies the storage settings - * for the virtual machine disks. + * @param {string} [parameters.storageProfile.imageReference.id] Resource Id * * @param {object} [parameters.storageProfile.osDisk] Specifies information * about the operating system disk used by the virtual machine.

    For * more information about disks, see [About disks and VHDs for Azure virtual * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * - * @param {string} parameters.storageProfile.osDisk.osType This property allows - * you to specify the type of the OS that is included in the disk if creating a - * VM from a custom image.

    Possible values are:

    **Windows** - *

    **Linux**. Possible values include: 'Windows', 'Linux' - * - * @param {string} parameters.storageProfile.osDisk.osState The OS State. - * Possible values include: 'Generalized', 'Specialized' + * @param {string} [parameters.storageProfile.osDisk.osType] This property + * allows you to specify the type of the OS that is included in the disk if + * creating a VM from user-image or a specialized VHD.

    Possible values + * are:

    **Windows**

    **Linux**. Possible values include: + * 'Windows', 'Linux' * - * @param {object} [parameters.storageProfile.osDisk.snapshot] The snapshot. + * @param {object} [parameters.storageProfile.osDisk.encryptionSettings] + * Specifies the encryption settings for the OS Disk.

    Minimum + * api-version: 2015-06-15 * - * @param {object} [parameters.storageProfile.osDisk.managedDisk] The - * managedDisk. + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey] + * Specifies the location of the disk encryption key, which is a Key Vault + * Secret. * - * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource - * Id - * - * @param {string} [parameters.storageProfile.osDisk.blobUri] The Virtual Hard - * Disk. - * - * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the - * caching requirements.

    Possible values are:

    **None** - *

    **ReadOnly**

    **ReadWrite**

    Default: **None for - * Standard storage. ReadOnly for Premium storage**. Possible values include: - * 'None', 'ReadOnly', 'ReadWrite' - * - * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the - * size of empty data disks in gigabytes. This element can be used to overwrite - * the name of the disk in a virtual machine image.

    This value cannot - * be larger than 1023 GB - * - * @param {string} [parameters.storageProfile.osDisk.storageAccountType] - * Specifies the storage account type for the managed disk. Possible values - * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' - * - * @param {array} [parameters.storageProfile.dataDisks] Specifies the - * parameters that are used to add a data disk to a virtual machine.

    - * For more information about disks, see [About disks and VHDs for Azure - * virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). - * - * @param {boolean} [parameters.storageProfile.zoneResilient] Specifies whether - * an image is zone resilient or not. Default is false. Zone resilient images - * can be created only in regions that provide Zone Redundant Storage (ZRS). - * - * @param {string} parameters.location Resource location - * - * @param {object} [parameters.tags] Resource tags - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, imageName: string, parameters: models.Image, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Create or update an image. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} imageName The name of the image. - * - * @param {object} parameters Parameters supplied to the Create Image - * operation. + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.secretUrl + * The URL referencing a secret in a Key Vault. * - * @param {object} [parameters.sourceVirtualMachine] The source virtual machine - * from which Image is created. + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the secret. * - * @param {object} [parameters.storageProfile] Specifies the storage settings - * for the virtual machine disks. + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey] + * Specifies the location of the key encryption key in Key Vault. * - * @param {object} [parameters.storageProfile.osDisk] Specifies information - * about the operating system disk used by the virtual machine.

    For - * more information about disks, see [About disks and VHDs for Azure virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.keyUrl + * The URL referencing a key encryption key in Key Vault. * - * @param {string} parameters.storageProfile.osDisk.osType This property allows - * you to specify the type of the OS that is included in the disk if creating a - * VM from a custom image.

    Possible values are:

    **Windows** - *

    **Linux**. Possible values include: 'Windows', 'Linux' + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the key. * - * @param {string} parameters.storageProfile.osDisk.osState The OS State. - * Possible values include: 'Generalized', 'Specialized' + * @param {boolean} + * [parameters.storageProfile.osDisk.encryptionSettings.enabled] Specifies + * whether disk encryption should be enabled on the virtual machine. * - * @param {object} [parameters.storageProfile.osDisk.snapshot] The snapshot. + * @param {string} [parameters.storageProfile.osDisk.name] The disk name. * - * @param {object} [parameters.storageProfile.osDisk.managedDisk] The - * managedDisk. + * @param {object} [parameters.storageProfile.osDisk.vhd] The virtual hard + * disk. * - * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource - * Id + * @param {object} [parameters.storageProfile.osDisk.image] The source user + * image virtual hard disk. The virtual hard disk will be copied before being + * attached to the virtual machine. If SourceImage is provided, the destination + * virtual hard drive must not exist. * - * @param {string} [parameters.storageProfile.osDisk.blobUri] The Virtual Hard - * Disk. + * @param {string} [parameters.storageProfile.osDisk.image.uri] Specifies the + * virtual hard disk's uri. * * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the * caching requirements.

    Possible values are:

    **None** @@ -1961,208 +2280,208 @@ export interface Images { * Standard storage. ReadOnly for Premium storage**. Possible values include: * 'None', 'ReadOnly', 'ReadWrite' * + * @param {boolean} [parameters.storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @param {string} parameters.storageProfile.osDisk.createOption Specifies how + * the virtual machine should be created.

    Possible values are:

    + * **Attach** \u2013 This value is used when you are using a specialized disk + * to create the virtual machine.

    **FromImage** \u2013 This value is + * used when you are using an image to create the virtual machine. If you are + * using a platform image, you also use the imageReference element described + * above. If you are using a marketplace image, you also use the plan element + * previously described. Possible values include: 'FromImage', 'Empty', + * 'Attach' + * * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the - * size of empty data disks in gigabytes. This element can be used to overwrite - * the name of the disk in a virtual machine image.

    This value cannot - * be larger than 1023 GB + * size of an empty data disk in gigabytes. This element can be used to + * overwrite the name of the disk in a virtual machine image.

    This + * value cannot be larger than 1023 GB * - * @param {string} [parameters.storageProfile.osDisk.storageAccountType] - * Specifies the storage account type for the managed disk. Possible values - * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed + * disk parameters. + * + * @param {string} + * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies + * the storage account type for the managed disk. Possible values are: + * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', * 'Premium_LRS' * + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id + * * @param {array} [parameters.storageProfile.dataDisks] Specifies the * parameters that are used to add a data disk to a virtual machine.

    * For more information about disks, see [About disks and VHDs for Azure * virtual * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * - * @param {boolean} [parameters.storageProfile.zoneResilient] Specifies whether - * an image is zone resilient or not. Default is false. Zone resilient images - * can be created only in regions that provide Zone Redundant Storage (ZRS). + * @param {object} [parameters.osProfile] Specifies the operating system + * settings for the virtual machine. * - * @param {string} parameters.location Resource location + * @param {string} [parameters.osProfile.computerName] Specifies the host OS + * name of the virtual machine.

    **Max-length (Windows):** 15 + * characters

    **Max-length (Linux):** 64 characters.

    For + * naming conventions and restrictions see [Azure infrastructure services + * implementation + * guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). * - * @param {object} [parameters.tags] Resource tags + * @param {string} [parameters.osProfile.adminUsername] Specifies the name of + * the administrator account.

    **Windows-only restriction:** Cannot end + * in "."

    **Disallowed values:** "administrator", "admin", "user", + * "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", + * "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", + * "john", "owner", "root", "server", "sql", "support", "support_388945a0", + * "sys", "test2", "test3", "user4", "user5".

    **Minimum-length + * (Linux):** 1 character

    **Max-length (Linux):** 64 characters + *

    **Max-length (Windows):** 20 characters

  • For root + * access to the Linux VM, see [Using root privileges on Linux virtual machines + * in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in this + * field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) * - * @param {object} [options] Optional Parameters. + * @param {string} [parameters.osProfile.adminPassword] Specifies the password + * of the administrator account.

    **Minimum-length (Windows):** 8 + * characters

    **Minimum-length (Linux):** 6 characters

    + * **Max-length (Windows):** 123 characters

    **Max-length (Linux):** 72 + * characters

    **Complexity requirements:** 3 out of 4 conditions below + * need to be fulfilled
    Has lower characters
    Has upper characters
    + * Has a digit
    Has a special character (Regex match [\W_])

    + * **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", + * "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", + * "iloveyou!"

    For resetting the password, see [How to reset the + * Remote Desktop service or its login password in a Windows + * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    For resetting root password, see [Manage users, SSH, and check or + * repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [parameters.osProfile.customData] Specifies a base-64 + * encoded string of custom data. The base-64 encoded string is decoded to a + * binary array that is saved as a file on the Virtual Machine. The maximum + * length of the binary array is 65535 bytes.

    For using cloud-init for + * your VM, see [Using cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {object} [parameters.osProfile.windowsConfiguration] Specifies + * Windows operating system settings on the virtual machine. * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.provisionVMAgent] Indicates + * whether virtual machine agent should be provisioned on the virtual machine. + *

    When this property is not specified in the request body, default + * behavior is to set it to true. This will ensure that VM Agent is installed + * on the VM so that extensions can be added to the VM later. * - * {Promise} A promise is returned. + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.enableAutomaticUpdates] Indicates + * whether virtual machine is enabled for automatic updates. * - * @resolve {Image} - The deserialized result object. + * @param {string} [parameters.osProfile.windowsConfiguration.timeZone] + * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" * - * @reject {Error|ServiceError} - The error object. + * @param {array} + * [parameters.osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {object} [parameters.osProfile.windowsConfiguration.winRM] Specifies + * the Windows Remote Management listeners. This enables remote Windows + * PowerShell. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {array} [parameters.osProfile.windowsConfiguration.winRM.listeners] + * The list of Windows Remote Management listeners * - * {Image} [result] - The deserialized result object if an error did not occur. - * See {@link Image} for more information. + * @param {object} [parameters.osProfile.linuxConfiguration] Specifies the + * Linux operating system settings on the virtual machine.

    For a list + * of supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {boolean} + * [parameters.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - createOrUpdate(resourceGroupName: string, imageName: string, parameters: models.Image, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, imageName: string, parameters: models.Image, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, imageName: string, parameters: models.Image, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Update an image. + * @param {object} [parameters.osProfile.linuxConfiguration.ssh] Specifies the + * ssh key configuration for a Linux OS. * - * @param {string} resourceGroupName The name of the resource group. + * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The + * list of SSH public keys used to authenticate with linux based VMs. * - * @param {string} imageName The name of the image. + * @param {array} [parameters.osProfile.secrets] Specifies set of certificates + * that should be installed onto the virtual machine. * - * @param {object} parameters Parameters supplied to the Update Image - * operation. + * @param {object} [parameters.networkProfile] Specifies the network interfaces + * of the virtual machine. * - * @param {object} [parameters.sourceVirtualMachine] The source virtual machine - * from which Image is created. - * - * @param {object} [parameters.storageProfile] Specifies the storage settings - * for the virtual machine disks. - * - * @param {object} [parameters.storageProfile.osDisk] Specifies information - * about the operating system disk used by the virtual machine.

    For - * more information about disks, see [About disks and VHDs for Azure virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). - * - * @param {string} parameters.storageProfile.osDisk.osType This property allows - * you to specify the type of the OS that is included in the disk if creating a - * VM from a custom image.

    Possible values are:

    **Windows** - *

    **Linux**. Possible values include: 'Windows', 'Linux' - * - * @param {string} parameters.storageProfile.osDisk.osState The OS State. - * Possible values include: 'Generalized', 'Specialized' - * - * @param {object} [parameters.storageProfile.osDisk.snapshot] The snapshot. - * - * @param {object} [parameters.storageProfile.osDisk.managedDisk] The - * managedDisk. - * - * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource - * Id - * - * @param {string} [parameters.storageProfile.osDisk.blobUri] The Virtual Hard - * Disk. - * - * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the - * caching requirements.

    Possible values are:

    **None** - *

    **ReadOnly**

    **ReadWrite**

    Default: **None for - * Standard storage. ReadOnly for Premium storage**. Possible values include: - * 'None', 'ReadOnly', 'ReadWrite' - * - * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the - * size of empty data disks in gigabytes. This element can be used to overwrite - * the name of the disk in a virtual machine image.

    This value cannot - * be larger than 1023 GB - * - * @param {string} [parameters.storageProfile.osDisk.storageAccountType] - * Specifies the storage account type for the managed disk. Possible values - * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' - * - * @param {array} [parameters.storageProfile.dataDisks] Specifies the - * parameters that are used to add a data disk to a virtual machine.

    - * For more information about disks, see [About disks and VHDs for Azure - * virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). - * - * @param {boolean} [parameters.storageProfile.zoneResilient] Specifies whether - * an image is zone resilient or not. Default is false. Zone resilient images - * can be created only in regions that provide Zone Redundant Storage (ZRS). - * - * @param {object} [parameters.tags] Resource tags - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - updateWithHttpOperationResponse(resourceGroupName: string, imageName: string, parameters: models.ImageUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Update an image. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} imageName The name of the image. - * - * @param {object} parameters Parameters supplied to the Update Image - * operation. - * - * @param {object} [parameters.sourceVirtualMachine] The source virtual machine - * from which Image is created. - * - * @param {object} [parameters.storageProfile] Specifies the storage settings - * for the virtual machine disks. + * @param {array} [parameters.networkProfile.networkInterfaces] Specifies the + * list of resource Ids for the network interfaces associated with the virtual + * machine. * - * @param {object} [parameters.storageProfile.osDisk] Specifies information - * about the operating system disk used by the virtual machine.

    For - * more information about disks, see [About disks and VHDs for Azure virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @param {object} [parameters.diagnosticsProfile] Specifies the boot + * diagnostic settings state.

    Minimum api-version: 2015-06-15. * - * @param {string} parameters.storageProfile.osDisk.osType This property allows - * you to specify the type of the OS that is included in the disk if creating a - * VM from a custom image.

    Possible values are:

    **Windows** - *

    **Linux**. Possible values include: 'Windows', 'Linux' + * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, + * you can easily view the output of your console log.

    For both + * Windows and Linux virtual machines, Azure also enables you to see a + * screenshot of the VM from the hypervisor. * - * @param {string} parameters.storageProfile.osDisk.osState The OS State. - * Possible values include: 'Generalized', 'Specialized' + * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] + * Whether boot diagnostics should be enabled on the Virtual Machine. * - * @param {object} [parameters.storageProfile.osDisk.snapshot] The snapshot. + * @param {string} [parameters.diagnosticsProfile.bootDiagnostics.storageUri] + * Uri of the storage account to use for placing the console output and + * screenshot. * - * @param {object} [parameters.storageProfile.osDisk.managedDisk] The - * managedDisk. + * @param {object} [parameters.availabilitySet] Specifies information about the + * availability set that the virtual machine should be assigned to. Virtual + * machines specified in the same availability set are allocated to different + * nodes to maximize availability. For more information about availability + * sets, see [Manage the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    For more information on Azure planned maintainance, see [Planned + * maintenance for virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Currently, a VM can only be added to availability set at creation + * time. An existing VM cannot be added to an availability set. * - * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource - * Id + * @param {string} [parameters.availabilitySet.id] Resource Id * - * @param {string} [parameters.storageProfile.osDisk.blobUri] The Virtual Hard - * Disk. + * @param {string} [parameters.licenseType] Specifies that the image or disk + * that is being used was licensed on-premises. This element is only used for + * images that contain the Windows Server operating system.

    Possible + * values are:

    Windows_Client

    Windows_Server

    If this + * element is included in a request for an update, the value must match the + * initial value. This value cannot be updated.

    For more information, + * see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Minimum api-version: 2015-06-15 * - * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the - * caching requirements.

    Possible values are:

    **None** - *

    **ReadOnly**

    **ReadWrite**

    Default: **None for - * Standard storage. ReadOnly for Premium storage**. Possible values include: - * 'None', 'ReadOnly', 'ReadWrite' + * @param {object} [parameters.identity] The identity of the virtual machine, + * if configured. * - * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the - * size of empty data disks in gigabytes. This element can be used to overwrite - * the name of the disk in a virtual machine image.

    This value cannot - * be larger than 1023 GB + * @param {string} [parameters.identity.type] The type of identity used for the + * virtual machine. The type 'SystemAssigned, UserAssigned' includes both an + * implicitly created identity and a set of user assigned identities. The type + * 'None' will remove any identities from the virtual machine. Possible values + * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', + * 'None' * - * @param {string} [parameters.storageProfile.osDisk.storageAccountType] - * Specifies the storage account type for the managed disk. Possible values - * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * @param {array} [parameters.identity.identityIds] The list of user identities + * associated with the Virtual Machine. The user identity references will be + * ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. * - * @param {array} [parameters.storageProfile.dataDisks] Specifies the - * parameters that are used to add a data disk to a virtual machine.

    - * For more information about disks, see [About disks and VHDs for Azure - * virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @param {array} [parameters.zones] The virtual machine zones. * - * @param {boolean} [parameters.storageProfile.zoneResilient] Specifies whether - * an image is zone resilient or not. Default is false. Zone resilient images - * can be created only in regions that provide Zone Redundant Storage (ZRS). + * @param {string} parameters.location Resource location * * @param {object} [parameters.tags] Resource tags * @@ -2178,7 +2497,7 @@ export interface Images { * * {Promise} A promise is returned. * - * @resolve {Image} - The deserialized result object. + * @resolve {VirtualMachine} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2186,113 +2505,858 @@ export interface Images { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Image} [result] - The deserialized result object if an error did not occur. - * See {@link Image} for more information. + * {VirtualMachine} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachine} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - update(resourceGroupName: string, imageName: string, parameters: models.ImageUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - update(resourceGroupName: string, imageName: string, parameters: models.ImageUpdate, callback: ServiceCallback): void; - update(resourceGroupName: string, imageName: string, parameters: models.ImageUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - + createOrUpdate(resourceGroupName: string, vmName: string, parameters: models.VirtualMachine, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, vmName: string, parameters: models.VirtualMachine, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, vmName: string, parameters: models.VirtualMachine, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - /** - * Deletes an Image. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} imageName The name of the image. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, imageName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes an Image. + * The operation to update a virtual machine. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} imageName The name of the image. - * - * @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. + * @param {string} vmName The name of the virtual machine. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @param {object} parameters Parameters supplied to the Update Virtual Machine + * operation. * - * @reject {Error|ServiceError} - The error object. + * @param {object} [parameters.plan] Specifies information about the + * marketplace image used to create the virtual machine. This element is only + * used for marketplace images. Before you can use a marketplace image from an + * API, you must enable the image for programmatic use. In the Azure portal, + * find the marketplace image that you want to use and then click **Want to + * deploy programmatically, Get Started ->**. Enter any required information + * and then click **Save**. * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {string} [parameters.plan.name] The plan ID. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {string} [parameters.plan.publisher] The publisher ID. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * @param {string} [parameters.plan.product] Specifies the product of the image + * from the marketplace. This is the same value as Offer under the + * imageReference element. * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {string} [parameters.plan.promotionCode] The promotion code. * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - deleteMethod(resourceGroupName: string, imageName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, imageName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, imageName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets an image. + * @param {object} [parameters.hardwareProfile] Specifies the hardware settings + * for the virtual machine. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} [parameters.hardwareProfile.vmSize] Specifies the size of + * the virtual machine. For more information about virtual machine sizes, see + * [Sizes for virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    The available VM sizes depend on region and availability set. For a + * list of available sizes use these APIs:

    [List all available + * virtual machine sizes in an availability + * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) + *

    [List all available virtual machine sizes in a + * region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) + *

    [List all available virtual machine sizes for + * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). + * Possible values include: '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_B1s', 'Standard_B1ms', + * 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', + * '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_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', + * 'Standard_D32_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', + * 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', + * 'Standard_D64s_v3', '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_DS13-4_v2', 'Standard_DS13-2_v2', + * 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', 'Standard_E2_v3', + * 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', 'Standard_E32_v3', + * 'Standard_E64_v3', 'Standard_E2s_v3', 'Standard_E4s_v3', 'Standard_E8s_v3', + * 'Standard_E16s_v3', 'Standard_E32s_v3', 'Standard_E64s_v3', + * 'Standard_E32-16_v3', 'Standard_E32-8s_v3', 'Standard_E64-32s_v3', + * 'Standard_E64-16s_v3', 'Standard_F1', 'Standard_F2', 'Standard_F4', + * 'Standard_F8', 'Standard_F16', 'Standard_F1s', 'Standard_F2s', + * 'Standard_F4s', 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2', + * 'Standard_F4s_v2', 'Standard_F8s_v2', 'Standard_F16s_v2', + * 'Standard_F32s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1', + * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', + * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', + * 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8', + * 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m', + * 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', + * 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms', + * 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms', + * 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms', + * 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', + * 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2', + * 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3', + * 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s', + * 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6', + * 'Standard_NV12', 'Standard_NV24' + * + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. + * + * @param {object} [parameters.storageProfile.imageReference] Specifies + * information about the image to use. You can specify information about + * platform images, marketplace images, or virtual machine images. This element + * is required when you want to use a platform image, marketplace image, or + * virtual machine image, but is not used in other creation operations. + * + * @param {string} [parameters.storageProfile.imageReference.publisher] The + * image publisher. + * + * @param {string} [parameters.storageProfile.imageReference.offer] Specifies + * the offer of the platform image or marketplace image used to create the + * virtual machine. + * + * @param {string} [parameters.storageProfile.imageReference.sku] The image + * SKU. + * + * @param {string} [parameters.storageProfile.imageReference.version] Specifies + * the version of the platform image or marketplace image used to create the + * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the + * latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. + * + * @param {string} [parameters.storageProfile.imageReference.id] Resource Id + * + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} [parameters.storageProfile.osDisk.osType] This property + * allows you to specify the type of the OS that is included in the disk if + * creating a VM from user-image or a specialized VHD.

    Possible values + * are:

    **Windows**

    **Linux**. Possible values include: + * 'Windows', 'Linux' + * + * @param {object} [parameters.storageProfile.osDisk.encryptionSettings] + * Specifies the encryption settings for the OS Disk.

    Minimum + * api-version: 2015-06-15 + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey] + * Specifies the location of the disk encryption key, which is a Key Vault + * Secret. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.secretUrl + * The URL referencing a secret in a Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the secret. + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey] + * Specifies the location of the key encryption key in Key Vault. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.keyUrl + * The URL referencing a key encryption key in Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the key. + * + * @param {boolean} + * [parameters.storageProfile.osDisk.encryptionSettings.enabled] Specifies + * whether disk encryption should be enabled on the virtual machine. + * + * @param {string} [parameters.storageProfile.osDisk.name] The disk name. + * + * @param {object} [parameters.storageProfile.osDisk.vhd] The virtual hard + * disk. + * + * @param {object} [parameters.storageProfile.osDisk.image] The source user + * image virtual hard disk. The virtual hard disk will be copied before being + * attached to the virtual machine. If SourceImage is provided, the destination + * virtual hard drive must not exist. + * + * @param {string} [parameters.storageProfile.osDisk.image.uri] Specifies the + * virtual hard disk's uri. + * + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {boolean} [parameters.storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @param {string} parameters.storageProfile.osDisk.createOption Specifies how + * the virtual machine should be created.

    Possible values are:

    + * **Attach** \u2013 This value is used when you are using a specialized disk + * to create the virtual machine.

    **FromImage** \u2013 This value is + * used when you are using an image to create the virtual machine. If you are + * using a platform image, you also use the imageReference element described + * above. If you are using a marketplace image, you also use the plan element + * previously described. Possible values include: 'FromImage', 'Empty', + * 'Attach' + * + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of an empty data disk in gigabytes. This element can be used to + * overwrite the name of the disk in a virtual machine image.

    This + * value cannot be larger than 1023 GB + * + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed + * disk parameters. + * + * @param {string} + * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies + * the storage account type for the managed disk. Possible values are: + * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id + * + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {object} [parameters.osProfile] Specifies the operating system + * settings for the virtual machine. + * + * @param {string} [parameters.osProfile.computerName] Specifies the host OS + * name of the virtual machine.

    **Max-length (Windows):** 15 + * characters

    **Max-length (Linux):** 64 characters.

    For + * naming conventions and restrictions see [Azure infrastructure services + * implementation + * guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). + * + * @param {string} [parameters.osProfile.adminUsername] Specifies the name of + * the administrator account.

    **Windows-only restriction:** Cannot end + * in "."

    **Disallowed values:** "administrator", "admin", "user", + * "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", + * "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", + * "john", "owner", "root", "server", "sql", "support", "support_388945a0", + * "sys", "test2", "test3", "user4", "user5".

    **Minimum-length + * (Linux):** 1 character

    **Max-length (Linux):** 64 characters + *

    **Max-length (Windows):** 20 characters

  • For root + * access to the Linux VM, see [Using root privileges on Linux virtual machines + * in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in this + * field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {string} [parameters.osProfile.adminPassword] Specifies the password + * of the administrator account.

    **Minimum-length (Windows):** 8 + * characters

    **Minimum-length (Linux):** 6 characters

    + * **Max-length (Windows):** 123 characters

    **Max-length (Linux):** 72 + * characters

    **Complexity requirements:** 3 out of 4 conditions below + * need to be fulfilled
    Has lower characters
    Has upper characters
    + * Has a digit
    Has a special character (Regex match [\W_])

    + * **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", + * "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", + * "iloveyou!"

    For resetting the password, see [How to reset the + * Remote Desktop service or its login password in a Windows + * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    For resetting root password, see [Manage users, SSH, and check or + * repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + * + * @param {string} [parameters.osProfile.customData] Specifies a base-64 + * encoded string of custom data. The base-64 encoded string is decoded to a + * binary array that is saved as a file on the Virtual Machine. The maximum + * length of the binary array is 65535 bytes.

    For using cloud-init for + * your VM, see [Using cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {object} [parameters.osProfile.windowsConfiguration] Specifies + * Windows operating system settings on the virtual machine. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.provisionVMAgent] Indicates + * whether virtual machine agent should be provisioned on the virtual machine. + *

    When this property is not specified in the request body, default + * behavior is to set it to true. This will ensure that VM Agent is installed + * on the VM so that extensions can be added to the VM later. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.enableAutomaticUpdates] Indicates + * whether virtual machine is enabled for automatic updates. + * + * @param {string} [parameters.osProfile.windowsConfiguration.timeZone] + * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" + * + * @param {array} + * [parameters.osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * + * @param {object} [parameters.osProfile.windowsConfiguration.winRM] Specifies + * the Windows Remote Management listeners. This enables remote Windows + * PowerShell. + * + * @param {array} [parameters.osProfile.windowsConfiguration.winRM.listeners] + * The list of Windows Remote Management listeners + * + * @param {object} [parameters.osProfile.linuxConfiguration] Specifies the + * Linux operating system settings on the virtual machine.

    For a list + * of supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @param {boolean} + * [parameters.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * + * @param {object} [parameters.osProfile.linuxConfiguration.ssh] Specifies the + * ssh key configuration for a Linux OS. + * + * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The + * list of SSH public keys used to authenticate with linux based VMs. + * + * @param {array} [parameters.osProfile.secrets] Specifies set of certificates + * that should be installed onto the virtual machine. + * + * @param {object} [parameters.networkProfile] Specifies the network interfaces + * of the virtual machine. + * + * @param {array} [parameters.networkProfile.networkInterfaces] Specifies the + * list of resource Ids for the network interfaces associated with the virtual + * machine. + * + * @param {object} [parameters.diagnosticsProfile] Specifies the boot + * diagnostic settings state.

    Minimum api-version: 2015-06-15. + * + * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, + * you can easily view the output of your console log.

    For both + * Windows and Linux virtual machines, Azure also enables you to see a + * screenshot of the VM from the hypervisor. + * + * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] + * Whether boot diagnostics should be enabled on the Virtual Machine. + * + * @param {string} [parameters.diagnosticsProfile.bootDiagnostics.storageUri] + * Uri of the storage account to use for placing the console output and + * screenshot. + * + * @param {object} [parameters.availabilitySet] Specifies information about the + * availability set that the virtual machine should be assigned to. Virtual + * machines specified in the same availability set are allocated to different + * nodes to maximize availability. For more information about availability + * sets, see [Manage the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    For more information on Azure planned maintainance, see [Planned + * maintenance for virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Currently, a VM can only be added to availability set at creation + * time. An existing VM cannot be added to an availability set. + * + * @param {string} [parameters.availabilitySet.id] Resource Id + * + * @param {string} [parameters.licenseType] Specifies that the image or disk + * that is being used was licensed on-premises. This element is only used for + * images that contain the Windows Server operating system.

    Possible + * values are:

    Windows_Client

    Windows_Server

    If this + * element is included in a request for an update, the value must match the + * initial value. This value cannot be updated.

    For more information, + * see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Minimum api-version: 2015-06-15 + * + * @param {object} [parameters.identity] The identity of the virtual machine, + * if configured. + * + * @param {string} [parameters.identity.type] The type of identity used for the + * virtual machine. The type 'SystemAssigned, UserAssigned' includes both an + * implicitly created identity and a set of user assigned identities. The type + * 'None' will remove any identities from the virtual machine. Possible values + * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', + * 'None' + * + * @param {array} [parameters.identity.identityIds] The list of user identities + * associated with the Virtual Machine. The user identity references will be + * ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * + * @param {array} [parameters.zones] The virtual machine zones. + * + * @param {object} [parameters.tags] Resource tags + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + updateWithHttpOperationResponse(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * The operation to update a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @param {object} parameters Parameters supplied to the Update Virtual Machine + * operation. + * + * @param {object} [parameters.plan] Specifies information about the + * marketplace image used to create the virtual machine. This element is only + * used for marketplace images. Before you can use a marketplace image from an + * API, you must enable the image for programmatic use. In the Azure portal, + * find the marketplace image that you want to use and then click **Want to + * deploy programmatically, Get Started ->**. Enter any required information + * and then click **Save**. + * + * @param {string} [parameters.plan.name] The plan ID. + * + * @param {string} [parameters.plan.publisher] The publisher ID. + * + * @param {string} [parameters.plan.product] Specifies the product of the image + * from the marketplace. This is the same value as Offer under the + * imageReference element. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {object} [parameters.hardwareProfile] Specifies the hardware settings + * for the virtual machine. + * + * @param {string} [parameters.hardwareProfile.vmSize] Specifies the size of + * the virtual machine. For more information about virtual machine sizes, see + * [Sizes for virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    The available VM sizes depend on region and availability set. For a + * list of available sizes use these APIs:

    [List all available + * virtual machine sizes in an availability + * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) + *

    [List all available virtual machine sizes in a + * region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) + *

    [List all available virtual machine sizes for + * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). + * Possible values include: '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_B1s', 'Standard_B1ms', + * 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', + * '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_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', + * 'Standard_D32_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', + * 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', + * 'Standard_D64s_v3', '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_DS13-4_v2', 'Standard_DS13-2_v2', + * 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', 'Standard_E2_v3', + * 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', 'Standard_E32_v3', + * 'Standard_E64_v3', 'Standard_E2s_v3', 'Standard_E4s_v3', 'Standard_E8s_v3', + * 'Standard_E16s_v3', 'Standard_E32s_v3', 'Standard_E64s_v3', + * 'Standard_E32-16_v3', 'Standard_E32-8s_v3', 'Standard_E64-32s_v3', + * 'Standard_E64-16s_v3', 'Standard_F1', 'Standard_F2', 'Standard_F4', + * 'Standard_F8', 'Standard_F16', 'Standard_F1s', 'Standard_F2s', + * 'Standard_F4s', 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2', + * 'Standard_F4s_v2', 'Standard_F8s_v2', 'Standard_F16s_v2', + * 'Standard_F32s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1', + * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', + * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', + * 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8', + * 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m', + * 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', + * 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms', + * 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms', + * 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms', + * 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', + * 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2', + * 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3', + * 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s', + * 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6', + * 'Standard_NV12', 'Standard_NV24' + * + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. + * + * @param {object} [parameters.storageProfile.imageReference] Specifies + * information about the image to use. You can specify information about + * platform images, marketplace images, or virtual machine images. This element + * is required when you want to use a platform image, marketplace image, or + * virtual machine image, but is not used in other creation operations. + * + * @param {string} [parameters.storageProfile.imageReference.publisher] The + * image publisher. + * + * @param {string} [parameters.storageProfile.imageReference.offer] Specifies + * the offer of the platform image or marketplace image used to create the + * virtual machine. + * + * @param {string} [parameters.storageProfile.imageReference.sku] The image + * SKU. + * + * @param {string} [parameters.storageProfile.imageReference.version] Specifies + * the version of the platform image or marketplace image used to create the + * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the + * latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. + * + * @param {string} [parameters.storageProfile.imageReference.id] Resource Id + * + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} [parameters.storageProfile.osDisk.osType] This property + * allows you to specify the type of the OS that is included in the disk if + * creating a VM from user-image or a specialized VHD.

    Possible values + * are:

    **Windows**

    **Linux**. Possible values include: + * 'Windows', 'Linux' + * + * @param {object} [parameters.storageProfile.osDisk.encryptionSettings] + * Specifies the encryption settings for the OS Disk.

    Minimum + * api-version: 2015-06-15 + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey] + * Specifies the location of the disk encryption key, which is a Key Vault + * Secret. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.secretUrl + * The URL referencing a secret in a Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the secret. + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey] + * Specifies the location of the key encryption key in Key Vault. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.keyUrl + * The URL referencing a key encryption key in Key Vault. + * + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the key. + * + * @param {boolean} + * [parameters.storageProfile.osDisk.encryptionSettings.enabled] Specifies + * whether disk encryption should be enabled on the virtual machine. + * + * @param {string} [parameters.storageProfile.osDisk.name] The disk name. + * + * @param {object} [parameters.storageProfile.osDisk.vhd] The virtual hard + * disk. + * + * @param {object} [parameters.storageProfile.osDisk.image] The source user + * image virtual hard disk. The virtual hard disk will be copied before being + * attached to the virtual machine. If SourceImage is provided, the destination + * virtual hard drive must not exist. * - * @param {string} imageName The name of the image. + * @param {string} [parameters.storageProfile.osDisk.image.uri] Specifies the + * virtual hard disk's uri. + * + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {boolean} [parameters.storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @param {string} parameters.storageProfile.osDisk.createOption Specifies how + * the virtual machine should be created.

    Possible values are:

    + * **Attach** \u2013 This value is used when you are using a specialized disk + * to create the virtual machine.

    **FromImage** \u2013 This value is + * used when you are using an image to create the virtual machine. If you are + * using a platform image, you also use the imageReference element described + * above. If you are using a marketplace image, you also use the plan element + * previously described. Possible values include: 'FromImage', 'Empty', + * 'Attach' + * + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of an empty data disk in gigabytes. This element can be used to + * overwrite the name of the disk in a virtual machine image.

    This + * value cannot be larger than 1023 GB + * + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed + * disk parameters. + * + * @param {string} + * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies + * the storage account type for the managed disk. Possible values are: + * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id + * + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {object} [parameters.osProfile] Specifies the operating system + * settings for the virtual machine. + * + * @param {string} [parameters.osProfile.computerName] Specifies the host OS + * name of the virtual machine.

    **Max-length (Windows):** 15 + * characters

    **Max-length (Linux):** 64 characters.

    For + * naming conventions and restrictions see [Azure infrastructure services + * implementation + * guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). + * + * @param {string} [parameters.osProfile.adminUsername] Specifies the name of + * the administrator account.

    **Windows-only restriction:** Cannot end + * in "."

    **Disallowed values:** "administrator", "admin", "user", + * "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", + * "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", + * "john", "owner", "root", "server", "sql", "support", "support_388945a0", + * "sys", "test2", "test3", "user4", "user5".

    **Minimum-length + * (Linux):** 1 character

    **Max-length (Linux):** 64 characters + *

    **Max-length (Windows):** 20 characters

  • For root + * access to the Linux VM, see [Using root privileges on Linux virtual machines + * in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in this + * field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {string} [parameters.osProfile.adminPassword] Specifies the password + * of the administrator account.

    **Minimum-length (Windows):** 8 + * characters

    **Minimum-length (Linux):** 6 characters

    + * **Max-length (Windows):** 123 characters

    **Max-length (Linux):** 72 + * characters

    **Complexity requirements:** 3 out of 4 conditions below + * need to be fulfilled
    Has lower characters
    Has upper characters
    + * Has a digit
    Has a special character (Regex match [\W_])

    + * **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", + * "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", + * "iloveyou!"

    For resetting the password, see [How to reset the + * Remote Desktop service or its login password in a Windows + * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    For resetting root password, see [Manage users, SSH, and check or + * repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + * + * @param {string} [parameters.osProfile.customData] Specifies a base-64 + * encoded string of custom data. The base-64 encoded string is decoded to a + * binary array that is saved as a file on the Virtual Machine. The maximum + * length of the binary array is 65535 bytes.

    For using cloud-init for + * your VM, see [Using cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * + * @param {object} [parameters.osProfile.windowsConfiguration] Specifies + * Windows operating system settings on the virtual machine. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.provisionVMAgent] Indicates + * whether virtual machine agent should be provisioned on the virtual machine. + *

    When this property is not specified in the request body, default + * behavior is to set it to true. This will ensure that VM Agent is installed + * on the VM so that extensions can be added to the VM later. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.enableAutomaticUpdates] Indicates + * whether virtual machine is enabled for automatic updates. + * + * @param {string} [parameters.osProfile.windowsConfiguration.timeZone] + * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" + * + * @param {array} + * [parameters.osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. + * + * @param {object} [parameters.osProfile.windowsConfiguration.winRM] Specifies + * the Windows Remote Management listeners. This enables remote Windows + * PowerShell. + * + * @param {array} [parameters.osProfile.windowsConfiguration.winRM.listeners] + * The list of Windows Remote Management listeners + * + * @param {object} [parameters.osProfile.linuxConfiguration] Specifies the + * Linux operating system settings on the virtual machine.

    For a list + * of supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * + * @param {boolean} + * [parameters.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * + * @param {object} [parameters.osProfile.linuxConfiguration.ssh] Specifies the + * ssh key configuration for a Linux OS. + * + * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The + * list of SSH public keys used to authenticate with linux based VMs. + * + * @param {array} [parameters.osProfile.secrets] Specifies set of certificates + * that should be installed onto the virtual machine. + * + * @param {object} [parameters.networkProfile] Specifies the network interfaces + * of the virtual machine. + * + * @param {array} [parameters.networkProfile.networkInterfaces] Specifies the + * list of resource Ids for the network interfaces associated with the virtual + * machine. + * + * @param {object} [parameters.diagnosticsProfile] Specifies the boot + * diagnostic settings state.

    Minimum api-version: 2015-06-15. + * + * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, + * you can easily view the output of your console log.

    For both + * Windows and Linux virtual machines, Azure also enables you to see a + * screenshot of the VM from the hypervisor. + * + * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] + * Whether boot diagnostics should be enabled on the Virtual Machine. + * + * @param {string} [parameters.diagnosticsProfile.bootDiagnostics.storageUri] + * Uri of the storage account to use for placing the console output and + * screenshot. + * + * @param {object} [parameters.availabilitySet] Specifies information about the + * availability set that the virtual machine should be assigned to. Virtual + * machines specified in the same availability set are allocated to different + * nodes to maximize availability. For more information about availability + * sets, see [Manage the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    For more information on Azure planned maintainance, see [Planned + * maintenance for virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Currently, a VM can only be added to availability set at creation + * time. An existing VM cannot be added to an availability set. + * + * @param {string} [parameters.availabilitySet.id] Resource Id + * + * @param {string} [parameters.licenseType] Specifies that the image or disk + * that is being used was licensed on-premises. This element is only used for + * images that contain the Windows Server operating system.

    Possible + * values are:

    Windows_Client

    Windows_Server

    If this + * element is included in a request for an update, the value must match the + * initial value. This value cannot be updated.

    For more information, + * see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Minimum api-version: 2015-06-15 + * + * @param {object} [parameters.identity] The identity of the virtual machine, + * if configured. + * + * @param {string} [parameters.identity.type] The type of identity used for the + * virtual machine. The type 'SystemAssigned, UserAssigned' includes both an + * implicitly created identity and a set of user assigned identities. The type + * 'None' will remove any identities from the virtual machine. Possible values + * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', + * 'None' + * + * @param {array} [parameters.identity.identityIds] The list of user identities + * associated with the Virtual Machine. The user identity references will be + * ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * + * @param {array} [parameters.zones] The virtual machine zones. + * + * @param {object} [parameters.tags] Resource tags * * @param {object} [options] Optional Parameters. * - * @param {string} [options.expand] The expand expression to apply on the - * operation. + * @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 {VirtualMachine} - 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. + * + * {VirtualMachine} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachine} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + update(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineUpdate, callback: ServiceCallback): void; + update(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * The operation to delete a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @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. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, imageName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets an image. + * The operation to delete a virtual machine. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} imageName The name of the image. + * @param {string} vmName The name of the virtual machine. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.expand] The expand expression to apply on the - * operation. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -2303,7 +3367,7 @@ export interface Images { * * {Promise} A promise is returned. * - * @resolve {Image} - The deserialized result object. + * @resolve {OperationStatusResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2311,43 +3375,56 @@ export interface Images { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Image} [result] - The deserialized result object if an error did not occur. - * See {@link Image} for more information. + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, imageName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, imageName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, imageName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets the list of images under a resource group. + * Retrieves information about the model view or the instance view of a virtual + * machine. * * @param {string} resourceGroupName The name of the resource group. * + * @param {string} vmName The name of the virtual machine. + * * @param {object} [options] Optional Parameters. * + * @param {string} [options.expand] The expand expression to apply on the + * operation. Possible values include: 'instanceView' + * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the list of images under a resource group. + * Retrieves information about the model view or the instance view of a virtual + * machine. * * @param {string} resourceGroupName The name of the resource group. * + * @param {string} vmName The name of the virtual machine. + * * @param {object} [options] Optional Parameters. * + * @param {string} [options.expand] The expand expression to apply on the + * operation. Possible values include: 'instanceView' + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -2358,7 +3435,7 @@ export interface Images { * * {Promise} A promise is returned. * - * @resolve {ImageListResult} - The deserialized result object. + * @resolve {VirtualMachine} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2366,22 +3443,24 @@ export interface Images { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ImageListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ImageListResult} for more information. + * {VirtualMachine} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachine} 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. */ - 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; + get(resourceGroupName: string, vmName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, vmName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets the list of Images in the subscription. Use nextLink property in the - * response to get the next page of Images. Do this till nextLink is null to - * fetch all the Images. + * Retrieves information about the run-time state of a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. * * @param {object} [options] Optional Parameters. * @@ -2390,16 +3469,18 @@ export interface Images { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + instanceViewWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the list of Images in the subscription. Use nextLink property in the - * response to get the next page of Images. Do this till nextLink is null to - * fetch all the Images. + * Retrieves information about the run-time state of a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. * * @param {object} [options] Optional Parameters. * @@ -2413,7 +3494,7 @@ export interface Images { * * {Promise} A promise is returned. * - * @resolve {ImageListResult} - The deserialized result object. + * @resolve {VirtualMachineInstanceView} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2421,87 +3502,88 @@ export interface Images { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ImageListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ImageListResult} for more information. + * {VirtualMachineInstanceView} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineInstanceView} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(callback: ServiceCallback): void; - list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + instanceView(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + instanceView(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + instanceView(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Create or update an image. + * Converts virtual machine disks from blob-based to managed disks. Virtual + * machine must be stop-deallocated before invoking this operation. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} imageName The name of the image. + * @param {string} vmName The name of the virtual machine. * - * @param {object} parameters Parameters supplied to the Create Image - * operation. + * @param {object} [options] Optional Parameters. * - * @param {object} [parameters.sourceVirtualMachine] The source virtual machine - * from which Image is created. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} [parameters.storageProfile] Specifies the storage settings - * for the virtual machine disks. + * @returns {Promise} A promise is returned * - * @param {object} [parameters.storageProfile.osDisk] Specifies information - * about the operating system disk used by the virtual machine.

    For - * more information about disks, see [About disks and VHDs for Azure virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} parameters.storageProfile.osDisk.osType This property allows - * you to specify the type of the OS that is included in the disk if creating a - * VM from a custom image.

    Possible values are:

    **Windows** - *

    **Linux**. Possible values include: 'Windows', 'Linux' + * @reject {Error|ServiceError} - The error object. + */ + convertToManagedDisksWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Converts virtual machine disks from blob-based to managed disks. Virtual + * machine must be stop-deallocated before invoking this operation. * - * @param {string} parameters.storageProfile.osDisk.osState The OS State. - * Possible values include: 'Generalized', 'Specialized' + * @param {string} resourceGroupName The name of the resource group. * - * @param {object} [parameters.storageProfile.osDisk.snapshot] The snapshot. + * @param {string} vmName The name of the virtual machine. * - * @param {object} [parameters.storageProfile.osDisk.managedDisk] The - * managedDisk. + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource - * Id + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.storageProfile.osDisk.blobUri] The Virtual Hard - * Disk. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the - * caching requirements.

    Possible values are:

    **None** - *

    **ReadOnly**

    **ReadWrite**

    Default: **None for - * Standard storage. ReadOnly for Premium storage**. Possible values include: - * 'None', 'ReadOnly', 'ReadWrite' + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the - * size of empty data disks in gigabytes. This element can be used to overwrite - * the name of the disk in a virtual machine image.

    This value cannot - * be larger than 1023 GB + * {Promise} A promise is returned. * - * @param {string} [parameters.storageProfile.osDisk.storageAccountType] - * Specifies the storage account type for the managed disk. Possible values - * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * @resolve {OperationStatusResponse} - The deserialized result object. * - * @param {array} [parameters.storageProfile.dataDisks] Specifies the - * parameters that are used to add a data disk to a virtual machine.

    - * For more information about disks, see [About disks and VHDs for Azure - * virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @reject {Error|ServiceError} - The error object. * - * @param {boolean} [parameters.storageProfile.zoneResilient] Specifies whether - * an image is zone resilient or not. Default is false. Zone resilient images - * can be created only in regions that provide Zone Redundant Storage (ZRS). + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {string} parameters.location Resource location + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {object} [parameters.tags] Resource tags + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. + */ + convertToManagedDisks(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + convertToManagedDisks(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + convertToManagedDisks(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Shuts down the virtual machine and releases the compute resources. You are + * not billed for the compute resources that this virtual machine uses. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. * * @param {object} [options] Optional Parameters. * @@ -2510,81 +3592,79 @@ export interface Images { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, imageName: string, parameters: models.Image, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deallocateWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Create or update an image. + * Shuts down the virtual machine and releases the compute resources. You are + * not billed for the compute resources that this virtual machine uses. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} imageName The name of the image. + * @param {string} vmName The name of the virtual machine. * - * @param {object} parameters Parameters supplied to the Create Image - * operation. + * @param {object} [options] Optional Parameters. * - * @param {object} [parameters.sourceVirtualMachine] The source virtual machine - * from which Image is created. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} [parameters.storageProfile] Specifies the storage settings - * for the virtual machine disks. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {object} [parameters.storageProfile.osDisk] Specifies information - * about the operating system disk used by the virtual machine.

    For - * more information about disks, see [About disks and VHDs for Azure virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {string} parameters.storageProfile.osDisk.osType This property allows - * you to specify the type of the OS that is included in the disk if creating a - * VM from a custom image.

    Possible values are:

    **Windows** - *

    **Linux**. Possible values include: 'Windows', 'Linux' + * {Promise} A promise is returned. * - * @param {string} parameters.storageProfile.osDisk.osState The OS State. - * Possible values include: 'Generalized', 'Specialized' + * @resolve {OperationStatusResponse} - The deserialized result object. * - * @param {object} [parameters.storageProfile.osDisk.snapshot] The snapshot. + * @reject {Error|ServiceError} - The error object. * - * @param {object} [parameters.storageProfile.osDisk.managedDisk] The - * managedDisk. + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource - * Id + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {string} [parameters.storageProfile.osDisk.blobUri] The Virtual Hard - * Disk. + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} for more + * information. * - * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the - * caching requirements.

    Possible values are:

    **None** - *

    **ReadOnly**

    **ReadWrite**

    Default: **None for - * Standard storage. ReadOnly for Premium storage**. Possible values include: - * 'None', 'ReadOnly', 'ReadWrite' + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the - * size of empty data disks in gigabytes. This element can be used to overwrite - * the name of the disk in a virtual machine image.

    This value cannot - * be larger than 1023 GB + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deallocate(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deallocate(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + deallocate(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Sets the state of the virtual machine to generalized. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.storageProfile.osDisk.storageAccountType] - * Specifies the storage account type for the managed disk. Possible values - * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * @returns {Promise} A promise is returned * - * @param {array} [parameters.storageProfile.dataDisks] Specifies the - * parameters that are used to add a data disk to a virtual machine.

    - * For more information about disks, see [About disks and VHDs for Azure - * virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {boolean} [parameters.storageProfile.zoneResilient] Specifies whether - * an image is zone resilient or not. Default is false. Zone resilient images - * can be created only in regions that provide Zone Redundant Storage (ZRS). + * @reject {Error|ServiceError} - The error object. + */ + generalizeWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Sets the state of the virtual machine to generalized. * - * @param {string} parameters.location Resource location + * @param {string} resourceGroupName The name of the resource group. * - * @param {object} [parameters.tags] Resource tags + * @param {string} vmName The name of the virtual machine. * * @param {object} [options] Optional Parameters. * @@ -2598,7 +3678,7 @@ export interface Images { * * {Promise} A promise is returned. * - * @resolve {Image} - The deserialized result object. + * @resolve {OperationStatusResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2606,85 +3686,80 @@ export interface Images { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Image} [result] - The deserialized result object if an error did not occur. - * See {@link Image} for more information. + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. */ - beginCreateOrUpdate(resourceGroupName: string, imageName: string, parameters: models.Image, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, imageName: string, parameters: models.Image, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, imageName: string, parameters: models.Image, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + generalize(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + generalize(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + generalize(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Update an image. + * Lists all of the virtual machines in the specified resource group. Use the + * nextLink property in the response to get the next page of virtual machines. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} imageName The name of the image. + * @param {object} [options] Optional Parameters. * - * @param {object} parameters Parameters supplied to the Update Image - * operation. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} [parameters.sourceVirtualMachine] The source virtual machine - * from which Image is created. + * @returns {Promise} A promise is returned * - * @param {object} [parameters.storageProfile] Specifies the storage settings - * for the virtual machine disks. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {object} [parameters.storageProfile.osDisk] Specifies information - * about the operating system disk used by the virtual machine.

    For - * more information about disks, see [About disks and VHDs for Azure virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all of the virtual machines in the specified resource group. Use the + * nextLink property in the response to get the next page of virtual machines. * - * @param {string} parameters.storageProfile.osDisk.osType This property allows - * you to specify the type of the OS that is included in the disk if creating a - * VM from a custom image.

    Possible values are:

    **Windows** - *

    **Linux**. Possible values include: 'Windows', 'Linux' + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} parameters.storageProfile.osDisk.osState The OS State. - * Possible values include: 'Generalized', 'Specialized' + * @param {object} [options] Optional Parameters. * - * @param {object} [parameters.storageProfile.osDisk.snapshot] The snapshot. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} [parameters.storageProfile.osDisk.managedDisk] The - * managedDisk. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource - * Id + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {string} [parameters.storageProfile.osDisk.blobUri] The Virtual Hard - * Disk. + * {Promise} A promise is returned. * - * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the - * caching requirements.

    Possible values are:

    **None** - *

    **ReadOnly**

    **ReadWrite**

    Default: **None for - * Standard storage. ReadOnly for Premium storage**. Possible values include: - * 'None', 'ReadOnly', 'ReadWrite' + * @resolve {VirtualMachineListResult} - The deserialized result object. * - * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the - * size of empty data disks in gigabytes. This element can be used to overwrite - * the name of the disk in a virtual machine image.

    This value cannot - * be larger than 1023 GB + * @reject {Error|ServiceError} - The error object. * - * @param {string} [parameters.storageProfile.osDisk.storageAccountType] - * Specifies the storage account type for the managed disk. Possible values - * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {array} [parameters.storageProfile.dataDisks] Specifies the - * parameters that are used to add a data disk to a virtual machine.

    - * For more information about disks, see [About disks and VHDs for Azure - * virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {boolean} [parameters.storageProfile.zoneResilient] Specifies whether - * an image is zone resilient or not. Default is false. Zone resilient images - * can be created only in regions that provide Zone Redundant Storage (ZRS). + * {VirtualMachineListResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineListResult} for more + * information. * - * @param {object} [parameters.tags] Resource tags + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(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; + + + /** + * Lists all of the virtual machines in the specified subscription. Use the + * nextLink property in the response to get the next page of virtual machines. * * @param {object} [options] Optional Parameters. * @@ -2693,79 +3768,77 @@ export interface Images { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginUpdateWithHttpOperationResponse(resourceGroupName: string, imageName: string, parameters: models.ImageUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listAllWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Update an image. + * Lists all of the virtual machines in the specified subscription. Use the + * nextLink property in the response to get the next page of virtual machines. * - * @param {string} resourceGroupName The name of the resource group. + * @param {object} [options] Optional Parameters. * - * @param {string} imageName The name of the image. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} parameters Parameters supplied to the Update Image - * operation. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {object} [parameters.sourceVirtualMachine] The source virtual machine - * from which Image is created. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {object} [parameters.storageProfile] Specifies the storage settings - * for the virtual machine disks. + * {Promise} A promise is returned. * - * @param {object} [parameters.storageProfile.osDisk] Specifies information - * about the operating system disk used by the virtual machine.

    For - * more information about disks, see [About disks and VHDs for Azure virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @resolve {VirtualMachineListResult} - The deserialized result object. * - * @param {string} parameters.storageProfile.osDisk.osType This property allows - * you to specify the type of the OS that is included in the disk if creating a - * VM from a custom image.

    Possible values are:

    **Windows** - *

    **Linux**. Possible values include: 'Windows', 'Linux' + * @reject {Error|ServiceError} - The error object. * - * @param {string} parameters.storageProfile.osDisk.osState The OS State. - * Possible values include: 'Generalized', 'Specialized' + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {object} [parameters.storageProfile.osDisk.snapshot] The snapshot. + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {object} [parameters.storageProfile.osDisk.managedDisk] The - * managedDisk. + * {VirtualMachineListResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineListResult} for more + * information. * - * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource - * Id + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {string} [parameters.storageProfile.osDisk.blobUri] The Virtual Hard - * Disk. + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listAll(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAll(callback: ServiceCallback): void; + listAll(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists all available virtual machine sizes to which the specified virtual + * machine can be resized. * - * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the - * caching requirements.

    Possible values are:

    **None** - *

    **ReadOnly**

    **ReadWrite**

    Default: **None for - * Standard storage. ReadOnly for Premium storage**. Possible values include: - * 'None', 'ReadOnly', 'ReadWrite' + * @param {string} resourceGroupName The name of the resource group. * - * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the - * size of empty data disks in gigabytes. This element can be used to overwrite - * the name of the disk in a virtual machine image.

    This value cannot - * be larger than 1023 GB + * @param {string} vmName The name of the virtual machine. * - * @param {string} [parameters.storageProfile.osDisk.storageAccountType] - * Specifies the storage account type for the managed disk. Possible values - * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * @param {object} [options] Optional Parameters. * - * @param {array} [parameters.storageProfile.dataDisks] Specifies the - * parameters that are used to add a data disk to a virtual machine.

    - * For more information about disks, see [About disks and VHDs for Azure - * virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {boolean} [parameters.storageProfile.zoneResilient] Specifies whether - * an image is zone resilient or not. Default is false. Zone resilient images - * can be created only in regions that provide Zone Redundant Storage (ZRS). + * @returns {Promise} A promise is returned * - * @param {object} [parameters.tags] Resource tags + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listAvailableSizesWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all available virtual machine sizes to which the specified virtual + * machine can be resized. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. * * @param {object} [options] Optional Parameters. * @@ -2779,7 +3852,7 @@ export interface Images { * * {Promise} A promise is returned. * - * @resolve {Image} - The deserialized result object. + * @resolve {VirtualMachineSizeListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2787,24 +3860,27 @@ export interface Images { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Image} [result] - The deserialized result object if an error did not occur. - * See {@link Image} for more information. + * {VirtualMachineSizeListResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineSizeListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginUpdate(resourceGroupName: string, imageName: string, parameters: models.ImageUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdate(resourceGroupName: string, imageName: string, parameters: models.ImageUpdate, callback: ServiceCallback): void; - beginUpdate(resourceGroupName: string, imageName: string, parameters: models.ImageUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listAvailableSizes(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAvailableSizes(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + listAvailableSizes(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes an Image. + * The operation to power off (stop) a virtual machine. The virtual machine can + * be restarted with the same provisioned resources. You are still charged for + * this virtual machine. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} imageName The name of the image. + * @param {string} vmName The name of the virtual machine. * * @param {object} [options] Optional Parameters. * @@ -2817,14 +3893,16 @@ export interface Images { * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, imageName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + powerOffWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes an Image. + * The operation to power off (stop) a virtual machine. The virtual machine can + * be restarted with the same provisioned resources. You are still charged for + * this virtual machine. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} imageName The name of the image. + * @param {string} vmName The name of the virtual machine. * * @param {object} [options] Optional Parameters. * @@ -2854,16 +3932,17 @@ export interface Images { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginDeleteMethod(resourceGroupName: string, imageName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, imageName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, imageName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + powerOff(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + powerOff(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + powerOff(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets the list of images under a resource group. + * The operation to restart a virtual machine. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. * * @param {object} [options] Optional Parameters. * @@ -2872,17 +3951,18 @@ export interface Images { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + restartWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the list of images under a resource group. + * The operation to restart a virtual machine. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. * * @param {object} [options] Optional Parameters. * @@ -2896,7 +3976,7 @@ export interface Images { * * {Promise} A promise is returned. * - * @resolve {ImageListResult} - The deserialized result object. + * @resolve {OperationStatusResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2904,25 +3984,25 @@ export interface Images { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ImageListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ImageListResult} for more information. + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. */ - listByResourceGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; - listByResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + restart(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + restart(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + restart(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets the list of Images in the subscription. Use nextLink property in the - * response to get the next page of Images. Do this till nextLink is null to - * fetch all the Images. + * The operation to start a virtual machine. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. * * @param {object} [options] Optional Parameters. * @@ -2931,19 +4011,18 @@ export interface Images { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + startWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the list of Images in the subscription. Use nextLink property in the - * response to get the next page of Images. Do this till nextLink is null to - * fetch all the Images. + * The operation to start a virtual machine. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine. * * @param {object} [options] Optional Parameters. * @@ -2957,7 +4036,7 @@ export interface Images { * * {Promise} A promise is returned. * - * @resolve {ImageListResult} - The deserialized result object. + * @resolve {OperationStatusResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2965,47 +4044,26 @@ export interface Images { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ImageListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ImageListResult} for more information. + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * VirtualMachines - * __NOTE__: An instance of this class is automatically created for an - * instance of the ComputeManagementClient. - */ -export interface VirtualMachines { + start(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + start(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + start(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Captures the VM by copying virtual hard disks of the VM and outputs a - * template that can be used to create similar VMs. + * The operation to redeploy a virtual machine. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} vmName The name of the virtual machine. * - * @param {object} parameters Parameters supplied to the Capture Virtual - * Machine operation. - * - * @param {string} parameters.vhdPrefix The captured virtual hard disk's name - * prefix. - * - * @param {string} parameters.destinationContainerName The destination - * container name. - * - * @param {boolean} parameters.overwriteVhds Specifies whether to overwrite the - * destination virtual hard disk, in case of conflict. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -3013,32 +4071,19 @@ export interface VirtualMachines { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - captureWithHttpOperationResponse(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineCaptureParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + redeployWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Captures the VM by copying virtual hard disks of the VM and outputs a - * template that can be used to create similar VMs. + * The operation to redeploy a virtual machine. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} vmName The name of the virtual machine. * - * @param {object} parameters Parameters supplied to the Capture Virtual - * Machine operation. - * - * @param {string} parameters.vhdPrefix The captured virtual hard disk's name - * prefix. - * - * @param {string} parameters.destinationContainerName The destination - * container name. - * - * @param {boolean} parameters.overwriteVhds Specifies whether to overwrite the - * destination virtual hard disk, in case of conflict. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -3051,7 +4096,7 @@ export interface VirtualMachines { * * {Promise} A promise is returned. * - * @resolve {VirtualMachineCaptureResult} - The deserialized result object. + * @resolve {OperationStatusResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -3059,416 +4104,243 @@ export interface VirtualMachines { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VirtualMachineCaptureResult} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualMachineCaptureResult} for more + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. */ - capture(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineCaptureParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - capture(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineCaptureParameters, callback: ServiceCallback): void; - capture(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineCaptureParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + redeploy(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + redeploy(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + redeploy(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * The operation to create or update a virtual machine. + * The operation to perform maintenance on a virtual machine. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} vmName The name of the virtual machine. * - * @param {object} parameters Parameters supplied to the Create Virtual Machine - * operation. - * - * @param {object} [parameters.plan] Specifies information about the - * marketplace image used to create the virtual machine. This element is only - * used for marketplace images. Before you can use a marketplace image from an - * API, you must enable the image for programmatic use. In the Azure portal, - * find the marketplace image that you want to use and then click **Want to - * deploy programmatically, Get Started ->**. Enter any required information - * and then click **Save**. - * - * @param {string} [parameters.plan.name] The plan ID. - * - * @param {string} [parameters.plan.publisher] The publisher ID. - * - * @param {string} [parameters.plan.product] Specifies the product of the image - * from the marketplace. This is the same value as Offer under the - * imageReference element. - * - * @param {string} [parameters.plan.promotionCode] The promotion code. - * - * @param {object} [parameters.hardwareProfile] Specifies the hardware settings - * for the virtual machine. - * - * @param {string} [parameters.hardwareProfile.vmSize] Specifies the size of - * the virtual machine. For more information about virtual machine sizes, see - * [Sizes for virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). - *

    The available VM sizes depend on region and availability set. For a - * list of available sizes use these APIs:

    [List all available - * virtual machine sizes in an availability - * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) - *

    [List all available virtual machine sizes in a - * region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) - *

    [List all available virtual machine sizes for - * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). - * Possible values include: '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_B1s', 'Standard_B1ms', - * 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', - * '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_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', - * 'Standard_D32_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', - * 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', - * 'Standard_D64s_v3', '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_DS13-4_v2', 'Standard_DS13-2_v2', - * 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', 'Standard_E2_v3', - * 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', 'Standard_E32_v3', - * 'Standard_E64_v3', 'Standard_E2s_v3', 'Standard_E4s_v3', 'Standard_E8s_v3', - * 'Standard_E16s_v3', 'Standard_E32s_v3', 'Standard_E64s_v3', - * 'Standard_E32-16_v3', 'Standard_E32-8s_v3', 'Standard_E64-32s_v3', - * 'Standard_E64-16s_v3', 'Standard_F1', 'Standard_F2', 'Standard_F4', - * 'Standard_F8', 'Standard_F16', 'Standard_F1s', 'Standard_F2s', - * 'Standard_F4s', 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2', - * 'Standard_F4s_v2', 'Standard_F8s_v2', 'Standard_F16s_v2', - * 'Standard_F32s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1', - * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', - * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', - * 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8', - * 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m', - * 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', - * 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms', - * 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms', - * 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms', - * 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', - * 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2', - * 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3', - * 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s', - * 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6', - * 'Standard_NV12', 'Standard_NV24' + * @param {object} [options] Optional Parameters. * - * @param {object} [parameters.storageProfile] Specifies the storage settings - * for the virtual machine disks. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} [parameters.storageProfile.imageReference] Specifies - * information about the image to use. You can specify information about - * platform images, marketplace images, or virtual machine images. This element - * is required when you want to use a platform image, marketplace image, or - * virtual machine image, but is not used in other creation operations. + * @returns {Promise} A promise is returned * - * @param {string} [parameters.storageProfile.imageReference.publisher] The - * image publisher. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} [parameters.storageProfile.imageReference.offer] Specifies - * the offer of the platform image or marketplace image used to create the - * virtual machine. + * @reject {Error|ServiceError} - The error object. + */ + performMaintenanceWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * The operation to perform maintenance on a virtual machine. * - * @param {string} [parameters.storageProfile.imageReference.sku] The image - * SKU. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} [parameters.storageProfile.imageReference.version] Specifies - * the version of the platform image or marketplace image used to create the - * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. - * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the - * latest version of an image available at deploy time. Even if you use - * 'latest', the VM image will not automatically update after deploy time even - * if a new version becomes available. + * @param {string} vmName The name of the virtual machine. * - * @param {string} [parameters.storageProfile.imageReference.id] Resource Id + * @param {object} [options] Optional Parameters. * - * @param {object} [parameters.storageProfile.osDisk] Specifies information - * about the operating system disk used by the virtual machine.

    For - * more information about disks, see [About disks and VHDs for Azure virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.storageProfile.osDisk.osType] This property - * allows you to specify the type of the OS that is included in the disk if - * creating a VM from user-image or a specialized VHD.

    Possible values - * are:

    **Windows**

    **Linux**. Possible values include: - * 'Windows', 'Linux' + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {object} [parameters.storageProfile.osDisk.encryptionSettings] - * Specifies the encryption settings for the OS Disk.

    Minimum - * api-version: 2015-06-15 + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {object} - * [parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey] - * Specifies the location of the disk encryption key, which is a Key Vault - * Secret. + * {Promise} A promise is returned. * - * @param {string} - * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.secretUrl - * The URL referencing a secret in a Key Vault. + * @resolve {OperationStatusResponse} - The deserialized result object. * - * @param {object} - * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault - * The relative URL of the Key Vault containing the secret. + * @reject {Error|ServiceError} - The error object. * - * @param {object} - * [parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey] - * Specifies the location of the key encryption key in Key Vault. + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {string} - * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.keyUrl - * The URL referencing a key encryption key in Key Vault. + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {object} - * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault - * The relative URL of the Key Vault containing the key. + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} for more + * information. * - * @param {boolean} - * [parameters.storageProfile.osDisk.encryptionSettings.enabled] Specifies - * whether disk encryption should be enabled on the virtual machine. + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {string} [parameters.storageProfile.osDisk.name] The disk name. + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + performMaintenance(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + performMaintenance(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + performMaintenance(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Run command on the VM. * - * @param {object} [parameters.storageProfile.osDisk.vhd] The virtual hard - * disk. + * @param {string} resourceGroupName The name of the resource group. * - * @param {object} [parameters.storageProfile.osDisk.image] The source user - * image virtual hard disk. The virtual hard disk will be copied before being - * attached to the virtual machine. If SourceImage is provided, the destination - * virtual hard drive must not exist. + * @param {string} vmName The name of the virtual machine. * - * @param {string} [parameters.storageProfile.osDisk.image.uri] Specifies the - * virtual hard disk's uri. + * @param {object} parameters Parameters supplied to the Run command operation. * - * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the - * caching requirements.

    Possible values are:

    **None** - *

    **ReadOnly**

    **ReadWrite**

    Default: **None for - * Standard storage. ReadOnly for Premium storage**. Possible values include: - * 'None', 'ReadOnly', 'ReadWrite' + * @param {string} parameters.commandId The run command id. * - * @param {boolean} [parameters.storageProfile.osDisk.writeAcceleratorEnabled] - * Specifies whether writeAccelerator should be enabled or disabled on the - * disk. + * @param {array} [parameters.script] Optional. The script to be executed. + * When this value is given, the given script will override the default script + * of the command. * - * @param {string} parameters.storageProfile.osDisk.createOption Specifies how - * the virtual machine should be created.

    Possible values are:

    - * **Attach** \u2013 This value is used when you are using a specialized disk - * to create the virtual machine.

    **FromImage** \u2013 This value is - * used when you are using an image to create the virtual machine. If you are - * using a platform image, you also use the imageReference element described - * above. If you are using a marketplace image, you also use the plan element - * previously described. Possible values include: 'FromImage', 'Empty', - * 'Attach' + * @param {array} [parameters.parameters] The run command parameters. * - * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the - * size of an empty data disk in gigabytes. This element can be used to - * overwrite the name of the disk in a virtual machine image.

    This - * value cannot be larger than 1023 GB + * @param {object} [options] Optional Parameters. * - * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed - * disk parameters. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} - * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies - * the storage account type for the managed disk. Possible values are: - * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * @returns {Promise} A promise is returned * - * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource - * Id + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {array} [parameters.storageProfile.dataDisks] Specifies the - * parameters that are used to add a data disk to a virtual machine.

    - * For more information about disks, see [About disks and VHDs for Azure - * virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @reject {Error|ServiceError} - The error object. + */ + runCommandWithHttpOperationResponse(resourceGroupName: string, vmName: string, parameters: models.RunCommandInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Run command on the VM. * - * @param {object} [parameters.osProfile] Specifies the operating system - * settings for the virtual machine. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} [parameters.osProfile.computerName] Specifies the host OS - * name of the virtual machine.

    **Max-length (Windows):** 15 - * characters

    **Max-length (Linux):** 64 characters.

    For - * naming conventions and restrictions see [Azure infrastructure services - * implementation - * guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). + * @param {string} vmName The name of the virtual machine. * - * @param {string} [parameters.osProfile.adminUsername] Specifies the name of - * the administrator account.

    **Windows-only restriction:** Cannot end - * in "."

    **Disallowed values:** "administrator", "admin", "user", - * "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", - * "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", - * "john", "owner", "root", "server", "sql", "support", "support_388945a0", - * "sys", "test2", "test3", "user4", "user5".

    **Minimum-length - * (Linux):** 1 character

    **Max-length (Linux):** 64 characters - *

    **Max-length (Windows):** 20 characters

  • For root - * access to the Linux VM, see [Using root privileges on Linux virtual machines - * in - * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • - * For a list of built-in system users on Linux that should not be used in this - * field, see [Selecting User Names for Linux on - * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * @param {object} parameters Parameters supplied to the Run command operation. * - * @param {string} [parameters.osProfile.adminPassword] Specifies the password - * of the administrator account.

    **Minimum-length (Windows):** 8 - * characters

    **Minimum-length (Linux):** 6 characters

    - * **Max-length (Windows):** 123 characters

    **Max-length (Linux):** 72 - * characters

    **Complexity requirements:** 3 out of 4 conditions below - * need to be fulfilled
    Has lower characters
    Has upper characters
    - * Has a digit
    Has a special character (Regex match [\W_])

    - * **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", - * "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", - * "iloveyou!"

    For resetting the password, see [How to reset the - * Remote Desktop service or its login password in a Windows - * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) - *

    For resetting root password, see [Manage users, SSH, and check or - * repair disks on Azure Linux VMs using the VMAccess - * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + * @param {string} parameters.commandId The run command id. * - * @param {string} [parameters.osProfile.customData] Specifies a base-64 - * encoded string of custom data. The base-64 encoded string is decoded to a - * binary array that is saved as a file on the Virtual Machine. The maximum - * length of the binary array is 65535 bytes.

    For using cloud-init for - * your VM, see [Using cloud-init to customize a Linux VM during - * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * @param {array} [parameters.script] Optional. The script to be executed. + * When this value is given, the given script will override the default script + * of the command. * - * @param {object} [parameters.osProfile.windowsConfiguration] Specifies - * Windows operating system settings on the virtual machine. + * @param {array} [parameters.parameters] The run command parameters. * - * @param {boolean} - * [parameters.osProfile.windowsConfiguration.provisionVMAgent] Indicates - * whether virtual machine agent should be provisioned on the virtual machine. - *

    When this property is not specified in the request body, default - * behavior is to set it to true. This will ensure that VM Agent is installed - * on the VM so that extensions can be added to the VM later. + * @param {object} [options] Optional Parameters. * - * @param {boolean} - * [parameters.osProfile.windowsConfiguration.enableAutomaticUpdates] Indicates - * whether virtual machine is enabled for automatic updates. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.osProfile.windowsConfiguration.timeZone] - * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {array} - * [parameters.osProfile.windowsConfiguration.additionalUnattendContent] - * Specifies additional base-64 encoded XML formatted information that can be - * included in the Unattend.xml file, which is used by Windows Setup. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {object} [parameters.osProfile.windowsConfiguration.winRM] Specifies - * the Windows Remote Management listeners. This enables remote Windows - * PowerShell. + * {Promise} A promise is returned. * - * @param {array} [parameters.osProfile.windowsConfiguration.winRM.listeners] - * The list of Windows Remote Management listeners + * @resolve {RunCommandResult} - The deserialized result object. * - * @param {object} [parameters.osProfile.linuxConfiguration] Specifies the - * Linux operating system settings on the virtual machine.

    For a list - * of supported Linux distributions, see [Linux on Azure-Endorsed - * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) - *

    For running non-endorsed distributions, see [Information for - * Non-Endorsed - * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * @reject {Error|ServiceError} - The error object. * - * @param {boolean} - * [parameters.osProfile.linuxConfiguration.disablePasswordAuthentication] - * Specifies whether password authentication should be disabled. + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {object} [parameters.osProfile.linuxConfiguration.ssh] Specifies the - * ssh key configuration for a Linux OS. + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The - * list of SSH public keys used to authenticate with linux based VMs. + * {RunCommandResult} [result] - The deserialized result object if an error did not occur. + * See {@link RunCommandResult} for more information. * - * @param {array} [parameters.osProfile.secrets] Specifies set of certificates - * that should be installed onto the virtual machine. + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {object} [parameters.networkProfile] Specifies the network interfaces - * of the virtual machine. + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + runCommand(resourceGroupName: string, vmName: string, parameters: models.RunCommandInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + runCommand(resourceGroupName: string, vmName: string, parameters: models.RunCommandInput, callback: ServiceCallback): void; + runCommand(resourceGroupName: string, vmName: string, parameters: models.RunCommandInput, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Captures the VM by copying virtual hard disks of the VM and outputs a + * template that can be used to create similar VMs. * - * @param {array} [parameters.networkProfile.networkInterfaces] Specifies the - * list of resource Ids for the network interfaces associated with the virtual - * machine. + * @param {string} resourceGroupName The name of the resource group. * - * @param {object} [parameters.diagnosticsProfile] Specifies the boot - * diagnostic settings state.

    Minimum api-version: 2015-06-15. + * @param {string} vmName The name of the virtual machine. * - * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot - * Diagnostics is a debugging feature which allows you to view Console Output - * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, - * you can easily view the output of your console log.

    For both - * Windows and Linux virtual machines, Azure also enables you to see a - * screenshot of the VM from the hypervisor. + * @param {object} parameters Parameters supplied to the Capture Virtual + * Machine operation. * - * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] - * Whether boot diagnostics should be enabled on the Virtual Machine. + * @param {string} parameters.vhdPrefix The captured virtual hard disk's name + * prefix. * - * @param {string} [parameters.diagnosticsProfile.bootDiagnostics.storageUri] - * Uri of the storage account to use for placing the console output and - * screenshot. + * @param {string} parameters.destinationContainerName The destination + * container name. * - * @param {object} [parameters.availabilitySet] Specifies information about the - * availability set that the virtual machine should be assigned to. Virtual - * machines specified in the same availability set are allocated to different - * nodes to maximize availability. For more information about availability - * sets, see [Manage the availability of virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). - *

    For more information on Azure planned maintainance, see [Planned - * maintenance for virtual machines in - * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) - *

    Currently, a VM can only be added to availability set at creation - * time. An existing VM cannot be added to an availability set. + * @param {boolean} parameters.overwriteVhds Specifies whether to overwrite the + * destination virtual hard disk, in case of conflict. * - * @param {string} [parameters.availabilitySet.id] Resource Id + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.licenseType] Specifies that the image or disk - * that is being used was licensed on-premises. This element is only used for - * images that contain the Windows Server operating system.

    Possible - * values are:

    Windows_Client

    Windows_Server

    If this - * element is included in a request for an update, the value must match the - * initial value. This value cannot be updated.

    For more information, - * see [Azure Hybrid Use Benefit for Windows - * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) - *

    Minimum api-version: 2015-06-15 + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} [parameters.identity] The identity of the virtual machine, - * if configured. + * @returns {Promise} A promise is returned * - * @param {string} [parameters.identity.type] The type of identity used for the - * virtual machine. The type 'SystemAssigned, UserAssigned' includes both an - * implicitly created identity and a set of user assigned identities. The type - * 'None' will remove any identities from the virtual machine. Possible values - * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', - * 'None' + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {array} [parameters.identity.identityIds] The list of user identities - * associated with the Virtual Machine. The user identity references will be - * ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @reject {Error|ServiceError} - The error object. + */ + beginCaptureWithHttpOperationResponse(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineCaptureParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Captures the VM by copying virtual hard disks of the VM and outputs a + * template that can be used to create similar VMs. * - * @param {array} [parameters.zones] The virtual machine zones. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} parameters.location Resource location + * @param {string} vmName The name of the virtual machine. * - * @param {object} [parameters.tags] Resource tags + * @param {object} parameters Parameters supplied to the Capture Virtual + * Machine operation. + * + * @param {string} parameters.vhdPrefix The captured virtual hard disk's name + * prefix. + * + * @param {string} parameters.destinationContainerName The destination + * container name. + * + * @param {boolean} parameters.overwriteVhds Specifies whether to overwrite the + * destination virtual hard disk, in case of conflict. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * - * @returns {Promise} A promise is returned + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @reject {Error|ServiceError} - The error object. + * {Promise} A promise is returned. + * + * @resolve {VirtualMachineCaptureResult} - 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. + * + * {VirtualMachineCaptureResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineCaptureResult} 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. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, vmName: string, parameters: models.VirtualMachine, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCapture(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineCaptureParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCapture(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineCaptureParameters, callback: ServiceCallback): void; + beginCapture(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineCaptureParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** * The operation to create or update a virtual machine. @@ -3860,41 +4732,22 @@ export interface VirtualMachines { * @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 {VirtualMachine} - 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. - * - * {VirtualMachine} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualMachine} for more information. + * @returns {Promise} A promise is returned * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + * @reject {Error|ServiceError} - The error object. */ - createOrUpdate(resourceGroupName: string, vmName: string, parameters: models.VirtualMachine, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, vmName: string, parameters: models.VirtualMachine, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, vmName: string, parameters: models.VirtualMachine, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, vmName: string, parameters: models.VirtualMachine, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * The operation to update a virtual machine. + * The operation to create or update a virtual machine. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} vmName The name of the virtual machine. * - * @param {object} parameters Parameters supplied to the Update Virtual Machine + * @param {object} parameters Parameters supplied to the Create Virtual Machine * operation. * * @param {object} [parameters.plan] Specifies information about the @@ -4268,6 +5121,8 @@ export interface VirtualMachines { * * @param {array} [parameters.zones] The virtual machine zones. * + * @param {string} parameters.location Resource location + * * @param {object} [parameters.tags] Resource tags * * @param {object} [options] Optional Parameters. @@ -4275,13 +5130,32 @@ export interface VirtualMachines { * @param {object} [options.customHeaders] Headers that will be added to the * request * - * @returns {Promise} A promise is returned + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @reject {Error|ServiceError} - The error object. + * {Promise} A promise is returned. + * + * @resolve {VirtualMachine} - 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. + * + * {VirtualMachine} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachine} 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. */ - updateWithHttpOperationResponse(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdate(resourceGroupName: string, vmName: string, parameters: models.VirtualMachine, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, vmName: string, parameters: models.VirtualMachine, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, vmName: string, parameters: models.VirtualMachine, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** * The operation to update a virtual machine. @@ -4671,310 +5545,396 @@ export interface VirtualMachines { * @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 {VirtualMachine} - 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. - * - * {VirtualMachine} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualMachine} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - update(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - update(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineUpdate, callback: ServiceCallback): void; - update(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * The operation to delete a virtual machine. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} vmName The name of the virtual machine. - * - * @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. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * The operation to delete a virtual machine. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} vmName The name of the virtual machine. - * - * @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 {OperationStatusResponse} - 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. - * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} 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. - */ - deleteMethod(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - + beginUpdateWithHttpOperationResponse(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Retrieves information about the model view or the instance view of a virtual - * machine. + * The operation to update a virtual machine. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} vmName The name of the virtual machine. * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] The expand expression to apply on the - * operation. Possible values include: 'instanceView' - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {object} parameters Parameters supplied to the Update Virtual Machine + * operation. * - * @reject {Error|ServiceError} - The error object. - */ - getWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Retrieves information about the model view or the instance view of a virtual - * machine. + * @param {object} [parameters.plan] Specifies information about the + * marketplace image used to create the virtual machine. This element is only + * used for marketplace images. Before you can use a marketplace image from an + * API, you must enable the image for programmatic use. In the Azure portal, + * find the marketplace image that you want to use and then click **Want to + * deploy programmatically, Get Started ->**. Enter any required information + * and then click **Save**. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} [parameters.plan.name] The plan ID. * - * @param {string} vmName The name of the virtual machine. + * @param {string} [parameters.plan.publisher] The publisher ID. * - * @param {object} [options] Optional Parameters. + * @param {string} [parameters.plan.product] Specifies the product of the image + * from the marketplace. This is the same value as Offer under the + * imageReference element. * - * @param {string} [options.expand] The expand expression to apply on the - * operation. Possible values include: 'instanceView' + * @param {string} [parameters.plan.promotionCode] The promotion code. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {object} [parameters.hardwareProfile] Specifies the hardware settings + * for the virtual machine. * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {string} [parameters.hardwareProfile.vmSize] Specifies the size of + * the virtual machine. For more information about virtual machine sizes, see + * [Sizes for virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    The available VM sizes depend on region and availability set. For a + * list of available sizes use these APIs:

    [List all available + * virtual machine sizes in an availability + * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) + *

    [List all available virtual machine sizes in a + * region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) + *

    [List all available virtual machine sizes for + * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). + * Possible values include: '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_B1s', 'Standard_B1ms', + * 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', + * '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_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', + * 'Standard_D32_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', + * 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', + * 'Standard_D64s_v3', '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_DS13-4_v2', 'Standard_DS13-2_v2', + * 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', 'Standard_E2_v3', + * 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', 'Standard_E32_v3', + * 'Standard_E64_v3', 'Standard_E2s_v3', 'Standard_E4s_v3', 'Standard_E8s_v3', + * 'Standard_E16s_v3', 'Standard_E32s_v3', 'Standard_E64s_v3', + * 'Standard_E32-16_v3', 'Standard_E32-8s_v3', 'Standard_E64-32s_v3', + * 'Standard_E64-16s_v3', 'Standard_F1', 'Standard_F2', 'Standard_F4', + * 'Standard_F8', 'Standard_F16', 'Standard_F1s', 'Standard_F2s', + * 'Standard_F4s', 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2', + * 'Standard_F4s_v2', 'Standard_F8s_v2', 'Standard_F16s_v2', + * 'Standard_F32s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1', + * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', + * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', + * 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8', + * 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m', + * 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', + * 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms', + * 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms', + * 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms', + * 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', + * 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2', + * 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3', + * 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s', + * 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6', + * 'Standard_NV12', 'Standard_NV24' * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. * - * {Promise} A promise is returned. + * @param {object} [parameters.storageProfile.imageReference] Specifies + * information about the image to use. You can specify information about + * platform images, marketplace images, or virtual machine images. This element + * is required when you want to use a platform image, marketplace image, or + * virtual machine image, but is not used in other creation operations. * - * @resolve {VirtualMachine} - The deserialized result object. + * @param {string} [parameters.storageProfile.imageReference.publisher] The + * image publisher. * - * @reject {Error|ServiceError} - The error object. + * @param {string} [parameters.storageProfile.imageReference.offer] Specifies + * the offer of the platform image or marketplace image used to create the + * virtual machine. * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {string} [parameters.storageProfile.imageReference.sku] The image + * SKU. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {string} [parameters.storageProfile.imageReference.version] Specifies + * the version of the platform image or marketplace image used to create the + * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the + * latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even + * if a new version becomes available. * - * {VirtualMachine} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualMachine} for more information. + * @param {string} [parameters.storageProfile.imageReference.id] Resource Id * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - get(resourceGroupName: string, vmName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, vmName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Retrieves information about the run-time state of a virtual machine. + * @param {string} [parameters.storageProfile.osDisk.osType] This property + * allows you to specify the type of the OS that is included in the disk if + * creating a VM from user-image or a specialized VHD.

    Possible values + * are:

    **Windows**

    **Linux**. Possible values include: + * 'Windows', 'Linux' * - * @param {string} resourceGroupName The name of the resource group. + * @param {object} [parameters.storageProfile.osDisk.encryptionSettings] + * Specifies the encryption settings for the OS Disk.

    Minimum + * api-version: 2015-06-15 * - * @param {string} vmName The name of the virtual machine. + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey] + * Specifies the location of the disk encryption key, which is a Key Vault + * Secret. * - * @param {object} [options] Optional Parameters. + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.secretUrl + * The URL referencing a secret in a Key Vault. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the secret. * - * @returns {Promise} A promise is returned + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey] + * Specifies the location of the key encryption key in Key Vault. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.keyUrl + * The URL referencing a key encryption key in Key Vault. * - * @reject {Error|ServiceError} - The error object. - */ - instanceViewWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Retrieves information about the run-time state of a virtual machine. + * @param {object} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault + * The relative URL of the Key Vault containing the key. * - * @param {string} resourceGroupName The name of the resource group. + * @param {boolean} + * [parameters.storageProfile.osDisk.encryptionSettings.enabled] Specifies + * whether disk encryption should be enabled on the virtual machine. * - * @param {string} vmName The name of the virtual machine. + * @param {string} [parameters.storageProfile.osDisk.name] The disk name. * - * @param {object} [options] Optional Parameters. + * @param {object} [parameters.storageProfile.osDisk.vhd] The virtual hard + * disk. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {object} [parameters.storageProfile.osDisk.image] The source user + * image virtual hard disk. The virtual hard disk will be copied before being + * attached to the virtual machine. If SourceImage is provided, the destination + * virtual hard drive must not exist. * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {string} [parameters.storageProfile.osDisk.image.uri] Specifies the + * virtual hard disk's uri. * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' * - * {Promise} A promise is returned. + * @param {boolean} [parameters.storageProfile.osDisk.writeAcceleratorEnabled] + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. * - * @resolve {VirtualMachineInstanceView} - The deserialized result object. + * @param {string} parameters.storageProfile.osDisk.createOption Specifies how + * the virtual machine should be created.

    Possible values are:

    + * **Attach** \u2013 This value is used when you are using a specialized disk + * to create the virtual machine.

    **FromImage** \u2013 This value is + * used when you are using an image to create the virtual machine. If you are + * using a platform image, you also use the imageReference element described + * above. If you are using a marketplace image, you also use the plan element + * previously described. Possible values include: 'FromImage', 'Empty', + * 'Attach' * - * @reject {Error|ServiceError} - The error object. + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of an empty data disk in gigabytes. This element can be used to + * overwrite the name of the disk in a virtual machine image.

    This + * value cannot be larger than 1023 GB * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed + * disk parameters. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {string} + * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies + * the storage account type for the managed disk. Possible values are: + * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' * - * {VirtualMachineInstanceView} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualMachineInstanceView} for more - * information. + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - instanceView(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - instanceView(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; - instanceView(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Converts virtual machine disks from blob-based to managed disks. Virtual - * machine must be stop-deallocated before invoking this operation. + * @param {object} [parameters.osProfile] Specifies the operating system + * settings for the virtual machine. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} [parameters.osProfile.computerName] Specifies the host OS + * name of the virtual machine.

    **Max-length (Windows):** 15 + * characters

    **Max-length (Linux):** 64 characters.

    For + * naming conventions and restrictions see [Azure infrastructure services + * implementation + * guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). * - * @param {string} vmName The name of the virtual machine. + * @param {string} [parameters.osProfile.adminUsername] Specifies the name of + * the administrator account.

    **Windows-only restriction:** Cannot end + * in "."

    **Disallowed values:** "administrator", "admin", "user", + * "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", + * "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", + * "john", "owner", "root", "server", "sql", "support", "support_388945a0", + * "sys", "test2", "test3", "user4", "user5".

    **Minimum-length + * (Linux):** 1 character

    **Max-length (Linux):** 64 characters + *

    **Max-length (Windows):** 20 characters

  • For root + * access to the Linux VM, see [Using root privileges on Linux virtual machines + * in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • + * For a list of built-in system users on Linux that should not be used in this + * field, see [Selecting User Names for Linux on + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) * - * @param {object} [options] Optional Parameters. + * @param {string} [parameters.osProfile.adminPassword] Specifies the password + * of the administrator account.

    **Minimum-length (Windows):** 8 + * characters

    **Minimum-length (Linux):** 6 characters

    + * **Max-length (Windows):** 123 characters

    **Max-length (Linux):** 72 + * characters

    **Complexity requirements:** 3 out of 4 conditions below + * need to be fulfilled
    Has lower characters
    Has upper characters
    + * Has a digit
    Has a special character (Regex match [\W_])

    + * **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", + * "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", + * "iloveyou!"

    For resetting the password, see [How to reset the + * Remote Desktop service or its login password in a Windows + * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    For resetting root password, see [Manage users, SSH, and check or + * repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [parameters.osProfile.customData] Specifies a base-64 + * encoded string of custom data. The base-64 encoded string is decoded to a + * binary array that is saved as a file on the Virtual Machine. The maximum + * length of the binary array is 65535 bytes.

    For using cloud-init for + * your VM, see [Using cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) * - * @returns {Promise} A promise is returned + * @param {object} [parameters.osProfile.windowsConfiguration] Specifies + * Windows operating system settings on the virtual machine. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.provisionVMAgent] Indicates + * whether virtual machine agent should be provisioned on the virtual machine. + *

    When this property is not specified in the request body, default + * behavior is to set it to true. This will ensure that VM Agent is installed + * on the VM so that extensions can be added to the VM later. * - * @reject {Error|ServiceError} - The error object. - */ - convertToManagedDisksWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Converts virtual machine disks from blob-based to managed disks. Virtual - * machine must be stop-deallocated before invoking this operation. + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.enableAutomaticUpdates] Indicates + * whether virtual machine is enabled for automatic updates. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} [parameters.osProfile.windowsConfiguration.timeZone] + * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" * - * @param {string} vmName The name of the virtual machine. + * @param {array} + * [parameters.osProfile.windowsConfiguration.additionalUnattendContent] + * Specifies additional base-64 encoded XML formatted information that can be + * included in the Unattend.xml file, which is used by Windows Setup. * - * @param {object} [options] Optional Parameters. + * @param {object} [parameters.osProfile.windowsConfiguration.winRM] Specifies + * the Windows Remote Management listeners. This enables remote Windows + * PowerShell. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {array} [parameters.osProfile.windowsConfiguration.winRM.listeners] + * The list of Windows Remote Management listeners * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {object} [parameters.osProfile.linuxConfiguration] Specifies the + * Linux operating system settings on the virtual machine.

    For a list + * of supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + *

    For running non-endorsed distributions, see [Information for + * Non-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @param {boolean} + * [parameters.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. * - * {Promise} A promise is returned. + * @param {object} [parameters.osProfile.linuxConfiguration.ssh] Specifies the + * ssh key configuration for a Linux OS. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The + * list of SSH public keys used to authenticate with linux based VMs. * - * @reject {Error|ServiceError} - The error object. + * @param {array} [parameters.osProfile.secrets] Specifies set of certificates + * that should be installed onto the virtual machine. * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {object} [parameters.networkProfile] Specifies the network interfaces + * of the virtual machine. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {array} [parameters.networkProfile.networkInterfaces] Specifies the + * list of resource Ids for the network interfaces associated with the virtual + * machine. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * @param {object} [parameters.diagnosticsProfile] Specifies the boot + * diagnostic settings state.

    Minimum api-version: 2015-06-15. * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, + * you can easily view the output of your console log.

    For both + * Windows and Linux virtual machines, Azure also enables you to see a + * screenshot of the VM from the hypervisor. * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - convertToManagedDisks(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - convertToManagedDisks(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; - convertToManagedDisks(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Shuts down the virtual machine and releases the compute resources. You are - * not billed for the compute resources that this virtual machine uses. + * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] + * Whether boot diagnostics should be enabled on the Virtual Machine. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} [parameters.diagnosticsProfile.bootDiagnostics.storageUri] + * Uri of the storage account to use for placing the console output and + * screenshot. * - * @param {string} vmName The name of the virtual machine. + * @param {object} [parameters.availabilitySet] Specifies information about the + * availability set that the virtual machine should be assigned to. Virtual + * machines specified in the same availability set are allocated to different + * nodes to maximize availability. For more information about availability + * sets, see [Manage the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + *

    For more information on Azure planned maintainance, see [Planned + * maintenance for virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Currently, a VM can only be added to availability set at creation + * time. An existing VM cannot be added to an availability set. * - * @param {object} [options] Optional Parameters. + * @param {string} [parameters.availabilitySet.id] Resource Id * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [parameters.licenseType] Specifies that the image or disk + * that is being used was licensed on-premises. This element is only used for + * images that contain the Windows Server operating system.

    Possible + * values are:

    Windows_Client

    Windows_Server

    If this + * element is included in a request for an update, the value must match the + * initial value. This value cannot be updated.

    For more information, + * see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + *

    Minimum api-version: 2015-06-15 * - * @returns {Promise} A promise is returned + * @param {object} [parameters.identity] The identity of the virtual machine, + * if configured. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} [parameters.identity.type] The type of identity used for the + * virtual machine. The type 'SystemAssigned, UserAssigned' includes both an + * implicitly created identity and a set of user assigned identities. The type + * 'None' will remove any identities from the virtual machine. Possible values + * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', + * 'None' * - * @reject {Error|ServiceError} - The error object. - */ - deallocateWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Shuts down the virtual machine and releases the compute resources. You are - * not billed for the compute resources that this virtual machine uses. + * @param {array} [parameters.identity.identityIds] The list of user identities + * associated with the Virtual Machine. The user identity references will be + * ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. * - * @param {string} resourceGroupName The name of the resource group. + * @param {array} [parameters.zones] The virtual machine zones. * - * @param {string} vmName The name of the virtual machine. + * @param {object} [parameters.tags] Resource tags * * @param {object} [options] Optional Parameters. * @@ -4988,7 +5948,7 @@ export interface VirtualMachines { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {VirtualMachine} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -4996,21 +5956,20 @@ export interface VirtualMachines { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {VirtualMachine} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachine} 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. */ - deallocate(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deallocate(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; - deallocate(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdate(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineUpdate, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Sets the state of the virtual machine to generalized. + * The operation to delete a virtual machine. * * @param {string} resourceGroupName The name of the resource group. * @@ -5027,10 +5986,10 @@ export interface VirtualMachines { * * @reject {Error|ServiceError} - The error object. */ - generalizeWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Sets the state of the virtual machine to generalized. + * The operation to delete a virtual machine. * * @param {string} resourceGroupName The name of the resource group. * @@ -5064,17 +6023,19 @@ export interface VirtualMachines { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - generalize(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - generalize(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; - generalize(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists all of the virtual machines in the specified resource group. Use the - * nextLink property in the response to get the next page of virtual machines. + * Converts virtual machine disks from blob-based to managed disks. Virtual + * machine must be stop-deallocated before invoking this operation. * * @param {string} resourceGroupName The name of the resource group. * + * @param {string} vmName The name of the virtual machine. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -5082,71 +6043,19 @@ export interface VirtualMachines { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginConvertToManagedDisksWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists all of the virtual machines in the specified resource group. Use the - * nextLink property in the response to get the next page of virtual machines. + * Converts virtual machine disks from blob-based to managed disks. Virtual + * machine must be stop-deallocated before invoking this operation. * * @param {string} resourceGroupName The name of the resource group. * - * @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 {VirtualMachineListResult} - 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. - * - * {VirtualMachineListResult} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualMachineListResult} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - list(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; - - - /** - * Lists all of the virtual machines in the specified subscription. Use the - * nextLink property in the response to get the next page of virtual machines. - * - * @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. - */ - listAllWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists all of the virtual machines in the specified subscription. Use the - * nextLink property in the response to get the next page of virtual machines. + * @param {string} vmName The name of the virtual machine. * * @param {object} [options] Optional Parameters. * @@ -5160,7 +6069,7 @@ export interface VirtualMachines { * * {Promise} A promise is returned. * - * @resolve {VirtualMachineListResult} - The deserialized result object. + * @resolve {OperationStatusResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5168,22 +6077,22 @@ export interface VirtualMachines { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VirtualMachineListResult} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualMachineListResult} for more + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. */ - listAll(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAll(callback: ServiceCallback): void; - listAll(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginConvertToManagedDisks(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginConvertToManagedDisks(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + beginConvertToManagedDisks(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists all available virtual machine sizes to which the specified virtual - * machine can be resized. + * Shuts down the virtual machine and releases the compute resources. You are + * not billed for the compute resources that this virtual machine uses. * * @param {string} resourceGroupName The name of the resource group. * @@ -5196,15 +6105,15 @@ export interface VirtualMachines { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listAvailableSizesWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeallocateWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists all available virtual machine sizes to which the specified virtual - * machine can be resized. + * Shuts down the virtual machine and releases the compute resources. You are + * not billed for the compute resources that this virtual machine uses. * * @param {string} resourceGroupName The name of the resource group. * @@ -5222,7 +6131,7 @@ export interface VirtualMachines { * * {Promise} A promise is returned. * - * @resolve {VirtualMachineSizeListResult} - The deserialized result object. + * @resolve {OperationStatusResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5230,17 +6139,17 @@ export interface VirtualMachines { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VirtualMachineSizeListResult} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualMachineSizeListResult} for more + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. */ - listAvailableSizes(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAvailableSizes(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; - listAvailableSizes(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeallocate(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeallocate(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + beginDeallocate(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -5263,7 +6172,7 @@ export interface VirtualMachines { * * @reject {Error|ServiceError} - The error object. */ - powerOffWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginPowerOffWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * The operation to power off (stop) a virtual machine. The virtual machine can @@ -5302,9 +6211,9 @@ export interface VirtualMachines { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - powerOff(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - powerOff(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; - powerOff(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginPowerOff(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginPowerOff(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + beginPowerOff(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -5325,7 +6234,7 @@ export interface VirtualMachines { * * @reject {Error|ServiceError} - The error object. */ - restartWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginRestartWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * The operation to restart a virtual machine. @@ -5362,9 +6271,9 @@ export interface VirtualMachines { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - restart(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - restart(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; - restart(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginRestart(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginRestart(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + beginRestart(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -5385,7 +6294,7 @@ export interface VirtualMachines { * * @reject {Error|ServiceError} - The error object. */ - startWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginStartWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * The operation to start a virtual machine. @@ -5422,9 +6331,9 @@ export interface VirtualMachines { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - start(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - start(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; - start(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginStart(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginStart(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + beginStart(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -5445,7 +6354,7 @@ export interface VirtualMachines { * * @reject {Error|ServiceError} - The error object. */ - redeployWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginRedeployWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * The operation to redeploy a virtual machine. @@ -5482,9 +6391,9 @@ export interface VirtualMachines { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - redeploy(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - redeploy(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; - redeploy(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginRedeploy(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginRedeploy(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + beginRedeploy(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -5505,7 +6414,7 @@ export interface VirtualMachines { * * @reject {Error|ServiceError} - The error object. */ - performMaintenanceWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginPerformMaintenanceWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * The operation to perform maintenance on a virtual machine. @@ -5542,9 +6451,9 @@ export interface VirtualMachines { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - performMaintenance(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - performMaintenance(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; - performMaintenance(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginPerformMaintenance(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginPerformMaintenance(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + beginPerformMaintenance(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -5575,7 +6484,7 @@ export interface VirtualMachines { * * @reject {Error|ServiceError} - The error object. */ - runCommandWithHttpOperationResponse(resourceGroupName: string, vmName: string, parameters: models.RunCommandInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginRunCommandWithHttpOperationResponse(resourceGroupName: string, vmName: string, parameters: models.RunCommandInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Run command on the VM. @@ -5621,879 +6530,439 @@ export interface VirtualMachines { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - runCommand(resourceGroupName: string, vmName: string, parameters: models.RunCommandInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - runCommand(resourceGroupName: string, vmName: string, parameters: models.RunCommandInput, callback: ServiceCallback): void; - runCommand(resourceGroupName: string, vmName: string, parameters: models.RunCommandInput, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Captures the VM by copying virtual hard disks of the VM and outputs a - * template that can be used to create similar VMs. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} vmName The name of the virtual machine. - * - * @param {object} parameters Parameters supplied to the Capture Virtual - * Machine operation. - * - * @param {string} parameters.vhdPrefix The captured virtual hard disk's name - * prefix. - * - * @param {string} parameters.destinationContainerName The destination - * container name. - * - * @param {boolean} parameters.overwriteVhds Specifies whether to overwrite the - * destination virtual hard disk, in case of conflict. - * - * @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. - */ - beginCaptureWithHttpOperationResponse(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineCaptureParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Captures the VM by copying virtual hard disks of the VM and outputs a - * template that can be used to create similar VMs. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} vmName The name of the virtual machine. - * - * @param {object} parameters Parameters supplied to the Capture Virtual - * Machine operation. - * - * @param {string} parameters.vhdPrefix The captured virtual hard disk's name - * prefix. - * - * @param {string} parameters.destinationContainerName The destination - * container name. - * - * @param {boolean} parameters.overwriteVhds Specifies whether to overwrite the - * destination virtual hard disk, in case of conflict. - * - * @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 {VirtualMachineCaptureResult} - 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. - * - * {VirtualMachineCaptureResult} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualMachineCaptureResult} 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. - */ - beginCapture(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineCaptureParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCapture(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineCaptureParameters, callback: ServiceCallback): void; - beginCapture(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineCaptureParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginRunCommand(resourceGroupName: string, vmName: string, parameters: models.RunCommandInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginRunCommand(resourceGroupName: string, vmName: string, parameters: models.RunCommandInput, callback: ServiceCallback): void; + beginRunCommand(resourceGroupName: string, vmName: string, parameters: models.RunCommandInput, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * The operation to create or update a virtual machine. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} vmName The name of the virtual machine. - * - * @param {object} parameters Parameters supplied to the Create Virtual Machine - * operation. - * - * @param {object} [parameters.plan] Specifies information about the - * marketplace image used to create the virtual machine. This element is only - * used for marketplace images. Before you can use a marketplace image from an - * API, you must enable the image for programmatic use. In the Azure portal, - * find the marketplace image that you want to use and then click **Want to - * deploy programmatically, Get Started ->**. Enter any required information - * and then click **Save**. - * - * @param {string} [parameters.plan.name] The plan ID. - * - * @param {string} [parameters.plan.publisher] The publisher ID. - * - * @param {string} [parameters.plan.product] Specifies the product of the image - * from the marketplace. This is the same value as Offer under the - * imageReference element. - * - * @param {string} [parameters.plan.promotionCode] The promotion code. - * - * @param {object} [parameters.hardwareProfile] Specifies the hardware settings - * for the virtual machine. - * - * @param {string} [parameters.hardwareProfile.vmSize] Specifies the size of - * the virtual machine. For more information about virtual machine sizes, see - * [Sizes for virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). - *

    The available VM sizes depend on region and availability set. For a - * list of available sizes use these APIs:

    [List all available - * virtual machine sizes in an availability - * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) - *

    [List all available virtual machine sizes in a - * region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) - *

    [List all available virtual machine sizes for - * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). - * Possible values include: '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_B1s', 'Standard_B1ms', - * 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', - * '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_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', - * 'Standard_D32_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', - * 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', - * 'Standard_D64s_v3', '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_DS13-4_v2', 'Standard_DS13-2_v2', - * 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', 'Standard_E2_v3', - * 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', 'Standard_E32_v3', - * 'Standard_E64_v3', 'Standard_E2s_v3', 'Standard_E4s_v3', 'Standard_E8s_v3', - * 'Standard_E16s_v3', 'Standard_E32s_v3', 'Standard_E64s_v3', - * 'Standard_E32-16_v3', 'Standard_E32-8s_v3', 'Standard_E64-32s_v3', - * 'Standard_E64-16s_v3', 'Standard_F1', 'Standard_F2', 'Standard_F4', - * 'Standard_F8', 'Standard_F16', 'Standard_F1s', 'Standard_F2s', - * 'Standard_F4s', 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2', - * 'Standard_F4s_v2', 'Standard_F8s_v2', 'Standard_F16s_v2', - * 'Standard_F32s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1', - * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', - * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', - * 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8', - * 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m', - * 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', - * 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms', - * 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms', - * 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms', - * 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', - * 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2', - * 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3', - * 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s', - * 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6', - * 'Standard_NV12', 'Standard_NV24' + * Lists all of the virtual machines in the specified resource group. Use the + * nextLink property in the response to get the next page of virtual machines. * - * @param {object} [parameters.storageProfile] Specifies the storage settings - * for the virtual machine disks. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * - * @param {object} [parameters.storageProfile.imageReference] Specifies - * information about the image to use. You can specify information about - * platform images, marketplace images, or virtual machine images. This element - * is required when you want to use a platform image, marketplace image, or - * virtual machine image, but is not used in other creation operations. + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.storageProfile.imageReference.publisher] The - * image publisher. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.storageProfile.imageReference.offer] Specifies - * the offer of the platform image or marketplace image used to create the - * virtual machine. + * @returns {Promise} A promise is returned * - * @param {string} [parameters.storageProfile.imageReference.sku] The image - * SKU. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} [parameters.storageProfile.imageReference.version] Specifies - * the version of the platform image or marketplace image used to create the - * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. - * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the - * latest version of an image available at deploy time. Even if you use - * 'latest', the VM image will not automatically update after deploy time even - * if a new version becomes available. + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all of the virtual machines in the specified resource group. Use the + * nextLink property in the response to get the next page of virtual machines. * - * @param {string} [parameters.storageProfile.imageReference.id] Resource Id + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * - * @param {object} [parameters.storageProfile.osDisk] Specifies information - * about the operating system disk used by the virtual machine.

    For - * more information about disks, see [About disks and VHDs for Azure virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.storageProfile.osDisk.osType] This property - * allows you to specify the type of the OS that is included in the disk if - * creating a VM from user-image or a specialized VHD.

    Possible values - * are:

    **Windows**

    **Linux**. Possible values include: - * 'Windows', 'Linux' + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} [parameters.storageProfile.osDisk.encryptionSettings] - * Specifies the encryption settings for the OS Disk.

    Minimum - * api-version: 2015-06-15 + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {object} - * [parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey] - * Specifies the location of the disk encryption key, which is a Key Vault - * Secret. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {string} - * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.secretUrl - * The URL referencing a secret in a Key Vault. + * {Promise} A promise is returned. * - * @param {object} - * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault - * The relative URL of the Key Vault containing the secret. + * @resolve {VirtualMachineListResult} - The deserialized result object. * - * @param {object} - * [parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey] - * Specifies the location of the key encryption key in Key Vault. + * @reject {Error|ServiceError} - The error object. * - * @param {string} - * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.keyUrl - * The URL referencing a key encryption key in Key Vault. + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {object} - * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault - * The relative URL of the Key Vault containing the key. + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {boolean} - * [parameters.storageProfile.osDisk.encryptionSettings.enabled] Specifies - * whether disk encryption should be enabled on the virtual machine. + * {VirtualMachineListResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineListResult} for more + * information. * - * @param {string} [parameters.storageProfile.osDisk.name] The disk name. + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {object} [parameters.storageProfile.osDisk.vhd] The virtual hard - * disk. + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists all of the virtual machines in the specified subscription. Use the + * nextLink property in the response to get the next page of virtual machines. * - * @param {object} [parameters.storageProfile.osDisk.image] The source user - * image virtual hard disk. The virtual hard disk will be copied before being - * attached to the virtual machine. If SourceImage is provided, the destination - * virtual hard drive must not exist. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * - * @param {string} [parameters.storageProfile.osDisk.image.uri] Specifies the - * virtual hard disk's uri. + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the - * caching requirements.

    Possible values are:

    **None** - *

    **ReadOnly**

    **ReadWrite**

    Default: **None for - * Standard storage. ReadOnly for Premium storage**. Possible values include: - * 'None', 'ReadOnly', 'ReadWrite' + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {boolean} [parameters.storageProfile.osDisk.writeAcceleratorEnabled] - * Specifies whether writeAccelerator should be enabled or disabled on the - * disk. + * @returns {Promise} A promise is returned * - * @param {string} parameters.storageProfile.osDisk.createOption Specifies how - * the virtual machine should be created.

    Possible values are:

    - * **Attach** \u2013 This value is used when you are using a specialized disk - * to create the virtual machine.

    **FromImage** \u2013 This value is - * used when you are using an image to create the virtual machine. If you are - * using a platform image, you also use the imageReference element described - * above. If you are using a marketplace image, you also use the plan element - * previously described. Possible values include: 'FromImage', 'Empty', - * 'Attach' + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the - * size of an empty data disk in gigabytes. This element can be used to - * overwrite the name of the disk in a virtual machine image.

    This - * value cannot be larger than 1023 GB + * @reject {Error|ServiceError} - The error object. + */ + listAllNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all of the virtual machines in the specified subscription. Use the + * nextLink property in the response to get the next page of virtual machines. * - * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed - * disk parameters. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * - * @param {string} - * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies - * the storage account type for the managed disk. Possible values are: - * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource - * Id + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {array} [parameters.storageProfile.dataDisks] Specifies the - * parameters that are used to add a data disk to a virtual machine.

    - * For more information about disks, see [About disks and VHDs for Azure - * virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {object} [parameters.osProfile] Specifies the operating system - * settings for the virtual machine. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {string} [parameters.osProfile.computerName] Specifies the host OS - * name of the virtual machine.

    **Max-length (Windows):** 15 - * characters

    **Max-length (Linux):** 64 characters.

    For - * naming conventions and restrictions see [Azure infrastructure services - * implementation - * guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). + * {Promise} A promise is returned. * - * @param {string} [parameters.osProfile.adminUsername] Specifies the name of - * the administrator account.

    **Windows-only restriction:** Cannot end - * in "."

    **Disallowed values:** "administrator", "admin", "user", - * "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", - * "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", - * "john", "owner", "root", "server", "sql", "support", "support_388945a0", - * "sys", "test2", "test3", "user4", "user5".

    **Minimum-length - * (Linux):** 1 character

    **Max-length (Linux):** 64 characters - *

    **Max-length (Windows):** 20 characters

  • For root - * access to the Linux VM, see [Using root privileges on Linux virtual machines - * in - * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • - * For a list of built-in system users on Linux that should not be used in this - * field, see [Selecting User Names for Linux on - * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * @resolve {VirtualMachineListResult} - The deserialized result object. * - * @param {string} [parameters.osProfile.adminPassword] Specifies the password - * of the administrator account.

    **Minimum-length (Windows):** 8 - * characters

    **Minimum-length (Linux):** 6 characters

    - * **Max-length (Windows):** 123 characters

    **Max-length (Linux):** 72 - * characters

    **Complexity requirements:** 3 out of 4 conditions below - * need to be fulfilled
    Has lower characters
    Has upper characters
    - * Has a digit
    Has a special character (Regex match [\W_])

    - * **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", - * "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", - * "iloveyou!"

    For resetting the password, see [How to reset the - * Remote Desktop service or its login password in a Windows - * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) - *

    For resetting root password, see [Manage users, SSH, and check or - * repair disks on Azure Linux VMs using the VMAccess - * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + * @reject {Error|ServiceError} - The error object. * - * @param {string} [parameters.osProfile.customData] Specifies a base-64 - * encoded string of custom data. The base-64 encoded string is decoded to a - * binary array that is saved as a file on the Virtual Machine. The maximum - * length of the binary array is 65535 bytes.

    For using cloud-init for - * your VM, see [Using cloud-init to customize a Linux VM during - * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {object} [parameters.osProfile.windowsConfiguration] Specifies - * Windows operating system settings on the virtual machine. + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {boolean} - * [parameters.osProfile.windowsConfiguration.provisionVMAgent] Indicates - * whether virtual machine agent should be provisioned on the virtual machine. - *

    When this property is not specified in the request body, default - * behavior is to set it to true. This will ensure that VM Agent is installed - * on the VM so that extensions can be added to the VM later. + * {VirtualMachineListResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineListResult} 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. + */ + listAllNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAllNext(nextPageLink: string, callback: ServiceCallback): void; + listAllNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * VirtualMachineImages + * __NOTE__: An instance of this class is automatically created for an + * instance of the ComputeManagementClient. + */ +export interface VirtualMachineImages { + + + /** + * Gets a virtual machine image. + * + * @param {string} location The name of a supported Azure region. + * + * @param {string} publisherName A valid image publisher. + * + * @param {string} offer A valid image publisher offer. + * + * @param {string} skus A valid image SKU. + * + * @param {string} version A valid image SKU version. + * + * @param {object} [options] Optional Parameters. * - * @param {boolean} - * [parameters.osProfile.windowsConfiguration.enableAutomaticUpdates] Indicates - * whether virtual machine is enabled for automatic updates. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.osProfile.windowsConfiguration.timeZone] - * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" + * @returns {Promise} A promise is returned * - * @param {array} - * [parameters.osProfile.windowsConfiguration.additionalUnattendContent] - * Specifies additional base-64 encoded XML formatted information that can be - * included in the Unattend.xml file, which is used by Windows Setup. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {object} [parameters.osProfile.windowsConfiguration.winRM] Specifies - * the Windows Remote Management listeners. This enables remote Windows - * PowerShell. + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(location: string, publisherName: string, offer: string, skus: string, version: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a virtual machine image. * - * @param {array} [parameters.osProfile.windowsConfiguration.winRM.listeners] - * The list of Windows Remote Management listeners + * @param {string} location The name of a supported Azure region. * - * @param {object} [parameters.osProfile.linuxConfiguration] Specifies the - * Linux operating system settings on the virtual machine.

    For a list - * of supported Linux distributions, see [Linux on Azure-Endorsed - * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) - *

    For running non-endorsed distributions, see [Information for - * Non-Endorsed - * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * @param {string} publisherName A valid image publisher. * - * @param {boolean} - * [parameters.osProfile.linuxConfiguration.disablePasswordAuthentication] - * Specifies whether password authentication should be disabled. + * @param {string} offer A valid image publisher offer. * - * @param {object} [parameters.osProfile.linuxConfiguration.ssh] Specifies the - * ssh key configuration for a Linux OS. + * @param {string} skus A valid image SKU. * - * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The - * list of SSH public keys used to authenticate with linux based VMs. + * @param {string} version A valid image SKU version. * - * @param {array} [parameters.osProfile.secrets] Specifies set of certificates - * that should be installed onto the virtual machine. + * @param {object} [options] Optional Parameters. * - * @param {object} [parameters.networkProfile] Specifies the network interfaces - * of the virtual machine. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {array} [parameters.networkProfile.networkInterfaces] Specifies the - * list of resource Ids for the network interfaces associated with the virtual - * machine. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {object} [parameters.diagnosticsProfile] Specifies the boot - * diagnostic settings state.

    Minimum api-version: 2015-06-15. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot - * Diagnostics is a debugging feature which allows you to view Console Output - * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, - * you can easily view the output of your console log.

    For both - * Windows and Linux virtual machines, Azure also enables you to see a - * screenshot of the VM from the hypervisor. + * {Promise} A promise is returned. * - * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] - * Whether boot diagnostics should be enabled on the Virtual Machine. + * @resolve {VirtualMachineImage} - The deserialized result object. * - * @param {string} [parameters.diagnosticsProfile.bootDiagnostics.storageUri] - * Uri of the storage account to use for placing the console output and - * screenshot. + * @reject {Error|ServiceError} - The error object. * - * @param {object} [parameters.availabilitySet] Specifies information about the - * availability set that the virtual machine should be assigned to. Virtual - * machines specified in the same availability set are allocated to different - * nodes to maximize availability. For more information about availability - * sets, see [Manage the availability of virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). - *

    For more information on Azure planned maintainance, see [Planned - * maintenance for virtual machines in - * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) - *

    Currently, a VM can only be added to availability set at creation - * time. An existing VM cannot be added to an availability set. + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {string} [parameters.availabilitySet.id] Resource Id + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {string} [parameters.licenseType] Specifies that the image or disk - * that is being used was licensed on-premises. This element is only used for - * images that contain the Windows Server operating system.

    Possible - * values are:

    Windows_Client

    Windows_Server

    If this - * element is included in a request for an update, the value must match the - * initial value. This value cannot be updated.

    For more information, - * see [Azure Hybrid Use Benefit for Windows - * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) - *

    Minimum api-version: 2015-06-15 + * {VirtualMachineImage} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineImage} for more information. * - * @param {object} [parameters.identity] The identity of the virtual machine, - * if configured. + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {string} [parameters.identity.type] The type of identity used for the - * virtual machine. The type 'SystemAssigned, UserAssigned' includes both an - * implicitly created identity and a set of user assigned identities. The type - * 'None' will remove any identities from the virtual machine. Possible values - * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', - * 'None' + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(location: string, publisherName: string, offer: string, skus: string, version: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(location: string, publisherName: string, offer: string, skus: string, version: string, callback: ServiceCallback): void; + get(location: string, publisherName: string, offer: string, skus: string, version: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a list of all virtual machine image versions for the specified + * location, publisher, offer, and SKU. * - * @param {array} [parameters.identity.identityIds] The list of user identities - * associated with the Virtual Machine. The user identity references will be - * ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @param {string} location The name of a supported Azure region. * - * @param {array} [parameters.zones] The virtual machine zones. + * @param {string} publisherName A valid image publisher. * - * @param {string} parameters.location Resource location + * @param {string} offer A valid image publisher offer. * - * @param {object} [parameters.tags] Resource tags + * @param {string} skus A valid image SKU. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.filter] The filter to apply on the operation. + * + * @param {number} [options.top] + * + * @param {string} [options.orderby] + * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, vmName: string, parameters: models.VirtualMachine, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(location: string, publisherName: string, offer: string, skus: string, options?: { filter? : string, top? : number, orderby? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * The operation to create or update a virtual machine. - * - * @param {string} resourceGroupName The name of the resource group. + * Gets a list of all virtual machine image versions for the specified + * location, publisher, offer, and SKU. * - * @param {string} vmName The name of the virtual machine. + * @param {string} location The name of a supported Azure region. * - * @param {object} parameters Parameters supplied to the Create Virtual Machine - * operation. + * @param {string} publisherName A valid image publisher. * - * @param {object} [parameters.plan] Specifies information about the - * marketplace image used to create the virtual machine. This element is only - * used for marketplace images. Before you can use a marketplace image from an - * API, you must enable the image for programmatic use. In the Azure portal, - * find the marketplace image that you want to use and then click **Want to - * deploy programmatically, Get Started ->**. Enter any required information - * and then click **Save**. + * @param {string} offer A valid image publisher offer. * - * @param {string} [parameters.plan.name] The plan ID. + * @param {string} skus A valid image SKU. * - * @param {string} [parameters.plan.publisher] The publisher ID. + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.plan.product] Specifies the product of the image - * from the marketplace. This is the same value as Offer under the - * imageReference element. + * @param {string} [options.filter] The filter to apply on the operation. * - * @param {string} [parameters.plan.promotionCode] The promotion code. + * @param {number} [options.top] * - * @param {object} [parameters.hardwareProfile] Specifies the hardware settings - * for the virtual machine. + * @param {string} [options.orderby] * - * @param {string} [parameters.hardwareProfile.vmSize] Specifies the size of - * the virtual machine. For more information about virtual machine sizes, see - * [Sizes for virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). - *

    The available VM sizes depend on region and availability set. For a - * list of available sizes use these APIs:

    [List all available - * virtual machine sizes in an availability - * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) - *

    [List all available virtual machine sizes in a - * region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) - *

    [List all available virtual machine sizes for - * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). - * Possible values include: '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_B1s', 'Standard_B1ms', - * 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', - * '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_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', - * 'Standard_D32_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', - * 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', - * 'Standard_D64s_v3', '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_DS13-4_v2', 'Standard_DS13-2_v2', - * 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', 'Standard_E2_v3', - * 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', 'Standard_E32_v3', - * 'Standard_E64_v3', 'Standard_E2s_v3', 'Standard_E4s_v3', 'Standard_E8s_v3', - * 'Standard_E16s_v3', 'Standard_E32s_v3', 'Standard_E64s_v3', - * 'Standard_E32-16_v3', 'Standard_E32-8s_v3', 'Standard_E64-32s_v3', - * 'Standard_E64-16s_v3', 'Standard_F1', 'Standard_F2', 'Standard_F4', - * 'Standard_F8', 'Standard_F16', 'Standard_F1s', 'Standard_F2s', - * 'Standard_F4s', 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2', - * 'Standard_F4s_v2', 'Standard_F8s_v2', 'Standard_F16s_v2', - * 'Standard_F32s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1', - * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', - * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', - * 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8', - * 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m', - * 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', - * 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms', - * 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms', - * 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms', - * 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', - * 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2', - * 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3', - * 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s', - * 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6', - * 'Standard_NV12', 'Standard_NV24' + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} [parameters.storageProfile] Specifies the storage settings - * for the virtual machine disks. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {object} [parameters.storageProfile.imageReference] Specifies - * information about the image to use. You can specify information about - * platform images, marketplace images, or virtual machine images. This element - * is required when you want to use a platform image, marketplace image, or - * virtual machine image, but is not used in other creation operations. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {string} [parameters.storageProfile.imageReference.publisher] The - * image publisher. + * {Promise} A promise is returned. * - * @param {string} [parameters.storageProfile.imageReference.offer] Specifies - * the offer of the platform image or marketplace image used to create the - * virtual machine. + * @resolve {Array} - The deserialized result object. * - * @param {string} [parameters.storageProfile.imageReference.sku] The image - * SKU. + * @reject {Error|ServiceError} - The error object. * - * @param {string} [parameters.storageProfile.imageReference.version] Specifies - * the version of the platform image or marketplace image used to create the - * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. - * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the - * latest version of an image available at deploy time. Even if you use - * 'latest', the VM image will not automatically update after deploy time even - * if a new version becomes available. + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {string} [parameters.storageProfile.imageReference.id] Resource Id + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {object} [parameters.storageProfile.osDisk] Specifies information - * about the operating system disk used by the virtual machine.

    For - * more information about disks, see [About disks and VHDs for Azure virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * {Array} [result] - The deserialized result object if an error did not occur. * - * @param {string} [parameters.storageProfile.osDisk.osType] This property - * allows you to specify the type of the OS that is included in the disk if - * creating a VM from user-image or a specialized VHD.

    Possible values - * are:

    **Windows**

    **Linux**. Possible values include: - * 'Windows', 'Linux' + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {object} [parameters.storageProfile.osDisk.encryptionSettings] - * Specifies the encryption settings for the OS Disk.

    Minimum - * api-version: 2015-06-15 + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(location: string, publisherName: string, offer: string, skus: string, options?: { filter? : string, top? : number, orderby? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + list(location: string, publisherName: string, offer: string, skus: string, callback: ServiceCallback): void; + list(location: string, publisherName: string, offer: string, skus: string, options: { filter? : string, top? : number, orderby? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a list of virtual machine image offers for the specified location and + * publisher. * - * @param {object} - * [parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey] - * Specifies the location of the disk encryption key, which is a Key Vault - * Secret. + * @param {string} location The name of a supported Azure region. * - * @param {string} - * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.secretUrl - * The URL referencing a secret in a Key Vault. + * @param {string} publisherName A valid image publisher. * - * @param {object} - * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault - * The relative URL of the Key Vault containing the secret. + * @param {object} [options] Optional Parameters. * - * @param {object} - * [parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey] - * Specifies the location of the key encryption key in Key Vault. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} - * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.keyUrl - * The URL referencing a key encryption key in Key Vault. + * @returns {Promise} A promise is returned * - * @param {object} - * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault - * The relative URL of the Key Vault containing the key. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {boolean} - * [parameters.storageProfile.osDisk.encryptionSettings.enabled] Specifies - * whether disk encryption should be enabled on the virtual machine. + * @reject {Error|ServiceError} - The error object. + */ + listOffersWithHttpOperationResponse(location: string, publisherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a list of virtual machine image offers for the specified location and + * publisher. * - * @param {string} [parameters.storageProfile.osDisk.name] The disk name. + * @param {string} location The name of a supported Azure region. * - * @param {object} [parameters.storageProfile.osDisk.vhd] The virtual hard - * disk. + * @param {string} publisherName A valid image publisher. * - * @param {object} [parameters.storageProfile.osDisk.image] The source user - * image virtual hard disk. The virtual hard disk will be copied before being - * attached to the virtual machine. If SourceImage is provided, the destination - * virtual hard drive must not exist. + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.storageProfile.osDisk.image.uri] Specifies the - * virtual hard disk's uri. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the - * caching requirements.

    Possible values are:

    **None** - *

    **ReadOnly**

    **ReadWrite**

    Default: **None for - * Standard storage. ReadOnly for Premium storage**. Possible values include: - * 'None', 'ReadOnly', 'ReadWrite' + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {boolean} [parameters.storageProfile.osDisk.writeAcceleratorEnabled] - * Specifies whether writeAccelerator should be enabled or disabled on the - * disk. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {string} parameters.storageProfile.osDisk.createOption Specifies how - * the virtual machine should be created.

    Possible values are:

    - * **Attach** \u2013 This value is used when you are using a specialized disk - * to create the virtual machine.

    **FromImage** \u2013 This value is - * used when you are using an image to create the virtual machine. If you are - * using a platform image, you also use the imageReference element described - * above. If you are using a marketplace image, you also use the plan element - * previously described. Possible values include: 'FromImage', 'Empty', - * 'Attach' + * {Promise} A promise is returned. * - * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the - * size of an empty data disk in gigabytes. This element can be used to - * overwrite the name of the disk in a virtual machine image.

    This - * value cannot be larger than 1023 GB + * @resolve {Array} - The deserialized result object. * - * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed - * disk parameters. + * @reject {Error|ServiceError} - The error object. * - * @param {string} - * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies - * the storage account type for the managed disk. Possible values are: - * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource - * Id + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {array} [parameters.storageProfile.dataDisks] Specifies the - * parameters that are used to add a data disk to a virtual machine.

    - * For more information about disks, see [About disks and VHDs for Azure - * virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * {Array} [result] - The deserialized result object if an error did not occur. * - * @param {object} [parameters.osProfile] Specifies the operating system - * settings for the virtual machine. + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {string} [parameters.osProfile.computerName] Specifies the host OS - * name of the virtual machine.

    **Max-length (Windows):** 15 - * characters

    **Max-length (Linux):** 64 characters.

    For - * naming conventions and restrictions see [Azure infrastructure services - * implementation - * guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listOffers(location: string, publisherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listOffers(location: string, publisherName: string, callback: ServiceCallback): void; + listOffers(location: string, publisherName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a list of virtual machine image publishers for the specified Azure + * location. * - * @param {string} [parameters.osProfile.adminUsername] Specifies the name of - * the administrator account.

    **Windows-only restriction:** Cannot end - * in "."

    **Disallowed values:** "administrator", "admin", "user", - * "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", - * "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", - * "john", "owner", "root", "server", "sql", "support", "support_388945a0", - * "sys", "test2", "test3", "user4", "user5".

    **Minimum-length - * (Linux):** 1 character

    **Max-length (Linux):** 64 characters - *

    **Max-length (Windows):** 20 characters

  • For root - * access to the Linux VM, see [Using root privileges on Linux virtual machines - * in - * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • - * For a list of built-in system users on Linux that should not be used in this - * field, see [Selecting User Names for Linux on - * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * @param {string} location The name of a supported Azure region. * - * @param {string} [parameters.osProfile.adminPassword] Specifies the password - * of the administrator account.

    **Minimum-length (Windows):** 8 - * characters

    **Minimum-length (Linux):** 6 characters

    - * **Max-length (Windows):** 123 characters

    **Max-length (Linux):** 72 - * characters

    **Complexity requirements:** 3 out of 4 conditions below - * need to be fulfilled
    Has lower characters
    Has upper characters
    - * Has a digit
    Has a special character (Regex match [\W_])

    - * **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", - * "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", - * "iloveyou!"

    For resetting the password, see [How to reset the - * Remote Desktop service or its login password in a Windows - * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) - *

    For resetting root password, see [Manage users, SSH, and check or - * repair disks on Azure Linux VMs using the VMAccess - * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.osProfile.customData] Specifies a base-64 - * encoded string of custom data. The base-64 encoded string is decoded to a - * binary array that is saved as a file on the Virtual Machine. The maximum - * length of the binary array is 65535 bytes.

    For using cloud-init for - * your VM, see [Using cloud-init to customize a Linux VM during - * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} [parameters.osProfile.windowsConfiguration] Specifies - * Windows operating system settings on the virtual machine. + * @returns {Promise} A promise is returned * - * @param {boolean} - * [parameters.osProfile.windowsConfiguration.provisionVMAgent] Indicates - * whether virtual machine agent should be provisioned on the virtual machine. - *

    When this property is not specified in the request body, default - * behavior is to set it to true. This will ensure that VM Agent is installed - * on the VM so that extensions can be added to the VM later. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {boolean} - * [parameters.osProfile.windowsConfiguration.enableAutomaticUpdates] Indicates - * whether virtual machine is enabled for automatic updates. + * @reject {Error|ServiceError} - The error object. + */ + listPublishersWithHttpOperationResponse(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a list of virtual machine image publishers for the specified Azure + * location. * - * @param {string} [parameters.osProfile.windowsConfiguration.timeZone] - * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" + * @param {string} location The name of a supported Azure region. * - * @param {array} - * [parameters.osProfile.windowsConfiguration.additionalUnattendContent] - * Specifies additional base-64 encoded XML formatted information that can be - * included in the Unattend.xml file, which is used by Windows Setup. + * @param {object} [options] Optional Parameters. * - * @param {object} [parameters.osProfile.windowsConfiguration.winRM] Specifies - * the Windows Remote Management listeners. This enables remote Windows - * PowerShell. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {array} [parameters.osProfile.windowsConfiguration.winRM.listeners] - * The list of Windows Remote Management listeners + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {object} [parameters.osProfile.linuxConfiguration] Specifies the - * Linux operating system settings on the virtual machine.

    For a list - * of supported Linux distributions, see [Linux on Azure-Endorsed - * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) - *

    For running non-endorsed distributions, see [Information for - * Non-Endorsed - * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {boolean} - * [parameters.osProfile.linuxConfiguration.disablePasswordAuthentication] - * Specifies whether password authentication should be disabled. + * {Promise} A promise is returned. * - * @param {object} [parameters.osProfile.linuxConfiguration.ssh] Specifies the - * ssh key configuration for a Linux OS. + * @resolve {Array} - The deserialized result object. * - * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The - * list of SSH public keys used to authenticate with linux based VMs. + * @reject {Error|ServiceError} - The error object. * - * @param {array} [parameters.osProfile.secrets] Specifies set of certificates - * that should be installed onto the virtual machine. + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {object} [parameters.networkProfile] Specifies the network interfaces - * of the virtual machine. + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {array} [parameters.networkProfile.networkInterfaces] Specifies the - * list of resource Ids for the network interfaces associated with the virtual - * machine. + * {Array} [result] - The deserialized result object if an error did not occur. * - * @param {object} [parameters.diagnosticsProfile] Specifies the boot - * diagnostic settings state.

    Minimum api-version: 2015-06-15. + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot - * Diagnostics is a debugging feature which allows you to view Console Output - * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, - * you can easily view the output of your console log.

    For both - * Windows and Linux virtual machines, Azure also enables you to see a - * screenshot of the VM from the hypervisor. + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listPublishers(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listPublishers(location: string, callback: ServiceCallback): void; + listPublishers(location: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a list of virtual machine image SKUs for the specified location, + * publisher, and offer. * - * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] - * Whether boot diagnostics should be enabled on the Virtual Machine. + * @param {string} location The name of a supported Azure region. * - * @param {string} [parameters.diagnosticsProfile.bootDiagnostics.storageUri] - * Uri of the storage account to use for placing the console output and - * screenshot. + * @param {string} publisherName A valid image publisher. * - * @param {object} [parameters.availabilitySet] Specifies information about the - * availability set that the virtual machine should be assigned to. Virtual - * machines specified in the same availability set are allocated to different - * nodes to maximize availability. For more information about availability - * sets, see [Manage the availability of virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). - *

    For more information on Azure planned maintainance, see [Planned - * maintenance for virtual machines in - * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) - *

    Currently, a VM can only be added to availability set at creation - * time. An existing VM cannot be added to an availability set. + * @param {string} offer A valid image publisher offer. * - * @param {string} [parameters.availabilitySet.id] Resource Id + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.licenseType] Specifies that the image or disk - * that is being used was licensed on-premises. This element is only used for - * images that contain the Windows Server operating system.

    Possible - * values are:

    Windows_Client

    Windows_Server

    If this - * element is included in a request for an update, the value must match the - * initial value. This value cannot be updated.

    For more information, - * see [Azure Hybrid Use Benefit for Windows - * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) - *

    Minimum api-version: 2015-06-15 + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} [parameters.identity] The identity of the virtual machine, - * if configured. + * @returns {Promise} A promise is returned * - * @param {string} [parameters.identity.type] The type of identity used for the - * virtual machine. The type 'SystemAssigned, UserAssigned' includes both an - * implicitly created identity and a set of user assigned identities. The type - * 'None' will remove any identities from the virtual machine. Possible values - * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', - * 'None' + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {array} [parameters.identity.identityIds] The list of user identities - * associated with the Virtual Machine. The user identity references will be - * ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @reject {Error|ServiceError} - The error object. + */ + listSkusWithHttpOperationResponse(location: string, publisherName: string, offer: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a list of virtual machine image SKUs for the specified location, + * publisher, and offer. * - * @param {array} [parameters.zones] The virtual machine zones. + * @param {string} location The name of a supported Azure region. * - * @param {string} parameters.location Resource location + * @param {string} publisherName A valid image publisher. * - * @param {object} [parameters.tags] Resource tags + * @param {string} offer A valid image publisher offer. * * @param {object} [options] Optional Parameters. * @@ -6507,7 +6976,7 @@ export interface VirtualMachines { * * {Promise} A promise is returned. * - * @resolve {VirtualMachine} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6515,398 +6984,289 @@ export interface VirtualMachines { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VirtualMachine} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualMachine} for more information. + * {Array} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName: string, vmName: string, parameters: models.VirtualMachine, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, vmName: string, parameters: models.VirtualMachine, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, vmName: string, parameters: models.VirtualMachine, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listSkus(location: string, publisherName: string, offer: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSkus(location: string, publisherName: string, offer: string, callback: ServiceCallback): void; + listSkus(location: string, publisherName: string, offer: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * UsageOperations + * __NOTE__: An instance of this class is automatically created for an + * instance of the ComputeManagementClient. + */ +export interface UsageOperations { /** - * The operation to update a virtual machine. + * Gets, for the specified location, the current compute resource usage + * information as well as the limits for compute resources under the + * subscription. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} location The location for which resource usage is queried. * - * @param {string} vmName The name of the virtual machine. + * @param {object} [options] Optional Parameters. * - * @param {object} parameters Parameters supplied to the Update Virtual Machine - * operation. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} [parameters.plan] Specifies information about the - * marketplace image used to create the virtual machine. This element is only - * used for marketplace images. Before you can use a marketplace image from an - * API, you must enable the image for programmatic use. In the Azure portal, - * find the marketplace image that you want to use and then click **Want to - * deploy programmatically, Get Started ->**. Enter any required information - * and then click **Save**. + * @returns {Promise} A promise is returned * - * @param {string} [parameters.plan.name] The plan ID. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} [parameters.plan.publisher] The publisher ID. + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets, for the specified location, the current compute resource usage + * information as well as the limits for compute resources under the + * subscription. * - * @param {string} [parameters.plan.product] Specifies the product of the image - * from the marketplace. This is the same value as Offer under the - * imageReference element. + * @param {string} location The location for which resource usage is queried. * - * @param {string} [parameters.plan.promotionCode] The promotion code. + * @param {object} [options] Optional Parameters. * - * @param {object} [parameters.hardwareProfile] Specifies the hardware settings - * for the virtual machine. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.hardwareProfile.vmSize] Specifies the size of - * the virtual machine. For more information about virtual machine sizes, see - * [Sizes for virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). - *

    The available VM sizes depend on region and availability set. For a - * list of available sizes use these APIs:

    [List all available - * virtual machine sizes in an availability - * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) - *

    [List all available virtual machine sizes in a - * region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) - *

    [List all available virtual machine sizes for - * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). - * Possible values include: '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_B1s', 'Standard_B1ms', - * 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', - * '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_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', - * 'Standard_D32_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', - * 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', - * 'Standard_D64s_v3', '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_DS13-4_v2', 'Standard_DS13-2_v2', - * 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', 'Standard_E2_v3', - * 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', 'Standard_E32_v3', - * 'Standard_E64_v3', 'Standard_E2s_v3', 'Standard_E4s_v3', 'Standard_E8s_v3', - * 'Standard_E16s_v3', 'Standard_E32s_v3', 'Standard_E64s_v3', - * 'Standard_E32-16_v3', 'Standard_E32-8s_v3', 'Standard_E64-32s_v3', - * 'Standard_E64-16s_v3', 'Standard_F1', 'Standard_F2', 'Standard_F4', - * 'Standard_F8', 'Standard_F16', 'Standard_F1s', 'Standard_F2s', - * 'Standard_F4s', 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2', - * 'Standard_F4s_v2', 'Standard_F8s_v2', 'Standard_F16s_v2', - * 'Standard_F32s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1', - * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', - * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', - * 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8', - * 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m', - * 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', - * 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms', - * 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms', - * 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms', - * 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', - * 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2', - * 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3', - * 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s', - * 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6', - * 'Standard_NV12', 'Standard_NV24' + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {object} [parameters.storageProfile] Specifies the storage settings - * for the virtual machine disks. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {object} [parameters.storageProfile.imageReference] Specifies - * information about the image to use. You can specify information about - * platform images, marketplace images, or virtual machine images. This element - * is required when you want to use a platform image, marketplace image, or - * virtual machine image, but is not used in other creation operations. + * {Promise} A promise is returned. * - * @param {string} [parameters.storageProfile.imageReference.publisher] The - * image publisher. + * @resolve {ListUsagesResult} - The deserialized result object. * - * @param {string} [parameters.storageProfile.imageReference.offer] Specifies - * the offer of the platform image or marketplace image used to create the - * virtual machine. + * @reject {Error|ServiceError} - The error object. * - * @param {string} [parameters.storageProfile.imageReference.sku] The image - * SKU. + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {string} [parameters.storageProfile.imageReference.version] Specifies - * the version of the platform image or marketplace image used to create the - * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. - * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the - * latest version of an image available at deploy time. Even if you use - * 'latest', the VM image will not automatically update after deploy time even - * if a new version becomes available. + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {string} [parameters.storageProfile.imageReference.id] Resource Id + * {ListUsagesResult} [result] - The deserialized result object if an error did not occur. + * See {@link ListUsagesResult} for more information. * - * @param {object} [parameters.storageProfile.osDisk] Specifies information - * about the operating system disk used by the virtual machine.

    For - * more information about disks, see [About disks and VHDs for Azure virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {string} [parameters.storageProfile.osDisk.osType] This property - * allows you to specify the type of the OS that is included in the disk if - * creating a VM from user-image or a specialized VHD.

    Possible values - * are:

    **Windows**

    **Linux**. Possible values include: - * 'Windows', 'Linux' + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(location: string, callback: ServiceCallback): void; + list(location: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets, for the specified location, the current compute resource usage + * information as well as the limits for compute resources under the + * subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets, for the specified location, the current compute resource usage + * information as well as the limits for compute resources under the + * subscription. * - * @param {object} [parameters.storageProfile.osDisk.encryptionSettings] - * Specifies the encryption settings for the OS Disk.

    Minimum - * api-version: 2015-06-15 + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * - * @param {object} - * [parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey] - * Specifies the location of the disk encryption key, which is a Key Vault - * Secret. + * @param {object} [options] Optional Parameters. * - * @param {string} - * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.secretUrl - * The URL referencing a secret in a Key Vault. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} - * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault - * The relative URL of the Key Vault containing the secret. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {object} - * [parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey] - * Specifies the location of the key encryption key in Key Vault. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {string} - * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.keyUrl - * The URL referencing a key encryption key in Key Vault. + * {Promise} A promise is returned. * - * @param {object} - * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault - * The relative URL of the Key Vault containing the key. + * @resolve {ListUsagesResult} - The deserialized result object. * - * @param {boolean} - * [parameters.storageProfile.osDisk.encryptionSettings.enabled] Specifies - * whether disk encryption should be enabled on the virtual machine. + * @reject {Error|ServiceError} - The error object. * - * @param {string} [parameters.storageProfile.osDisk.name] The disk name. + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {object} [parameters.storageProfile.osDisk.vhd] The virtual hard - * disk. + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {object} [parameters.storageProfile.osDisk.image] The source user - * image virtual hard disk. The virtual hard disk will be copied before being - * attached to the virtual machine. If SourceImage is provided, the destination - * virtual hard drive must not exist. + * {ListUsagesResult} [result] - The deserialized result object if an error did not occur. + * See {@link ListUsagesResult} for more information. * - * @param {string} [parameters.storageProfile.osDisk.image.uri] Specifies the - * virtual hard disk's uri. + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the - * caching requirements.

    Possible values are:

    **None** - *

    **ReadOnly**

    **ReadWrite**

    Default: **None for - * Standard storage. ReadOnly for Premium storage**. Possible values include: - * 'None', 'ReadOnly', 'ReadWrite' + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * VirtualMachineSizes + * __NOTE__: An instance of this class is automatically created for an + * instance of the ComputeManagementClient. + */ +export interface VirtualMachineSizes { + + + /** + * Lists all available virtual machine sizes for a subscription in a location. * - * @param {boolean} [parameters.storageProfile.osDisk.writeAcceleratorEnabled] - * Specifies whether writeAccelerator should be enabled or disabled on the - * disk. + * @param {string} location The location upon which virtual-machine-sizes is + * queried. * - * @param {string} parameters.storageProfile.osDisk.createOption Specifies how - * the virtual machine should be created.

    Possible values are:

    - * **Attach** \u2013 This value is used when you are using a specialized disk - * to create the virtual machine.

    **FromImage** \u2013 This value is - * used when you are using an image to create the virtual machine. If you are - * using a platform image, you also use the imageReference element described - * above. If you are using a marketplace image, you also use the plan element - * previously described. Possible values include: 'FromImage', 'Empty', - * 'Attach' + * @param {object} [options] Optional Parameters. * - * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the - * size of an empty data disk in gigabytes. This element can be used to - * overwrite the name of the disk in a virtual machine image.

    This - * value cannot be larger than 1023 GB + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed - * disk parameters. + * @returns {Promise} A promise is returned * - * @param {string} - * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies - * the storage account type for the managed disk. Possible values are: - * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', - * 'Premium_LRS' + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource - * Id + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all available virtual machine sizes for a subscription in a location. * - * @param {array} [parameters.storageProfile.dataDisks] Specifies the - * parameters that are used to add a data disk to a virtual machine.

    - * For more information about disks, see [About disks and VHDs for Azure - * virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @param {string} location The location upon which virtual-machine-sizes is + * queried. * - * @param {object} [parameters.osProfile] Specifies the operating system - * settings for the virtual machine. + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.osProfile.computerName] Specifies the host OS - * name of the virtual machine.

    **Max-length (Windows):** 15 - * characters

    **Max-length (Linux):** 64 characters.

    For - * naming conventions and restrictions see [Azure infrastructure services - * implementation - * guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.osProfile.adminUsername] Specifies the name of - * the administrator account.

    **Windows-only restriction:** Cannot end - * in "."

    **Disallowed values:** "administrator", "admin", "user", - * "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", - * "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", - * "john", "owner", "root", "server", "sql", "support", "support_388945a0", - * "sys", "test2", "test3", "user4", "user5".

    **Minimum-length - * (Linux):** 1 character

    **Max-length (Linux):** 64 characters - *

    **Max-length (Windows):** 20 characters

  • For root - * access to the Linux VM, see [Using root privileges on Linux virtual machines - * in - * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • - * For a list of built-in system users on Linux that should not be used in this - * field, see [Selecting User Names for Linux on - * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {string} [parameters.osProfile.adminPassword] Specifies the password - * of the administrator account.

    **Minimum-length (Windows):** 8 - * characters

    **Minimum-length (Linux):** 6 characters

    - * **Max-length (Windows):** 123 characters

    **Max-length (Linux):** 72 - * characters

    **Complexity requirements:** 3 out of 4 conditions below - * need to be fulfilled
    Has lower characters
    Has upper characters
    - * Has a digit
    Has a special character (Regex match [\W_])

    - * **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", - * "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", - * "iloveyou!"

    For resetting the password, see [How to reset the - * Remote Desktop service or its login password in a Windows - * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) - *

    For resetting root password, see [Manage users, SSH, and check or - * repair disks on Azure Linux VMs using the VMAccess - * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {string} [parameters.osProfile.customData] Specifies a base-64 - * encoded string of custom data. The base-64 encoded string is decoded to a - * binary array that is saved as a file on the Virtual Machine. The maximum - * length of the binary array is 65535 bytes.

    For using cloud-init for - * your VM, see [Using cloud-init to customize a Linux VM during - * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + * {Promise} A promise is returned. * - * @param {object} [parameters.osProfile.windowsConfiguration] Specifies - * Windows operating system settings on the virtual machine. + * @resolve {VirtualMachineSizeListResult} - The deserialized result object. * - * @param {boolean} - * [parameters.osProfile.windowsConfiguration.provisionVMAgent] Indicates - * whether virtual machine agent should be provisioned on the virtual machine. - *

    When this property is not specified in the request body, default - * behavior is to set it to true. This will ensure that VM Agent is installed - * on the VM so that extensions can be added to the VM later. + * @reject {Error|ServiceError} - The error object. * - * @param {boolean} - * [parameters.osProfile.windowsConfiguration.enableAutomaticUpdates] Indicates - * whether virtual machine is enabled for automatic updates. + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {string} [parameters.osProfile.windowsConfiguration.timeZone] - * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {array} - * [parameters.osProfile.windowsConfiguration.additionalUnattendContent] - * Specifies additional base-64 encoded XML formatted information that can be - * included in the Unattend.xml file, which is used by Windows Setup. + * {VirtualMachineSizeListResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineSizeListResult} for more + * information. * - * @param {object} [parameters.osProfile.windowsConfiguration.winRM] Specifies - * the Windows Remote Management listeners. This enables remote Windows - * PowerShell. + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {array} [parameters.osProfile.windowsConfiguration.winRM.listeners] - * The list of Windows Remote Management listeners + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(location: string, callback: ServiceCallback): void; + list(location: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * Images + * __NOTE__: An instance of this class is automatically created for an + * instance of the ComputeManagementClient. + */ +export interface Images { + + + /** + * Create or update an image. * - * @param {object} [parameters.osProfile.linuxConfiguration] Specifies the - * Linux operating system settings on the virtual machine.

    For a list - * of supported Linux distributions, see [Linux on Azure-Endorsed - * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) - *

    For running non-endorsed distributions, see [Information for - * Non-Endorsed - * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * @param {string} resourceGroupName The name of the resource group. * - * @param {boolean} - * [parameters.osProfile.linuxConfiguration.disablePasswordAuthentication] - * Specifies whether password authentication should be disabled. + * @param {string} imageName The name of the image. * - * @param {object} [parameters.osProfile.linuxConfiguration.ssh] Specifies the - * ssh key configuration for a Linux OS. + * @param {object} parameters Parameters supplied to the Create Image + * operation. * - * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The - * list of SSH public keys used to authenticate with linux based VMs. + * @param {object} [parameters.sourceVirtualMachine] The source virtual machine + * from which Image is created. * - * @param {array} [parameters.osProfile.secrets] Specifies set of certificates - * that should be installed onto the virtual machine. + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. * - * @param {object} [parameters.networkProfile] Specifies the network interfaces - * of the virtual machine. + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * - * @param {array} [parameters.networkProfile.networkInterfaces] Specifies the - * list of resource Ids for the network interfaces associated with the virtual - * machine. + * @param {string} parameters.storageProfile.osDisk.osType This property allows + * you to specify the type of the OS that is included in the disk if creating a + * VM from a custom image.

    Possible values are:

    **Windows** + *

    **Linux**. Possible values include: 'Windows', 'Linux' * - * @param {object} [parameters.diagnosticsProfile] Specifies the boot - * diagnostic settings state.

    Minimum api-version: 2015-06-15. + * @param {string} parameters.storageProfile.osDisk.osState The OS State. + * Possible values include: 'Generalized', 'Specialized' * - * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot - * Diagnostics is a debugging feature which allows you to view Console Output - * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, - * you can easily view the output of your console log.

    For both - * Windows and Linux virtual machines, Azure also enables you to see a - * screenshot of the VM from the hypervisor. + * @param {object} [parameters.storageProfile.osDisk.snapshot] The snapshot. * - * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] - * Whether boot diagnostics should be enabled on the Virtual Machine. + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The + * managedDisk. * - * @param {string} [parameters.diagnosticsProfile.bootDiagnostics.storageUri] - * Uri of the storage account to use for placing the console output and - * screenshot. + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id * - * @param {object} [parameters.availabilitySet] Specifies information about the - * availability set that the virtual machine should be assigned to. Virtual - * machines specified in the same availability set are allocated to different - * nodes to maximize availability. For more information about availability - * sets, see [Manage the availability of virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). - *

    For more information on Azure planned maintainance, see [Planned - * maintenance for virtual machines in - * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) - *

    Currently, a VM can only be added to availability set at creation - * time. An existing VM cannot be added to an availability set. + * @param {string} [parameters.storageProfile.osDisk.blobUri] The Virtual Hard + * Disk. * - * @param {string} [parameters.availabilitySet.id] Resource Id + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' * - * @param {string} [parameters.licenseType] Specifies that the image or disk - * that is being used was licensed on-premises. This element is only used for - * images that contain the Windows Server operating system.

    Possible - * values are:

    Windows_Client

    Windows_Server

    If this - * element is included in a request for an update, the value must match the - * initial value. This value cannot be updated.

    For more information, - * see [Azure Hybrid Use Benefit for Windows - * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) - *

    Minimum api-version: 2015-06-15 + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of empty data disks in gigabytes. This element can be used to overwrite + * the name of the disk in a virtual machine image.

    This value cannot + * be larger than 1023 GB * - * @param {object} [parameters.identity] The identity of the virtual machine, - * if configured. + * @param {string} [parameters.storageProfile.osDisk.storageAccountType] + * Specifies the storage account type for the managed disk. Possible values + * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' * - * @param {string} [parameters.identity.type] The type of identity used for the - * virtual machine. The type 'SystemAssigned, UserAssigned' includes both an - * implicitly created identity and a set of user assigned identities. The type - * 'None' will remove any identities from the virtual machine. Possible values - * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', - * 'None' + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * - * @param {array} [parameters.identity.identityIds] The list of user identities - * associated with the Virtual Machine. The user identity references will be - * ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @param {boolean} [parameters.storageProfile.zoneResilient] Specifies whether + * an image is zone resilient or not. Default is false. Zone resilient images + * can be created only in regions that provide Zone Redundant Storage (ZRS). * - * @param {array} [parameters.zones] The virtual machine zones. + * @param {string} parameters.location Resource location * * @param {object} [parameters.tags] Resource tags * @@ -6917,185 +7277,153 @@ export interface VirtualMachines { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginUpdateWithHttpOperationResponse(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, imageName: string, parameters: models.Image, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * The operation to update a virtual machine. + * Create or update an image. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} vmName The name of the virtual machine. + * @param {string} imageName The name of the image. * - * @param {object} parameters Parameters supplied to the Update Virtual Machine + * @param {object} parameters Parameters supplied to the Create Image * operation. * - * @param {object} [parameters.plan] Specifies information about the - * marketplace image used to create the virtual machine. This element is only - * used for marketplace images. Before you can use a marketplace image from an - * API, you must enable the image for programmatic use. In the Azure portal, - * find the marketplace image that you want to use and then click **Want to - * deploy programmatically, Get Started ->**. Enter any required information - * and then click **Save**. + * @param {object} [parameters.sourceVirtualMachine] The source virtual machine + * from which Image is created. * - * @param {string} [parameters.plan.name] The plan ID. + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. * - * @param {string} [parameters.plan.publisher] The publisher ID. + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * - * @param {string} [parameters.plan.product] Specifies the product of the image - * from the marketplace. This is the same value as Offer under the - * imageReference element. + * @param {string} parameters.storageProfile.osDisk.osType This property allows + * you to specify the type of the OS that is included in the disk if creating a + * VM from a custom image.

    Possible values are:

    **Windows** + *

    **Linux**. Possible values include: 'Windows', 'Linux' * - * @param {string} [parameters.plan.promotionCode] The promotion code. + * @param {string} parameters.storageProfile.osDisk.osState The OS State. + * Possible values include: 'Generalized', 'Specialized' * - * @param {object} [parameters.hardwareProfile] Specifies the hardware settings - * for the virtual machine. + * @param {object} [parameters.storageProfile.osDisk.snapshot] The snapshot. * - * @param {string} [parameters.hardwareProfile.vmSize] Specifies the size of - * the virtual machine. For more information about virtual machine sizes, see - * [Sizes for virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). - *

    The available VM sizes depend on region and availability set. For a - * list of available sizes use these APIs:

    [List all available - * virtual machine sizes in an availability - * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) - *

    [List all available virtual machine sizes in a - * region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) - *

    [List all available virtual machine sizes for - * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). - * Possible values include: '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_B1s', 'Standard_B1ms', - * 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', - * '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_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', - * 'Standard_D32_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', - * 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', - * 'Standard_D64s_v3', '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_DS13-4_v2', 'Standard_DS13-2_v2', - * 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', 'Standard_E2_v3', - * 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', 'Standard_E32_v3', - * 'Standard_E64_v3', 'Standard_E2s_v3', 'Standard_E4s_v3', 'Standard_E8s_v3', - * 'Standard_E16s_v3', 'Standard_E32s_v3', 'Standard_E64s_v3', - * 'Standard_E32-16_v3', 'Standard_E32-8s_v3', 'Standard_E64-32s_v3', - * 'Standard_E64-16s_v3', 'Standard_F1', 'Standard_F2', 'Standard_F4', - * 'Standard_F8', 'Standard_F16', 'Standard_F1s', 'Standard_F2s', - * 'Standard_F4s', 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2', - * 'Standard_F4s_v2', 'Standard_F8s_v2', 'Standard_F16s_v2', - * 'Standard_F32s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1', - * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', - * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', - * 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8', - * 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m', - * 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', - * 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms', - * 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms', - * 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms', - * 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', - * 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2', - * 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3', - * 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s', - * 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6', - * 'Standard_NV12', 'Standard_NV24' + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The + * managedDisk. * - * @param {object} [parameters.storageProfile] Specifies the storage settings - * for the virtual machine disks. + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id * - * @param {object} [parameters.storageProfile.imageReference] Specifies - * information about the image to use. You can specify information about - * platform images, marketplace images, or virtual machine images. This element - * is required when you want to use a platform image, marketplace image, or - * virtual machine image, but is not used in other creation operations. + * @param {string} [parameters.storageProfile.osDisk.blobUri] The Virtual Hard + * Disk. * - * @param {string} [parameters.storageProfile.imageReference.publisher] The - * image publisher. + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' * - * @param {string} [parameters.storageProfile.imageReference.offer] Specifies - * the offer of the platform image or marketplace image used to create the - * virtual machine. + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of empty data disks in gigabytes. This element can be used to overwrite + * the name of the disk in a virtual machine image.

    This value cannot + * be larger than 1023 GB * - * @param {string} [parameters.storageProfile.imageReference.sku] The image - * SKU. + * @param {string} [parameters.storageProfile.osDisk.storageAccountType] + * Specifies the storage account type for the managed disk. Possible values + * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' * - * @param {string} [parameters.storageProfile.imageReference.version] Specifies - * the version of the platform image or marketplace image used to create the - * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. - * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the - * latest version of an image available at deploy time. Even if you use - * 'latest', the VM image will not automatically update after deploy time even - * if a new version becomes available. + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * - * @param {string} [parameters.storageProfile.imageReference.id] Resource Id + * @param {boolean} [parameters.storageProfile.zoneResilient] Specifies whether + * an image is zone resilient or not. Default is false. Zone resilient images + * can be created only in regions that provide Zone Redundant Storage (ZRS). * - * @param {object} [parameters.storageProfile.osDisk] Specifies information - * about the operating system disk used by the virtual machine.

    For - * more information about disks, see [About disks and VHDs for Azure virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * @param {string} parameters.location Resource location * - * @param {string} [parameters.storageProfile.osDisk.osType] This property - * allows you to specify the type of the OS that is included in the disk if - * creating a VM from user-image or a specialized VHD.

    Possible values - * are:

    **Windows**

    **Linux**. Possible values include: - * 'Windows', 'Linux' + * @param {object} [parameters.tags] Resource tags + * + * @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 {Image} - 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. + * + * {Image} [result] - The deserialized result object if an error did not occur. + * See {@link Image} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {object} [parameters.storageProfile.osDisk.encryptionSettings] - * Specifies the encryption settings for the OS Disk.

    Minimum - * api-version: 2015-06-15 + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, imageName: string, parameters: models.Image, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, imageName: string, parameters: models.Image, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, imageName: string, parameters: models.Image, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Update an image. * - * @param {object} - * [parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey] - * Specifies the location of the disk encryption key, which is a Key Vault - * Secret. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} - * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.secretUrl - * The URL referencing a secret in a Key Vault. + * @param {string} imageName The name of the image. * - * @param {object} - * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault - * The relative URL of the Key Vault containing the secret. + * @param {object} parameters Parameters supplied to the Update Image + * operation. * - * @param {object} - * [parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey] - * Specifies the location of the key encryption key in Key Vault. + * @param {object} [parameters.sourceVirtualMachine] The source virtual machine + * from which Image is created. * - * @param {string} - * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.keyUrl - * The URL referencing a key encryption key in Key Vault. + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. * - * @param {object} - * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault - * The relative URL of the Key Vault containing the key. + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * - * @param {boolean} - * [parameters.storageProfile.osDisk.encryptionSettings.enabled] Specifies - * whether disk encryption should be enabled on the virtual machine. + * @param {string} parameters.storageProfile.osDisk.osType This property allows + * you to specify the type of the OS that is included in the disk if creating a + * VM from a custom image.

    Possible values are:

    **Windows** + *

    **Linux**. Possible values include: 'Windows', 'Linux' * - * @param {string} [parameters.storageProfile.osDisk.name] The disk name. + * @param {string} parameters.storageProfile.osDisk.osState The OS State. + * Possible values include: 'Generalized', 'Specialized' * - * @param {object} [parameters.storageProfile.osDisk.vhd] The virtual hard - * disk. + * @param {object} [parameters.storageProfile.osDisk.snapshot] The snapshot. * - * @param {object} [parameters.storageProfile.osDisk.image] The source user - * image virtual hard disk. The virtual hard disk will be copied before being - * attached to the virtual machine. If SourceImage is provided, the destination - * virtual hard drive must not exist. + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The + * managedDisk. * - * @param {string} [parameters.storageProfile.osDisk.image.uri] Specifies the - * virtual hard disk's uri. + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id + * + * @param {string} [parameters.storageProfile.osDisk.blobUri] The Virtual Hard + * Disk. * * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the * caching requirements.

    Possible values are:

    **None** @@ -7103,206 +7431,106 @@ export interface VirtualMachines { * Standard storage. ReadOnly for Premium storage**. Possible values include: * 'None', 'ReadOnly', 'ReadWrite' * - * @param {boolean} [parameters.storageProfile.osDisk.writeAcceleratorEnabled] - * Specifies whether writeAccelerator should be enabled or disabled on the - * disk. - * - * @param {string} parameters.storageProfile.osDisk.createOption Specifies how - * the virtual machine should be created.

    Possible values are:

    - * **Attach** \u2013 This value is used when you are using a specialized disk - * to create the virtual machine.

    **FromImage** \u2013 This value is - * used when you are using an image to create the virtual machine. If you are - * using a platform image, you also use the imageReference element described - * above. If you are using a marketplace image, you also use the plan element - * previously described. Possible values include: 'FromImage', 'Empty', - * 'Attach' - * * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the - * size of an empty data disk in gigabytes. This element can be used to - * overwrite the name of the disk in a virtual machine image.

    This - * value cannot be larger than 1023 GB - * - * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed - * disk parameters. + * size of empty data disks in gigabytes. This element can be used to overwrite + * the name of the disk in a virtual machine image.

    This value cannot + * be larger than 1023 GB * - * @param {string} - * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies - * the storage account type for the managed disk. Possible values are: - * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * @param {string} [parameters.storageProfile.osDisk.storageAccountType] + * Specifies the storage account type for the managed disk. Possible values + * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', * 'Premium_LRS' * - * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource - * Id - * * @param {array} [parameters.storageProfile.dataDisks] Specifies the * parameters that are used to add a data disk to a virtual machine.

    * For more information about disks, see [About disks and VHDs for Azure * virtual * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * - * @param {object} [parameters.osProfile] Specifies the operating system - * settings for the virtual machine. - * - * @param {string} [parameters.osProfile.computerName] Specifies the host OS - * name of the virtual machine.

    **Max-length (Windows):** 15 - * characters

    **Max-length (Linux):** 64 characters.

    For - * naming conventions and restrictions see [Azure infrastructure services - * implementation - * guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). - * - * @param {string} [parameters.osProfile.adminUsername] Specifies the name of - * the administrator account.

    **Windows-only restriction:** Cannot end - * in "."

    **Disallowed values:** "administrator", "admin", "user", - * "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", - * "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", - * "john", "owner", "root", "server", "sql", "support", "support_388945a0", - * "sys", "test2", "test3", "user4", "user5".

    **Minimum-length - * (Linux):** 1 character

    **Max-length (Linux):** 64 characters - *

    **Max-length (Windows):** 20 characters

  • For root - * access to the Linux VM, see [Using root privileges on Linux virtual machines - * in - * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • - * For a list of built-in system users on Linux that should not be used in this - * field, see [Selecting User Names for Linux on - * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) - * - * @param {string} [parameters.osProfile.adminPassword] Specifies the password - * of the administrator account.

    **Minimum-length (Windows):** 8 - * characters

    **Minimum-length (Linux):** 6 characters

    - * **Max-length (Windows):** 123 characters

    **Max-length (Linux):** 72 - * characters

    **Complexity requirements:** 3 out of 4 conditions below - * need to be fulfilled
    Has lower characters
    Has upper characters
    - * Has a digit
    Has a special character (Regex match [\W_])

    - * **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", - * "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", - * "iloveyou!"

    For resetting the password, see [How to reset the - * Remote Desktop service or its login password in a Windows - * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) - *

    For resetting root password, see [Manage users, SSH, and check or - * repair disks on Azure Linux VMs using the VMAccess - * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) - * - * @param {string} [parameters.osProfile.customData] Specifies a base-64 - * encoded string of custom data. The base-64 encoded string is decoded to a - * binary array that is saved as a file on the Virtual Machine. The maximum - * length of the binary array is 65535 bytes.

    For using cloud-init for - * your VM, see [Using cloud-init to customize a Linux VM during - * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) - * - * @param {object} [parameters.osProfile.windowsConfiguration] Specifies - * Windows operating system settings on the virtual machine. - * - * @param {boolean} - * [parameters.osProfile.windowsConfiguration.provisionVMAgent] Indicates - * whether virtual machine agent should be provisioned on the virtual machine. - *

    When this property is not specified in the request body, default - * behavior is to set it to true. This will ensure that VM Agent is installed - * on the VM so that extensions can be added to the VM later. - * - * @param {boolean} - * [parameters.osProfile.windowsConfiguration.enableAutomaticUpdates] Indicates - * whether virtual machine is enabled for automatic updates. + * @param {boolean} [parameters.storageProfile.zoneResilient] Specifies whether + * an image is zone resilient or not. Default is false. Zone resilient images + * can be created only in regions that provide Zone Redundant Storage (ZRS). * - * @param {string} [parameters.osProfile.windowsConfiguration.timeZone] - * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" + * @param {object} [parameters.tags] Resource tags * - * @param {array} - * [parameters.osProfile.windowsConfiguration.additionalUnattendContent] - * Specifies additional base-64 encoded XML formatted information that can be - * included in the Unattend.xml file, which is used by Windows Setup. + * @param {object} [options] Optional Parameters. * - * @param {object} [parameters.osProfile.windowsConfiguration.winRM] Specifies - * the Windows Remote Management listeners. This enables remote Windows - * PowerShell. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {array} [parameters.osProfile.windowsConfiguration.winRM.listeners] - * The list of Windows Remote Management listeners + * @returns {Promise} A promise is returned * - * @param {object} [parameters.osProfile.linuxConfiguration] Specifies the - * Linux operating system settings on the virtual machine.

    For a list - * of supported Linux distributions, see [Linux on Azure-Endorsed - * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) - *

    For running non-endorsed distributions, see [Information for - * Non-Endorsed - * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {boolean} - * [parameters.osProfile.linuxConfiguration.disablePasswordAuthentication] - * Specifies whether password authentication should be disabled. + * @reject {Error|ServiceError} - The error object. + */ + updateWithHttpOperationResponse(resourceGroupName: string, imageName: string, parameters: models.ImageUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Update an image. * - * @param {object} [parameters.osProfile.linuxConfiguration.ssh] Specifies the - * ssh key configuration for a Linux OS. + * @param {string} resourceGroupName The name of the resource group. * - * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The - * list of SSH public keys used to authenticate with linux based VMs. + * @param {string} imageName The name of the image. * - * @param {array} [parameters.osProfile.secrets] Specifies set of certificates - * that should be installed onto the virtual machine. + * @param {object} parameters Parameters supplied to the Update Image + * operation. * - * @param {object} [parameters.networkProfile] Specifies the network interfaces - * of the virtual machine. + * @param {object} [parameters.sourceVirtualMachine] The source virtual machine + * from which Image is created. * - * @param {array} [parameters.networkProfile.networkInterfaces] Specifies the - * list of resource Ids for the network interfaces associated with the virtual - * machine. + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. * - * @param {object} [parameters.diagnosticsProfile] Specifies the boot - * diagnostic settings state.

    Minimum api-version: 2015-06-15. + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * - * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot - * Diagnostics is a debugging feature which allows you to view Console Output - * and Screenshot to diagnose VM status.

    For Linux Virtual Machines, - * you can easily view the output of your console log.

    For both - * Windows and Linux virtual machines, Azure also enables you to see a - * screenshot of the VM from the hypervisor. + * @param {string} parameters.storageProfile.osDisk.osType This property allows + * you to specify the type of the OS that is included in the disk if creating a + * VM from a custom image.

    Possible values are:

    **Windows** + *

    **Linux**. Possible values include: 'Windows', 'Linux' * - * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] - * Whether boot diagnostics should be enabled on the Virtual Machine. + * @param {string} parameters.storageProfile.osDisk.osState The OS State. + * Possible values include: 'Generalized', 'Specialized' * - * @param {string} [parameters.diagnosticsProfile.bootDiagnostics.storageUri] - * Uri of the storage account to use for placing the console output and - * screenshot. + * @param {object} [parameters.storageProfile.osDisk.snapshot] The snapshot. * - * @param {object} [parameters.availabilitySet] Specifies information about the - * availability set that the virtual machine should be assigned to. Virtual - * machines specified in the same availability set are allocated to different - * nodes to maximize availability. For more information about availability - * sets, see [Manage the availability of virtual - * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). - *

    For more information on Azure planned maintainance, see [Planned - * maintenance for virtual machines in - * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) - *

    Currently, a VM can only be added to availability set at creation - * time. An existing VM cannot be added to an availability set. + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The + * managedDisk. * - * @param {string} [parameters.availabilitySet.id] Resource Id + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id * - * @param {string} [parameters.licenseType] Specifies that the image or disk - * that is being used was licensed on-premises. This element is only used for - * images that contain the Windows Server operating system.

    Possible - * values are:

    Windows_Client

    Windows_Server

    If this - * element is included in a request for an update, the value must match the - * initial value. This value cannot be updated.

    For more information, - * see [Azure Hybrid Use Benefit for Windows - * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) - *

    Minimum api-version: 2015-06-15 + * @param {string} [parameters.storageProfile.osDisk.blobUri] The Virtual Hard + * Disk. * - * @param {object} [parameters.identity] The identity of the virtual machine, - * if configured. + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' * - * @param {string} [parameters.identity.type] The type of identity used for the - * virtual machine. The type 'SystemAssigned, UserAssigned' includes both an - * implicitly created identity and a set of user assigned identities. The type - * 'None' will remove any identities from the virtual machine. Possible values - * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', - * 'None' + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of empty data disks in gigabytes. This element can be used to overwrite + * the name of the disk in a virtual machine image.

    This value cannot + * be larger than 1023 GB * - * @param {array} [parameters.identity.identityIds] The list of user identities - * associated with the Virtual Machine. The user identity references will be - * ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * @param {string} [parameters.storageProfile.osDisk.storageAccountType] + * Specifies the storage account type for the managed disk. Possible values + * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' * - * @param {array} [parameters.zones] The virtual machine zones. + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {boolean} [parameters.storageProfile.zoneResilient] Specifies whether + * an image is zone resilient or not. Default is false. Zone resilient images + * can be created only in regions that provide Zone Redundant Storage (ZRS). * * @param {object} [parameters.tags] Resource tags * @@ -7318,7 +7546,7 @@ export interface VirtualMachines { * * {Promise} A promise is returned. * - * @resolve {VirtualMachine} - The deserialized result object. + * @resolve {Image} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7326,24 +7554,24 @@ export interface VirtualMachines { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VirtualMachine} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualMachine} for more information. + * {Image} [result] - The deserialized result object if an error did not occur. + * See {@link Image} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginUpdate(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdate(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineUpdate, callback: ServiceCallback): void; - beginUpdate(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + update(resourceGroupName: string, imageName: string, parameters: models.ImageUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, imageName: string, parameters: models.ImageUpdate, callback: ServiceCallback): void; + update(resourceGroupName: string, imageName: string, parameters: models.ImageUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * The operation to delete a virtual machine. + * Deletes an Image. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} vmName The name of the virtual machine. + * @param {string} imageName The name of the image. * * @param {object} [options] Optional Parameters. * @@ -7356,14 +7584,14 @@ export interface VirtualMachines { * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, imageName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * The operation to delete a virtual machine. + * Deletes an Image. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} vmName The name of the virtual machine. + * @param {string} imageName The name of the image. * * @param {object} [options] Optional Parameters. * @@ -7393,42 +7621,46 @@ export interface VirtualMachines { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginDeleteMethod(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, imageName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, imageName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, imageName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Converts virtual machine disks from blob-based to managed disks. Virtual - * machine must be stop-deallocated before invoking this operation. + * Gets an image. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} vmName The name of the virtual machine. + * @param {string} imageName The name of the image. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.expand] The expand expression to apply on the + * operation. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginConvertToManagedDisksWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, imageName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Converts virtual machine disks from blob-based to managed disks. Virtual - * machine must be stop-deallocated before invoking this operation. + * Gets an image. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} vmName The name of the virtual machine. + * @param {string} imageName The name of the image. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.expand] The expand expression to apply on the + * operation. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -7439,7 +7671,7 @@ export interface VirtualMachines { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {Image} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7447,27 +7679,23 @@ export interface VirtualMachines { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {Image} [result] - The deserialized result object if an error did not occur. + * See {@link Image} 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. */ - beginConvertToManagedDisks(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginConvertToManagedDisks(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; - beginConvertToManagedDisks(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, imageName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, imageName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, imageName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Shuts down the virtual machine and releases the compute resources. You are - * not billed for the compute resources that this virtual machine uses. + * Gets the list of images under a resource group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} vmName The name of the virtual machine. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -7475,20 +7703,17 @@ export interface VirtualMachines { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginDeallocateWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Shuts down the virtual machine and releases the compute resources. You are - * not billed for the compute resources that this virtual machine uses. + * Gets the list of images under a resource group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} vmName The name of the virtual machine. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -7501,7 +7726,7 @@ export interface VirtualMachines { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {ImageListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7509,27 +7734,22 @@ export interface VirtualMachines { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {ImageListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ImageListResult} 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. */ - beginDeallocate(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeallocate(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; - beginDeallocate(resourceGroupName: string, vmName: 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; /** - * The operation to power off (stop) a virtual machine. The virtual machine can - * be restarted with the same provisioned resources. You are still charged for - * this virtual machine. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} vmName The name of the virtual machine. + * Gets the list of Images in the subscription. Use nextLink property in the + * response to get the next page of Images. Do this till nextLink is null to + * fetch all the Images. * * @param {object} [options] Optional Parameters. * @@ -7538,80 +7758,201 @@ export interface VirtualMachines { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginPowerOffWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * The operation to power off (stop) a virtual machine. The virtual machine can - * be restarted with the same provisioned resources. You are still charged for - * this virtual machine. + * Gets the list of Images in the subscription. Use nextLink property in the + * response to get the next page of Images. Do this till nextLink is null to + * fetch all the Images. + * + * @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 {ImageListResult} - 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. + * + * {ImageListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ImageListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Create or update an image. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} vmName The name of the virtual machine. + * @param {string} imageName The name of the image. + * + * @param {object} parameters Parameters supplied to the Create Image + * operation. + * + * @param {object} [parameters.sourceVirtualMachine] The source virtual machine + * from which Image is created. + * + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. + * + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {string} parameters.storageProfile.osDisk.osType This property allows + * you to specify the type of the OS that is included in the disk if creating a + * VM from a custom image.

    Possible values are:

    **Windows** + *

    **Linux**. Possible values include: 'Windows', 'Linux' + * + * @param {string} parameters.storageProfile.osDisk.osState The OS State. + * Possible values include: 'Generalized', 'Specialized' + * + * @param {object} [parameters.storageProfile.osDisk.snapshot] The snapshot. + * + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The + * managedDisk. + * + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id + * + * @param {string} [parameters.storageProfile.osDisk.blobUri] The Virtual Hard + * Disk. + * + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' + * + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of empty data disks in gigabytes. This element can be used to overwrite + * the name of the disk in a virtual machine image.

    This value cannot + * be larger than 1023 GB + * + * @param {string} [parameters.storageProfile.osDisk.storageAccountType] + * Specifies the storage account type for the managed disk. Possible values + * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' + * + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {boolean} [parameters.storageProfile.zoneResilient] Specifies whether + * an image is zone resilient or not. Default is false. Zone resilient images + * can be created only in regions that provide Zone Redundant Storage (ZRS). + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @returns {Promise} A promise is returned * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * {Promise} A promise is returned. + * @reject {Error|ServiceError} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, imageName: string, parameters: models.Image, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Create or update an image. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @param {string} resourceGroupName The name of the resource group. * - * @reject {Error|ServiceError} - The error object. + * @param {string} imageName The name of the image. * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {object} parameters Parameters supplied to the Create Image + * operation. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {object} [parameters.sourceVirtualMachine] The source virtual machine + * from which Image is created. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - beginPowerOff(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginPowerOff(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; - beginPowerOff(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * The operation to restart a virtual machine. + * @param {string} parameters.storageProfile.osDisk.osType This property allows + * you to specify the type of the OS that is included in the disk if creating a + * VM from a custom image.

    Possible values are:

    **Windows** + *

    **Linux**. Possible values include: 'Windows', 'Linux' * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} parameters.storageProfile.osDisk.osState The OS State. + * Possible values include: 'Generalized', 'Specialized' * - * @param {string} vmName The name of the virtual machine. + * @param {object} [parameters.storageProfile.osDisk.snapshot] The snapshot. * - * @param {object} [options] Optional Parameters. + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The + * managedDisk. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id * - * @returns {Promise} A promise is returned + * @param {string} [parameters.storageProfile.osDisk.blobUri] The Virtual Hard + * Disk. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' * - * @reject {Error|ServiceError} - The error object. - */ - beginRestartWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * The operation to restart a virtual machine. + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of empty data disks in gigabytes. This element can be used to overwrite + * the name of the disk in a virtual machine image.

    This value cannot + * be larger than 1023 GB * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} [parameters.storageProfile.osDisk.storageAccountType] + * Specifies the storage account type for the managed disk. Possible values + * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' * - * @param {string} vmName The name of the virtual machine. + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * + * @param {boolean} [parameters.storageProfile.zoneResilient] Specifies whether + * an image is zone resilient or not. Default is false. Zone resilient images + * can be created only in regions that provide Zone Redundant Storage (ZRS). + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags * * @param {object} [options] Optional Parameters. * @@ -7625,7 +7966,7 @@ export interface VirtualMachines { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {Image} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7633,85 +7974,85 @@ export interface VirtualMachines { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {Image} [result] - The deserialized result object if an error did not occur. + * See {@link Image} 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. */ - beginRestart(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginRestart(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; - beginRestart(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, imageName: string, parameters: models.Image, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, imageName: string, parameters: models.Image, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, imageName: string, parameters: models.Image, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * The operation to start a virtual machine. + * Update an image. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} vmName The name of the virtual machine. - * - * @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. - */ - beginStartWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * The operation to start a virtual machine. + * @param {string} imageName The name of the image. * - * @param {string} resourceGroupName The name of the resource group. + * @param {object} parameters Parameters supplied to the Update Image + * operation. * - * @param {string} vmName The name of the virtual machine. + * @param {object} [parameters.sourceVirtualMachine] The source virtual machine + * from which Image is created. * - * @param {object} [options] Optional Parameters. + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {string} parameters.storageProfile.osDisk.osType This property allows + * you to specify the type of the OS that is included in the disk if creating a + * VM from a custom image.

    Possible values are:

    **Windows** + *

    **Linux**. Possible values include: 'Windows', 'Linux' * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @param {string} parameters.storageProfile.osDisk.osState The OS State. + * Possible values include: 'Generalized', 'Specialized' * - * {Promise} A promise is returned. + * @param {object} [parameters.storageProfile.osDisk.snapshot] The snapshot. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The + * managedDisk. * - * @reject {Error|ServiceError} - The error object. + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {string} [parameters.storageProfile.osDisk.blobUri] The Virtual Hard + * Disk. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of empty data disks in gigabytes. This element can be used to overwrite + * the name of the disk in a virtual machine image.

    This value cannot + * be larger than 1023 GB * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {string} [parameters.storageProfile.osDisk.storageAccountType] + * Specifies the storage account type for the managed disk. Possible values + * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - beginStart(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginStart(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; - beginStart(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * The operation to redeploy a virtual machine. + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * - * @param {string} resourceGroupName The name of the resource group. + * @param {boolean} [parameters.storageProfile.zoneResilient] Specifies whether + * an image is zone resilient or not. Default is false. Zone resilient images + * can be created only in regions that provide Zone Redundant Storage (ZRS). * - * @param {string} vmName The name of the virtual machine. + * @param {object} [parameters.tags] Resource tags * * @param {object} [options] Optional Parameters. * @@ -7720,78 +8061,79 @@ export interface VirtualMachines { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginRedeployWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginUpdateWithHttpOperationResponse(resourceGroupName: string, imageName: string, parameters: models.ImageUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * The operation to redeploy a virtual machine. + * Update an image. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} vmName The name of the virtual machine. - * - * @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 {OperationStatusResponse} - The deserialized result object. + * @param {string} imageName The name of the image. * - * @reject {Error|ServiceError} - The error object. + * @param {object} parameters Parameters supplied to the Update Image + * operation. * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {object} [parameters.sourceVirtualMachine] The source virtual machine + * from which Image is created. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {object} [parameters.storageProfile] Specifies the storage settings + * for the virtual machine disks. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * @param {object} [parameters.storageProfile.osDisk] Specifies information + * about the operating system disk used by the virtual machine.

    For + * more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {string} parameters.storageProfile.osDisk.osType This property allows + * you to specify the type of the OS that is included in the disk if creating a + * VM from a custom image.

    Possible values are:

    **Windows** + *

    **Linux**. Possible values include: 'Windows', 'Linux' * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - beginRedeploy(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginRedeploy(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; - beginRedeploy(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * The operation to perform maintenance on a virtual machine. + * @param {string} parameters.storageProfile.osDisk.osState The OS State. + * Possible values include: 'Generalized', 'Specialized' * - * @param {string} resourceGroupName The name of the resource group. + * @param {object} [parameters.storageProfile.osDisk.snapshot] The snapshot. * - * @param {string} vmName The name of the virtual machine. + * @param {object} [parameters.storageProfile.osDisk.managedDisk] The + * managedDisk. * - * @param {object} [options] Optional Parameters. + * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource + * Id * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [parameters.storageProfile.osDisk.blobUri] The Virtual Hard + * Disk. * - * @returns {Promise} A promise is returned + * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the + * caching requirements.

    Possible values are:

    **None** + *

    **ReadOnly**

    **ReadWrite**

    Default: **None for + * Standard storage. ReadOnly for Premium storage**. Possible values include: + * 'None', 'ReadOnly', 'ReadWrite' * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the + * size of empty data disks in gigabytes. This element can be used to overwrite + * the name of the disk in a virtual machine image.

    This value cannot + * be larger than 1023 GB * - * @reject {Error|ServiceError} - The error object. - */ - beginPerformMaintenanceWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * The operation to perform maintenance on a virtual machine. + * @param {string} [parameters.storageProfile.osDisk.storageAccountType] + * Specifies the storage account type for the managed disk. Possible values + * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', + * 'Premium_LRS' * - * @param {string} resourceGroupName The name of the resource group. + * @param {array} [parameters.storageProfile.dataDisks] Specifies the + * parameters that are used to add a data disk to a virtual machine.

    + * For more information about disks, see [About disks and VHDs for Azure + * virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * - * @param {string} vmName The name of the virtual machine. + * @param {boolean} [parameters.storageProfile.zoneResilient] Specifies whether + * an image is zone resilient or not. Default is false. Zone resilient images + * can be created only in regions that provide Zone Redundant Storage (ZRS). + * + * @param {object} [parameters.tags] Resource tags * * @param {object} [options] Optional Parameters. * @@ -7805,7 +8147,7 @@ export interface VirtualMachines { * * {Promise} A promise is returned. * - * @resolve {OperationStatusResponse} - The deserialized result object. + * @resolve {Image} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7813,35 +8155,24 @@ export interface VirtualMachines { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. - * See {@link OperationStatusResponse} for more - * information. + * {Image} [result] - The deserialized result object if an error did not occur. + * See {@link Image} 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. */ - beginPerformMaintenance(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginPerformMaintenance(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; - beginPerformMaintenance(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, imageName: string, parameters: models.ImageUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdate(resourceGroupName: string, imageName: string, parameters: models.ImageUpdate, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, imageName: string, parameters: models.ImageUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Run command on the VM. + * Deletes an Image. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} vmName The name of the virtual machine. - * - * @param {object} parameters Parameters supplied to the Run command operation. - * - * @param {string} parameters.commandId The run command id. - * - * @param {array} [parameters.script] Optional. The script to be executed. - * When this value is given, the given script will override the default script - * of the command. - * - * @param {array} [parameters.parameters] The run command parameters. + * @param {string} imageName The name of the image. * * @param {object} [options] Optional Parameters. * @@ -7850,28 +8181,18 @@ export interface VirtualMachines { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginRunCommandWithHttpOperationResponse(resourceGroupName: string, vmName: string, parameters: models.RunCommandInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, imageName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Run command on the VM. + * Deletes an Image. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} vmName The name of the virtual machine. - * - * @param {object} parameters Parameters supplied to the Run command operation. - * - * @param {string} parameters.commandId The run command id. - * - * @param {array} [parameters.script] Optional. The script to be executed. - * When this value is given, the given script will override the default script - * of the command. - * - * @param {array} [parameters.parameters] The run command parameters. + * @param {string} imageName The name of the image. * * @param {object} [options] Optional Parameters. * @@ -7885,7 +8206,7 @@ export interface VirtualMachines { * * {Promise} A promise is returned. * - * @resolve {RunCommandResult} - The deserialized result object. + * @resolve {OperationStatusResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7893,21 +8214,21 @@ export interface VirtualMachines { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RunCommandResult} [result] - The deserialized result object if an error did not occur. - * See {@link RunCommandResult} for more information. + * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatusResponse} 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. */ - beginRunCommand(resourceGroupName: string, vmName: string, parameters: models.RunCommandInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginRunCommand(resourceGroupName: string, vmName: string, parameters: models.RunCommandInput, callback: ServiceCallback): void; - beginRunCommand(resourceGroupName: string, vmName: string, parameters: models.RunCommandInput, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, imageName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, imageName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, imageName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists all of the virtual machines in the specified resource group. Use the - * nextLink property in the response to get the next page of virtual machines. + * Gets the list of images under a resource group. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -7919,15 +8240,14 @@ export interface VirtualMachines { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists all of the virtual machines in the specified resource group. Use the - * nextLink property in the response to get the next page of virtual machines. + * Gets the list of images under a resource group. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -7944,7 +8264,7 @@ export interface VirtualMachines { * * {Promise} A promise is returned. * - * @resolve {VirtualMachineListResult} - The deserialized result object. + * @resolve {ImageListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7952,22 +8272,22 @@ export interface VirtualMachines { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VirtualMachineListResult} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualMachineListResult} for more - * information. + * {ImageListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ImageListResult} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists all of the virtual machines in the specified subscription. Use the - * nextLink property in the response to get the next page of virtual machines. + * Gets the list of Images in the subscription. Use nextLink property in the + * response to get the next page of Images. Do this till nextLink is null to + * fetch all the Images. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -7979,15 +8299,16 @@ export interface VirtualMachines { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listAllNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists all of the virtual machines in the specified subscription. Use the - * nextLink property in the response to get the next page of virtual machines. + * Gets the list of Images in the subscription. Use nextLink property in the + * response to get the next page of Images. Do this till nextLink is null to + * fetch all the Images. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -8004,7 +8325,7 @@ export interface VirtualMachines { * * {Promise} A promise is returned. * - * @resolve {VirtualMachineListResult} - The deserialized result object. + * @resolve {ImageListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8012,17 +8333,16 @@ export interface VirtualMachines { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VirtualMachineListResult} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualMachineListResult} for more - * information. + * {ImageListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ImageListResult} 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. */ - listAllNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAllNext(nextPageLink: string, callback: ServiceCallback): void; - listAllNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** @@ -8396,6 +8716,11 @@ export interface VirtualMachineScaleSets { * priority for the virtual machines in the scale set.

    Minimum * api-version: 2017-10-30-preview. Possible values include: 'Regular', 'Low' * + * @param {string} [parameters.virtualMachineProfile.evictionPolicy] Specifies + * the eviction policy for virtual machines in the low priority scale set. + *

    Minimum api-version: 2017-10-30-preview. Possible values include: + * 'Deallocate', 'Delete' + * * @param {boolean} [parameters.overprovision] Specifies whether the Virtual * Machine Scale Set should be overprovisioned. * @@ -8804,6 +9129,11 @@ export interface VirtualMachineScaleSets { * priority for the virtual machines in the scale set.

    Minimum * api-version: 2017-10-30-preview. Possible values include: 'Regular', 'Low' * + * @param {string} [parameters.virtualMachineProfile.evictionPolicy] Specifies + * the eviction policy for virtual machines in the low priority scale set. + *

    Minimum api-version: 2017-10-30-preview. Possible values include: + * 'Deallocate', 'Delete' + * * @param {boolean} [parameters.overprovision] Specifies whether the Virtual * Machine Scale Set should be overprovisioned. * @@ -9958,6 +10288,66 @@ export interface VirtualMachineScaleSets { listSkus(resourceGroupName: string, vmScaleSetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** + * Gets list of OS upgrades on a VM scale set instance. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @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. + */ + getOSUpgradeHistoryWithHttpOperationResponse(resourceGroupName: string, vmScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets list of OS upgrades on a VM scale set instance. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @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 {VirtualMachineScaleSetListOSUpgradeHistory} - 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. + * + * {VirtualMachineScaleSetListOSUpgradeHistory} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineScaleSetListOSUpgradeHistory} + * 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. + */ + getOSUpgradeHistory(resourceGroupName: string, vmScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getOSUpgradeHistory(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + getOSUpgradeHistory(resourceGroupName: string, vmScaleSetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * Power off (stop) one or more virtual machines in a VM scale set. Note that * resources are still attached and you are getting charged for the resources. @@ -10951,6 +11341,11 @@ export interface VirtualMachineScaleSets { * priority for the virtual machines in the scale set.

    Minimum * api-version: 2017-10-30-preview. Possible values include: 'Regular', 'Low' * + * @param {string} [parameters.virtualMachineProfile.evictionPolicy] Specifies + * the eviction policy for virtual machines in the low priority scale set. + *

    Minimum api-version: 2017-10-30-preview. Possible values include: + * 'Deallocate', 'Delete' + * * @param {boolean} [parameters.overprovision] Specifies whether the Virtual * Machine Scale Set should be overprovisioned. * @@ -11359,6 +11754,11 @@ export interface VirtualMachineScaleSets { * priority for the virtual machines in the scale set.

    Minimum * api-version: 2017-10-30-preview. Possible values include: 'Regular', 'Low' * + * @param {string} [parameters.virtualMachineProfile.evictionPolicy] Specifies + * the eviction policy for virtual machines in the low priority scale set. + *

    Minimum api-version: 2017-10-30-preview. Possible values include: + * 'Deallocate', 'Delete' + * * @param {boolean} [parameters.overprovision] Specifies whether the Virtual * Machine Scale Set should be overprovisioned. * @@ -12961,6 +13361,64 @@ export interface VirtualMachineScaleSets { listSkusNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; listSkusNext(nextPageLink: string, callback: ServiceCallback): void; listSkusNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets list of OS upgrades on a VM scale set instance. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getOSUpgradeHistoryNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets list of OS upgrades on a VM scale set instance. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {VirtualMachineScaleSetListOSUpgradeHistory} - 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. + * + * {VirtualMachineScaleSetListOSUpgradeHistory} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineScaleSetListOSUpgradeHistory} + * 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. + */ + getOSUpgradeHistoryNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getOSUpgradeHistoryNext(nextPageLink: string, callback: ServiceCallback): void; + getOSUpgradeHistoryNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** diff --git a/lib/services/computeManagement2/lib/operations/index.js b/lib/services/computeManagement2/lib/operations/index.js index 26857f8e1c..c6c01da729 100644 --- a/lib/services/computeManagement2/lib/operations/index.js +++ b/lib/services/computeManagement2/lib/operations/index.js @@ -18,11 +18,11 @@ exports.Operations = require('./operations'); exports.AvailabilitySets = require('./availabilitySets'); exports.VirtualMachineExtensionImages = require('./virtualMachineExtensionImages'); exports.VirtualMachineExtensions = require('./virtualMachineExtensions'); +exports.VirtualMachines = require('./virtualMachines'); exports.VirtualMachineImages = require('./virtualMachineImages'); exports.UsageOperations = require('./usageOperations'); exports.VirtualMachineSizes = require('./virtualMachineSizes'); exports.Images = require('./images'); -exports.VirtualMachines = require('./virtualMachines'); exports.VirtualMachineScaleSets = require('./virtualMachineScaleSets'); exports.VirtualMachineScaleSetExtensions = require('./virtualMachineScaleSetExtensions'); exports.VirtualMachineScaleSetRollingUpgrades = require('./virtualMachineScaleSetRollingUpgrades'); diff --git a/lib/services/computeManagement2/lib/operations/virtualMachineExtensions.js b/lib/services/computeManagement2/lib/operations/virtualMachineExtensions.js index 064b547637..669cd7f9c8 100644 --- a/lib/services/computeManagement2/lib/operations/virtualMachineExtensions.js +++ b/lib/services/computeManagement2/lib/operations/virtualMachineExtensions.js @@ -21,7 +21,7 @@ const WebResource = msRest.WebResource; * @param {string} resourceGroupName The name of the resource group. * * @param {string} vmName The name of the virtual machine where the extension - * should be create or updated. + * should be created or updated. * * @param {string} vmExtensionName The name of the virtual machine extension. * @@ -147,6 +147,118 @@ function _createOrUpdate(resourceGroupName, vmName, vmExtensionName, extensionPa } +/** + * The operation to update the extension. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine where the extension + * should be updated. + * + * @param {string} vmExtensionName The name of the virtual machine extension. + * + * @param {object} extensionParameters Parameters supplied to the Update + * Virtual Machine Extension operation. + * + * @param {string} [extensionParameters.forceUpdateTag] How the extension + * handler should be forced to update even if the extension configuration has + * not changed. + * + * @param {string} [extensionParameters.publisher] The name of the extension + * handler publisher. + * + * @param {string} [extensionParameters.type] Specifies the type of the + * extension; an example is "CustomScriptExtension". + * + * @param {string} [extensionParameters.typeHandlerVersion] Specifies the + * version of the script handler. + * + * @param {boolean} [extensionParameters.autoUpgradeMinorVersion] Indicates + * whether the extension should use a newer minor version if one is available + * at deployment time. Once deployed, however, the extension will not upgrade + * minor versions unless redeployed, even with this property set to true. + * + * @param {object} [extensionParameters.settings] Json formatted public + * settings for the extension. + * + * @param {object} [extensionParameters.protectedSettings] The extension can + * contain either protectedSettings or protectedSettingsFromKeyVault or no + * protected settings at all. + * + * @param {object} [extensionParameters.tags] Resource tags + * + * @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 VirtualMachineExtension} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _update(resourceGroupName, vmName, vmExtensionName, extensionParameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginUpdate(resourceGroupName, vmName, vmExtensionName, extensionParameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['VirtualMachineExtension']().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); + }); + }); +} + + /** * The operation to delete the extension. * @@ -395,7 +507,7 @@ function _get(resourceGroupName, vmName, vmExtensionName, options, callback) { * @param {string} resourceGroupName The name of the resource group. * * @param {string} vmName The name of the virtual machine where the extension - * should be create or updated. + * should be created or updated. * * @param {string} vmExtensionName The name of the virtual machine extension. * @@ -625,15 +737,45 @@ function _beginCreateOrUpdate(resourceGroupName, vmName, vmExtensionName, extens } /** - * The operation to delete the extension. + * The operation to update the extension. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} vmName The name of the virtual machine where the extension - * should be deleted. + * should be updated. * * @param {string} vmExtensionName The name of the virtual machine extension. * + * @param {object} extensionParameters Parameters supplied to the Update + * Virtual Machine Extension operation. + * + * @param {string} [extensionParameters.forceUpdateTag] How the extension + * handler should be forced to update even if the extension configuration has + * not changed. + * + * @param {string} [extensionParameters.publisher] The name of the extension + * handler publisher. + * + * @param {string} [extensionParameters.type] Specifies the type of the + * extension; an example is "CustomScriptExtension". + * + * @param {string} [extensionParameters.typeHandlerVersion] Specifies the + * version of the script handler. + * + * @param {boolean} [extensionParameters.autoUpgradeMinorVersion] Indicates + * whether the extension should use a newer minor version if one is available + * at deployment time. Once deployed, however, the extension will not upgrade + * minor versions unless redeployed, even with this property set to true. + * + * @param {object} [extensionParameters.settings] Json formatted public + * settings for the extension. + * + * @param {object} [extensionParameters.protectedSettings] The extension can + * contain either protectedSettings or protectedSettingsFromKeyVault or no + * protected settings at all. + * + * @param {object} [extensionParameters.tags] Resource tags + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -646,14 +788,14 @@ function _beginCreateOrUpdate(resourceGroupName, vmName, vmExtensionName, extens * {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 OperationStatusResponse} for more + * See {@link VirtualMachineExtension} 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 _beginDeleteMethod(resourceGroupName, vmName, vmExtensionName, options, callback) { +function _beginUpdate(resourceGroupName, vmName, vmExtensionName, extensionParameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -675,6 +817,9 @@ function _beginDeleteMethod(resourceGroupName, vmName, vmExtensionName, options, if (vmExtensionName === null || vmExtensionName === undefined || typeof vmExtensionName.valueOf() !== 'string') { throw new Error('vmExtensionName cannot be null or undefined and it must be of type string.'); } + if (extensionParameters === null || extensionParameters === undefined) { + throw new Error('extensionParameters cannot be null or undefined.'); + } 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.'); } @@ -700,7 +845,7 @@ function _beginDeleteMethod(resourceGroupName, vmName, vmExtensionName, options, // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -718,14 +863,28 @@ function _beginDeleteMethod(resourceGroupName, vmName, vmExtensionName, options, } } } - httpRequest.body = null; + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (extensionParameters !== null && extensionParameters !== undefined) { + let requestModelMapper = new client.models['VirtualMachineExtensionUpdate']().mapper(); + requestModel = client.serialize(requestModelMapper, extensionParameters, 'extensionParameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(extensionParameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -760,7 +919,7 @@ function _beginDeleteMethod(resourceGroupName, vmName, vmExtensionName, options, parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['OperationStatusResponse']().mapper(); + let resultMapper = new client.models['VirtualMachineExtension']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -775,46 +934,199 @@ function _beginDeleteMethod(resourceGroupName, vmName, vmExtensionName, options, }); } -/** Class representing a VirtualMachineExtensions. */ -class VirtualMachineExtensions { - /** - * Create a VirtualMachineExtensions. - * @param {ComputeManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._createOrUpdate = _createOrUpdate; - this._deleteMethod = _deleteMethod; - this._get = _get; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._beginDeleteMethod = _beginDeleteMethod; +/** + * The operation to delete the extension. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine where the extension + * should be deleted. + * + * @param {string} vmExtensionName The name of the virtual machine extension. + * + * @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 OperationStatusResponse} 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 _beginDeleteMethod(resourceGroupName, vmName, vmExtensionName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmName === null || vmName === undefined || typeof vmName.valueOf() !== 'string') { + throw new Error('vmName cannot be null or undefined and it must be of type string.'); + } + if (vmExtensionName === null || vmExtensionName === undefined || typeof vmExtensionName.valueOf() !== 'string') { + throw new Error('vmExtensionName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); } - /** - * The operation to create or update the extension. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} vmName The name of the virtual machine where the extension - * should be create or updated. - * - * @param {string} vmExtensionName The name of the virtual machine extension. - * - * @param {object} extensionParameters Parameters supplied to the Create - * Virtual Machine Extension operation. - * - * @param {string} [extensionParameters.forceUpdateTag] How the extension - * handler should be forced to update even if the extension configuration has - * not changed. - * - * @param {string} [extensionParameters.publisher] The name of the extension - * handler publisher. - * - * @param {string} [extensionParameters.virtualMachineExtensionType] Specifies - * the type of the extension; an example is "CustomScriptExtension". - * - * @param {string} [extensionParameters.typeHandlerVersion] Specifies the - * version of the script handler. + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmName}', encodeURIComponent(vmName)); + requestUrl = requestUrl.replace('{vmExtensionName}', encodeURIComponent(vmExtensionName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // 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['OperationStatusResponse']().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 VirtualMachineExtensions. */ +class VirtualMachineExtensions { + /** + * Create a VirtualMachineExtensions. + * @param {ComputeManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._createOrUpdate = _createOrUpdate; + this._update = _update; + this._deleteMethod = _deleteMethod; + this._get = _get; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginUpdate = _beginUpdate; + this._beginDeleteMethod = _beginDeleteMethod; + } + + /** + * The operation to create or update the extension. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine where the extension + * should be created or updated. + * + * @param {string} vmExtensionName The name of the virtual machine extension. + * + * @param {object} extensionParameters Parameters supplied to the Create + * Virtual Machine Extension operation. + * + * @param {string} [extensionParameters.forceUpdateTag] How the extension + * handler should be forced to update even if the extension configuration has + * not changed. + * + * @param {string} [extensionParameters.publisher] The name of the extension + * handler publisher. + * + * @param {string} [extensionParameters.virtualMachineExtensionType] Specifies + * the type of the extension; an example is "CustomScriptExtension". + * + * @param {string} [extensionParameters.typeHandlerVersion] Specifies the + * version of the script handler. * * @param {boolean} [extensionParameters.autoUpgradeMinorVersion] Indicates * whether the extension should use a newer minor version if one is available @@ -881,7 +1193,7 @@ class VirtualMachineExtensions { * @param {string} resourceGroupName The name of the resource group. * * @param {string} vmName The name of the virtual machine where the extension - * should be create or updated. + * should be created or updated. * * @param {string} vmExtensionName The name of the virtual machine extension. * @@ -983,6 +1295,159 @@ class VirtualMachineExtensions { } } + /** + * The operation to update the extension. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine where the extension + * should be updated. + * + * @param {string} vmExtensionName The name of the virtual machine extension. + * + * @param {object} extensionParameters Parameters supplied to the Update + * Virtual Machine Extension operation. + * + * @param {string} [extensionParameters.forceUpdateTag] How the extension + * handler should be forced to update even if the extension configuration has + * not changed. + * + * @param {string} [extensionParameters.publisher] The name of the extension + * handler publisher. + * + * @param {string} [extensionParameters.type] Specifies the type of the + * extension; an example is "CustomScriptExtension". + * + * @param {string} [extensionParameters.typeHandlerVersion] Specifies the + * version of the script handler. + * + * @param {boolean} [extensionParameters.autoUpgradeMinorVersion] Indicates + * whether the extension should use a newer minor version if one is available + * at deployment time. Once deployed, however, the extension will not upgrade + * minor versions unless redeployed, even with this property set to true. + * + * @param {object} [extensionParameters.settings] Json formatted public + * settings for the extension. + * + * @param {object} [extensionParameters.protectedSettings] The extension can + * contain either protectedSettings or protectedSettingsFromKeyVault or no + * protected settings at all. + * + * @param {object} [extensionParameters.tags] Resource tags + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateWithHttpOperationResponse(resourceGroupName, vmName, vmExtensionName, extensionParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._update(resourceGroupName, vmName, vmExtensionName, extensionParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * The operation to update the extension. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine where the extension + * should be updated. + * + * @param {string} vmExtensionName The name of the virtual machine extension. + * + * @param {object} extensionParameters Parameters supplied to the Update + * Virtual Machine Extension operation. + * + * @param {string} [extensionParameters.forceUpdateTag] How the extension + * handler should be forced to update even if the extension configuration has + * not changed. + * + * @param {string} [extensionParameters.publisher] The name of the extension + * handler publisher. + * + * @param {string} [extensionParameters.type] Specifies the type of the + * extension; an example is "CustomScriptExtension". + * + * @param {string} [extensionParameters.typeHandlerVersion] Specifies the + * version of the script handler. + * + * @param {boolean} [extensionParameters.autoUpgradeMinorVersion] Indicates + * whether the extension should use a newer minor version if one is available + * at deployment time. Once deployed, however, the extension will not upgrade + * minor versions unless redeployed, even with this property set to true. + * + * @param {object} [extensionParameters.settings] Json formatted public + * settings for the extension. + * + * @param {object} [extensionParameters.protectedSettings] The extension can + * contain either protectedSettings or protectedSettingsFromKeyVault or no + * protected settings at all. + * + * @param {object} [extensionParameters.tags] Resource tags + * + * @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 {VirtualMachineExtension} - 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 VirtualMachineExtension} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + update(resourceGroupName, vmName, vmExtensionName, extensionParameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._update(resourceGroupName, vmName, vmExtensionName, extensionParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._update(resourceGroupName, vmName, vmExtensionName, extensionParameters, options, optionalCallback); + } + } + /** * The operation to delete the extension. * @@ -1181,7 +1646,7 @@ class VirtualMachineExtensions { * @param {string} resourceGroupName The name of the resource group. * * @param {string} vmName The name of the virtual machine where the extension - * should be create or updated. + * should be created or updated. * * @param {string} vmExtensionName The name of the virtual machine extension. * @@ -1266,7 +1731,7 @@ class VirtualMachineExtensions { * @param {string} resourceGroupName The name of the resource group. * * @param {string} vmName The name of the virtual machine where the extension - * should be create or updated. + * should be created or updated. * * @param {string} vmExtensionName The name of the virtual machine extension. * @@ -1368,6 +1833,159 @@ class VirtualMachineExtensions { } } + /** + * The operation to update the extension. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine where the extension + * should be updated. + * + * @param {string} vmExtensionName The name of the virtual machine extension. + * + * @param {object} extensionParameters Parameters supplied to the Update + * Virtual Machine Extension operation. + * + * @param {string} [extensionParameters.forceUpdateTag] How the extension + * handler should be forced to update even if the extension configuration has + * not changed. + * + * @param {string} [extensionParameters.publisher] The name of the extension + * handler publisher. + * + * @param {string} [extensionParameters.type] Specifies the type of the + * extension; an example is "CustomScriptExtension". + * + * @param {string} [extensionParameters.typeHandlerVersion] Specifies the + * version of the script handler. + * + * @param {boolean} [extensionParameters.autoUpgradeMinorVersion] Indicates + * whether the extension should use a newer minor version if one is available + * at deployment time. Once deployed, however, the extension will not upgrade + * minor versions unless redeployed, even with this property set to true. + * + * @param {object} [extensionParameters.settings] Json formatted public + * settings for the extension. + * + * @param {object} [extensionParameters.protectedSettings] The extension can + * contain either protectedSettings or protectedSettingsFromKeyVault or no + * protected settings at all. + * + * @param {object} [extensionParameters.tags] Resource tags + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginUpdateWithHttpOperationResponse(resourceGroupName, vmName, vmExtensionName, extensionParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginUpdate(resourceGroupName, vmName, vmExtensionName, extensionParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * The operation to update the extension. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine where the extension + * should be updated. + * + * @param {string} vmExtensionName The name of the virtual machine extension. + * + * @param {object} extensionParameters Parameters supplied to the Update + * Virtual Machine Extension operation. + * + * @param {string} [extensionParameters.forceUpdateTag] How the extension + * handler should be forced to update even if the extension configuration has + * not changed. + * + * @param {string} [extensionParameters.publisher] The name of the extension + * handler publisher. + * + * @param {string} [extensionParameters.type] Specifies the type of the + * extension; an example is "CustomScriptExtension". + * + * @param {string} [extensionParameters.typeHandlerVersion] Specifies the + * version of the script handler. + * + * @param {boolean} [extensionParameters.autoUpgradeMinorVersion] Indicates + * whether the extension should use a newer minor version if one is available + * at deployment time. Once deployed, however, the extension will not upgrade + * minor versions unless redeployed, even with this property set to true. + * + * @param {object} [extensionParameters.settings] Json formatted public + * settings for the extension. + * + * @param {object} [extensionParameters.protectedSettings] The extension can + * contain either protectedSettings or protectedSettingsFromKeyVault or no + * protected settings at all. + * + * @param {object} [extensionParameters.tags] Resource tags + * + * @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 {VirtualMachineExtension} - 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 VirtualMachineExtension} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginUpdate(resourceGroupName, vmName, vmExtensionName, extensionParameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginUpdate(resourceGroupName, vmName, vmExtensionName, extensionParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginUpdate(resourceGroupName, vmName, vmExtensionName, extensionParameters, options, optionalCallback); + } + } + /** * The operation to delete the extension. * diff --git a/lib/services/computeManagement2/lib/operations/virtualMachineScaleSets.js b/lib/services/computeManagement2/lib/operations/virtualMachineScaleSets.js index f47ba7554c..c984fd6762 100644 --- a/lib/services/computeManagement2/lib/operations/virtualMachineScaleSets.js +++ b/lib/services/computeManagement2/lib/operations/virtualMachineScaleSets.js @@ -377,6 +377,11 @@ const WebResource = msRest.WebResource; * priority for the virtual machines in the scale set.

    Minimum * api-version: 2017-10-30-preview. Possible values include: 'Regular', 'Low' * + * @param {string} [parameters.virtualMachineProfile.evictionPolicy] Specifies + * the eviction policy for virtual machines in the low priority scale set. + *

    Minimum api-version: 2017-10-30-preview. Possible values include: + * 'Deallocate', 'Delete' + * * @param {boolean} [parameters.overprovision] Specifies whether the Virtual * Machine Scale Set should be overprovisioned. * @@ -1779,6 +1784,150 @@ function _listSkus(resourceGroupName, vmScaleSetName, options, callback) { }); } +/** + * Gets list of OS upgrades on a VM scale set instance. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @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 VirtualMachineScaleSetListOSUpgradeHistory} + * 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 _getOSUpgradeHistory(resourceGroupName, vmScaleSetName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmScaleSetName === null || vmScaleSetName === undefined || typeof vmScaleSetName.valueOf() !== 'string') { + throw new Error('vmScaleSetName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/osUpgradeHistory'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmScaleSetName}', encodeURIComponent(vmScaleSetName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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['VirtualMachineScaleSetListOSUpgradeHistory']().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); + }); +} + /** * Power off (stop) one or more virtual machines in a VM scale set. Note that @@ -2966,6 +3115,11 @@ function _forceRecoveryServiceFabricPlatformUpdateDomainWalk(resourceGroupName, * priority for the virtual machines in the scale set.

    Minimum * api-version: 2017-10-30-preview. Possible values include: 'Regular', 'Low' * + * @param {string} [parameters.virtualMachineProfile.evictionPolicy] Specifies + * the eviction policy for virtual machines in the low priority scale set. + *

    Minimum api-version: 2017-10-30-preview. Possible values include: + * 'Deallocate', 'Delete' + * * @param {boolean} [parameters.overprovision] Specifies whether the Virtual * Machine Scale Set should be overprovisioned. * @@ -5891,6 +6045,134 @@ function _listSkusNext(nextPageLink, options, callback) { }); } +/** + * Gets list of OS upgrades on a VM scale set instance. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualMachineScaleSetListOSUpgradeHistory} + * 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 _getOSUpgradeHistoryNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['VirtualMachineScaleSetListOSUpgradeHistory']().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 VirtualMachineScaleSets. */ class VirtualMachineScaleSets { /** @@ -5909,6 +6191,7 @@ class VirtualMachineScaleSets { this._list = _list; this._listAll = _listAll; this._listSkus = _listSkus; + this._getOSUpgradeHistory = _getOSUpgradeHistory; this._powerOff = _powerOff; this._restart = _restart; this._start = _start; @@ -5934,6 +6217,7 @@ class VirtualMachineScaleSets { this._listNext = _listNext; this._listAllNext = _listAllNext; this._listSkusNext = _listSkusNext; + this._getOSUpgradeHistoryNext = _getOSUpgradeHistoryNext; } /** @@ -6298,6 +6582,11 @@ class VirtualMachineScaleSets { * priority for the virtual machines in the scale set.

    Minimum * api-version: 2017-10-30-preview. Possible values include: 'Regular', 'Low' * + * @param {string} [parameters.virtualMachineProfile.evictionPolicy] Specifies + * the eviction policy for virtual machines in the low priority scale set. + *

    Minimum api-version: 2017-10-30-preview. Possible values include: + * 'Deallocate', 'Delete' + * * @param {boolean} [parameters.overprovision] Specifies whether the Virtual * Machine Scale Set should be overprovisioned. * @@ -6718,6 +7007,11 @@ class VirtualMachineScaleSets { * priority for the virtual machines in the scale set.

    Minimum * api-version: 2017-10-30-preview. Possible values include: 'Regular', 'Low' * + * @param {string} [parameters.virtualMachineProfile.evictionPolicy] Specifies + * the eviction policy for virtual machines in the low priority scale set. + *

    Minimum api-version: 2017-10-30-preview. Possible values include: + * 'Deallocate', 'Delete' + * * @param {boolean} [parameters.overprovision] Specifies whether the Virtual * Machine Scale Set should be overprovisioned. * @@ -8130,6 +8424,93 @@ class VirtualMachineScaleSets { } } + /** + * Gets list of OS upgrades on a VM scale set instance. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @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. + */ + getOSUpgradeHistoryWithHttpOperationResponse(resourceGroupName, vmScaleSetName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getOSUpgradeHistory(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets list of OS upgrades on a VM scale set instance. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmScaleSetName The name of the VM scale set. + * + * @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 {VirtualMachineScaleSetListOSUpgradeHistory} - 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 VirtualMachineScaleSetListOSUpgradeHistory} + * 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. + */ + getOSUpgradeHistory(resourceGroupName, vmScaleSetName, 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._getOSUpgradeHistory(resourceGroupName, vmScaleSetName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getOSUpgradeHistory(resourceGroupName, vmScaleSetName, options, optionalCallback); + } + } + /** * Power off (stop) one or more virtual machines in a VM scale set. Note that * resources are still attached and you are getting charged for the resources. @@ -9366,6 +9747,11 @@ class VirtualMachineScaleSets { * priority for the virtual machines in the scale set.

    Minimum * api-version: 2017-10-30-preview. Possible values include: 'Regular', 'Low' * + * @param {string} [parameters.virtualMachineProfile.evictionPolicy] Specifies + * the eviction policy for virtual machines in the low priority scale set. + *

    Minimum api-version: 2017-10-30-preview. Possible values include: + * 'Deallocate', 'Delete' + * * @param {boolean} [parameters.overprovision] Specifies whether the Virtual * Machine Scale Set should be overprovisioned. * @@ -9786,6 +10172,11 @@ class VirtualMachineScaleSets { * priority for the virtual machines in the scale set.

    Minimum * api-version: 2017-10-30-preview. Possible values include: 'Regular', 'Low' * + * @param {string} [parameters.virtualMachineProfile.evictionPolicy] Specifies + * the eviction policy for virtual machines in the low priority scale set. + *

    Minimum api-version: 2017-10-30-preview. Possible values include: + * 'Deallocate', 'Delete' + * * @param {boolean} [parameters.overprovision] Specifies whether the Virtual * Machine Scale Set should be overprovisioned. * @@ -11810,6 +12201,91 @@ class VirtualMachineScaleSets { } } + /** + * Gets list of OS upgrades on a VM scale set instance. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getOSUpgradeHistoryNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getOSUpgradeHistoryNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets list of OS upgrades on a VM scale set instance. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {VirtualMachineScaleSetListOSUpgradeHistory} - 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 VirtualMachineScaleSetListOSUpgradeHistory} + * 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. + */ + getOSUpgradeHistoryNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getOSUpgradeHistoryNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getOSUpgradeHistoryNext(nextPageLink, options, optionalCallback); + } + } + } module.exports = VirtualMachineScaleSets; diff --git a/lib/services/computeManagement2/lib/operations/virtualMachines.js b/lib/services/computeManagement2/lib/operations/virtualMachines.js index 4c966c853c..c5c28bb9c3 100644 --- a/lib/services/computeManagement2/lib/operations/virtualMachines.js +++ b/lib/services/computeManagement2/lib/operations/virtualMachines.js @@ -14,6 +14,161 @@ const msRest = require('ms-rest'); const msRestAzure = require('ms-rest-azure'); const WebResource = msRest.WebResource; +/** + * The operation to get all extensions of a Virtual Machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine containing the + * extension. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] The expand expression to apply on the + * operation. + * + * @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 VirtualMachineExtensionsListResult} 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 _getExtensions(resourceGroupName, vmName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let expand = (options && options.expand !== undefined) ? options.expand : undefined; + let apiVersion = '2017-12-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vmName === null || vmName === undefined || typeof vmName.valueOf() !== 'string') { + throw new Error('vmName cannot be null or undefined and it must be of type string.'); + } + if (expand !== null && expand !== undefined && typeof expand.valueOf() !== 'string') { + throw new Error('expand must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vmName}', encodeURIComponent(vmName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (expand !== null && expand !== undefined) { + queryParameters.push('$expand=' + encodeURIComponent(expand)); + } + queryParameters.push('api-version=' + encodeURIComponent(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['VirtualMachineExtensionsListResult']().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); + }); +} + /** * Captures the VM by copying virtual hard disks of the VM and outputs a @@ -5476,6 +5631,7 @@ class VirtualMachines { */ constructor(client) { this.client = client; + this._getExtensions = _getExtensions; this._capture = _capture; this._createOrUpdate = _createOrUpdate; this._update = _update; @@ -5510,6 +5666,101 @@ class VirtualMachines { this._listAllNext = _listAllNext; } + /** + * The operation to get all extensions of a Virtual Machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine containing the + * extension. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] The expand expression to apply on the + * operation. + * + * @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. + */ + getExtensionsWithHttpOperationResponse(resourceGroupName, vmName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getExtensions(resourceGroupName, vmName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * The operation to get all extensions of a Virtual Machine. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} vmName The name of the virtual machine containing the + * extension. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] The expand expression to apply on the + * operation. + * + * @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 {VirtualMachineExtensionsListResult} - 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 VirtualMachineExtensionsListResult} 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. + */ + getExtensions(resourceGroupName, vmName, 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._getExtensions(resourceGroupName, vmName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getExtensions(resourceGroupName, vmName, options, optionalCallback); + } + } + /** * Captures the VM by copying virtual hard disks of the VM and outputs a * template that can be used to create similar VMs. diff --git a/lib/services/computeManagement2/lib/package.json b/lib/services/computeManagement2/lib/package.json new file mode 100644 index 0000000000..b180573fbe --- /dev/null +++ b/lib/services/computeManagement2/lib/package.json @@ -0,0 +1,22 @@ +{ + "name": "azure-arm-compute", + "author": "Microsoft Corporation", + "description": "ComputeManagementClient Library with typescript type definitions for node", + "version": "", + "dependencies": { + "ms-rest": "^2.3.2", + "ms-rest-azure": "^2.5.5" + }, + "keywords": [ "node", "azure" ], + "license": "MIT", + "main": "./lib/computeManagementClient.js", + "types": "./lib/computeManagementClient.d.ts", + "homepage": "http://github.com/azure/azure-sdk-for-node", + "repository": { + "type": "git", + "url": "https://github.com/azure/azure-sdk-for-node.git" + }, + "bugs": { + "url": "http://github.com/Azure/azure-sdk-for-node/issues" + } +} diff --git a/lib/services/computeManagement2/package.json b/lib/services/computeManagement2/package.json index 0411b56677..7ec334d332 100644 --- a/lib/services/computeManagement2/package.json +++ b/lib/services/computeManagement2/package.json @@ -1,43 +1,22 @@ { "name": "azure-arm-compute", "author": "Microsoft Corporation", - "contributors": [ - "Huang, Pengfei ", - "Onalan, Alp ", - "Lee, Hyonho ", - "Cigdem Celik Aydin ", - "Rohit Bhat ", - "Ahmed El Baz ", - "Wang, Yugang ", - "Zavery, Amar ", - "Sun, Carissa " - ], - "version": "4.0.0", - "description": "Microsoft Azure Compute Resource Provider Management Client Library for node", - "tags": [ - "azure", - "sdk" - ], - "keywords": [ - "node", - "azure" - ], - "main": "./lib/computeManagementClient.js", - "types": "./lib/computeManagementClient.d.ts", - "license": "MIT", + "description": "ComputeManagementClient Library with typescript type definitions for node", + "version": "5.1.0", "dependencies": { - "ms-rest": "^2.2.2", - "ms-rest-azure": "^2.3.3" + "ms-rest": "^2.3.2", + "ms-rest-azure": "^2.5.5" }, - "homepage": "http://github.com/Azure/azure-sdk-for-node", + "keywords": [ "node", "azure" ], + "license": "MIT", + "main": "./lib/computeManagementClient.js", + "types": "./lib/computeManagementClient.d.ts", + "homepage": "http://github.com/azure/azure-sdk-for-node", "repository": { "type": "git", - "url": "git@github.com:Azure/azure-sdk-for-node.git" + "url": "https://github.com/azure/azure-sdk-for-node.git" }, "bugs": { "url": "http://github.com/Azure/azure-sdk-for-node/issues" - }, - "scripts": { - "test": "npm -s run-script jshint" } }